/* ============================================================
   GOAT DEEPER — landing v0
   Palette & language extracted from the iOS app
   (ChooseCompanionsView / CharacterCreationFlow / Grimoire)
   ============================================================ */

@font-face {
  font-family: "Neue Machina";
  src: url("assets/fonts/NeueMachina-Ultrabold.otf") format("opentype");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Neue Machina";
  src: url("assets/fonts/NeueMachina-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Neue Machina";
  src: url("assets/fonts/NeueMachina-Light.otf") format("opentype");
  font-weight: 300;
  font-display: swap;
}

:root {
  --gold:        #FCCA06;
  --gold-light:  #FFE55C;
  --gold-deep:   #B8860B;
  --ink:         #07070C;
  --ink-2:       #0E0E16;
  --navy:        #1A1A2E;
  --navy-2:      #2A2A3E;
  --text:        #F4F1EA;
  --text-dim:    rgba(244, 241, 234, 0.62);
  --text-faint:  rgba(244, 241, 234, 0.40);
  --line:        rgba(255, 255, 255, 0.10);
  --glass:       rgba(255, 255, 255, 0.045);
  --glass-2:     rgba(255, 255, 255, 0.07);

  --display: "Neue Machina", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  --radius: 20px;
  --shadow-gold: 0 14px 40px -12px rgba(252, 202, 6, 0.45);
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--gold); }

/* ---------- Ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.ambient__glow {
  position: absolute;
  top: -25vh; left: 50%; transform: translateX(-50%);
  width: 120vw; height: 120vh;
  background:
    radial-gradient(45% 40% at 50% 22%, rgba(252,202,6,0.10), transparent 70%),
    radial-gradient(60% 55% at 50% 30%, rgba(26,26,46,0.55), transparent 75%);
  filter: blur(8px);
}
.ambient__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, transparent 50%, rgba(0,0,0,0.6) 100%);
}
#embers { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.6; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px;
  padding: 12px 20px; border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer; transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
  white-space: nowrap;
}
.btn--lg { padding: 16px 26px; font-size: 16px; border-radius: 16px; }
.btn--gold {
  color: #1a1400;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: var(--shadow-gold);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 18px 50px -10px rgba(252,202,6,.6); }
.btn--ghost {
  color: var(--text);
  background: var(--glass);
  border-color: var(--line);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { background: var(--glass-2); transform: translateY(-2px); }
.appstore svg { margin-top: -2px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease, padding .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7,7,12,0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__logo { border-radius: 10px; }
.nav__word { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .06em; }
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--text-dim); }
.nav__links a { position: relative; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--gold); transition: width .25s ease;
}
.nav__links a:hover::after { width: 100%; }
.nav__cta { padding: 10px 18px; }
.nav__right { display: flex; align-items: center; gap: 12px; }

/* Language picker */
.lang { position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .06em;
  color: var(--text-dim); cursor: pointer;
  padding: 8px 11px; border-radius: 11px;
  background: var(--glass); border: 1px solid var(--line);
  transition: color .2s, border-color .2s, background .2s;
}
.lang__btn:hover { color: var(--gold); border-color: rgba(252,202,6,0.4); background: var(--glass-2); }
.lang__flag { font-size: 15px; line-height: 1; }
.lang__chev { transition: transform .25s ease; opacity: .8; }
.lang.open .lang__chev { transform: rotate(180deg); }

.lang__menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 210px; max-height: 60vh; overflow-y: auto;
  list-style: none; padding: 8px; margin: 0;
  background: rgba(14,14,22,0.96);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.7);
  backdrop-filter: blur(18px) saturate(140%);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 60;
}
.lang.open .lang__menu { opacity: 1; visibility: visible; transform: none; }
.lang__menu li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  font-size: 14px; color: var(--text-dim); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang__menu li:hover { background: var(--glass-2); color: var(--text); }
.lang__menu li[aria-selected="true"] { color: var(--gold); background: rgba(252,202,6,0.08); }
.lang__menu li[aria-selected="true"]::after { content: "✓"; margin-left: auto; font-weight: 700; }
.lang__menu::-webkit-scrollbar { width: 8px; }
.lang__menu::-webkit-scrollbar-thumb { background: rgba(252,202,6,0.25); border-radius: 99px; }

/* RTL tweaks (Arabic) */
[dir="rtl"] .nav__links a::after { left: auto; right: 0; }
[dir="rtl"] .lang__menu { right: auto; left: 0; transform-origin: top left; }
[dir="rtl"] .lang__menu li[aria-selected="true"]::after { margin-left: 0; margin-right: auto; }
[dir="rtl"] .hero__sub, [dir="rtl"] .section__head p { text-align: inherit; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center; gap: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px clamp(18px, 4vw, 48px) 80px;
}
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold);
  padding: 7px 14px; border-radius: 999px;
  background: rgba(252,202,6,0.08);
  border: 1px solid rgba(252,202,6,0.22);
}
.hero__title {
  font-size: clamp(40px, 6.2vw, 76px);
  margin: 22px 0 18px;
}
.grad {
  background: linear-gradient(120deg, var(--gold-light), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--text-dim); max-width: 30em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__note { margin-top: 18px; color: var(--text-faint); font-size: 14px; letter-spacing: .02em; }

/* Hero stage — floating party */
.hero__stage { position: relative; height: 520px; display: grid; place-items: center; }
.stage__ring {
  position: absolute; border-radius: 50%; border: 1px dashed rgba(252,202,6,0.18);
}
.stage__ring--a { width: 360px; height: 360px; animation: spin 60s linear infinite; }
.stage__ring--b { width: 500px; height: 500px; border-color: rgba(255,255,255,0.06); animation: spin 90s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-mascot {
  position: relative; z-index: 3;
  width: 200px; height: 200px; display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(252,202,6,0.22), transparent 65%);
}
.hero-mascot img { width: 180px; height: 180px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); }

.orb {
  position: absolute; z-index: 2;
  width: 92px; height: 92px; border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(252,202,6,0.55);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 6px rgba(252,202,6,0.06);
  background: var(--navy);
}
.orb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.orb--1 { top: 30px;  left: 36%; width: 104px; height: 104px; }
.orb--2 { top: 120px; right: 18px; }
.orb--3 { bottom: 70px; left: 8px; width: 100px; height: 100px; }
.orb--4 { bottom: 24px; right: 70px; width: 84px; height: 84px; }
.orb--5 { top: 210px; left: -6px; width: 78px; height: 78px; }

.float { animation: float 7s ease-in-out infinite; }
.orb--2 { animation-delay: -1.4s; }
.orb--3 { animation-delay: -2.6s; }
.orb--4 { animation-delay: -3.8s; }
.orb--5 { animation-delay: -5s; }
@keyframes float {
  0%,100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-14px) translateX(6px); }
  66% { transform: translateY(8px) translateX(-6px); }
}
.float-bob { animation: bob 4.5s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--text-faint); border-radius: 14px;
  display: grid; justify-items: center; padding-top: 7px;
}
.scroll-cue span { width: 4px; height: 8px; border-radius: 2px; background: var(--gold); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 10vw, 130px) clamp(18px, 4vw, 48px); }
.section--alt { position: relative; }
.section--alt::before {
  content: ""; position: absolute; inset: 0 -50vw;
  background: linear-gradient(180deg, transparent, rgba(26,26,46,0.45), transparent);
  z-index: -1;
}
.section__head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section__head h2 { font-size: clamp(30px, 4.2vw, 50px); margin: 16px 0 14px; }
.section__head p { color: var(--text-dim); font-size: 17px; }

/* ---------- Feature cards ---------- */
.grid { display: grid; gap: 20px; }
.features { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  position: relative;
  padding: 30px 26px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% -20%, rgba(252,202,6,0.10), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(252,202,6,0.35); background: var(--glass-2); }
.card:hover::after { opacity: 1; }
.card h3 { font-size: 20px; margin: 18px 0 10px; }
.card p { color: var(--text-dim); font-size: 15px; }

.card__icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  display: grid; place-items: center;
  box-shadow: var(--shadow-gold);
  -webkit-mask-composite: source-over;
  position: relative;
}
.card__icon::before {
  content: ""; position: absolute; inset: 0;
  background: #1a1400;
  -webkit-mask: var(--g) center / 60% no-repeat; mask: var(--g) center / 60% no-repeat;
}
.i-quill   { --g: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2s-5 .5-9 4.5S5.5 15 5 17l-2 4 4-2c2-.5 6.5-1.5 10.5-5.5S22 2 22 2zM7 17l4-4'/%3E%3C/svg%3E"); }
.i-party   { --g: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='black'%3E%3Ccircle cx='9' cy='8' r='3.4'/%3E%3Ccircle cx='17' cy='9.5' r='2.6'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6zM15.5 20c0-2.3 1.2-4.3 3-5.4 1.6.9 2.5 2.6 2.5 5.4z'/%3E%3C/g%3E%3C/svg%3E"); }
.i-dice    { --g: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 7v10l9 5 9-5V7zm0 2.3 6.5 3.6L12 11.5 5.5 7.9zM5 9.6l6 3.4v6.6l-6-3.3zm14 0v6.7l-6 3.3V13z'/%3E%3C/svg%3E"); }
.i-grimoire{ --g: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h11a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H5zM5 19h12v2H6a1 1 0 0 1-1-1zM12 6l1.1 2.4L15.5 9l-2 1.6.6 2.6L12 12l-2.1 1.2.6-2.6-2-1.6 2.4-.6z'/%3E%3C/svg%3E"); }

/* ---------- Classes ---------- */
.classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  max-width: 880px; margin: 0 auto;
}
.class-chip {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 12px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .04em;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.class-chip:hover { transform: translateY(-5px) scale(1.03); border-color: rgba(252,202,6,0.45); background: var(--glass-2); }
.class-chip .ci {
  width: 46px; height: 46px; display: block;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
  transition: transform .25s ease, filter .25s ease;
  filter: drop-shadow(0 4px 10px rgba(252,202,6,0.35));
}
.class-chip:hover .ci { transform: rotate(-6deg) scale(1.12); }

/* ---------- Companions rail ---------- */
.companions-rail {
  display: flex; gap: 18px; overflow-x: auto;
  padding: 8px 4px 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.companions-rail::-webkit-scrollbar { height: 8px; }
.companions-rail::-webkit-scrollbar-thumb { background: rgba(252,202,6,0.3); border-radius: 99px; }
.comp {
  flex: 0 0 auto; width: 220px; scroll-snap-align: center;
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--navy);
  position: relative;
  transition: transform .3s ease, border-color .3s ease;
}
.comp:hover { transform: translateY(-6px); border-color: rgba(252,202,6,0.5); }
.comp img { width: 100%; height: 240px; object-fit: cover; display: block; }
.comp figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 16px 14px;
  font-family: var(--display); font-weight: 800; font-size: 15px;
  background: linear-gradient(180deg, transparent, rgba(7,7,12,0.92));
}

/* ---------- CTA ---------- */
.cta { max-width: var(--maxw); margin: 0 auto; padding: 60px clamp(18px,4vw,48px) 110px; }
.cta__inner {
  position: relative; overflow: hidden;
  text-align: center;
  padding: clamp(48px, 7vw, 90px) 30px;
  border-radius: 32px;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(252,202,6,0.14), transparent 60%),
    linear-gradient(180deg, var(--navy), var(--ink-2));
  border: 1px solid rgba(252,202,6,0.25);
}
.cta__gem { width: 64px; height: 64px; filter: drop-shadow(0 8px 24px rgba(252,202,6,0.5)); }
.cta__inner h2 { font-size: clamp(30px, 5vw, 56px); margin: 18px 0 12px; }
.cta__inner p { color: var(--text-dim); max-width: 36em; margin: 0 auto 28px; font-size: 17px; }
.cta__inner .hero__actions { justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--ink-2); }
.footer__top, .footer__bottom { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px,4vw,48px); }
.footer__top { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding-top: 40px; padding-bottom: 28px; }
.footer__brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 800; letter-spacing: .06em; }
.footer__brand img { border-radius: 9px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 24px; color: var(--text-dim); font-size: 15px; }
.footer__nav a:hover { color: var(--gold); }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding-top: 22px; padding-bottom: 34px;
  border-top: 1px solid var(--line);
  color: var(--text-faint); font-size: 13px;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 110px; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .hero__stage { order: -1; height: 380px; margin-bottom: 10px; }
  .stage__ring--a { width: 280px; height: 280px; }
  .stage__ring--b { width: 380px; height: 380px; }
  .hero-mascot img { width: 140px; height: 140px; }
  .nav__links { display: none; }
}
@media (max-width: 560px) {
  .nav__cta { display: none; }
  .orb--5, .orb--4 { display: none; }
  .comp { width: 170px; }
  .comp img { height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
