/* =========================================================
   44 / ЖИВАЯ · BLUE GREY — полный одностраничный сайт
   Палитра: вечерний серо-синий #31465A · молочно-светлый #E9EEF0
            пыльный голубой #9EB9C7 · шалфей #9DB0A2 · тёплый #D98A6A
   Шрифты:  Onest (текст) · Manrope 200 (цифры «44» и счёт)
   ========================================================= */

:root {
  --bg: #31465A;
  --bg-soft: #3A5165;
  --bg-softer: #42596E;
  --ink: #E9EEF0;
  --soft: #9EB9C7;
  --sage: #9DB0A2;
  --warm: #D98A6A;
  --muted: #A9BEC9;
  --line: rgba(233, 238, 240, .16);
  --cta-text: #2B3F52;
}

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

html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Onest", "Segoe UI", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

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

[hidden] { display: none !important; }

/* ---------- Живой фон ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.loop {
  position: absolute;
  width: 74vmin;
  height: 74vmin;
  color: var(--soft);
  opacity: .38;
}

.loop-a {
  top: -16vmin;
  right: -20vmin;
  animation: drift-a 60s ease-in-out infinite alternate;
}

.loop-b {
  bottom: -22vmin;
  left: -24vmin;
  color: var(--sage);
  animation: drift-b 74s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) rotate(0deg) scale(1); }
  to   { transform: translate(2.6vmin, 2vmin) rotate(8deg) scale(1.04); }
}

@keyframes drift-b {
  from { transform: translate(0, 0) rotate(0deg) scale(1); }
  to   { transform: translate(-2.2vmin, -2.6vmin) rotate(-7deg) scale(1.05); }
}

/* ---------- HERO ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 44px) 26px
           calc(env(safe-area-inset-bottom, 0px) + 40px);
}

.date {
  order: 1;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.date.state-word {
  color: var(--warm);
  font-size: 1rem;
  letter-spacing: .3em;
}

.headline {
  order: 2;
  font-size: clamp(2.05rem, 9.6vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 12ch;
}

.object {
  order: 3;
  align-self: flex-end;
  position: relative;
  margin: 14px 4px 0 0;
  font-family: "Manrope", sans-serif;
  font-weight: 200;
  font-size: clamp(5.5rem, 28vw, 12rem);
  line-height: .9;
  letter-spacing: 0;
  user-select: none;
  will-change: transform;
}

.d { display: inline-block; }

.d1 { color: var(--ink); animation: float-a 13s ease-in-out infinite; }
.d2 { color: var(--soft); animation: float-b 17s ease-in-out infinite; }

@keyframes float-a {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.035em); }
}

@keyframes float-b {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(0.03em); }
}

/* 8 точек — круг своих людей вокруг «44» */

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.orb { position: absolute; animation: orbit var(--t, 170s) linear infinite; }

@keyframes orbit {
  from { transform: rotate(var(--a, 0deg)); }
  to   { transform: rotate(calc(var(--a, 0deg) + 360deg)); }
}

.dot {
  position: absolute;
  width: var(--s, 7px);
  height: var(--s, 7px);
  border-radius: 50%;
  animation: radial var(--rt, 26s) ease-in-out infinite alternate;
}

@keyframes radial {
  from { transform: translate(-50%, -50%) translateX(var(--rr, 28vmin)); }
  to   { transform: translate(-50%, -50%) translateX(calc(var(--rr, 28vmin) + var(--dr, 3vmin))); }
}

.c-soft { background: var(--soft); }
.c-sage { background: var(--sage); }
.c-warm { background: var(--warm); }
.c-light { background: var(--ink); opacity: .35; }

.micro {
  order: 4;
  margin-top: 36px;
  max-width: 24ch;
  font-size: .98rem;
  line-height: 1.55;
  color: var(--muted);
}

.cta {
  order: 5;
  align-self: flex-start;
  margin-top: 30px;
  padding: 15px 30px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cta-text);
  font-family: "Onest", "Segoe UI", sans-serif;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  display: inline-block;
  transition: background-color .3s ease, transform .25s ease;
}

.cta:hover { background: #F6F9F9; }
.cta:active { transform: scale(.97); }

.cta:focus-visible,
.link:focus-visible,
.file-btn:focus-visible {
  outline: 2px solid var(--soft);
  outline-offset: 3px;
}

.arr { display: inline-block; transition: transform .3s ease; }
.cta:hover .arr { transform: translateX(4px); }

/* ---------- Секции ---------- */

main { position: relative; z-index: 1; }

.section {
  padding: 11vh 26px;
  max-width: 640px;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s ease, transform .9s ease;
}

.section.in { opacity: 1; transform: none; }

.section-title {
  font-size: clamp(1.5rem, 6.4vw, 2.1rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.section-note {
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.6;
  max-width: 34ch;
  margin-bottom: 24px;
}

/* Countdown */

.countdown { margin: 8px 0 26px; }

.count-days {
  font-family: "Manrope", sans-serif;
  font-weight: 200;
  font-size: clamp(5.5rem, 30vw, 11rem);
  line-height: 1;
  color: var(--ink);
}

.count-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: .95rem;
  letter-spacing: .06em;
}

.count-small {
  margin-top: 14px;
  color: var(--soft);
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}

/* Словесное состояние (Завтра / Сегодня / Спасибо) вместо числа */
.count-days.count-state {
  font-family: "Onest", sans-serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  letter-spacing: .01em;
}

.signature {
  color: var(--sage);
  font-size: .92rem;
  line-height: 1.55;
  max-width: 30ch;
}

/* Место и время */

.place-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px;
  background: rgba(58, 81, 101, .45);
}

.place-line {
  display: flex;
  gap: 16px;
  padding: 9px 0;
  font-size: 1rem;
  line-height: 1.5;
}

.place-line + .place-line { border-top: 1px solid var(--line); }

.place-key {
  flex: 0 0 92px;
  color: var(--muted);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding-top: 3px;
}

/* Формы */

.field { margin-top: 26px; }

.field-label {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 10px;
}

.input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(58, 81, 101, .45);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .25s ease;
}

.input-narrow { max-width: 140px; }

.input::placeholder { color: rgba(169, 190, 201, .55); }
.input:focus { outline: none; border-color: var(--soft); }

.options { display: grid; gap: 10px; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(58, 81, 101, .45);
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
  text-align: left;
  transition: border-color .25s ease, background-color .25s ease;
}

.option input { position: absolute; opacity: 0; pointer-events: none; }

.option .mark {
  flex: 0 0 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--soft);
  transition: background-color .25s ease, border-color .25s ease;
}

.option.selected {
  border-color: var(--sage);
  background: rgba(157, 176, 162, .14);
}

.option.selected .mark { background: var(--sage); border-color: var(--sage); }

.option:has(input:focus-visible) { outline: 2px solid var(--soft); outline-offset: 2px; }

.reaction {
  margin-top: 14px;
  min-height: 1.4em;
  color: var(--warm);
  font-size: .98rem;
}

/* Квиз */

.q-block { margin-top: 26px; }

.q-title {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.quiz-result {
  margin-top: 24px;
  min-height: 1.5em;
  color: var(--warm);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Музыка — короткая реакция звуковой волны */

.wave {
  display: none;
  gap: 5px;
  align-items: flex-end;
  height: 22px;
  margin-top: 16px;
}

.wave.on { display: inline-flex; }

.wave i {
  width: 3px;
  border-radius: 2px;
  background: var(--soft);
  animation: wave 1.2s ease-in-out infinite;
}

.wave i:nth-child(1) { height: 30%; animation-delay: 0s; }
.wave i:nth-child(2) { height: 70%; animation-delay: .12s; }
.wave i:nth-child(3) { height: 100%; animation-delay: .24s; }
.wave i:nth-child(4) { height: 55%; animation-delay: .36s; }
.wave i:nth-child(5) { height: 80%; animation-delay: .48s; }

@keyframes wave {
  0%, 100% { transform: scaleY(.6); }
  50%      { transform: scaleY(1); }
}

/* Фото */

.file-label { display: inline-flex; align-items: center; gap: 14px; cursor: pointer; }

.file-btn {
  display: inline-block;
  padding: 13px 24px;
  border: 1px solid var(--soft);
  border-radius: 999px;
  color: var(--soft);
  font-size: .95rem;
  font-weight: 500;
  transition: background-color .25s ease, color .25s ease;
}

.file-label:hover .file-btn { background: rgba(158, 185, 199, .12); }

.file-hint { color: var(--muted); font-size: .88rem; }

.photo-preview {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.photo-preview img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.link {
  background: none;
  border: none;
  color: var(--soft);
  font: inherit;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 2px;
}

/* Чекбокс, отправка */

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .95rem;
  cursor: pointer;
  margin-bottom: 30px;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
}

.form-error {
  margin-top: 16px;
  min-height: 1.4em;
  color: var(--warm);
  font-size: .95rem;
}

/* Финал */

.final {
  border-top: 1px solid var(--line);
  padding-top: 12vh;
}

.final-title {
  font-family: "Manrope", sans-serif;
  font-weight: 200;
  font-size: clamp(2.6rem, 12vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 22px;
}

.final-meta {
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.final-status {
  color: var(--sage);
  font-size: .95rem;
  line-height: 1.5;
  margin-bottom: 26px;
}

.final-task {
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.6;
  max-width: 30ch;
  margin-bottom: 26px;
}

.final-count {
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.final-reaction {
  color: var(--sage);
  font-size: .95rem;
  min-height: 1.5em;
  margin-bottom: 22px;
}

/* Footer */

.footer {
  position: relative;
  z-index: 1;
  padding: 0 26px calc(env(safe-area-inset-bottom, 0px) + 34px);
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .08em;
}

/* ---------- Desktop ---------- */

@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    grid-template-rows: auto auto auto auto;
    align-content: center;
    column-gap: 5vw;
    padding: 8vh 8vw;
  }

  .date      { grid-row: 1; grid-column: 1; margin-bottom: 3vh; }
  .headline  { grid-row: 2; grid-column: 1; font-size: clamp(2.5rem, 3.6vw, 3.6rem); max-width: 14ch; }
  .object    { grid-row: 1 / -1; grid-column: 2; align-self: center; justify-self: center;
               margin: 0; font-size: clamp(9rem, 17vw, 17rem); }
  .micro     { grid-row: 3; grid-column: 1; margin-top: 6vh; max-width: 30ch; font-size: 1.08rem; }
  .cta       { grid-row: 4; grid-column: 1; justify-self: start; margin-top: 5vh; font-size: 1.12rem; }

  .section { padding: 13vh 8vw; max-width: 720px; }

  .count-days { font-size: clamp(9rem, 15vw, 15rem); }
}

/* ---------- Ограничение движения ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loop-a, .loop-b, .orb, .dot, .d1, .d2, .wave i { animation: none; }
  .wave.on { display: none; }
  .section { opacity: 1; transform: none; transition: none; }
  .cta, .arr, .option, .input { transition: none; }
}
