/* ============================================================
   planetyou.ai — dark "cosmic" sibling of kyledunne.ai
   Deep night-sky ground; the four brand-layer colors as glowing
   accents. Same fonts, same hero-fade device, same section rhythm.
   ============================================================ */

:root {
  --bg:        #0A0E1A;  /* deep night-sky navy/near-black canvas    */
  --bg-2:      #0F1626;  /* slightly lifted panel/surface            */
  --surface:   #151E33;  /* cards                                    */
  --orange:    #F28C28;  /* core / "You" — PRIMARY accent + CTA      */
  --orange-br: #FFA646;  /* hover                                    */
  --yellow:    #FFD43B;  /* mantle / integrations                    */
  --blue:      #8EC5E8;  /* atmosphere / always-on                   */
  --brown:     #4A2C1A;  /* outer shell — true logo brown (3D planet) */
  --brown-lt:  #9A6233;  /* dark-brown wordmark/UI tint, legible on dark */
  --text:      #EDEAF2;  /* near-white body                          */
  --muted:     #9AA3B8;  /* muted slate for secondary text           */
  --line:      rgba(237, 234, 242, 0.12);

  --maxw: 1080px;
  --radius: 18px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mark:    "Poppins", var(--font-body);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--text); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

:focus-visible { outline: 2px solid var(--orange); 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;
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--orange);
  margin: 0 0 0.9rem;
}

/* ---------- Wordmark (re-typeset, geometric sans) ---------- */
.wordmark { font-family: var(--font-mark); font-weight: 700; letter-spacing: -0.01em; }
.wordmark__planet { color: var(--brown-lt); }
.wordmark__you   { color: var(--orange); }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 500; color: var(--muted);
  padding: 0.4rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.pill .dot, .hero__status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 0 0 0 rgba(242, 140, 40, 0.6); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(242, 140, 40, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(242, 140, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 140, 40, 0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 500; font-size: 0.98rem;
  padding: 0.8rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--orange); color: #1A0E03; font-weight: 600; box-shadow: 0 0 0 0 rgba(242,140,40,0); }
.btn--primary:hover { background: var(--orange-br); box-shadow: 0 8px 28px rgba(242, 140, 40, 0.28); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); background: rgba(142, 197, 232, 0.06); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(10, 14, 26, 0.55);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.nav.is-scrolled { background: rgba(15, 22, 38, 0.9); border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand { font-size: 1.25rem; }
.nav__links { display: flex; align-items: center; gap: 1.3rem; }
.nav__back { font-size: 0.95rem; color: var(--muted); transition: color .2s; }
.nav__back:hover { color: var(--text); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav__mobile { display: none; flex-direction: column; align-items: flex-start; gap: 1rem; padding: 0.5rem clamp(1.25rem, 4vw, 2.5rem) 1.4rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.nav__mobile a { font-size: 1.05rem; color: var(--text); }

/* ---------- Starfield backdrop ---------- */
/* Pinned to the viewport, behind all content (z-index:-1) but above the body's
   navy. The opaque hero covers it on screen one; it's revealed behind the
   planet section and below as the page scrolls. Painted by starfield.js. */
.starfield {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.hero__media {
  position: absolute; inset: 0; z-index: 0;
  /* Night-sky photo at full strength up top, fading into the page bg as it
     descends — the dark sibling of kyledunne.ai's hero-forest fade. */
  background:
    linear-gradient(to bottom,
      rgba(10,14,26,0.15) 0%,
      rgba(10,14,26,0.00) 30%,
      rgba(10,14,26,0.55) 68%,
      rgba(10,14,26,0.92) 88%,
      var(--bg) 100%),
    url("assets/starry-night-sky-4.avif") center top / cover no-repeat;
}
.hero__inner { position: relative; z-index: 1; padding-block: 7rem 4rem; text-align: center; margin-inline: auto; max-width: 46rem; }
/* Localized scrim: a darker pocket of sky behind the text so it stays legible
   over the bright nebula, while the photo stays vivid at the edges. */
.hero__inner::before {
  content: ""; position: absolute; z-index: -1; inset: -6% -14%; pointer-events: none;
  background: radial-gradient(ellipse 62% 60% at 50% 46%,
    rgba(10, 14, 26, 0.74) 0%,
    rgba(10, 14, 26, 0.58) 42%,
    rgba(10, 14, 26, 0.0) 80%);
}
.hero__planet {
  width: clamp(96px, 14vw, 132px); height: auto; margin: 0 auto 1.4rem;
  filter: drop-shadow(0 0 36px rgba(142, 197, 232, 0.45)) drop-shadow(0 0 14px rgba(242, 140, 40, 0.35));
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero__wordmark { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 1.4rem; text-shadow: 0 1px 20px rgba(10, 14, 26, 0.7); }
.hero__title { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 600; letter-spacing: -0.02em; }
.t-accent {
  font-weight: 700;
  background: linear-gradient(100deg, var(--orange) 10%, var(--yellow) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.t-you { color: var(--orange); font-weight: 700; }
.t-bright { color: var(--text); }
.hero__sub { max-width: 42ch; margin: 1.6rem auto 1.8rem; font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--muted); }
.hero__status { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--muted); margin: 0 0 2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ---------- Generic section ---------- */
.section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.section__title { font-size: clamp(1.9rem, 4.5vw, 2.9rem); color: var(--text); }
.section__lede { max-width: 60ch; margin: 1.2rem 0 0; font-size: clamp(1.08rem, 2.2vw, 1.22rem); color: var(--muted); }

/* ============================================================
   The centerpiece — scrollytelling cut-away planet
   ============================================================ */
.scrolly { position: relative; height: 400vh; }
.scrolly__stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.scrolly__visual { position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; }
.scrolly__visual::after {
  /* soft luminous glow behind the planet */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(142,197,232,0.16) 0%, rgba(242,140,40,0.08) 32%, transparent 62%);
}
#planet-canvas { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }
.scrolly__fallback { display: none; width: clamp(220px, 34vw, 340px); height: auto; position: relative; z-index: 1;
  filter: drop-shadow(0 0 40px rgba(142, 197, 232, 0.4)); }

.scrolly__copy { position: relative; }
.scrolly__eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem;
  font-weight: 600; color: var(--blue); margin: 0 0 1.4rem;
}
.layers { list-style: none; margin: 0; padding: 0; position: relative; }
.layer { position: absolute; top: 0; left: 0; right: 0;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .5s ease, transform .5s ease; }
.layer.is-active { opacity: 1; transform: none; pointer-events: auto; }
.layer__index { display: inline-block; font-family: var(--font-mark); font-size: 0.82rem;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.8rem; }
.layer__index b { color: var(--text); font-weight: 700; }
.layer__title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); color: var(--text); display: flex; align-items: center; gap: 0.7rem; }
.layer__swatch { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 16px var(--c); flex: none; }
.layer__copy { margin: 1rem 0 0; font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--muted); max-width: 42ch; }

/* ---------- Why / cards ---------- */
.cards { margin-top: 2.6rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.4rem); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 1.9rem);
  transition: border-color .25s ease, transform .25s ease;
}
.card:hover { border-color: rgba(142, 197, 232, 0.4); transform: translateY(-2px); }
.card__title { font-size: 1.2rem; color: var(--text); margin-bottom: 0.5rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.99rem; }

/* ---------- Notify ---------- */
.section--notify {
  background:
    radial-gradient(900px 400px at 50% -10%, rgba(242,140,40,0.10), transparent 70%),
    var(--bg-2);
  border-block: 1px solid var(--line);
  text-align: center;
}
.notify { max-width: 620px; }
.notify__lede { color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.18rem); margin: 0.9rem auto 1.8rem; }
.subscribe { display: flex; gap: 0.7rem; max-width: 460px; margin: 0 auto; }
.subscribe input {
  flex: 1; min-width: 0; font-family: var(--font-body); font-size: 1rem; color: var(--text);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.8rem 1.25rem; transition: border-color .2s ease, background .2s ease;
}
.subscribe input::placeholder { color: var(--muted); }
.subscribe input:focus { outline: none; border-color: var(--orange); background: rgba(255, 255, 255, 0.06); }
.subscribe__msg { min-height: 1.4rem; margin: 1rem 0 0; font-size: 0.95rem; font-weight: 500; }
.subscribe__msg.is-ok { color: var(--blue); }
.subscribe__msg.is-err { color: #F2926A; }
.subscribe__msg a { color: var(--orange); text-decoration: underline; }
.subscribe__fine { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 240px 1fr; gap: clamp(1.8rem, 5vw, 3.5rem); align-items: center; }
.about__photo img { border-radius: var(--radius); width: 100%; height: auto;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5); border: 1px solid var(--line); }
.about__text p { color: var(--muted); margin: 0 0 0.9rem; }
.about__text p:first-of-type { color: var(--text); }
.about__links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.link-pill { padding: 0.5rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.92rem; font-weight: 500; color: var(--text); transition: background .2s, border-color .2s; }
.link-pill:hover { background: rgba(142, 197, 232, 0.06); border-color: var(--blue); }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: 2.4rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem; align-items: center; justify-content: space-between; }
.footer__brand { font-size: 1.15rem; margin: 0; }
.footer__tag { font-size: 0.9rem; color: var(--muted); margin: 0.2rem 0 0; }
.footer__links { display: flex; gap: 1.4rem; }
.footer__links a { font-size: 0.95rem; color: var(--muted); }
.footer__links a:hover { color: var(--orange); }
.footer__copy { font-size: 0.88rem; color: var(--muted); margin: 0; width: 100%; padding-top: 0.6rem; border-top: 1px solid var(--line); }

/* ============================================================
   Fallback path — no WebGL / reduced motion (html.no-3d)
   The scrolly section becomes ordinary stacked sections.
   ============================================================ */
.no-3d .scrolly { height: auto; }
.no-3d .scrolly__stage { position: static; height: auto; display: block;
  padding-block: clamp(3.5rem, 8vw, 6rem); }
.no-3d .scrolly__visual { height: auto; margin-bottom: 2.5rem; min-height: 320px; }
.no-3d #planet-canvas { display: none; }
.no-3d .scrolly__fallback { display: block; }
.no-3d .layers { display: grid; gap: 2.2rem; }
.no-3d .layer { position: static; opacity: 1; transform: none; pointer-events: auto;
  transition: none; padding-left: 1.1rem; border-left: 2px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .scrolly__stage { grid-template-columns: 1fr; grid-template-rows: 1fr auto; gap: 1rem; }
  .scrolly__visual { min-height: 38vh; }
  .scrolly__copy { padding-bottom: 6vh; }
  .layers { min-height: 11rem; }
}

@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .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); }
  .nav__mobile:not([hidden]) { display: flex; }

  .cards { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .about__photo { max-width: 200px; }
  .about__links { justify-content: center; }
  .subscribe { flex-direction: column; }
  .subscribe input, .subscribe .btn { width: 100%; }
  .no-3d .scrolly__visual { min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
  .pill .dot, .hero__status .dot { animation: none; }
  .hero__planet { animation: none; }
  .layer { transition: none; }
}
