/* League Spartan (headings) and Figtree (text), both SIL OFL (see /fonts/OFL-*.txt), variable weight,
   each split so Czech pulls in latin-ext. */
@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;
}

/* 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;
}

@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;
  }
}

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

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

body {
  font-family: "Figtree", 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", "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", "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; }
.wordmark b { font-weight: 800; }
.wordmark .dot, .wordmark .tagline { 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; }
.lang-switch { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.nav nav .lang-switch a { font-weight: 700; padding: 3px 8px; color: var(--muted); }
.nav nav .lang-switch a[aria-current="page"] { color: var(--ink); background: var(--paper); }
.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; }
.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: #BFC9D1; 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; }
@media (prefers-color-scheme: dark) {
  .flow-wire { stroke: var(--rule); }
}
.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 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); }

@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 { line-height: 1.1; }
  .wordmark .dot { display: none; }
  .wordmark .tagline { display: block; 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; }
}
