/* ============================================================
   Drape — base.css
   Design system: dark luxury · silk · editorial
   Tokens, reset, texture, nav, buttons, footer, legal pages.
   ============================================================ */

:root {
  /* canvas */
  --bg: #0A0708;
  --surface: #151013;
  --raised: #1E161B;

  /* ink */
  --ink: #F4EDE4;
  --ink-dim: #A79A8E;
  --hairline: rgba(244, 237, 228, 0.09);

  /* accents */
  --plum: #8A2E5C;
  --magenta: #C0446E;
  --violet: #7A5CFF;
  --gold: #D9A441;
  --gold-hi: #F2C36B;

  --grad: linear-gradient(115deg, #C0446E, #7A5CFF 55%, #D9A441);

  /* type */
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter Tight", -apple-system, "Segoe UI", sans-serif;
  --fs-h1: clamp(3rem, 7.2vw, 6rem);
  --fs-h2: clamp(2.125rem, 4.5vw, 3.5rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.5rem);

  /* rhythm */
  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(6rem, 14vh, 10rem);
  --radius: 20px;

  /* light */
  --glow:
    0 0 60px -18px rgba(192, 68, 110, 0.45),
    0 0 90px -30px rgba(217, 164, 65, 0.30);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* the skewed marquee band must never widen the page */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; } /* width/height attrs are CLS hints, not layout */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; list-style: none; }
::selection { background: rgba(217, 164, 65, 0.28); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 600;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ---------- texture: grain + vignette ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.32) 100%);
}

/* ---------- typography helpers ---------- */
h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 em, h2 em, .grad-em {
  font-style: italic;
  font-weight: 500;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding-right: 0.06em; /* italic overhang clips without it */
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.eyebrow.center { justify-content: center; }
.eyebrow.center::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: linear-gradient(270deg, var(--gold), transparent);
}

.lede, .sub {
  color: var(--ink-dim);
  max-width: 56ch;
}
.sub.center { margin-inline: auto; text-align: center; }
.lede strong, .sub strong { color: var(--ink); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease, background-color 0.35s ease,
              border-color 0.35s ease, color 0.35s ease;
}
.btn .arr { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.btn:hover .arr { transform: translateX(4px); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow:
    0 0 70px -14px rgba(192, 68, 110, 0.6),
    0 0 110px -24px rgba(217, 164, 65, 0.45);
}

.btn-ghost {
  border: 1px solid var(--hairline);
  color: var(--ink);
  background: rgba(21, 16, 19, 0.4);
}
.btn-ghost:hover {
  border-color: rgba(217, 164, 65, 0.55);
  transform: translateY(-2px);
}

.btn.sm { padding: 0.65rem 1.35rem; font-size: 0.875rem; }
.btn.full { width: 100%; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
.nav.scrolled {
  padding-block: 0.7rem;
  background: rgba(21, 16, 19, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 102;
}
.brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links > a:not(.btn) {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color 0.3s ease;
  padding-block: 0.25rem;
}
.nav-links > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links > a:not(.btn):hover { color: var(--ink); }
.nav-links > a:not(.btn):hover::after { right: 0; }

.nav-toggle {
  display: none;
  z-index: 102;
  width: 44px; height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 101;
    flex-direction: column;
    justify-content: center;
    gap: 1.4rem;
    background: rgba(10, 7, 8, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links > a:not(.btn) {
    font-family: var(--serif);
    font-size: 2rem;
    color: var(--ink);
  }
  .nav-links .btn { margin-top: 1rem; }
  .nav-links.open ~ * { overflow: hidden; }
  body:has(.nav-links.open) { overflow: hidden; }
  .nav-toggle.open span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav-toggle.open span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
}

/* ---------- layout primitives ---------- */
.section {
  position: relative;
  padding-block: var(--section);
}
.wrap {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.head {
  display: grid;
  gap: 1.1rem;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}
.head .h2 { font-size: var(--fs-h2); }

/* glass card */
.card {
  background: rgba(21, 16, 19, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 3.5rem var(--gutter) 3rem;
  display: grid;
  gap: 1.75rem;
  justify-items: center;
  text-align: center;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
}
.foot-brand img { width: 30px; height: 30px; border-radius: 8px; }
.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
}
.footer nav a {
  font-size: 0.9rem;
  color: var(--ink-dim);
  transition: color 0.3s ease;
}
.footer nav a:hover { color: var(--gold-hi); }
.fineprint {
  font-size: 0.8125rem;
  color: var(--ink-dim);
  opacity: 0.75;
  max-width: 62ch;
}

/* ============================================================
   Legal pages (terms / privacy / refund)
   ============================================================ */
.legal-hero {
  padding: clamp(9rem, 18vh, 12rem) var(--gutter) 3rem;
  display: grid;
  gap: 1.1rem;
  justify-items: center;
  text-align: center;
  border-bottom: 1px solid var(--hairline);
}
.legal-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
}
.legal-meta {
  font-size: 0.875rem;
  color: var(--ink-dim);
}
.legal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.35rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(21, 16, 19, 0.7);
}
.legal-tabs a {
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color 0.3s ease, background-color 0.3s ease;
}
.legal-tabs a:hover { color: var(--ink); }
.legal-tabs a.active {
  color: var(--bg);
  background: var(--gold);
  font-weight: 600;
}

.legal {
  width: min(72ch, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5rem) var(--section);
  line-height: 1.75;
  color: var(--ink-dim);
}
.legal h2 {
  font-size: 1.5rem;
  color: var(--ink);
  margin: 2.75rem 0 0.9rem;
}
.legal p, .legal li { margin-bottom: 0.9rem; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-color: rgba(217, 164, 65, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease;
}
.legal a:hover { text-decoration-color: var(--gold-hi); }
.legal ul {
  list-style: none;
  padding-left: 1.4rem;
}
.legal ul li { position: relative; }
.legal ul li::before {
  content: "✦";
  position: absolute;
  left: -1.4rem;
  color: var(--gold);
  font-size: 0.7em;
  top: 0.45em;
}
.legal-note {
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(21, 16, 19, 0.7);
  margin-bottom: 2rem;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
