/*
 * «Warm Calm» — the same tokens the product uses, written out by hand because this page has
 * no build step. They are not local choices: changing one here changes only this page, which
 * is how the two drift apart.
 */

:root {
  --paper: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #fdfbf8;
  --ink: #2b2622;
  --muted: #6e655e;
  --hairline: #ebe4da;

  --primary: #d9694b;
  --primary-ink: #ffffff;
  --secondary: #5b8c7b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-card: 0 1px 2px rgb(43 38 34 / 0.04), 0 8px 24px rgb(43 38 34 / 0.06);

  --font-display: Vollkorn, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-sans: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  color-scheme: light dark;
}

/* Dark mode is re-designed warm charcoal surfaces, not an inversion. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1917;
    --surface: #26211d;
    --surface-2: #2e2823;
    --ink: #f0ebe4;
    --muted: #a89e95;
    --hairline: #3a332d;

    --primary: #e37e60;
    --secondary: #7fa894;

    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.2), 0 8px 24px rgb(0 0 0 / 0.28);
  }
}

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

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Hidden until i18n.js has put words on the page: a Russian hero flashing before an English
 * one is exactly the mismatch the copy discipline exists to prevent. i18n.js always removes
 * this, even when the catalog fetch fails; noscript.css covers JS being off entirely. */
html.boot body {
  opacity: 0;
}

body {
  transition: opacity 250ms ease-out;
}

/* --- shell ------------------------------------------------------------------ */

.page {
  display: flex;
  min-height: 100dvh;
  max-width: 720px;
  flex-direction: column;
  gap: 48px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand svg {
  display: block;
  width: 36px;
  height: 36px;
}

/* The mark is coloured from CSS, not from `fill=` attributes, so it follows the theme: in
 * dark mode the chair becomes warm charcoal on lightened terracotta rather than staying a
 * paper-white cut-out that glows. */
.mark-plate {
  fill: var(--primary);
}

.mark-body,
.mark-leaf-a {
  fill: var(--paper);
}

.mark-leaf-b {
  fill: var(--secondary);
}

.mark-stem {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* --- language ---------------------------------------------------------------- */

.lang {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.lang button {
  position: relative;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.lang button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--primary-ink);
}

/* >=44px hit area without a 44px-tall control. */
.lang button::after {
  content: '';
  position: absolute;
  inset: -6px;
}

/* --- hero -------------------------------------------------------------------- */

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 32px;
}

.badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hero {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 11vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

/* --- the three beats ---------------------------------------------------------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 24px;
  counter-increment: step;
}

.steps li + li {
  border-top: 1px solid var(--hairline);
}

.steps li::before {
  content: counter(step);
  flex: none;
  width: 1.5ch;
  color: var(--primary);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.step-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.step-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Always its own line, even when it would fit beside the name: three rows that wrap
 * differently from each other read as three unrelated items instead of one rhythm. */
.step-hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The last beat is the payoff, so it gets the only sage accent on the page. */
.steps li:last-child .step-name {
  color: var(--secondary);
}

.steps li:last-child::before {
  color: var(--secondary);
}

/* --- teaser + note ------------------------------------------------------------ */

.teaser {
  max-width: 46ch;
  margin: 0;
  padding-left: 20px;
  border-left: 2px solid var(--primary);
  font-size: 1.0625rem;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* --- footer ------------------------------------------------------------------- */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.875rem;
}

/* --- a11y --------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .lang button {
    transition: none;
  }

  .badge::before {
    animation: none;
  }
}

@media (min-width: 640px) {
  .page {
    gap: 64px;
    padding: 48px 32px 32px;
  }
}
