/* ──────────────────────────────────────────────────────────────────────
   home.css — стили главной страницы (Hero-вариант A + секции ниже)
   Подключается отдельно от styles.css только на /home.
   ────────────────────────────────────────────────────────────────────── */

/* ── hero shell ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: calc(100vh - 80px);
  overflow: hidden;
  isolation: isolate;
}
.hero-stage {
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--bg);
}

/* abstract warm drift — multiple soft radials, slow movement */
.drift {
  position: absolute; inset: -20%;
  filter: blur(60px);
  opacity: 0.85;
  will-change: transform;
}
.drift::before, .drift::after, .drift > span {
  content: ''; position: absolute; border-radius: 50%;
}
.drift::before {
  width: 55%; height: 55%; top: 15%; left: 10%;
  background: radial-gradient(circle, var(--hero-warm-1) 0%, transparent 60%);
  animation: drift1 38s ease-in-out infinite alternate;
}
.drift::after {
  width: 50%; height: 50%; bottom: 10%; right: 5%;
  background: radial-gradient(circle, var(--hero-warm-2) 0%, transparent 60%);
  animation: drift2 46s ease-in-out infinite alternate;
}
.drift > span {
  width: 40%; height: 40%; top: 35%; left: 40%;
  background: radial-gradient(circle, var(--hero-warm-3) 0%, transparent 60%);
  opacity: 0.5;
  animation: drift3 60s linear infinite;
}
@keyframes drift1 { from { transform: translate(0,0) scale(1); }      to { transform: translate(8%,6%) scale(1.12); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1.05); }   to { transform: translate(-7%,-5%) scale(0.95); } }
@keyframes drift3 { from { transform: translate(-3%,2%) rotate(0deg); } to { transform: translate(3%,-2%) rotate(360deg); } }

.hero-stage::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, transparent 30%, color-mix(in oklab, var(--bg) 70%, transparent) 100%);
  pointer-events: none;
}

/* ── hero variant A — editorial asymmetric ───────────────────────────── */
.hero-a {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 64px;
  padding: 120px 64px 160px;
  min-height: calc(100vh - 80px);
}
.hero-a .lead { max-width: 620px; }
.hero-a .title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(56px, 7.6vw, 110px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 32px;
}
.hero-a .title .em { font-style: italic; color: var(--text-muted); }

/* ── hero intro: counting words + letter-by-letter title ─────────────── */
.hero-a .lead { position: relative; }

.intro-count {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(clamp(56px, 7.6vw, 110px) * 2 * 0.96);
  pointer-events: none;
}
.intro-count span {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  font-family: 'Instrument Serif', serif;
  font-size: clamp(56px, 7.6vw, 110px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--text);
  transform-origin: left center;
  opacity: 0;
  animation: countZoom 0.8s ease-in-out forwards;
}
.intro-count span:nth-child(1) { animation-delay: 0s; }
.intro-count span:nth-child(2) { animation-delay: 0.72s; }
.intro-count span:nth-child(3) { animation-delay: 1.44s; }
.intro-count span:nth-child(4) { animation-delay: 2.16s; }
.intro-count span:nth-child(5) { animation-delay: 2.88s; }

@keyframes countZoom {
  0%   { transform: scale(.06); opacity: 0; }
  18%  { opacity: 1; }
  55%  { transform: scale(1); opacity: 1; }
  85%  { opacity: 0; }
  100% { transform: scale(1.05); opacity: 0; }
}

.hero-a .title { opacity: 0; }
.hero-a .title .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
}
.hero-a .title.letters-ready {
  opacity: 1;
}
.hero-a .title.letters-ready .letter {
  animation: letterIn 0.4s ease-out forwards;
  animation-delay: calc(var(--i) * 35ms);
}
@keyframes letterIn {
  to { opacity: 1; transform: translateY(0); }
}

html.no-intro .intro-count { display: none; }
html.no-intro .hero-a .title { opacity: 1; }
html.no-intro .hero-a .title .letter { opacity: 1; transform: none; animation: none; }

@media (prefers-reduced-motion: reduce) {
  .intro-count { display: none; }
  .hero-a .title { opacity: 1; }
  .hero-a .title .letter { opacity: 1; transform: none; animation: none; }
}
.hero-a .sub {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 44px;
}
.hero-a .actions { display: flex; align-items: center; gap: 24px; }

.hero-meta {
  position: absolute;
  top: 40px; right: 40px;
  text-align: right;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.hero-meta .muted { color: var(--text-soft); }
.hero-marquee {
  position: absolute;
  bottom: 38px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 64px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.hero-marquee .quote {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 16px;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--text-muted);
}

.hero-aside {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 4px;
  overflow: hidden;
  background:
    linear-gradient(135deg,
      color-mix(in oklab, var(--accent) 28%, var(--surface)) 0%,
      var(--surface-2) 100%);
  box-shadow: 0 40px 80px -32px rgba(31,23,15,0.35);
}
.hero-aside .placeholder-tag {
  position: absolute; left: 18px; bottom: 16px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: color-mix(in oklab, var(--text) 60%, transparent);
  text-transform: uppercase;
}
.hero-aside .placeholder-tag::before { content: '↳ '; opacity: 0.5; }
.hero-aside .crosshair {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  background-image:
    linear-gradient(to right, transparent calc(50% - 0.5px), color-mix(in oklab, var(--text) 14%, transparent) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), color-mix(in oklab, var(--text) 14%, transparent) 50%, transparent calc(50% + 0.5px));
  background-size: 100% 100%;
  opacity: 0.9;
}
.hero-aside .pulse {
  position: absolute; left: 50%; top: 62%;
  width: 64px; height: 64px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--text) 40%, transparent);
  animation: pulse 4s ease-in-out infinite;
}
.hero-aside .pulse::after {
  content: ''; position: absolute; inset: -16px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
  animation: pulse 4s ease-in-out 1.5s infinite;
}
@keyframes pulse {
  0%   { transform: translate(-50%,-50%) scale(0.85); opacity: 0.9; }
  50%  { transform: translate(-50%,-50%) scale(1.1);  opacity: 0.4; }
  100% { transform: translate(-50%,-50%) scale(0.85); opacity: 0.9; }
}

/* ── ribbon (бегущая строка) ─────────────────────────────────────────── */
.ribbon {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}
.ribbon-track {
  display: flex; white-space: nowrap;
  animation: scroll-x 60s linear infinite;
}
.ribbon-track > * { margin-right: 56px; }
.ribbon-track .dot { color: var(--accent); }
@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}

/* ── how it works ────────────────────────────────────────────────────── */
.how { padding: 140px 0 80px; }
.how .eyebrow { text-align: center; }
.how .h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(36px, 4.4vw, 60px);
  text-align: center;
  margin: 16px auto 14px;
  max-width: 16ch;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.how .h2 .em { font-style: italic; color: var(--text-muted); }
.how .lede {
  text-align: center; max-width: 540px; margin: 0 auto 80px;
  color: var(--text-muted); font-size: 17px; line-height: 1.55;
}
.how-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.how-cell {
  background: var(--surface);
  padding: 44px 36px 48px;
  min-height: 280px;
  position: relative;
  display: flex; flex-direction: column;
}
.how-cell .step {
  font-family: ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 28px;
}
.how-cell h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 30px; line-height: 1.1; margin-bottom: 14px;
  letter-spacing: -0.015em;
}
.how-cell h3 .em { font-style: italic; color: var(--text-muted); }
.how-cell p { color: var(--text-muted); font-size: 15px; line-height: 1.55; margin: 0; }
.how-cell .ord {
  position: absolute; top: 20px; right: 24px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--text-soft);
}

/* ── promise ─────────────────────────────────────────────────────────── */
.promise { padding: 120px 0 60px; text-align: center; }
.promise .quote {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1.15;
  color: var(--text);
  max-width: 22ch;
  margin: 0 auto 20px;
  letter-spacing: -0.015em;
}
.promise .by {
  color: var(--text-soft); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
}

/* ── footer cta ──────────────────────────────────────────────────────── */
.footer-cta {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 90px 0;
  text-align: center;
}
.footer-cta .h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.05;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}
.footer-cta .h2 .em { font-style: italic; color: var(--text-muted); }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .hero-a {
    grid-template-columns: 1fr 630px;
    align-items: center;
    max-width: 1320px;
    margin-inline: auto;
  }
  .hero-a .lead {
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: 620px;
  }
}
@media (max-width: 880px) {
  .hero-a { grid-template-columns: 1fr; padding: 80px 22px; }
  .hero-a .hero-marquee { display: none; }
  .hero-aside { display: none; }
  .how-grid { grid-template-columns: 1fr; }
}
