/*
 * uberdeutsche.app: the app's two looks on the web, from src/theme.ts.
 * Basel (dunkel, the default): Inter Tight titles, Newsreader for his sentences, Inter for reading, amber.
 * Erstausgabe (hell): EB Garamond titles and sentences on cream paper, tracked capitals, brass.
 * His portrait is a dark photographic plate in both looks, like the film; its text is always light.
 * The fonts are the app's own files, served from here: no font or script from anyone else.
 */

@font-face { font-family: "Inter"; src: url("/fonts/Inter_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_500Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/InterTight_500Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/InterTight_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/InterTight_800ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/Newsreader_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/Newsreader_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/Newsreader_600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond_500Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond_600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root,
:root[data-look="basel"] {
  color-scheme: dark;
  --bg: #111110;
  --bg2: #191917;
  --surface: #1c1c1a;
  --fg: #f4f1ea;
  --muted: #a39c90;
  --line: #2e2e2a;
  --line2: #43423d;
  --accent: #e3a94f;
  --accent-deep: #b8832f;
  --red: #c8372a;
  --cta: #e3a94f;
  --on-cta: #111110;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --display-weight: 700;
  --display-heavy: 800;
  --serif: "Newsreader", Georgia, serif;
  --serif-bold: 600;
  --serif-scale: 1;
  --title-track: -0.02em;
  --caps: none;
  --caps-track: 0.01em;
  --label-size: 13px;
}

:root[data-look="paper"] {
  color-scheme: light;
  --bg: #f2ebdd;
  --bg2: #e9e0ce;
  --surface: #f8f3e9;
  --fg: #1f1a14;
  --muted: #6e6252;
  --line: #dcd1bd;
  --line2: #c8baa1;
  --accent: #7d5e25;
  --accent-deep: #9c7a3c;
  --red: #9e2b1f;
  --cta: #1f1a14;
  --on-cta: #f2ebdd;
  --display: "EB Garamond", Georgia, serif;
  --display-weight: 500;
  --display-heavy: 600;
  --serif: "EB Garamond", Georgia, serif;
  --serif-bold: 600;
  --serif-scale: 1.1;
  --title-track: 0;
  --caps: uppercase;
  --caps-track: 0.12em;
  --label-size: 11px;
}

/* The plate: his portrait and the hero text on it, the same in both looks; in Basel it runs into the page. */
:root {
  --plate: #171614;
}
:root[data-look="basel"] { --plate: #111110; }
:root {
  --plate-fg: #f0e8da;
  --plate-muted: #b5aa99;
  --plate-accent: #e3a94f;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-cta); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Small voice: labels and eyebrows, tracked capitals on paper, sentence case in Basel. */
.eyebrow,
.label {
  font: 500 var(--label-size)/1.4 "Inter", system-ui, sans-serif;
  letter-spacing: var(--caps-track);
  text-transform: var(--caps);
  color: var(--muted);
  margin: 0;
}
.gold { color: var(--accent); }
.small { font: 500 13px/1.5 "Inter", system-ui, sans-serif; letter-spacing: 0.01em; color: var(--muted); }

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  max-width: 1120px;
  margin: 0 auto;
}
.top.on-plate { position: absolute; inset: 0 0 auto 0; z-index: 2; color: var(--plate-fg); }
.mark {
  font-family: var(--display);
  font-weight: var(--display-heavy);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.on-plate .mark { font-family: "Inter Tight", "Inter", sans-serif; font-weight: 800; }

.look { display: flex; gap: 4px; }
.look button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 4px 6px;
  color: inherit;
  opacity: 0.62;
  cursor: pointer;
  font: 500 12px/1.4 "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
}
.look button[aria-pressed="true"] { opacity: 1; border-bottom-color: var(--accent); }
.on-plate .look button[aria-pressed="true"] { border-bottom-color: var(--plate-accent); }

/* ---------- Hero: the portrait as a plate ---------- */

.hero {
  position: relative;
  min-height: min(92svh, 860px);
  background: var(--plate);
  color: var(--plate-fg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  opacity: 0.92;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(23, 22, 20, 0.55) 0%, rgba(23, 22, 20, 0) 22%, rgba(23, 22, 20, 0) 42%, rgba(23, 22, 20, 0.88) 72%, var(--plate) 100%);
}
.hero-text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 20px 52px;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.hero .eyebrow { color: var(--plate-accent); font-family: "Inter", sans-serif; }
.title {
  margin: 0;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 9.6vw, 84px);
  line-height: 1.02;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
:root[data-look="paper"] .title { font-family: "EB Garamond", Georgia, serif; font-weight: 600; letter-spacing: 0.04em; font-size: clamp(32px, 10.6vw, 92px); }
.subtitle {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: calc(21px * var(--serif-scale));
  color: var(--plate-fg);
}
.tagline {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 11px/1.4 "Inter", sans-serif;
  letter-spacing: var(--caps-track);
  text-transform: var(--caps);
  color: var(--plate-fg);
}
.tagline::before,
.tagline::after { content: ""; width: 24px; height: 1px; background: currentColor; opacity: 0.6; }

/* ---------- Sections ---------- */

.lead {
  padding: 40px 0 8px;
  display: grid;
  gap: 18px;
}
.lead p { margin: 0; }
.lead .big {
  font-family: var(--serif);
  font-size: calc(24px * var(--serif-scale));
  line-height: 1.35;
}

.soon { display: flex; flex-wrap: wrap; gap: 10px; }
.soon span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 16px;
  font: 700 13px/1 "Inter", sans-serif;
  letter-spacing: var(--caps-track);
  text-transform: var(--caps);
}
.soon span em { font-style: normal; font-weight: 500; color: var(--muted); }

.section { padding: 56px 0 0; display: grid; gap: 14px; }
.section h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: calc(30px * var(--serif-scale));
  line-height: 1.15;
  letter-spacing: var(--title-track);
}
.section > p { margin: 0; }

/* Ruled rows: the big number or numeral in the display face, what it is, one English line. */
.rows { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line2); }
.rows li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.rows .n {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: calc(32px * var(--serif-scale));
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
}
.rows .de {
  display: block;
  font-family: var(--serif);
  font-weight: var(--serif-bold);
  font-size: calc(19px * var(--serif-scale));
  line-height: 1.25;
  padding-top: 3px;
}
.rows .en { display: block; margin-top: 3px; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* A lesson's film: the picture alone, 4:3 like the app's film frame, waiting for a tap. */
.film {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 10px auto 0;
  aspect-ratio: 4 / 3;
  background: #000;
  overflow: hidden;
}
.film video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.film .play {
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  /* The whole picture is the button; its mark sits in the lower corner, clear of the film's opening title. */
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 0 4.5% 4%;
  color: var(--plate-fg);
  background: linear-gradient(to bottom, rgba(10, 10, 9, 0) 60%, rgba(10, 10, 9, 0.6));
}
.film .play[hidden] { display: none; }
.film .disc {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--plate-accent);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  position: relative;
}
.film .disc::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 15px;
  border-color: transparent transparent transparent #111110;
}
.film .play:hover .disc { transform: scale(1.05); }
.film .play .label { font: 600 13px/1 "Inter", sans-serif; letter-spacing: 0.02em; padding-bottom: 17px; }
@media (min-width: 900px) {
  .film .disc { width: 60px; height: 60px; }
  .film .disc::after { left: 24px; top: 18px; border-width: 12px 0 12px 18px; }
  .film .play .label { font-size: 14px; padding-bottom: 23px; }
}
.credits { margin-top: 4px; }
.credits summary { cursor: pointer; list-style: none; text-align: center; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::after { content: " +"; color: var(--accent); }
.credits[open] summary::after { content: " –"; }
.credits p { margin: 10px 0 0; }
.credits a { color: var(--accent); }

/* His sentence. */
.quote { margin: 6px 0 0; padding: 26px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: calc(28px * var(--serif-scale));
  line-height: 1.3;
}
.quote figcaption { margin-top: 14px; display: grid; gap: 6px; }
.quote .en { font-family: var(--serif); font-style: italic; font-size: calc(17px * var(--serif-scale)); color: var(--muted); }

/* ---------- Documents: terms, privacy, help ---------- */

.doc { padding-top: 28px; }
.doc-head { display: grid; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line2); }
.doc-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: var(--display-heavy);
  font-size: calc(40px * var(--serif-scale));
  line-height: 1.08;
  letter-spacing: var(--title-track);
}
.doc-head .sub { margin: 0; font-family: var(--serif); font-style: italic; font-size: calc(19px * var(--serif-scale)); color: var(--muted); }
.doc .short {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: calc(21px * var(--serif-scale));
  line-height: 1.45;
}
.doc section { padding: 28px 0 0; }
.doc h2 {
  margin: 0 0 10px;
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: calc(22px * var(--serif-scale));
  line-height: 1.25;
  letter-spacing: var(--title-track);
}
.doc h2 .no { font-size: 0.78em; color: var(--accent); font-variant-numeric: tabular-nums; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding: 0; list-style: none; }
.doc li { position: relative; padding-left: 22px; margin: 0 0 8px; }
.doc li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.doc a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc strong { font-weight: 600; }
.provider { margin-top: 6px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.provider p { margin: 0; }

/* Help: questions as ruled rows that open. */
.faq { border-top: 1px solid var(--line2); margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-family: var(--serif);
  font-weight: var(--serif-bold);
  font-size: calc(19px * var(--serif-scale));
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-family: "Inter", sans-serif; font-weight: 500; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 16px; }
.faq .answer p:last-child, .faq .answer ul:last-child { margin-bottom: 0; }

.contact {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
}
.contact a.mail {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: calc(26px * var(--serif-scale));
  letter-spacing: var(--title-track);
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.foot { margin-top: 72px; border-top: 1px solid var(--line2); }
.foot .wrap { padding-top: 24px; padding-bottom: 40px; display: grid; gap: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { text-decoration: none; }
.foot nav a:hover, .foot nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.foot p { margin: 0; }

@media (min-width: 900px) {
  .top { padding: 24px 32px; }
  .hero-text { padding-bottom: 72px; }
  .lead { padding-top: 56px; }
  .lead .big { font-size: calc(28px * var(--serif-scale)); }
  .section { padding-top: 72px; }
  .section h2 { font-size: calc(36px * var(--serif-scale)); }
  .rows li { grid-template-columns: 96px 1fr; }
  .rows .n { font-size: calc(38px * var(--serif-scale)); }
  .quote blockquote { font-size: calc(34px * var(--serif-scale)); }
  .doc { padding-top: 48px; }
  .doc-head h1 { font-size: calc(52px * var(--serif-scale)); }
}

@media (prefers-reduced-motion: no-preference) {
  .look button { transition: opacity 0.15s ease; }
}
