/* Syntonus: the one stylesheet of the site.
   1 tokens · 2 fonts · 3 base · 4 components (skip link, header, footer, link, button)
   5 home page (the story) · 6 text pages (Impressum, Datenschutz) · 7 phone and tablet
   The rules and the reasons are in DESIGN_SPEC.md. */

/* ---- 1 tokens ----------------------------------------------------------------------------- */
:root {
  /* colour: off-white on near-black, the pair of the logo; one accent, gold, for AI and the curve */
  --bg: #0b0c0e;
  --fg: #f4f2ec;
  --soft: #c6c4be;      /* running text */
  --muted: #8e9197;     /* quiet text, secondary lines; 6.1 : 1 on --bg */
  --line: #26292e;      /* hairlines */
  --accent: #f2b24c;    /* gold */

  /* type */
  --font: "Syntonus Sans", "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.6875rem;   /* 11 px: the riddle only, which is part of the drawing */
  --text-sm: 0.8125rem;   /* 13 px: footer, labels (16 px on the phone) */
  --text-md: 1.0625rem;   /* 17 px: body */
  --text-lg: 1.1875rem;   /* 19 px: lead line */
  --text-xl: 1.5rem;      /* 24 px */
  --text-2xl: 2rem;       /* 32 px: headings */
  --leading-tight: 1.2;
  --leading: 1.6;

  /* space: one scale for every gap */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* layout */
  --page-max: 80rem;
  --page-pad: clamp(1.5rem, 4vw, 3rem);
  --measure: 40rem;       /* the longest line of running text */
}

/* ---- 2 fonts: a subset of Inter, renamed as its licence asks (fonts/README.txt) ---------- */
@font-face { font-family: "Syntonus Sans"; src: url("fonts/syntonus-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Syntonus Sans"; src: url("fonts/syntonus-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Syntonus Sans"; src: url("fonts/syntonus-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---- 3 base ------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;   /* header, content, footer: the footer stays at the bottom */
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: var(--leading);
  font-feature-settings: "kern", "calt", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-pad); }

/* ---- 4 components ------------------------------------------------------------------------- */
/* link */
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--fg); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* skip link: the first stop of the keyboard */
.skip { position: absolute; left: -999px; top: 0; z-index: 2; padding: var(--space-2) var(--space-4); background: var(--fg); color: var(--bg); }
.skip:focus { left: var(--space-4); top: var(--space-4); }

/* header: the name, and the address */
.top .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding-block: 1.75rem 2rem; }
.wordmark { display: block; color: var(--fg); text-decoration: none; }
/* the wordmark from logo/final/ (LOGO_GUIDE.md: at least 80 px wide, one x-height of free space,
   on its baseline with the text beside it). Its letters stand on a line at 76.3 % of its height,
   so the box is moved down by the remaining 23.7 %, the descender of the y. */
.wordmark .logo { display: block; height: 1.75rem; width: auto; position: relative; top: calc(0.237 * 1.75rem); }
.top-mail { font-size: 0.9375rem; font-weight: 500; color: var(--soft); text-decoration: none; }
.top-mail:hover { text-decoration: underline; }

/* footer: the register entry and the legal pages */
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6); padding-block: var(--space-5) var(--space-6); font-size: var(--text-sm); color: var(--muted); }
.foot .sep { margin-inline: 0.4rem; }
.foot ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.foot a { text-decoration: none; }
.foot a:hover, .foot a[aria-current="page"] { text-decoration: underline; }

/* button: not on the pages yet; for a call to act, one per page at most */
.button { display: inline-block; padding: 0.8rem 1.4rem; border: 1px solid var(--fg); border-radius: 999px; font-size: 0.9375rem; font-weight: 500; line-height: 1; text-decoration: none; }
.button:hover { background: var(--fg); color: var(--bg); }
.button--accent { border-color: var(--accent); color: var(--accent); }
.button--accent:hover { background: var(--accent); color: var(--bg); }

/* ---- 5 home page: the story ----------------------------------------------------------------
   One screen. The drawing tells three acts (forces.js), and the text lights up with them:
   act 1 "Hardware and software," · act 2 "designed as one" · act 3 the line with "AI-driven";
   at the end "Stay tuned." appears. These times are the times of forces.js; change them together. */
.story {
  --t-act1: 0.5s;      /* hardware and software, alone, out of tune */
  --t-act2: 4.0s;      /* designed as one: they come into tune */
  --t-act3: 10.6s;     /* AI-driven: AI's arm joins, the three draw the chord */
  --t-settle: 15.6s;   /* the curve is closed; "Hardware and software" settle to grey */
  --t-end: 16.0s;      /* Stay tuned. */
  display: grid;
  align-content: center;
  padding-block: var(--space-5) var(--space-7);
}
.story .wrap { display: grid; justify-items: center; text-align: center; }

.mark { width: min(45svh, 76vw); }
.mark svg { display: block; width: 100%; height: auto; overflow: visible; }
.mark path { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.f-final, .f-line { stroke: var(--accent); stroke-width: 3; }
.f-tangle { stroke: var(--muted); stroke-width: 1.2; }        /* the path while out of tune */
.f-tail { stroke: var(--soft); stroke-width: 2.2; }
.f-fifth { stroke: var(--soft); stroke-width: 2.2; }          /* hardware and software in tune */
.mark .arm { stroke: var(--soft); stroke-width: 2; stroke-linecap: round; }
.mark .arm--ai { stroke: var(--accent); stroke-width: 2.4; }
.mark .joint { fill: var(--bg); stroke: var(--soft); stroke-width: 1.6; }
.mark .pen { fill: var(--accent); }

/* the riddle: 4 : 5 : 6, for the picky eye; part of the drawing, hidden from screen readers */
.riddle { margin-top: 0.9rem; padding-left: 0.32em; font-size: var(--text-xs); letter-spacing: 0.32em; color: var(--muted); font-feature-settings: "tnum"; }
.riddle b { font-weight: 400; color: var(--accent); }

.story h1 { margin-top: 2.75rem; font-size: clamp(1.5rem, 2.3vw, 2rem); font-weight: 500; line-height: var(--leading-tight); letter-spacing: -0.03em; color: var(--muted); text-wrap: balance; }
.story .line { margin-top: 1.1rem; font-size: var(--text-lg); color: var(--soft); text-wrap: balance; }
.story .ai { color: var(--accent); white-space: nowrap; }
.story .coming { margin-top: 0.35rem; color: var(--muted); }

/* All text is there from the first moment, dim; each part lights up when its force acts, and
   only "Stay tuned." appears, at the end (the owner, 4 Dec, 02:41: "Paced", so that a reader with
   little time can read it all at once). */
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes glow {
  0%   { color: var(--muted); text-shadow: 0 0 0 rgba(244, 242, 236, 0); }
  40%  { color: var(--fg); text-shadow: 0 0 18px rgba(244, 242, 236, 0.55); }
  100% { color: var(--fg); text-shadow: 0 0 0 rgba(244, 242, 236, 0); }
}
@keyframes glow-gold {
  0%   { color: var(--muted); text-shadow: 0 0 0 rgba(242, 178, 76, 0); }
  40%  { color: var(--accent); text-shadow: 0 0 18px rgba(242, 178, 76, 0.6); }
  100% { color: var(--accent); text-shadow: 0 0 0 rgba(242, 178, 76, 0); }
}
@keyframes line-up { to { color: var(--soft); } }
@keyframes settle { from { color: var(--fg); } to { color: var(--muted); } }

.story .w-two, .story .act2, .story .line, .story .ai { color: var(--muted); }
.story .w-two { animation: glow 1.4s ease var(--t-act1) forwards, settle 1.6s ease var(--t-settle) forwards; }
.story .act2 { animation: glow 1.6s ease var(--t-act2) forwards; }
.story .line { animation: line-up 1.2s ease var(--t-act3) forwards; }
.story .ai { animation: glow-gold 1.8s ease var(--t-act3) forwards; }
.story .riddle, .story .coming { opacity: 0; animation: appear 1.2s ease forwards; }
.story .riddle { animation-delay: var(--t-act1); }
.story .coming { animation-delay: var(--t-end); }

/* with reduced motion: the finished page at once */
@media (prefers-reduced-motion: reduce) {
  .story .w-two, .story .act2, .story .line, .story .ai, .story .riddle, .story .coming { animation: none; }
  .story .act2 { color: var(--fg); }
  .story .line { color: var(--soft); }
  .story .ai { color: var(--accent); }
  .story .riddle, .story .coming { opacity: 1; }
}

/* ---- 6 text pages: Impressum, Datenschutz ------------------------------------------------- */
.page { padding-block: var(--space-7) var(--space-9); }
.page .wrap { max-width: calc(var(--measure) + 2 * var(--page-pad)); margin-inline: 0 auto; }
@media (min-width: 62rem) { .page .wrap { margin-inline: auto; } }
.page h1 { font-size: var(--text-2xl); font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.page h2 { margin-top: var(--space-6); font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.page p, .page .facts { margin-top: var(--space-4); color: var(--soft); }
.page .lang { margin-top: var(--space-3); font-size: 0.9375rem; color: var(--muted); }
.page section + section { margin-top: var(--space-8); padding-top: var(--space-7); border-top: 1px solid var(--line); }
.facts dt { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--muted); }
.facts dd { color: var(--fg); }
.note { margin-top: var(--space-6); padding: var(--space-3) var(--space-4); border-left: 2px solid var(--accent); color: var(--soft); font-size: 0.9375rem; }

/* ---- 7 tablet and phone ------------------------------------------------------------------- */
@media (max-width: 44rem) {
  .top .wrap { padding-block: 1.25rem 1.5rem; }
  .wordmark .logo { height: 1.5rem; top: calc(0.237 * 1.5rem); }
  .top-mail, .foot .wrap { font-size: 1rem; }               /* nothing under 16 px on the phone */
  .story { padding-block: var(--space-4) var(--space-6); }
  .mark { width: min(36svh, 68vw); }
  .mark path.f-final, .mark path.f-line { stroke-width: 3.6; }
  .story h1 { margin-top: 1.75rem; font-size: var(--text-xl); }
  .story h1 .act1 { display: block; }
  .story .line { font-size: var(--text-md); max-width: 19em; }
  .foot .wrap { padding-block: var(--space-4) var(--space-5); }
  .foot ul { gap: var(--space-1) var(--space-5); }
  .page { padding-block: var(--space-6) var(--space-8); }
  .page h1 { font-size: 1.75rem; }
  .facts dt, .page .lang, .note { font-size: 1rem; }
}
