/* ============================================================
   πLand · Newsletter Landing Page — v6.3
   Layout  : Full-bleed cinematic — headline over image / glass card right
   Type    : Inter 900 throughout (consistency) — no display serifs
   Vibe    : WoodNest-inspired entry animation, atmospheric, image-forward
   Changes : Smooth bg zoom via .hero__bg transform (not background-size),
             mobile form card uses near-opaque white, mobile padding +
             legal line inside card, .yr year spans populated in JS
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --gold:          #D4A820;
  --gold-lt:       #F2D888;
  --gold-dk:       #9A6E0A;
  --gold-glow:     rgba(212, 168, 32, 0.35);
  --navy:          #08101E;
  --white:         #FFFFFF;
  --white-85:      rgba(255,255,255,0.85);
  --white-55:      rgba(255,255,255,0.55);
  --white-35:      rgba(255,255,255,0.35);
  --card-bg:       rgba(255, 255, 255, 0.20);
  --card-border:   rgba(255, 255, 255, 0.42);
  --input-bg:      rgba(255, 255, 255, 0.22);
  --input-border:  rgba(255, 255, 255, 0.45);
  --error-col:     #FF7575;
  --success-col:   #72E0A0;
  --font-ui:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease:          0.22s ease;
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);  /* timing fn only — no time value */
  --ease-spring:   0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius-card:   22px;
  --radius-input:  10px;
  --radius-btn:    50px;
  --shadow-btn:    0 6px 28px rgba(212,168,32,0.42);
}

/* ── Reset ────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  flex: 1;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;   /* keeps the scaled .hero__bg clipped to the panel */
}

/* Background lives on its own layer so we can animate it with transform:scale()
   — CSS cannot interpolate background-size to/from the keyword "cover", which
   causes the old bgReveal to jerk. GPU-composited scale is perfectly smooth. */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;   /* overlay (z-index: 1) sits on top */
  background-image: url('../images/PiLand_YT_Banner_Trello_v2.jpeg');
  background-size: cover;
  background-position: 58% 28%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transform-origin: center center;
  animation: bgZoom 1.8s var(--ease-out) both;
}

@keyframes bgZoom {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1.0); }
}

/* ── Overlay ──────────────────────────────────────────────── */
.hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;   /* above .hero__bg (0), below content (2) */
  background:
    /* Heavy corner vignette bottom-left — where headline lives */
    radial-gradient(
      ellipse 72% 62% at 0% 100%,
      rgba(7,14,26,0.82) 0%,
      rgba(7,14,26,0.22) 50%,
      transparent        78%
    ),
    /* Light atmospheric veil over whole image */
    linear-gradient(
      160deg,
      rgba(7,14,26,0.28) 0%,
      rgba(7,14,26,0.08) 45%,
      rgba(7,14,26,0.25) 100%
    ),
    /* Bottom fade to navy so footer blends */
    linear-gradient(
      to bottom,
      transparent         72%,
      rgba(8,16,30,0.60)  88%,
      var(--navy)        100%
    );
  animation: overlayReveal 1.0s var(--ease-out) 0.4s both;
}

@keyframes overlayReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */

.topbar {
  position: relative;
  z-index: 2;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  /* Drops from above with a little spring bounce — first element on screen */
  animation: brandBounce 0.65s cubic-bezier(0.34, 1.50, 0.64, 1) 0.50s both;
}

/* ── Brand mark ───────────────────────────────────────────── */
.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* "πLand" — π in gold, "Land" in white — Inter 800 */
.brand-mark__name {
  font-family: var(--font-ui);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  background: linear-gradient(
    90deg,
    var(--gold)  0%,
    var(--gold)  1.05ch,
    var(--white) 1.05ch,
    var(--white) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* "Nerd Paradise" — Inter 400 italic, understated */
.brand-mark__tagline {
  font-family: var(--font-ui);
  font-style: italic;
  font-size: clamp(0.68rem, 1.0vw, 0.80rem);
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   HERO BODY
   ═══════════════════════════════════════════════════════════ */

.hero__body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  padding: 0 3rem 4.5rem;
}

/* ═══════════════════════════════════════════════════════════
   HEADLINE STACK  — cinematic staggered entry
   ═══════════════════════════════════════════════════════════ */

.headline-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* All headline words: Inter 900, very tight */
.hs {
  font-family: var(--font-ui);
  font-size: clamp(5rem, 10.5vw, 9.5rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.045em;
  display: block;
}

/* ── "Stop" — springs up, first word on screen ─────────────── */
.hs--solid {
  color: rgba(255,255,255,0.95);
  text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 4px 40px rgba(0,0,0,0.30);
  animation: stopSpring 0.75s cubic-bezier(0.34, 1.42, 0.64, 1) 0.75s both;
}

/* ── "Renting" — 95% like the others, slides in from lower-left ─ */
.hs--ghost {
  color: rgba(255,255,255,0.95);
  text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 4px 40px rgba(0,0,0,0.30);
  animation: rentingSlide 0.75s cubic-bezier(0.34, 1.42, 0.64, 1) 0.95s both;
}

/* ── "Software." — gold shimmer crowns the stack ───────────── */
/* gradient text can't use text-shadow; filter: drop-shadow() is the approach.
   This is safe now that the real animation bug (invalid var() in shorthand) is fixed. */
.hs--solid-display {
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.95) 15%,
    #FFF6DC                52%,
    var(--gold-lt)        100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 16px rgba(0,0,0,0.52)) drop-shadow(0 4px 32px rgba(0,0,0,0.26));
}

/* Wrapper for the wavy underline */
.hs-display-wrap {
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 0.7rem;
  animation: softwareRise 0.85s cubic-bezier(0.34, 1.38, 0.64, 1) 1.15s both;
}

/* Gold wave draws left→right after Software. lands */
.hs-display-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M0 8 C16 2,32 14,48 8 C64 2,80 14,96 8 C112 2,128 14,144 8 C160 2,176 14,192 8 L200 8' stroke='%23D4A820' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 0% 100%;
  opacity: 0.82;
  animation: drawWave 0.95s var(--ease-out) 1.75s forwards;
}

/* ── Whimsical entry keyframes ─────────────────────────────── */

/* Brand mark: drops from above, little spring bounce on landing */
@keyframes brandBounce {
  0%   { opacity: 0; transform: translateY(-18px) scale(0.95); }
  60%  { opacity: 1; transform: translateY(3px)  scale(1.01); }
  80%  { transform: translateY(-1px) scale(1.0); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}

/* "Stop": springs up with a scale pop on arrival */
@keyframes stopSpring {
  0%   { opacity: 0; transform: translateY(48px) scale(0.88); filter: blur(5px); }
  55%  { opacity: 1; filter: blur(0); }
  72%  { transform: translateY(-6px) scale(1.025); }
  88%  { transform: translateY(2px)  scale(0.998); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* "Renting": diagonal slide from lower-left with spring */
@keyframes rentingSlide {
  0%   { opacity: 0; transform: translateY(40px) translateX(-28px); filter: blur(5px); }
  60%  { opacity: 1; filter: blur(0); }
  80%  { transform: translateY(-4px) translateX(3px); }
  100% { opacity: 1; transform: translateY(0) translateX(0); filter: blur(0); }
}

/* "Software.": biggest spring — the crown moment */
@keyframes softwareRise {
  0%   { opacity: 0; transform: translateY(55px) scale(0.84); filter: blur(8px); }
  50%  { opacity: 1; filter: blur(0); }
  68%  { transform: translateY(-9px) scale(1.03); }
  85%  { transform: translateY(3px)  scale(0.998); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Wave draw */
@keyframes drawWave {
  to { background-size: 100% 100%; }
}

/* "Learn to Own It.": rises like a whisper after the wave */
@keyframes subRise {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Mobile form card: rises from below (desktop swoop-from-right doesn't fit a bottom tray) */
@keyframes cardRise {
  0%   { opacity: 0; transform: translateY(36px); filter: blur(5px); }
  55%  { opacity: 1; filter: blur(0); }
  74%  { transform: translateY(-5px); }
  90%  { transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Form card: swoops in from the right with spring and blur reveal */
@keyframes cardSpring {
  0%   { opacity: 0; transform: translateX(50px) translateY(14px) scale(0.94); filter: blur(8px); }
  55%  { opacity: 1; filter: blur(0); }
  73%  { transform: translateX(-6px) translateY(-2px) scale(1.015); }
  88%  { transform: translateX(2px)  translateY(1px)  scale(0.999); }
  100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); filter: blur(0); }
}

/* "Learn to Own It." — heavyweight fourth line, gold glow */
.hs-sub {
  font-family: var(--font-ui);
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: rgba(242, 216, 136, 0.95);
  text-shadow:
    0 0 28px rgba(212, 168, 32, 0.45),
    0 2px 12px rgba(0, 0, 0, 0.40);
  animation: subRise 0.60s var(--ease-out) 1.55s both;
}

/* ═══════════════════════════════════════════════════════════
   FORM CARD — frosted white glass
   ═══════════════════════════════════════════════════════════ */

.form-card {
  flex: 0 0 340px;
  /* White-tinted frosted glass — brighter, more opaque white */
  background: var(--card-bg);
  backdrop-filter: blur(36px) saturate(160%) brightness(1.50);
  -webkit-backdrop-filter: blur(36px) saturate(160%) brightness(1.50);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.8rem 1.75rem 1.6rem;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.55);
  /* Swoops in from the right with spring — parallel with headline words */
  animation: cardSpring 0.85s cubic-bezier(0.34, 1.40, 0.64, 1) 1.05s both;
}

/* "Join the Waitlist" — real heading treatment, not a tiny label */
.card__eyebrow {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(8, 20, 45, 0.88);
  margin-bottom: 1.2rem;
  line-height: 1.1;
}

/* ── Form elements ────────────────────────────────────────── */
.form__honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.65rem;
}

.form__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(8, 20, 45, 0.75);    /* dark navy on light glass — legible */
}

.form__input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  color: rgba(8, 20, 45, 0.90);     /* dark text in light input fields */
  font-family: var(--font-ui);
  font-size: 0.93rem;
  padding: 0.7rem 1rem;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  transition:
    border-color var(--ease),
    background   var(--ease),
    box-shadow   var(--ease);
}

.form__input::placeholder { color: rgba(8, 20, 45, 0.35); }

.form__input:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.20);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form__group.is-invalid .form__input {
  border-color: var(--error-col);
  box-shadow: 0 0 0 3px rgba(255,117,117,0.20);
}

.form__error {
  display: block;
  font-size: 0.72rem;
  color: var(--error-col);
  min-height: 1em;
}

/* Submit button */
.form__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.88rem 1.5rem;
  background: linear-gradient(135deg, var(--gold-lt) 0%, var(--gold) 50%, var(--gold-dk) 100%);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 0.93rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  -webkit-appearance: none;
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease), opacity var(--ease);
}

.form__btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 10px 36px rgba(212,168,32,0.55);
}
.form__btn:active:not(:disabled) { transform: none; box-shadow: var(--shadow-btn); }
.form__btn:disabled { opacity: 0.62; cursor: not-allowed; transform: none; }

.form__btn-loading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--navy);
}
.form__btn-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--navy);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

.form__privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  margin-top: 0.75rem;
  font-size: 0.70rem;
  color: #000000;   /* full black — lock + caption must be legible */
  text-align: center;
  line-height: 1.5;
}

/* ── States ───────────────────────────────────────────────── */
.state { text-align: center; padding-top: 1rem; }
.state:empty { display: none; }
.state--success { color: var(--success-col); }
.state--error   { color: var(--error-col); }

/* ── Mobile legal line (hidden on desktop, shown below card on mobile) ── */
.mobile-legal { display: none; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 1.1rem 1.5rem;
  text-align: center;
}

.footer__copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
  line-height: 1.7;
}

.footer__pi    { color: var(--gold); font-weight: 700; }
.footer__link  {
  color: rgba(255,255,255,0.42);
  border-bottom: 1px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.footer__link:hover { color: var(--white-85); border-bottom-color: rgba(255,255,255,0.28); }

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hs-display-wrap::after { background-size: 100% 100%; }
  .hero__bg { background-attachment: scroll; animation: none; opacity: 1; transform: none; }
  .hero__overlay { animation: none; opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── Large desktop ─────────────────────────────────────────── */
@media (min-width: 1400px) {
  .hero__bg     { background-position: 55% 22%; }
  .hero__body   { padding: 0 4rem 5rem; }
  .form-card    { flex: 0 0 360px; }
}

/* ── Tablet landscape ──────────────────────────────────────── */
@media (max-width: 1100px) and (min-width: 769px) {
  .hero__bg   { background-position: 65% 20%; background-attachment: scroll; }
  .hs         { font-size: clamp(4rem, 9.5vw, 7rem); }
  .hero__body { padding: 0 2.5rem 3.5rem; gap: 2rem; }
  .form-card  { flex: 0 0 310px; padding: 1.5rem 1.5rem 1.4rem; }
  .hs-sub     { font-size: clamp(1.1rem, 2.3vw, 1.55rem); }
}

/* ── Tablet portrait / large phone ────────────────────────── */
@media (max-width: 768px) {
  .hero__bg {
    background-position: 68% 18%;
    background-attachment: scroll;
  }

  .hero__body {
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    gap: 0;
  }

  /* Overlay heavier at bottom on mobile */
  .hero__overlay {
    background:
      radial-gradient(ellipse 130% 50% at 50% 0%, rgba(7,14,26,0.15) 0%, transparent 70%),
      linear-gradient(
        to bottom,
        transparent         15%,
        rgba(7,14,26,0.40)  45%,
        rgba(7,14,26,0.78)  68%,
        var(--navy)         84%
      );
  }

  /* Headline sits above the form tray */
  .headline-stack {
    padding: 1.5rem 1.8rem 1.2rem;
  }

  .hs {
    font-size: clamp(3.5rem, 15vw, 5.5rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
  }
  .hs-sub {
    font-size: clamp(1.05rem, 4.2vw, 1.4rem);
    margin-top: 0.4rem;
  }

  /* Softer drop shadow on mobile — less contrast needed at this scale */
  .hs--solid,
  .hs--ghost {
    text-shadow: 0 1px 10px rgba(0,0,0,0.40), 0 3px 24px rgba(0,0,0,0.20);
  }

  /* Tighten animation delays on mobile — keep the sequence but snappier */
  .hero__bg        { animation-duration: 0.8s; }
  .hero__overlay   { animation-delay: 0.2s; }
  .topbar          { animation-delay: 0.3s; }
  .hs--solid       { animation-delay: 0.42s; animation-duration: 0.55s; }
  .hs--ghost       { animation-delay: 0.54s; animation-duration: 0.55s; }
  .hs-display-wrap { animation-delay: 0.66s; animation-duration: 0.60s; }
  .hs-display-wrap::after { animation-delay: 1.0s; }
  .hs-sub          { animation-delay: 0.78s; animation-duration: 0.50s; }
  /* Card rises from below on mobile, not from the right like desktop */
  .form-card       { animation-name: cardRise; animation-delay: 0.60s; animation-duration: 0.65s; }
  /* Legal fades in after the card */
  .mobile-legal    { animation: subRise 0.50s var(--ease-out) 0.90s both; }

  /* Tighten the gap between Software. and Learn to Own It. on mobile */
  .hs-display-wrap {
    margin-bottom: 0.15rem;
    padding-bottom: 12px;
  }
  .hs-sub { margin-top: 0; }

  /* Form card: floating card with breathing room on all sides */
  .form-card {
    flex: none;
    width: calc(100% - 24px);
    margin: 0 12px;
    border-radius: 22px;              /* fully rounded — matches desktop card */
    background: rgba(255,255,255,0.93);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    box-shadow:
      0 8px 40px rgba(0,0,0,0.28),
      0 -4px 20px rgba(0,0,0,0.12),
      inset 0 1px 0 rgba(255,255,255,0.60);
    padding: 1.6rem 1.8rem 1.6rem;
  }

  /* Mobile legal line — outside the white card, on the dark background */
  .mobile-legal {
    display: block;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);   /* light on dark ocean */
    text-align: center;
    padding: 20px 24px 28px;         /* 20px above = gap from card, generous bottom */
    line-height: 1.65;
  }
  .mobile-legal a {
    color: rgba(255,255,255,0.48);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* Desktop footer not needed on mobile — legal line is below the card */
  .footer { display: none; }
}

/* ── Small phones ──────────────────────────────────────────── */
@media (max-width: 390px) {
  .hs             { font-size: clamp(3rem, 13.5vw, 4rem); }
  .headline-stack { padding: 1.2rem 1.5rem 0.8rem; }
  .form-card      { padding: 1.4rem 1.5rem 1.5rem; width: calc(100% - 20px); margin: 0 10px; border-radius: 20px; }
  .topbar         { padding: 1.4rem 1.4rem; }
  .hs-sub         { font-size: 1.05rem; }
}
