/* ==========================================================================
   Go Goals — лендинг.
   Дизайн-система: дерево цели + ИИ-спутник + планирование дня.
   Тёплый кремовый фон, плотные "нажимные" кнопки, жёсткие обводки карточек.
   ========================================================================== */

:root {
  --cream: #FAF1D9;
  --lav-bg: #DCE5FF;
  --green: #8AD641;
  --green-deep: #5C9C22;
  --lav: #ABC1FF;
  --gold: #F8C867;
  --gold-deep: #D89A2E;
  --orange: #F39139;
  --orange-deep: #C96A1C;
  --blue: #4572F0;
  --blue-deep: #2C4FC2;

  --ink: #1E2749;
  --ink-soft: #5B6382;
  --card: #FFFFFF;

  --font-display: "Baloo 2", "Segoe UI", system-ui, sans-serif;
  --font-body: "Mulish", "Segoe UI", system-ui, sans-serif;

  --container-width: 1140px;
  --transition-base: 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 12px 0;
  z-index: 200;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 18px;
  padding: 16px 28px;
  cursor: pointer;
  color: var(--ink);
  background: var(--green);
  box-shadow: 0 6px 0 var(--green-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity var(--transition-base);
}
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--green-deep); }

.btn.gold { background: var(--gold); box-shadow: 0 6px 0 var(--gold-deep); }
.btn.gold:active:not(:disabled) { box-shadow: 0 2px 0 var(--gold-deep); }

.btn.blue { background: var(--blue); color: #fff; box-shadow: 0 6px 0 var(--blue-deep); }
.btn.blue:active:not(:disabled) { box-shadow: 0 2px 0 var(--blue-deep); }

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.btn:disabled:active { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 241, 217, 0.85);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: auto; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.brand-name .go { color: var(--green-deep); }
.brand-name .goals { color: var(--orange-deep); }

.main-nav { display: flex; align-items: center; gap: 26px; font-weight: 700; font-size: 0.95rem; }
.main-nav a { color: var(--ink-soft); transition: color var(--transition-base); padding: 4px 0; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--ink); }
.main-nav a:last-child { color: var(--orange-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.nav-toggle span {
  display: block;
  height: 2.5px;
  width: 20px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 48px 0 90px; overflow: hidden; }
/* text hugs the container's left edge, mascot its right edge — same edges as the cards below */
.hero-grid { display: grid; grid-template-columns: 1fr auto; justify-content: space-between; gap: 36px; align-items: center; }

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.hero h1 .go { color: var(--green-deep); }
.hero h1 .goals { color: var(--orange-deep); }

.hero-sub { margin-top: 18px; font-size: 1.12rem; color: var(--ink-soft); max-width: 500px; }
.hero-actions { margin-top: 30px; }
.hero-note { margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }

.hero-visual {
  position: relative;
  width: 420px;
  max-width: 100%;
  aspect-ratio: 750 / 880;
  margin: 0 0 0 auto;
  border-radius: 28px;
  overflow: hidden;
  background: url('../assets/images/hero-bg.png') center / cover no-repeat;
  box-shadow: 0 20px 40px -18px rgba(30, 39, 73, 0.28);
}

.hero-mascot {
  width: 67%;
  position: absolute;
  left: 16.5%;
  bottom: 8%;
  z-index: 2;
  filter: drop-shadow(0 16px 20px rgba(30, 39, 73, 0.22));
}
.mascot-idle { animation: idle-float 2.4s ease-in-out infinite; transform-origin: bottom center; }
@keyframes idle-float {
  0%, 44% { transform: translateY(0) rotate(0deg) scale(1, 1); }
  8% { transform: translateY(3px) rotate(0deg) scale(1.08, 0.9); }
  24% { transform: translateY(-24px) rotate(-8deg) scale(0.94, 1.07); }
  34% { transform: translateY(0) rotate(5deg) scale(1.07, 0.93); }
  100% { transform: translateY(0) rotate(0deg) scale(1, 1); }
}

.mascot-breathe { animation: mascot-breathe 4.5s ease-in-out infinite; transform-origin: bottom center; }
@keyframes mascot-breathe {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-6px) scale(1.015, 1.025); }
}

.mascot-sway { animation: mascot-sway 3.6s ease-in-out infinite; transform-origin: bottom center; }
@keyframes mascot-sway {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

/* ---------- Section basics ---------- */
.kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-block;
}
.kicker.green { color: var(--green-deep); }
.kicker.orange { color: var(--orange-deep); }
.kicker.white { color: rgba(255,255,255,0.85); }
.kicker.blue { color: var(--blue-deep); }

/* ---------- App screens ---------- */
.screens { padding: 0 0 90px; }
.screens-track { display: flex; justify-content: center; gap: 28px; }
.screen { flex: 1 1 0; min-width: 0; max-width: 300px; }
.screen-img {
  width: 100%;
  border-radius: 28px;
  box-shadow: 0 20px 40px -18px rgba(30, 39, 73, 0.28);
}
/* Leo standing on the grass of the companion screen; % keep him in place at any screen width */
.screen-leo { position: relative; }
.screen-mascot {
  position: absolute;
  left: 15%;
  top: 11%;
  width: 70%;
  filter: drop-shadow(0 10px 12px rgba(30, 39, 73, 0.22));
}
@media (max-width: 700px) {
  /* one screen at a time, stacked in the same grid cell, JS toggles .is-active every 5s */
  .screens-track { display: grid; justify-items: center; }
  .screen { grid-area: 1 / 1; max-width: 280px; opacity: 0; transition: opacity 0.6s ease; }
  .screen.is-active { opacity: 1; }
}

/* ---------- Pillar 1: goal trees ---------- */
.pillar-trees { padding: 0 0 90px; }
.trees-card {
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--green);
  border-radius: 28px;
  padding: 56px 32px;
}
.pillar-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-top: 10px; }
.pillar-head p { margin-top: 16px; color: var(--ink-soft); font-size: 1.08rem; }

.tree-row { margin-top: 44px; }
.tree-track { display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.tree-set { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex: none; width: 100%; }
.tree-row .tree-set + .tree-set { display: none; }
.tree-set img { width: 195px; height: auto; }
/* each stage frame has a different amount of empty space below the ground ellipse; shift to align the visual ground line */
.tree-set img:nth-child(1) { transform: translateY(26px); }
.tree-set img:nth-child(5) { transform: translateY(10px); }

/* below ~5×130px fit, run the row as a self-scrolling marquee instead of wrapping */
@media (max-width: 700px) {
  /* fixed px math (not max-content/%) so iOS Safari can't recompute layout mid-animation and hitch:
     one set = 5 trees * 150px + 4 gaps * 24px + 24px trailing = 870px; track = 2 sets = 1740px.
     150px so that ~2.5 trees fit a 375px phone instead of 1.5 (which looked cut off) */
  .tree-row { overflow: hidden; }
  .tree-track { justify-content: flex-start; width: 1740px; animation: tree-marquee 18s linear infinite; }
  .tree-set { justify-content: flex-start; gap: 24px; padding-right: 24px; width: 870px; }
  .tree-set img { width: 150px; }
  .tree-row .tree-set + .tree-set { display: flex; }
}
@keyframes tree-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-870px); }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .tree-track { animation: none; }
  .tree-row { overflow-x: auto; }
  .tree-row .tree-set + .tree-set { display: none; }
}

/* ---------- Pillar 2: companion / AI ---------- */
.pillar-companion { padding: 0 0 90px; }
.companion-card {
  background: var(--blue);
  border-radius: 28px;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  align-items: center;
  gap: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.companion-card::before {
  content: "";
  position: absolute; right: -70px; top: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.companion-text { position: relative; }
.companion-card h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-top: 10px; }
.companion-lead { margin-top: 14px; color: rgba(255,255,255,0.92); font-size: 1.08rem; max-width: 440px; }

.companion-features { display: grid; gap: 14px; margin-top: 28px; }
.companion-feature {
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 16px;
  padding: 16px 18px;
}
.companion-feature h3 { font-size: 1.04rem; font-weight: 700; }
.companion-feature p { margin-top: 4px; font-size: 0.94rem; color: rgba(255,255,255,0.85); }

.name-form { display: flex; gap: 10px; margin-top: 26px; max-width: 440px; }
.name-form input {
  flex: 1 1 0;
  min-width: 0;
  padding: 13px 18px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}
.name-form input:focus { outline: none; box-shadow: 0 0 0 4px rgba(255,255,255,0.35); }
.name-form .btn { padding: 13px 20px; flex-shrink: 0; }
.name-note { min-height: 24px; margin-top: 12px; font-weight: 700; color: #fff; }

.companion-visual { display: flex; align-items: center; justify-content: center; position: relative; }
.companion-visual img { width: 100%; max-width: 352px; }

/* ---------- Pillar 3: planning ---------- */
.pillar-planning { padding: 0 0 90px; }
.planning-card {
  background: var(--lav-bg);
  border-radius: 28px;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  align-items: center;
  gap: 40px;
  color: var(--ink);
}
.planning-card h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-top: 10px; }
.planning-lead { margin-top: 14px; color: var(--ink-soft); font-size: 1.08rem; max-width: 440px; }

.planning-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.planning-list li {
  display: flex; align-items: center;
  background: var(--card);
  border: 2px solid var(--lav);
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700; font-size: 0.98rem; color: var(--ink);
}

.planning-visual { display: flex; align-items: center; justify-content: center; }

.phone-frame {
  width: 240px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 26px 54px -18px rgba(30, 39, 73, 0.4);
}
.phone-notch {
  position: relative;
}
.phone-notch::before {
  content: "";
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 18px;
  background: var(--ink);
  border-radius: 0 0 14px 14px;
  z-index: 2;
}
.phone-screen {
  width: 100%;
  border-radius: 26px;
  display: block;
}

/* ---------- Final CTA ---------- */
.cta-section { padding: 0 0 90px; }
.cta-card {
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--green);
  border-radius: 28px;
  padding: 56px 32px;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.cta-mascot { display: block; width: 165px; max-width: 55%; margin: 0 auto 12px; }
.cta-card h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.cta-card > p { margin-top: 10px; color: var(--ink-soft); font-size: 1.05rem; }

.signup-form {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
  justify-content: center;
}
.signup-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 15px 20px;
  border-radius: 16px;
  border: 2px solid var(--lav);
  font-family: inherit;
  font-size: 1rem;
  background: var(--cream);
}
.signup-form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(69, 114, 240, 0.18);
}

.signup-note { min-height: 24px; margin-top: 16px; font-weight: 700; color: var(--green-deep); }

.cta-tg { margin-top: 26px; min-width: 260px; font-size: 1.1rem; }
.cta-alt { margin-top: 28px; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.7); padding: 56px 0 30px; }

.grant-block {
  display: flex;
  align-items: center;
  gap: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  padding: 26px;
  margin-bottom: 40px;
}
.grant-logos { display: flex; gap: 16px; flex-shrink: 0; }
.grant-logo-img {
  width: 160px;
  height: 62px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  object-fit: contain;
}
.placeholder-logo {
  width: 160px;
  height: 62px;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.04) 10px, rgba(255,255,255,0.04) 20px);
  border: 1.5px dashed rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  padding: 6px;
  line-height: 1.3;
}
.grant-text { font-size: 0.9rem; line-height: 1.6; color: rgba(255,255,255,0.75); margin: 0; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand .brand-mark { width: 30px; height: auto; }
.footer-brand .brand-name { font-size: 1.05rem; }

.footer-nav { display: flex; gap: 22px; font-weight: 700; font-size: 0.9rem; }
.footer-nav a { color: rgba(255,255,255,0.65); }
.footer-nav a:hover { color: #fff; }

.footer-copy { color: rgba(255,255,255,0.5); font-size: 0.85rem; }

/* ---------- Section transitions ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .mascot-idle, .mascot-breathe, .mascot-sway { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-visual { width: 100%; max-width: 420px; margin: 0 auto; }
  .companion-card, .planning-card { grid-template-columns: 1fr; text-align: left; }
  .companion-visual, .planning-visual { order: -1; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--card);
    padding: 16px 24px 24px;
    border-bottom: 3px solid var(--ink);
  }
  .site-header.nav-open .main-nav a { padding: 10px 0; width: 100%; }
}

@media (max-width: 640px) {
  .hero { padding: 36px 0 70px; }
  .screens, .pillar-trees, .pillar-planning, .pillar-companion, .cta-section { padding: 0 0 70px; }
  .cta-card { padding: 40px 22px; }
  .trees-card, .companion-card, .planning-card { padding: 40px 22px; }
  .grant-block { flex-direction: column; text-align: center; }
  .footer-bottom { flex-direction: column; text-align: center; }
  /* flex-basis 220px in a column = 220px tall input; reset it */
  .signup-form { flex-direction: column; }
  .signup-form input, .signup-form button { width: 100%; flex: none; }
  .cta-tg { width: 100%; }
  .name-form { flex-direction: column; }
  .hero-sub { font-size: 1.02rem; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .placeholder-logo, .grant-logo-img { width: 130px; height: 52px; }
}
