/* TwoTrail landing — shared styles for index.html (en) and ru.html (ru).
   Tokens mirror the app brandbook (Theme.swift) and invite.html. */

/* Tokens mirror the shipped app (Theme.swift), not the .pen file:
   canvas 0.94/0.91/0.85, mossDeep 0.26/0.32/0.22, inkMuted 0.35/0.33/0.28,
   trailCardWarm, lineWarm, trailSpineMoss, autumn. Display face is Lora —
   the app's brand headline face (native Cyrillic). */
:root {
  --color-canvas: #F0E8D9;
  --color-card: #FBF7EE;
  --color-line-warm: #E8DFC8;
  --color-text: #221F1B;
  --color-text-muted: #595447;
  --color-moss: #5D6755;
  --color-moss-deep: #425238;
  --color-spring: #9FB07F;
  --color-clay: #A95C3F;
  --color-gold: #D3B066;
  --color-trail: #7E8F6A;

  --radius-sm: 14px;
  --radius-md: 24px;

  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --shadow-card: 0 1px 2px rgba(34, 31, 27, 0.04), 0 6px 18px rgba(34, 31, 27, 0.06);
}

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

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

body {
  margin: 0;
  /* Paper canvas with faint watercolor stains — echoes the app's
     PathPaperBackground (soft clay / moss / gold blooms on cream). */
  background-color: var(--color-canvas);
  background-image:
    radial-gradient(640px 420px at 85% 6%, rgba(211, 176, 102, 0.09), transparent 70%),
    radial-gradient(720px 520px at 8% 38%, rgba(169, 92, 63, 0.05), transparent 70%),
    radial-gradient(820px 620px at 78% 74%, rgba(126, 143, 106, 0.07), transparent 70%);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-moss-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

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

.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 48px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-moss);
}
.logo-text {
  /* The app wordmark: lowercase italic serif. */
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  color: var(--color-moss);
}

.lang {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border: 1px solid var(--color-line-warm);
  border-radius: 999px;
  background: rgba(250, 250, 245, 0.6);
  transition: color 150ms ease, border-color 150ms ease;
}
.lang:hover { color: var(--color-moss-deep); border-color: var(--color-moss); }

/* ---------- Hero ---------- */

/* The first screen owns the whole viewport. Mobile: the app's welcome
   watercolor is a full-bleed backdrop, copy sits in the light sky — same
   composition as the app's welcome screen. Desktop (≥900px): split — copy
   left, the watercolor as a postcard on the right. */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 110px 24px 48px;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  user-select: none;
}

/* Live app screen in a paper-bezel frame — desktop only. */
.hero-phone {
  display: none;
}

/* Two walkers, watercolor (alpha-keyed from the app asset) — desktop only. */
.hero-walkers {
  display: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .hero {
    align-content: center;
    justify-content: center;
    grid-template-columns: minmax(360px, 46%) 54%;
    align-items: center;
    column-gap: clamp(32px, 4vw, 64px);
    padding: 120px clamp(24px, 5vw, 72px) 0;
    text-align: left;
  }
  .hero-inner {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    justify-self: start;
    max-width: 620px;
  }
  .hero .hero-title {
    font-size: clamp(52px, 6.4vw, 84px);
    line-height: 1.0;
    letter-spacing: -0.02em;
  }
  .hero-visual {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    align-self: stretch;
  }
  .hero-art {
    /* Absolute inside the stretched column, so the art can never dictate
       the hero's height — it fills whatever the text column defines. */
    position: absolute;
    inset: 0;
    width: 118%;
    height: 100%;
    object-fit: cover;
    object-position: 42% 66%;
    /* Feathered into the paper canvas instead of a framed postcard. */
    -webkit-mask-image:
      linear-gradient(to right,  transparent 0, #000 22%),
      linear-gradient(to bottom, transparent 0, #000 16%, #000 88%, transparent 100%);
            mask-image:
      linear-gradient(to right,  transparent 0, #000 22%),
      linear-gradient(to bottom, transparent 0, #000 16%, #000 88%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-composite: intersect;
  }
  .hero-phone {
    display: block;
    position: absolute;
    right: 4%;
    bottom: -6%;
    width: clamp(300px, 26vw, 380px);
    /* Crop: the app screenshot starts below the status bar + nav chrome,
       from the "THE TRAIL" header (545px into the 1320×2868 capture). */
    aspect-ratio: 1320 / 1900;
    overflow: hidden;
    border-radius: 28px;
    border: 6px solid var(--color-card);
    background: var(--color-card);
    box-shadow: 0 30px 70px rgba(34, 31, 27, 0.24), 0 6px 18px rgba(34, 31, 27, 0.12);
    transform: rotate(-1.5deg);
  }
  .hero-phone img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: -41.3%;
  }
  .hero-walkers {
    display: block;
    width: 190px;
    height: auto;
    margin-top: 32px;
    margin-left: -6px;
  }
  /* .hero prefix wins the cascade over the base rules declared later. */
  .hero .hero-sub {
    margin-left: 0;
    margin-right: 0;
    margin-top: 24px;
    max-width: 420px;
    font-size: clamp(19px, 2.2vw, 22px);
  }
  .hero .hero-cta-row {
    align-items: flex-start;
  }
}

@media (prefers-contrast: more) {
  .hero-art { -webkit-mask-image: none; mask-image: none; }
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.hero-sub {
  margin: 20px auto 0;
  max-width: 440px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hero-cta-row {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-note {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- CTA button (matches invite.html) ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 30px;
  background: var(--color-moss-deep);
  color: var(--color-canvas);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 200ms ease;
  box-shadow: 0 6px 20px rgba(66, 74, 61, 0.25);
}
.cta:hover { box-shadow: 0 8px 26px rgba(66, 74, 61, 0.32); }
.cta:active { transform: scale(0.98); opacity: 0.9; }
.cta-icon { width: 16px; height: 20px; flex-shrink: 0; }

/* ---------- Trail wrap & sections ---------- */

.trail-wrap {
  position: relative;
}

.trail-svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}
.trail-path {
  fill: none;
  stroke: var(--color-trail);
  stroke-width: 3.5;
  stroke-linecap: round;
  opacity: 0.75;
}
.trail-marker {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 420ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
.trail-marker.is-passed { transform: scale(1); }
/* Solid dots on the spine, like day dots in the app's trail. */
.trail-marker--day {
  fill: var(--color-trail);
}
.trail-marker--milestone {
  fill: var(--color-gold);
}

.section {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(72px, 11vh, 120px) 24px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-moss);
}
/* Hand-drawn wavy underline — the app's section-header signature. */
.eyebrow::after {
  content: '';
  display: block;
  width: 46px;
  height: 7px;
  margin-top: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 7'%3E%3Cpath d='M1.5 4.5 Q 8 1 14.5 3.5 T 27.5 3.5 T 44.5 3' fill='none' stroke='%235D6755' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.section--center .eyebrow::after {
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 560px;
}

.section-sub {
  margin: 16px 0 0;
  max-width: 480px;
  color: var(--color-text-muted);
  font-size: 17px;
}

.section--center { text-align: center; }
.section--center .section-title,
.section--center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- How it works: steps ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 8vh, 84px);
  margin-top: clamp(48px, 8vh, 72px);
}

.step {
  width: min(430px, 100%);
  background: var(--color-card);
  border: 1px solid var(--color-line-warm);
  border-radius: var(--radius-md);
  padding: 28px 28px 26px;
  box-shadow: var(--shadow-card);
}
.step:nth-child(odd) { margin-right: auto; }
.step:nth-child(even) { margin-left: auto; }

.step-day {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-moss);
}

.step-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.step-text {
  margin: 10px 0 0;
  color: var(--color-text-muted);
  font-size: 15.5px;
}

/* ---------- Ritual demo card ---------- */

.demo {
  margin: clamp(56px, 9vh, 88px) auto 0;
  width: min(430px, 100%);
}

.demo-caption {
  margin: 0 0 14px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-muted);
}

.demo-card {
  background: var(--color-card);
  border: 1px solid var(--color-line-warm);
  border-radius: var(--radius-md);
  padding: 26px 26px 24px;
  box-shadow: var(--shadow-card);
}

.demo-day {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.demo-prompt {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
}

.demo-answers {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-answer { min-width: 0; }

.demo-answer-name {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.demo-answer-text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.5;
}

.demo-answer--partner .demo-answer-text {
  filter: blur(7px);
  user-select: none;
  transition: filter 700ms ease;
}
.demo-card.is-revealed .demo-answer--partner .demo-answer-text {
  filter: blur(0);
  user-select: auto;
}

.demo-reveal {
  margin-top: 18px;
  width: 100%;
  padding: 12px 18px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-moss-deep);
  background: var(--color-canvas);
  border: 1px solid var(--color-line-warm);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 150ms ease, opacity 300ms ease;
}
.demo-reveal:hover { border-color: var(--color-moss); }
.demo-card.is-revealed .demo-reveal {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Milestones ---------- */

.milestones {
  margin-top: clamp(48px, 8vh, 72px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.milestone {
  background: var(--color-card);
  border: 1px solid var(--color-line-warm);
  border-radius: var(--radius-sm);
  padding: 22px 16px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.milestone-dot {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--color-gold);
}

.milestone-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
}

.milestone-day {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.seasons-note {
  margin: 28px auto 0;
  max-width: 460px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--color-text-muted);
}

/* ---------- For whom ---------- */

.pairs {
  margin-top: clamp(48px, 8vh, 72px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.pair {
  background: var(--color-card);
  border: 1px solid var(--color-line-warm);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
}

.pair-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
}

.pair-text {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 15px;
}

/* ---------- Privacy ---------- */

.privacy-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--color-card);
  border: 1px solid var(--color-line-warm);
  border-radius: var(--radius-md);
  padding: clamp(36px, 6vw, 56px) clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-card);
}

.privacy-line {
  margin: 0 auto;
  max-width: 620px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
  line-height: 1.25;
}

.privacy-sub {
  margin: 18px auto 0;
  max-width: 420px;
  color: var(--color-text-muted);
  font-size: 16px;
}

/* ---------- Final CTA ---------- */

.final-cta .cta { margin-top: 32px; }

.pricing-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

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

.footer {
  position: relative;
  z-index: 1;
  padding: 72px 24px 56px;
  text-align: center;
}

.footer-tagline {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-muted);
}

.footer-links {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}
.footer-links a {
  color: var(--color-text-muted);
  text-underline-offset: 3px;
}

.footer-copyright {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ---------- Motion ---------- */

/* Hidden-until-scrolled only when JS is running (html.js set inline in <head>),
   so the page stays readable without JS and in static renders. */
.js .fade-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}
.js .fade-up.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .trail-marker {
    transform: scale(1);
    transition: none;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .milestones { grid-template-columns: repeat(2, 1fr); }
  .pairs { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Below 900px the trail hugs the center and runs behind centered text —
     keep it a quiet wash (matches the JS meander clamp threshold). */
  .trail-path { opacity: 0.35; }
}

@media (max-width: 700px) {
  .step:nth-child(odd),
  .step:nth-child(even) { margin-left: auto; margin-right: auto; }
}
