/* League Spartan (headings) and Figtree (text), both SIL OFL (see /fonts/OFL-*.txt), variable weight,
   each split so Czech pulls in latin-ext. Neither has Cyrillic: Onest (SIL OFL) draws only the Cyrillic letters,
   so only the Ukrainian page downloads it. One file per weight. */
@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/league-spartan-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/league-spartan-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/figtree-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/onest-cyrillic-400.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/onest-cyrillic-500.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/onest-cyrillic-600.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/onest-cyrillic-700.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/onest-cyrillic-800.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Slate mist: tram red, the one accent, on the pale grey slate of Prague roofs. One ground for the
   whole page; the nav is the lighter --mist, the close the dark slate block.
   Every text pair passes WCAG AA in both modes (tests/styles.test.mjs checks it). */
:root {
  --paper: #EEF1F3;
  --mist: #FFFFFF;
  --ink: #1C232B;
  --muted: #56616B;
  --rule: #D5DCE1;
  --action: #C4161C;
  --action-hover: #9E1116;
  --on-action: #FFFFFF;
  /* The dark slate block: the close and the footer. */
  --block-bg: #2E3B47;
  --block-text: #FFFFFF;
  --block-muted: #B9C5CF;
  /* Night-only parts read these: the flow lines. */
  --wire: #BFC9D1;
  --to-dark: inline;
  --to-light: none;
  color-scheme: light;
}

/* Dark mode follows the system. The switch in the footer (#mode, a checkbox) flips it either way, with no
   script: these two copies must match the light and the dark set exactly (tests/styles.test.mjs checks it). */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11161B;
    --mist: #182028;
    --ink: #EEF2F5;
    --muted: #9AA6B1;
    --rule: #2A343E;
    --action: #FF5A5F;
    --action-hover: #FF7D80;
    --on-action: #1A0B0C;
    --block-bg: #1E2831;
    --block-text: #EEF2F5;
    --block-muted: #9AA6B1;
    --wire: #2A343E;
    --to-dark: none;
    --to-light: inline;
    color-scheme: dark;
  }
  :root:has(#mode:checked) {
    --paper: #EEF1F3;
    --mist: #FFFFFF;
    --ink: #1C232B;
    --muted: #56616B;
    --rule: #D5DCE1;
    --action: #C4161C;
    --action-hover: #9E1116;
    --on-action: #FFFFFF;
    --block-bg: #2E3B47;
    --block-text: #FFFFFF;
    --block-muted: #B9C5CF;
    --wire: #BFC9D1;
    --to-dark: inline;
    --to-light: none;
    color-scheme: light;
  }
}
@media (prefers-color-scheme: light) {
  :root:has(#mode:checked) {
    --paper: #11161B;
    --mist: #182028;
    --ink: #EEF2F5;
    --muted: #9AA6B1;
    --rule: #2A343E;
    --action: #FF5A5F;
    --action-hover: #FF7D80;
    --on-action: #1A0B0C;
    --block-bg: #1E2831;
    --block-text: #EEF2F5;
    --block-muted: #9AA6B1;
    --wire: #2A343E;
    --to-dark: none;
    --to-light: inline;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; overflow-x: clip; }

body {
  font-family: "Figtree", "Onest", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip; /* Safari ignores hidden on body for viewport scrolling */
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

h1, h2, h3 { font-family: "League Spartan", "Onest", "Figtree", system-ui, sans-serif; letter-spacing: -0.02em; }
.wordmark b, .what .def, .does dt, .step-num, .flow-head, .flow-badge-num, .flow-hub-title { font-family: "League Spartan", "Onest", "Figtree", system-ui, sans-serif; }
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(3.25rem, 5.6vw + 0.5rem, 5.75rem); font-weight: 700; letter-spacing: -0.04em; line-height: 0.92; }
h2 { font-size: clamp(2rem, 2.6vw + 0.8rem, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
h3 { margin-bottom: 6px; font-size: 1.5rem; font-weight: 800; line-height: 1.25; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* Nav: the wordmark with its tagline, a link, the language switch and the button */
.nav { position: sticky; top: 0; z-index: 10; background: var(--mist); border-bottom: 1px solid var(--rule); }
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { font-size: 1.25rem; letter-spacing: -0.02em; text-decoration: none; }
/* "Golem" on the logo's red slip (the golem's shem), slightly tilted; the tagline in the logo's face. */
.wordmark { display: inline-flex; align-items: center; gap: 12px; }
.wordmark b {
  display: inline-block; padding: 6px 10px 3px; line-height: 1; font-weight: 800;
  color: var(--on-action); background: var(--action); transform: rotate(-3deg);
}
.wordmark .dot { display: none; }
.wordmark .tagline { font-family: "League Spartan", "Onest", "Figtree", system-ui, sans-serif; font-weight: 500; color: var(--muted); }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav nav a { font-size: 0.875rem; text-decoration: none; }
.nav nav a:hover { text-decoration: underline; }
/* The language menu: the current code in a bordered button, the three languages in a panel under it. */
.lang-menu { position: relative; }
/* As tall as the nav button: a finger-sized target. */
.lang-menu summary {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; list-style: none;
  font-size: 0.875rem; font-weight: 700; color: var(--ink); border: 1px solid var(--rule); border-radius: 6px;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.lang-menu[open] summary::after { border-top: 0; border-bottom: 4px solid currentColor; }
.lang-menu summary:hover { color: var(--muted); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 10rem; padding: 6px 0;
  list-style: none; background: var(--mist); border: 1px solid var(--rule);
}
.nav nav .lang-menu a { display: block; padding: 10px 16px; font-weight: 500; color: var(--muted); }
.nav nav .lang-menu a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.nav nav a.nav-cta { white-space: nowrap; color: var(--on-action); background: var(--action); font-weight: 700; padding: 8px 14px; border-radius: 6px; }
.nav nav a.nav-cta:hover { background: var(--action-hover); text-decoration: none; }

.button {
  display: inline-block;
  color: var(--on-action);
  background: var(--action);
  font-weight: 700;
  line-height: 1.2;
  padding: 16px 24px;
  border-radius: 6px;
  text-decoration: none;
}
.button:hover { background: var(--action-hover); }

/* Clear section rhythm: Offer (--paper) -> What is Golem (--mist with rules) -> How to join (--paper) -> Beta (--block-bg) */
.offer { padding-top: 96px; padding-bottom: 104px; }
/* The H1's second line names what people search for, in the size of an h2. */
.h1-keyword { display: block; margin-top: 20px; font-size: clamp(2rem, 2.6vw + 0.8rem, 3rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.offer .lead { max-width: 44ch; margin: 28px 0 36px; font-size: 1.25rem; }
#what { background: var(--mist); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band > .wrap { padding-top: 104px; padding-bottom: 104px; }

/* Flow diagram: 8+ sites -> Golem -> Telegram */
.flow { margin-top: 64px; }
.flow-svg { display: block; width: 100%; height: auto; }
.flow-frame { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.flow-head { fill: var(--ink); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.flow-wire { fill: none; stroke: var(--wire); stroke-width: 1.5; }
.flow-wire-out { stroke: var(--muted); stroke-width: 2; }
.flow-beam {
  fill: none;
  stroke: var(--action);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 20 80;
  stroke-dashoffset: 100;
  animation: flow-pulse 3.6s linear infinite;
}
.flow-out-main { stroke-width: 2.75; stroke-dasharray: 24 76; animation: flow-pulse 2.6s linear infinite; }
.flow-badge { fill: var(--mist); stroke: var(--rule); stroke-width: 1.25; }
.flow-node-ring { fill: none; stroke: var(--action); stroke-width: 1.75; opacity: 0; animation: flow-ring 3.6s ease-in-out infinite; }
.flow-in-1 { animation-duration: 2.9s; animation-delay: -0.2s; }
.flow-in-2 { animation-duration: 4.3s; animation-delay: -1.9s; }
.flow-in-3 { animation-duration: 3.4s; animation-delay: -2.7s; }
.flow-in-4 { animation-duration: 4.7s; animation-delay: -0.8s; }
.flow-in-5 { animation-duration: 3.9s; animation-delay: -3.1s; }
.flow-in-6 { animation-duration: 4.5s; animation-delay: -1.4s; }
.flow-icon { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow-icon-active { stroke: var(--action); }
.flow-icon-fill { fill: var(--muted); }
.flow-badge-num { fill: var(--ink); font-size: 0.875rem; font-weight: 800; }
.flow-label { fill: var(--ink); font-size: 0.875rem; font-weight: 600; }
.flow-hub-box { fill: var(--mist); stroke: var(--rule); stroke-width: 1.5; }
.flow-hub-dot { fill: var(--action); animation: flow-dot 1.8s ease-in-out infinite; }
.flow-hub-title { fill: var(--ink); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.flow-hub-sub { fill: var(--muted); font-size: 0.875rem; font-weight: 500; }
.flow-tg-card { fill: var(--mist); stroke: var(--rule); stroke-width: 1.5; }
.flow-slot-0, .flow-slot-1, .flow-slot-2, .flow-slot-3 { transform-origin: 788px 340px; }
.flow-slot-0 { animation: flow-drop-0 3.6s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.flow-slot-1 { animation: flow-push-1 3.6s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.flow-slot-2 { animation: flow-push-2 3.6s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.flow-slot-3 { animation: flow-push-3 3.6s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.flow-cycle-1, .flow-cycle-2, .flow-cycle-3 { animation: flow-swap 10.8s steps(1, end) infinite; }
.flow-cycle-1 { animation-delay: 0s; }
.flow-cycle-2 { animation-delay: -3.6s; }
.flow-cycle-3 { animation-delay: -7.2s; }
.flow-tg-wm { fill: #56616B; font-size: 0.875rem; font-weight: 700; }
.flow-tg-title { fill: var(--ink); font-size: 1.125rem; font-weight: 700; }
.flow-tg-pin { fill: var(--action); }
.flow-tg-link { fill: var(--action); font-size: 0.875rem; font-weight: 600; }
.flow-tg-meta { fill: var(--ink); font-size: 0.875rem; font-weight: 400; }
.flow-tg-time { fill: var(--muted); font-size: 0.875rem; font-weight: 500; }

@keyframes flow-pulse {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
@keyframes flow-ring {
  0%, 10% { opacity: 0; }
  30%, 45% { opacity: 1; }
  75%, 100% { opacity: 0; }
}
@keyframes flow-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes flow-drop-0 {
  0% { transform: translateY(-34px) scale(0.98); opacity: 0; }
  28%, 100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes flow-push-1 {
  0% { transform: translateY(0) scale(1); filter: blur(0px) brightness(1); }
  28%, 100% { transform: translateY(18px) scale(0.95); filter: blur(2px) brightness(0.9); }
}
@keyframes flow-push-2 {
  0% { transform: translateY(18px) scale(0.95); filter: blur(2px) brightness(0.9); }
  28%, 100% { transform: translateY(36px) scale(0.9); filter: blur(3.5px) brightness(0.8); }
}
@keyframes flow-push-3 {
  0% { transform: translateY(36px) scale(0.9); opacity: 1; filter: blur(3.5px) brightness(0.8); }
  28%, 100% { transform: translateY(54px) scale(0.85); opacity: 0; filter: blur(5px) brightness(0.7); }
}
@keyframes flow-swap {
  0%, 33.33% { opacity: 1; }
  33.34%, 100% { opacity: 0; }
}

/* What is Golem: the problem on the left, four verbs on the right */
.what { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
.what .def { margin: 20px 0; max-width: 24ch; font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.what p { max-width: 44ch; }
.what .note { margin-top: 16px; color: var(--muted); font-size: 0.875rem; }
.does div { padding: 20px 0; border-top: 1px solid var(--rule); }
.does div:first-child { padding-top: 0; border-top: 0; }
.does dt { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--action); }

/* How to join */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 48px; }
.step-num { display: block; margin-bottom: 12px; font-size: clamp(2rem, 2.6vw + 0.8rem, 3rem); font-weight: 800; line-height: 1; color: var(--action); }
.steps p { max-width: 36ch; }

/* The questions: dropdowns (<details>) in two columns, a 1px rule between them; + opens, − closes, no motion */
#faq.band > .wrap { padding-top: 56px; padding-bottom: 56px; }
.faq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 64px; align-items: start; margin-top: 40px; }
.faq > div { border-bottom: 1px solid var(--rule); }
.faq details { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 18px 0; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.faq summary::after { content: "+"; font-family: "League Spartan", sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.faq details p { padding-bottom: 22px; max-width: 60ch; }


/* The close and the footer: one dark slate block */
.beta, .footer { color: var(--block-text); background: var(--block-bg); }
.beta .wrap { padding-top: 104px; padding-bottom: 72px; }
.beta p { max-width: 48ch; margin: 20px 0 32px; color: var(--block-muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; padding-top: 28px; padding-bottom: 40px; font-size: 0.875rem; color: var(--block-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--block-text); }
/* The light/dark switch: a checkbox, hidden but focusable, and its label, which names the mode it switches to. */
.mode-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-label { color: var(--block-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mode-label:hover { color: var(--block-muted); }
.mode-input:focus-visible + .mode-label { outline: 2px solid var(--action); outline-offset: 3px; }
.mode-label .to-dark { display: var(--to-dark); }
.mode-label .to-light { display: var(--to-light); }

/* The 404 page: two short notes, English then Czech */
.not-found { padding-top: 96px; padding-bottom: 96px; }
.not-found section + section { margin-top: 64px; }
.not-found .lead { max-width: 44ch; margin-top: 24px; font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flow-beam, .flow-node-ring, .flow-hub-dot, .flow-slot-0, .flow-slot-1, .flow-slot-2, .flow-slot-3, .flow-cycle-1, .flow-cycle-2, .flow-cycle-3 { animation: none; }
}

@media (max-width: 900px) {
  .what { grid-template-columns: 1fr; gap: 48px; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 760px) {
  .wrap, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .nav nav > a:not(.nav-cta) { display: none; }
  .nav nav { gap: 12px; }
  .nav nav a.nav-cta { padding: 8px 12px; }
  .wordmark { flex-direction: column; align-items: flex-start; gap: 6px; line-height: 1.1; }
  .wordmark .tagline { font-size: 0.875rem; letter-spacing: 0; }
  .offer { padding-top: 56px; padding-bottom: 72px; }
  .band > .wrap { padding-top: 72px; padding-bottom: 72px; }
  .beta .wrap { padding-top: 72px; padding-bottom: 56px; }
  .faq { grid-template-columns: 1fr; }
  .faq > div:first-child { border-bottom: 0; }
}
