:root {
  --ink: #111111;
  --void: #0b0b0f;
  --paper: #f4efe6;
  --bone: #ede6d9;
  --gold: #c9a24a;
  --gold-2: #e0c06a;
  /* The brand gold only clears 4.5:1 against the dark bands. On paper and
     white it lands at 2.1:1, so light sections use this darker mix for the
     11px eyebrow labels instead. Same hue, same family, legible. */
  --gold-ink: #856419;
  --signal: #2f6f5e;
  --warm: #8a7a62;
  /* --warm on white is 4.17:1 -- under AA for the 12px captions that use it. */
  --warm-ink: #6f6047;
  --line: rgba(201, 162, 74, 0.28);
  --line-dark: rgba(244, 239, 230, 0.1);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --sans: "Inter", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--void);
  color: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

/* Links carry no underline, so without this a keyboard user has no idea where
   they are. :focus-visible rather than :focus keeps it off mouse clicks. */
:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
  border-radius: 4px;
}
.paper :focus-visible,
body.legal :focus-visible { outline-color: var(--gold-ink); }

/* Available to screen readers, absent from the visual layout. Used for the
   form label the placeholder was standing in for. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: present for keyboard and screen readers, out of the way until
   focused. */
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--gold);
  color: var(--void);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .btn:hover { transform: none; }
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(11, 11, 15, 0.72);
  border-bottom: 1px solid var(--line-dark);
}
.nav-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}
.brand-name { font-size: 15px; font-weight: 500; }
.brand-name em { font-family: var(--serif); font-style: italic; font-weight: 500; }
.nav-links {
  display: flex;
  gap: 28px;
  color: rgba(244, 239, 230, 0.72);
  font-size: 13px;
}
.nav-links a:hover { color: var(--paper); }

/* Hamburger. Hidden on desktop, where .nav-links is already visible. */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  color: var(--paper);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 4px auto;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--void); }
.btn-gold:hover { background: var(--gold-2); }
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-paper { background: var(--paper); color: var(--ink); }

/* HERO */
.hero {
  position: relative;
  padding: 72px 0 0;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 280px at 80% 10%, rgba(201,162,74,.12), transparent 60%),
    radial-gradient(800px 400px at 20% 80%, rgba(47,111,94,.08), transparent 55%);
  pointer-events: none;
}
.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  margin: 18px 0 22px;
  max-width: 14ch;
}
.hero h1 span {
  font-style: italic;
  color: var(--gold-2);
}
.lede {
  max-width: 36em;
  color: rgba(244, 239, 230, 0.72);
  font-size: 17px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note {
  margin-top: 16px;
  color: var(--warm);
  font-size: 12px;
}
.hero-frame {
  margin-top: 64px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #121218;
}
.hero-frame img { width: 100%; height: auto; }

/* The hero normally runs straight into the product shot, so it has no bottom
   padding. On a page where it is the only section (app.applymagic.ai), it needs
   to close itself off and hold the viewport rather than leaving a band of
   footer floating halfway up the screen. */
.hero.standalone {
  padding-bottom: 96px;
  min-height: calc(100svh - 72px);
  display: flex;
  align-items: center;
}
@media (max-width: 860px) {
  .hero.standalone { min-height: calc(100svh - 72px); padding-bottom: 72px; }
}

/* PAPER BANDS */
.paper {
  background: var(--paper);
  color: var(--ink);
}
.section { padding: 96px 0; }
.section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4.5vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 12px 0 18px;
}
.muted { color: var(--warm); }
.ink-muted { color: rgba(17,17,17,.62); }

/* Everything gold-on-light gets the darker mix. The brand gold stays on the
   dark bands, where it reads at 8.2:1. */
.paper .eyebrow { color: var(--gold-ink); }
.paper .num { color: var(--gold-ink); border-color: rgba(133,100,25,.4); }
.paper .faq summary::after { color: var(--gold-ink); }
.compare .good .meta { color: var(--warm-ink); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.steps { display: grid; gap: 22px; margin-top: 8px; }
.step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
}
.num {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(201,162,74,.45);
  color: var(--gold);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.step h3 { font-size: 18px; font-family: var(--serif); font-weight: 500; margin-bottom: 4px; }
.step p { color: rgba(17,17,17,.62); font-size: 14.5px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 40px;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 26px 24px 28px;
  border: 1px solid rgba(17,17,17,.06);
}
.card h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 10px 0 8px; }
.card p { color: rgba(17,17,17,.62); font-size: 14.5px; }

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 36px;
}
.compare article {
  border-radius: 16px;
  padding: 28px;
  min-height: 280px;
}
.compare .bad { background: #1a1a20; color: rgba(244,239,230,.78); border: 1px solid var(--line-dark); }
.compare .good { background: #fff; color: var(--ink); }
.compare .label {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
}
.compare .bad .label { color: #9a8f7d; }
.compare .good .label { color: var(--signal); }
.compare blockquote {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.4;
  font-style: italic;
}
.compare .meta { margin-top: 20px; font-size: 12px; color: var(--warm); }

.product-shot {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(17,17,17,.08);
  box-shadow: 0 20px 50px rgba(17,17,17,.08);
}

/* ACCESS */
/* The JPEG declaration comes first as the floor: a browser without image-set()
   drops the second rule entirely and still gets a background. Everything
   current takes the WebP, which is 42KB against the JPEG's 64KB. */
.access {
  background:
    linear-gradient(180deg, rgba(11,11,15,.2), rgba(11,11,15,.65)),
    url("assets/access.jpg") center/cover no-repeat;
  background:
    linear-gradient(180deg, rgba(11,11,15,.2), rgba(11,11,15,.65)),
    image-set(url("assets/access.webp") type("image/webp"),
              url("assets/access.jpg") type("image/jpeg")) center/cover no-repeat;
  color: var(--paper);
}
@media (max-width: 900px) {
  .access {
    background:
      linear-gradient(180deg, rgba(11,11,15,.2), rgba(11,11,15,.65)),
      url("assets/access-900.jpg") center/cover no-repeat;
    background:
      linear-gradient(180deg, rgba(11,11,15,.2), rgba(11,11,15,.65)),
      image-set(url("assets/access-900.webp") type("image/webp"),
                url("assets/access-900.jpg") type("image/jpeg")) center/cover no-repeat;
  }
}
.access-card h2 { color: var(--paper); }
.access-card .lede { margin-bottom: 0; }
.access-card {
  width: min(560px, 100%);
  background: rgba(11,11,15,.78);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(10px);
}
.form {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.form input {
  flex: 1;
  min-width: 220px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: 999px;
  padding: 12px 16px;
  outline: none;
}
.form input:focus { border-color: var(--gold); }
.form input::placeholder { color: rgba(244, 239, 230, 0.45); }
.form button[disabled] { opacity: .6; cursor: progress; }
/* Both messages live in one aria-live region, so they are announced when the
   request resolves rather than sitting silently in the DOM. */
.form-msg { margin-top: 16px; font-size: 14px; min-height: 0; }
.form-msg:empty { margin-top: 0; }
.form-msg[data-state="ok"] { color: #cde7dc; }
.form-msg[data-state="error"] { color: #e8b4a0; }

/* Section padding tweaks that used to be inline style attributes. */
.lede-flush { margin-bottom: 0; }
.section-flush { padding-top: 0; }
.section-snug { padding-top: 12px; }
.wrap-narrow { width: min(820px, calc(100% - 40px)); }
.wrap-doc { width: min(760px, calc(100% - 40px)); }

/* FAQ */
.faq { display: grid; gap: 0; margin-top: 28px; border-top: 1px solid rgba(17,17,17,.1); }
.faq details {
  border-bottom: 1px solid rgba(17,17,17,.1);
  padding: 18px 0;
}
.faq summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin-top: 10px; color: rgba(17,17,17,.62); max-width: 62ch; }

/* FOOTER */
footer {
  background: var(--void);
  color: rgba(244,239,230,.65);
  padding: 48px 0 36px;
  border-top: 1px solid var(--line-dark);
}
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
}
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a:hover { color: var(--paper); }

/* LEGAL PAGES */
body.legal { background: var(--paper); color: var(--ink); }
body.legal .nav { background: rgba(11, 11, 15, 0.94); }
.legal-hero {
  background: var(--void);
  color: var(--paper);
  padding: 72px 0 56px;
}
.legal-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
}
.legal-doc {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 96px;
}
.legal-doc h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
}
.legal-doc h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 22px 0 8px;
}
.legal-doc p, .legal-doc li {
  color: rgba(17,17,17,.72);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 12px;
}
.legal-doc ul { padding-left: 20px; margin-bottom: 16px; }
.legal-doc a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; }
.notice {
  background: var(--bone);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 8px 0 28px;
  font-size: 14px;
  color: rgba(17,17,17,.72);
}

@media (max-width: 860px) {
  .split, .grid-3, .compare { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .section { padding: 72px 0; }

  .nav-toggle { display: block; }
  /* The links move out of the bar and into a panel under it rather than
     disappearing, which is what they used to do. */
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 20px;
    /* Opaque, and deliberately no backdrop-filter. The parent .nav already has
       one, and a nested backdrop-filter makes Chromium sample the wrong
       backdrop: the panel composited as though it were ~70% transparent and
       the hero headline read straight through the menu. A menu needs to be
       legible more than it needs to be frosted. */
    background: var(--void);
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    font-size: 15px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line-dark);
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-inner { position: relative; }
  /* The nav CTA duplicates the hero CTA on a narrow screen and crowds the
     hamburger; the panel and the hero both still reach #access. */
  .nav > .nav-inner > .btn-gold { display: none; }
}
