/* ==========================================================================
   NERVEA - Premium stylesheet
   ========================================================================== */

/* 1. TOKENS ================================================================ */
:root {
  --bone: #FAF9F6;
  --cream: #F4F2EF;
  --stone: #6B7280;
  --charcoal: #1F2937;
  --deep: #111827;
  --ember: #FF5324;
  --ember-light: #FF6B42;
  --white: #FFFFFF;

  --font-head: "Space Grotesk", "Arial", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: clamp(0.8rem, 0.77rem + 0.15vw, 0.88rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1:  clamp(1.18rem, 1.08rem + 0.45vw, 1.45rem);
  --step-2:  clamp(1.4rem, 1.22rem + 0.85vw, 2rem);
  --step-3:  clamp(1.75rem, 1.4rem + 1.6vw, 2.8rem);
  --step-4:  clamp(2.2rem, 1.65rem + 2.5vw, 3.8rem);
  --step-5:  clamp(2.8rem, 1.9rem + 4.2vw, 5.2rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 1rem; --space-4: 1.5rem;
  --space-5: 2rem; --space-6: 3rem; --space-7: 4.5rem; --space-8: 6.5rem;
  --section-y: clamp(4rem, 2.5rem + 6vw, 7.5rem);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.12);

  --container: 1200px;
  --container-narrow: 720px;
}

/* 2. RESET ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ember); color: #fff; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; border-radius: var(--radius-sm); }

/* 3. LAYOUT ================================================================ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 0.5rem + 3vw, 2.5rem); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); }
.section--deep { background: var(--deep); color: var(--bone); }
.section--dark { background: var(--charcoal); color: var(--bone); }
.section--tint { background: var(--cream); }
.section--ember { background: var(--ember); color: var(--white); }

.grid { display: grid; gap: var(--space-5); }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* 4. TYPE ================================================================== */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; color: var(--deep); }
.section--deep h1, .section--deep h2, .section--deep h3,
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--bone); }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { max-width: 62ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
}
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ember);
  background: rgba(255,83,36,0.08);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
}
.lead { font-size: var(--step-1); color: var(--stone); line-height: 1.5; }
.section--deep .lead, .section--dark .lead { color: #9CA3AF; }
.muted { color: var(--stone); }
.text-ember { color: var(--ember); }
.balance { text-wrap: balance; }

/* 5. BUTTONS =============================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 600;
  font-size: var(--step--1);
  padding: 0.85rem 1.6rem;
  background: var(--ember); color: var(--white);
  border: 2px solid var(--ember);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.btn:hover { background: var(--ember-light); border-color: var(--ember-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--lg { padding: 1rem 2rem; font-size: var(--step-0); }
.btn--ghost { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.btn--ghost:hover { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }
.section--deep .btn--ghost, .section--dark .btn--ghost { color: var(--bone); border-color: var(--bone); }
.section--deep .btn--ghost:hover, .section--dark .btn--ghost:hover { background: var(--bone); color: var(--deep); }
.btn__arrow { transition: transform 0.2s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.textlink { font-weight: 600; color: var(--ember); border-bottom: 2px solid transparent; padding-bottom: 1px; transition: border-color 0.2s; }
.textlink:hover { border-color: var(--ember); }

/* 6. NAV =================================================================== */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(250,249,246,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: 0.85rem; }
.nav__logo { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--deep); }
.nav__links { display: none; align-items: center; gap: clamp(1.2rem, 2.5vw, 2.2rem); }
.nav__links a { font-size: var(--step--1); font-weight: 500; color: var(--stone); padding-bottom: 2px; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ember); border-color: var(--ember); }
.nav__cta { display: none; }
.nav__toggle { display: inline-flex; flex-direction: column; gap: 5px; padding: 0.5rem; }
.nav__toggle span { width: 22px; height: 2px; background: var(--charcoal); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 900px) { .nav__links, .nav__cta { display: flex; } .nav__toggle { display: none; } }

.nav__mobile { position: fixed; inset: 0; z-index: 105; background: var(--bone); display: flex; flex-direction: column; justify-content: center; gap: var(--space-3); padding: var(--space-6); transform: translateX(100%); transition: transform 0.3s ease; }
.nav.is-open .nav__mobile { transform: none; }
.nav__mobile a { font-family: var(--font-head); font-size: var(--step-3); font-weight: 700; letter-spacing: -0.02em; }
.nav__mobile a:hover { color: var(--ember); }
.nav__mobile .btn { align-self: flex-start; margin-top: var(--space-4); }
@media (min-width: 900px) { .nav__mobile { display: none; } }

/* 7. COMPONENTS ============================================================ */

/* Card */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.2rem);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  height: 100%;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card__icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: rgba(255,83,36,0.08); border-radius: var(--radius-md); color: var(--ember); margin-bottom: var(--space-4); }
.card h3 { margin-bottom: var(--space-2); }
.card p { color: var(--stone); }
.card__list { margin-top: var(--space-4); display: grid; gap: 0.6rem; }
.card__list li { display: flex; gap: 0.6rem; font-size: var(--step--1); color: var(--stone); }
.card__list li::before { content: "\2713"; color: var(--ember); font-weight: 700; flex: none; }

/* Number card */
.card__num { font-family: var(--font-head); font-weight: 700; font-size: var(--step-3); color: var(--ember); line-height: 1; margin-bottom: var(--space-3); }

/* Spec list */
.spec { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3) var(--space-5); font-size: var(--step--1); }
.spec dt { color: var(--stone); font-weight: 500; }
.spec dd { text-align: right; font-weight: 600; color: var(--deep); }
.section--deep .spec dt, .section--dark .spec dt { color: #9CA3AF; }
.section--deep .spec dd, .section--dark .spec dd { color: var(--bone); }

/* FAQ */
.faq details { border-bottom: 1px solid rgba(0,0,0,0.08); }
.faq details:first-child { border-top: 1px solid rgba(0,0,0,0.08); }
.faq summary { display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; padding: var(--space-4) 0; font-family: var(--font-head); font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: var(--step-2); color: var(--ember); font-weight: 300; transition: transform 0.2s; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { padding-bottom: var(--space-4); color: var(--stone); max-width: 56ch; }

/* Embed slot */
.embed-slot { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-height: 480px; overflow: hidden; }
.embed-slot iframe { width: 100%; border: 0; display: block; }
.embed-note { padding: var(--space-6); text-align: center; font-size: var(--step--1); color: var(--stone); }

/* Statement */
.statement { font-family: var(--font-head); font-weight: 700; font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
.statement em { font-style: normal; color: var(--ember); }

/* Process steps */
.process { counter-reset: step; display: grid; gap: var(--space-5); }
.process__step { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
.process__num::before { content: counter(step, decimal-leading-zero); font-family: var(--font-head); font-weight: 700; font-size: var(--step-2); color: var(--ember); }
.process__step h3 { margin-bottom: var(--space-2); }
.process__step p { color: var(--stone); }

/* Deny / includes list */
.feature-list { display: grid; gap: 0.7rem; }
.feature-list li { display: flex; gap: 0.7rem; align-items: baseline; }
.feature-list li::before { content: "\2713"; color: var(--ember); font-weight: 700; flex: none; }
.feature-list--x li::before { content: "\00D7"; }

/* 8. HERO ================================================================== */
.hero { padding: clamp(3.5rem, 2.5rem + 6vw, 8rem) 0 var(--section-y); }
.hero__eyebrow { margin-bottom: var(--space-4); }
.hero h1 { margin-bottom: var(--space-4); }
.hero__sub { font-size: var(--step-1); color: var(--stone); max-width: 52ch; margin-bottom: var(--space-6); line-height: 1.5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* 9. FOOTER ================================================================ */
.footer { background: var(--deep); color: var(--bone); padding: var(--space-8) 0 var(--space-5); }
.footer__grid { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer__brand p { color: #9CA3AF; margin-top: var(--space-3); font-size: var(--step--1); }
.footer h4 { font-size: var(--step--1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #9CA3AF; margin-bottom: var(--space-3); }
.footer__col a { display: block; padding: 0.3rem 0; font-size: var(--step--1); color: #D1D5DB; transition: color 0.2s; }
.footer__col a:hover { color: var(--ember); }
.footer__bottom { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; font-size: var(--step--1); color: #6B7280; }

/* 10. UTILITIES ============================================================ */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
.gap-lg { gap: var(--space-7); }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--deep); color: var(--bone); padding: 0.75rem 1.2rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: var(--space-3); top: var(--space-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* 11. MOTION =============================================================== */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
