/* SecAppDev design tokens and base styles (web).
   Source of truth: the typography and colour specifications; see secappdev-design-system.md.
   Light = reading surface. .navy = brand surface (video pages, page openings, dark mode). */

/* Fonts: self-host these files (woff2). Paths are placeholders. */
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* type */
  --font-brand: "Schibsted Grotesk", system-ui, sans-serif;
  --font-text: "Geist", system-ui, sans-serif;
  --text-label: 0.75rem;     /* 12px, labels in capitals */
  --text-small: 0.875rem;    /* 14px, metadata, facts line */
  --text-ui: 0.9375rem;      /* 15px, navigation, buttons */
  --text-base: 1rem;         /* 16px, body */
  --text-h3: 1.1875rem;      /* 19px */
  --text-h2: 1.4375rem;      /* 23px */
  --text-h1: 1.75rem;        /* 28px */
  --text-opening: 2.5rem;    /* 40px, 30px on phone */
  --leading-body: 1.6;
  --measure: 65ch;

  /* colour: light reading surface */
  --bg: #fafafa;
  --text: #1b1b1b;
  --text-muted: #636363;
  --line: #dfdfdf;
  --panel: #f0f0f0;
  --tile: #ffffff;
  --blue: #184676;
  --blue-line: #abbbcc;
  --brick: #93412d;
  --brick-hover: #7d3726;
  --on-brick: #ffffff;
  --brick-text: #93412d;
  --error: #b32228;
  --success: #337344;
  --warning: #915c08;
  --gold: #86682e;           /* ACADEMY under the wordmark (D-43) */

  /* navy brand surface values */
  --navy: #0d1e36;
  --navy-deep: #07152a;
  --video-bg: #08121f;
  --share-icon: #183664;

  /* layout */
  --page: 1040px;
  --gutter: 48px;
  --reading: 640px;
  --radius: 2px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
}

/* The navy surface redefines the tokens locally; components need no extra rules. */
.navy {
  --bg: var(--navy);
  --text: #eaebed;
  --text-muted: #b7bbc0;
  --line: #263549;
  --panel: #112746;
  --blue: #98c2f0;
  --blue-line: #385a87;
  --brick-text: #e2947c;
  --error: #f47b74;
  --success: #79c289;
  --warning: #e7b369;
  --gold: #e0c27a;
  background: var(--bg);
  color: var(--text);
}

/* The light surface (D-50): the mirror of .navy. Sets every token that dark mode redefines to its
   light value, so a component stays light on a navy page and in dark mode. A declaration on the
   element beats the values it inherits from :root, also in dark mode. Same values as :root. */
.light {
  --bg: #fafafa;
  --text: #1b1b1b;
  --text-muted: #636363;
  --line: #dfdfdf;
  --panel: #f0f0f0;
  --blue: #184676;
  --blue-line: #abbbcc;
  --brick-text: #93412d;
  --error: #b32228;
  --success: #337344;
  --warning: #915c08;
  --gold: #86682e;
  color-scheme: light;
  background: var(--bg);
  color: var(--text);
}

/* Dark mode: the whole page is navy; a navy opening drops to the deeper navy.
   If the site offers a theme switch, apply the same values under :root[data-theme="dark"]. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy);
    --text: #eaebed;
    --text-muted: #b7bbc0;
    --line: #263549;
    --panel: #112746;
    --blue: #98c2f0;
    --blue-line: #385a87;
    --brick-text: #e2947c;
    --error: #f47b74;
    --success: #79c289;
    --warning: #e7b369;
  --gold: #e0c27a;
    color-scheme: dark;
  }
  .opening.navy { --bg: var(--navy-deep); }
}

/* base */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--text-base)/var(--leading-body) var(--font-text);
}
h1, h2, h3 { font-family: var(--font-brand); font-weight: 500; margin: 0; text-wrap: balance; }
h1 { font-size: var(--text-h1); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); line-height: 1.2; letter-spacing: -0.015em; }
h3 { font-size: var(--text-h3); line-height: 1.3; letter-spacing: -0.005em; }
p, li { max-width: var(--measure); }
strong, b { font-weight: 500; }
time, .tabular { font-variant-numeric: tabular-nums; }

.opening-title { font: 500 var(--text-opening)/1.1 var(--font-brand); letter-spacing: -0.025em; margin: 0; text-wrap: balance; }

/* wordmark and subtitle (header size) */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; color: var(--text); text-decoration: none; }
.wordmark__name { font: 600 1.5rem/1 var(--font-brand); letter-spacing: -0.03em; }
.wordmark__sub { font: 500 11px/1 var(--font-brand); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }

/* labels */
.label { font: 500 var(--text-label)/1.3 var(--font-brand); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brick-text); }
.label--quiet { color: var(--text-muted); }

/* facts line */
.facts { font-size: var(--text-small); line-height: 1.5; color: var(--text-muted); }
.facts > * + *::before { content: "·"; margin: 0 0.55em; }
.facts .format { font-weight: 500; color: var(--text); }
.topics { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--text-small); }

/* navigation */
.site-nav { display: flex; gap: 28px; align-items: center; font: 400 var(--text-ui)/1.2 var(--font-text); color: var(--text-muted); }
.site-nav a { color: inherit; text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); }

/* links */
a { color: var(--blue); text-decoration: underline 1px var(--blue-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* button (one style) */
.button {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--brick); color: var(--on-brick);
  font: 500 var(--text-ui)/1.2 var(--font-text);
  padding: 10px 16px; border-radius: var(--radius);
}
.button:hover { background: var(--brick-hover); }
.button--secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

/* panels: newsletter, course, sponsor */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; align-content: start; }
.panel input[type="email"] { font: 400 var(--text-ui) var(--font-text); padding: 9px 12px; border: 1px solid var(--text-muted); border-radius: var(--radius); background: var(--bg); color: var(--text); }

/* sponsor block: the whole block is one link (rel="sponsored") */
.sponsor { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; align-items: center; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: var(--text-small); }
.sponsor:hover { border-color: var(--text-muted); }
.sponsor:hover .sponsor__name { text-decoration: underline 1px; text-underline-offset: 3px; }
.sponsor__logo { height: 72px; background: var(--tile); border-radius: var(--radius); display: grid; place-items: center; padding: 8px; }
.sponsor__name { font: 600 17px/1.3 var(--font-brand); letter-spacing: -0.01em; }

/* video frame */
.video { aspect-ratio: 16 / 9; background: var(--video-bg); border: 1px solid var(--line); border-radius: var(--radius); }

/* chapters */
.chapters { display: grid; gap: 6px; }
.chapters li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; font-size: 15px; line-height: 1.45; }
.chapters time { color: var(--text-muted); }

/* phone */
@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .opening-title { font-size: 1.875rem; }   /* 30px */
  .wordmark__name { font-size: 1.375rem; }  /* 22px */
  .sponsor { grid-template-columns: 1fr; }
  .chapters li { grid-template-columns: 64px 1fr; font-size: var(--text-small); }
}
