/*
 * The legal pages of tryhouse.app: /privacy and /terms (the invite page keeps /i/style.css). The top bar, footer,
 * cards and type match the home page (assets/home.css); the documents themselves stay plain and readable. Tokens follow docs/design/design-system.md §4: monochrome chrome, the brand red only in the
 * house glyph (§4.4a: graphics only, never text), glass for the bar, opaque content. System fonts only: the CSP
 * (default-src 'none', no font-src) loads no web font, and nothing here is inline.
 */

:root {
  color-scheme: light dark;
  --canvas: #ffffff;
  --surface: #f3f3f5;
  --surface-elevated: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #66666b;
  --ink-3: #8e8e93;
  --hairline: #e6e6e9;
  --chip: #efeff1;
  --ink-inverse: #ffffff;
  --glass: rgb(255 255 255 / 0.72);
  --focus: #2f6bff;
  /* The small glyph's gradient (design-system.md §4.4a, DSBrand.glyphStart/End): each stop >= 3:1 on the canvas. */
  --glyph-start: #f23d50;
  --glyph-end: #d91e2c;
  --radius-card: 24px;
  --card: #f5f5f7;
  --nav-glass: rgb(255 255 255 / 0.72);
  --nav-edge: rgb(0 0 0 / 0.12);
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1180px;
  --radius-inner: 14px;
  --font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  --font-display:
    -apple-system, BlinkMacSystemFont, 'SF Pro Display', Inter, 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0b0c;
    --surface: #151517;
    --surface-elevated: #1c1c1f;
    --ink: #f2f2f2;
    --ink-2: #a2a2a8;
    --ink-3: #77777d;
    --hairline: #2a2a2e;
    --chip: #232326;
    --ink-inverse: #0a0a0a;
    --glass: rgb(11 11 12 / 0.72);
    --focus: #4d82ff;
    --glyph-start: #ff7a88;
    --glyph-end: #ff4d5e;
    --card: #161618;
    --nav-glass: rgb(24 24 27 / 0.72);
    --nav-edge: rgb(255 255 255 / 0.14);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

html {
  scroll-padding-block-start: 84px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-3);
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ---- The top bar: the home page's glass capsule (controls are glass, content stays opaque) --------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: max(10px, env(safe-area-inset-top)) max(6px, calc(var(--gutter) - 16px)) 0;
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(var(--max) - 2 * var(--gutter) + 32px);
  margin: 0 auto;
  padding: 7px 8px 7px 16px;
  border-radius: 999px;
  background: var(--nav-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow:
    0 0 0 0.5px var(--nav-edge),
    0 6px 20px rgb(0 0 0 / 0.06);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: 26px;
  height: 26px;
}

/* The 26 px glyph uses the small-glyph stops (design-system.md §4.4a). */
.topbar .brand-mark stop:first-child {
  stop-color: var(--glyph-start);
}

.topbar .brand-mark stop:last-child {
  stop-color: var(--glyph-end);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.035em;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s;
}

.nav-links a:hover {
  background: rgb(127 127 127 / 0.12);
}

.nav-links a[aria-current='page'] {
  background: rgb(127 127 127 / 0.14);
}

.nav-cta {
  display: none;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 760px) {
  .nav-cta {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .nav-links a {
    padding: 8px 10px;
    font-size: 14px;
  }
}

@media (max-width: 340px) {
  .nav .wordmark {
    display: none;
  }
}

/* ---- Documents ------------------------------------------------------------------------------------------ */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 72px) max(16px, env(safe-area-inset-left)) 64px max(16px, env(safe-area-inset-right));
}

.doc h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 60px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.updated {
  display: inline-block;
  margin: 0 0 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.lede {
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1.5;
}

.doc h2 {
  margin: 56px 0 12px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 14px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin: 0 0 8px;
}

.doc li::marker {
  color: var(--ink-3);
}

strong {
  font-weight: 650;
}

.path {
  font-weight: 600;
  white-space: normal;
}

/* An opaque card for the summary and the contents. */
.card {
  margin: 0 0 16px;
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--card);
}

.card h2,
.contact-card h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.card ul,
.card ol {
  margin-bottom: 0;
}

.card li:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.toc ol {
  columns: 1;
  padding-left: 24px;
}

@media (min-width: 640px) {
  .toc ol {
    columns: 2;
    column-gap: 32px;
  }

  .toc li {
    break-inside: avoid;
  }
}

/* A line that must not be missed (no colour: an ink outline carries it). */
.callout {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: var(--radius-inner);
  border: 1.5px solid var(--ink);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Key and value rows (what we keep and for how long): stacked on a phone, two columns from 640 px. */
.rows {
  margin: 16px 0 20px;
  padding: 0;
  border-radius: var(--radius-card);
  background: var(--card);
  overflow: hidden;
}

.rows > div {
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
}

.rows > div:first-child {
  border-top: 0;
}

.rows dt {
  font-weight: 650;
}

.rows dd {
  margin: 4px 0 0;
  color: var(--ink-2);
}

@media (min-width: 640px) {
  .rows > div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 16px;
  }

  .rows dd {
    margin: 0;
  }
}

.faq h3 {
  margin-top: 24px;
}

.contact-card {
  margin: 0 0 16px;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}

.contact-card p {
  margin: 0 0 8px;
}

.contact-card .mail {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 4px 0 12px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-weight: 650;
  text-decoration: none;
}

/* ---- Footer: the home page's ---------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--hairline);
  padding: 28px var(--gutter) max(36px, env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 auto;
}

.footer .brand-mark {
  width: 18px;
  height: 18px;
}

.footer .wordmark {
  font-size: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.4;
}

.footer-links a {
  display: inline-block;
  padding: 5px 0;
  color: var(--ink-2);
  text-decoration-line: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration-line: underline;
}

.footer-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
}

/* ---- Landing page --------------------------------------------------------------------------------------- */

.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 48px max(16px, env(safe-area-inset-left)) 32px max(16px, env(safe-area-inset-right));
  text-align: center;
}

.hero .glyph {
  width: 72px;
  height: 72px;
}

.hero .wordmark {
  margin: 14px 0 0;
  font-size: 34px;
}

.hero h1 {
  margin: 28px 0 10px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.hero .lede {
  margin: 0 0 28px;
}

.button {
  display: block;
  width: 100%;
  max-width: 360px;
  padding: 16px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 17px;
  font-weight: 650;
  text-decoration: none;
}

.hint {
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

.landing .site-foot {
  width: 100%;
  border-top: 0;
  text-align: center;
}

.landing .site-foot ul {
  justify-content: center;
}

@media print {
  .topbar,
  .footer,
  .skip {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  .card,
  .rows,
  .callout {
    background: none;
    border: 1px solid #999;
  }
}
