/* ==========================================================================
   Papaweba — design tokens
   Palette: deep plum-ink night, foil gold, cool lilac. Not black, not neon.
   Type:    Bricolage Grotesque (display) / IBM Plex Sans (body) / JetBrains Mono (codes)
   ========================================================================== */

:root {
  --ink:        #12101b;
  --ink-2:      #191627;
  --ink-3:      #211d33;
  --edge:       #2f2946;
  --edge-soft:  #241f38;

  --paper:      #ece7f7;
  --muted:      #9a93b4;
  --dim:        #6f6890;

  --gold:       #e8b84b;
  --gold-deep:  #b98a1f;
  --lilac:      #8b7fd4;
  --mint:       #57c8b4;
  --alert:      #e2707a;

  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --shell:   1180px;
  --gutter:  clamp(20px, 5vw, 56px);
  --radius:  14px;

  --step--1: clamp(0.79rem, 0.77rem + 0.1vw, 0.85rem);
  --step-0:  clamp(0.98rem, 0.95rem + 0.15vw, 1.06rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 1.9vw, 3.1rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient: a faint foil sheen, fixed, never moving. */
body::before {
  content: "";
  position: fixed;
  inset: -30vh -10vw auto;
  height: 90vh;
  background:
    radial-gradient(58% 60% at 22% 12%, rgba(139, 127, 212, 0.20), transparent 70%),
    radial-gradient(46% 52% at 82% 0%, rgba(232, 184, 75, 0.12), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--paper); text-decoration-color: rgba(232, 184, 75, 0.5); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }

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

img, svg { max-width: 100%; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink);
  padding: 10px 16px; font-weight: 600; z-index: 99;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- headings ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
  font-variation-settings: "wdth" 92;
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--gold-deep);
  flex: none;
}

/* ---------- nav ---------- */
.topbar {
  position: sticky; top: 0;
  backdrop-filter: blur(14px);
  background: rgba(18, 16, 27, 0.82);
  border-bottom: 1px solid var(--edge-soft);
  z-index: 40;
}
.topbar .shell {
  display: flex; align-items: center; gap: 28px;
  height: 76px;
}
.wordmark {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  margin-right: auto;
}
.wordmark .chip {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}
.navlinks { display: flex; gap: 26px; }
.navlinks a {
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
}
.navlinks a:hover { color: var(--paper); }
@media (max-width: 820px) { .navlinks { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(150deg, #f2c85f, var(--gold-deep));
  color: #191305;
}
.btn-gold:hover { background: linear-gradient(150deg, #ffd76f, #cf9c26); }
.btn-ghost {
  border-color: var(--edge);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: var(--lilac); }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 118px); }
.section + .section { border-top: 1px solid var(--edge-soft); }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--muted); margin: 16px 0 0; font-size: var(--step-1); line-height: 1.5; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(56px, 8vw, 104px) clamp(56px, 8vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(36px, 6vw, 76px);
  align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

.hero h1 {
  font-size: var(--step-4);
  max-width: 13ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.hero-lead {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: 46ch;
  margin: 24px 0 32px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.trustrow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 32px;
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid var(--edge-soft);
}
.trustrow dt {
  font-family: var(--mono);
  font-size: 1.28rem;
  color: var(--paper);
  letter-spacing: -0.02em;
}
.trustrow dd {
  margin: 4px 0 0;
  font-size: var(--step--1);
  color: var(--dim);
  line-height: 1.45;
}

/* ---------- signature: the gift card object ---------- */
.card-stage {
  perspective: 1200px;
  position: relative;
  /* pulled up: with the caption below it, the pair otherwise sits noticeably
     lower than the headline it is meant to sit beside */
  margin-top: -46px;
}

/* A second card resting behind the interactive one: the pair reads as stock on hand,
   and the front card stays the thing you can actually scratch. */
.card-behind {
  position: absolute;
  z-index: 0;
  /* anchored to the right edge so the whole card stays inside the column and
     nothing gets clipped */
  right: -3%;
  top: -7%;
  width: min(80%, 340px);
  transform: rotate(-12deg);
  opacity: 0.5;
  filter: saturate(0.85) brightness(0.8);
  pointer-events: none;
  user-select: none;
}
/* Below the two-column breakpoint the card column spans the full width, so the
   -3% offset lands outside the viewport. Keep the back card flush instead. */
@media (max-width: 940px) {
  .card-behind { right: 0; top: 0; }
}
@media (max-width: 620px) {
  .card-behind { width: min(58%, 210px); opacity: 0.32; }
}
@media (max-width: 940px) {
  .card-stage { margin-top: 0; }
}

.giftcard {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  padding: 26px 26px 22px;
  background:
    linear-gradient(158deg, #2b2440 0%, #1d1930 52%, #171326 100%);
  border: 1px solid var(--edge);
  box-shadow:
    0 40px 80px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: rotate(-2.2deg);
  width: 100%;
  max-width: 430px;
  margin-inline: auto;
}
/* Gradient hairline border. Guarded: without mask-composite the gradient would
   flood the whole card instead of tracing its edge. */
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .giftcard::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(145deg, rgba(232,184,75,0.65), rgba(139,127,212,0.25) 42%, transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
  }
}

.gc-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.gc-brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.gc-brand span { display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; font-weight: 400; margin-top: 3px; }
.gc-value {
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -0.04em;
}

.gc-scratch {
  position: relative;
  margin-top: 30px;
  border-radius: 11px;
  overflow: hidden;
  background: #100e1a;
  border: 1px solid var(--edge-soft);
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 14px;
  cursor: crosshair;
  touch-action: none;
}
.gc-code {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 3.2vw, 1.32rem);
  letter-spacing: 0.16em;
  color: var(--mint);
  text-align: center;
  word-break: break-all;
}
.gc-scratch canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.gc-hint {
  position: absolute;
  bottom: 8px; left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(18, 16, 27, 0.62);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gc-scratch.revealed .gc-hint { opacity: 0; }

.gc-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dim);
}
.gc-caption {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 22px auto 0;
  max-width: 34ch;
  font-size: var(--step--1);
  color: var(--dim);
  line-height: 1.5;
}

/* ---------- brands ---------- */
.brandgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(168px, 100%), 1fr));
  gap: 14px;
}
.brand {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--edge-soft);
  background: linear-gradient(160deg, rgba(255,255,255,0.028), rgba(255,255,255,0.008));
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.brand:hover { border-color: var(--edge); transform: translateY(-2px); }
.brand-mark {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge-soft);
}
/* Logos are inlined SVG with a fill colour: masks are still unreliable across
   browsers and failed open as plain coloured squares. Each brand keeps its own
   colour on one neutral plate instead of 20 competing coloured squares. */
.brand-svg {
  display: block;
  width: 21px;
  height: 21px;
}
/* Fallback for brands with no vector logo available */
.brand-mark-text {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--tone, var(--paper));
}
.brand-name { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-kind { font-size: 0.74rem; color: var(--dim); font-family: var(--mono); letter-spacing: 0.06em; }

.trademark-note {
  margin-top: 26px;
  font-size: var(--step--1);
  color: var(--dim);
  max-width: 78ch;
  line-height: 1.55;
}

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 1px;
  background: var(--edge-soft);
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.step {
  background: var(--ink);
  padding: 30px 28px 34px;
}
.step-no {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  display: block;
  margin-bottom: 18px;
}
.step h3 { font-size: var(--step-2); margin-bottom: 12px; }
.step p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ---------- two-column info ---------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: clamp(24px, 4vw, 44px);
}
.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  padding: 30px 28px;
  background: rgba(255, 255, 255, 0.014);
}
.panel h3 {
  font-size: var(--step-2);
  margin-bottom: 8px;
}
.panel > p { color: var(--muted); font-size: 0.95rem; margin: 0 0 22px; }

.taglist { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; list-style: none; }
.taglist li {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  color: var(--muted);
}
.taglist li.on { border-color: rgba(232,184,75,0.45); color: var(--gold); }

.linelist { list-style: none; padding: 0; margin: 0; }
.linelist li {
  display: flex; gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--edge-soft);
  font-size: 0.95rem;
}
.linelist li:first-child { border-top: 0; padding-top: 0; }
.linelist b { font-weight: 600; min-width: 118px; flex: none; }
.linelist span { color: var(--muted); }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(30px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
.about-body p { color: var(--muted); font-size: var(--step-1); line-height: 1.62; margin: 0 0 20px; }
.about-body p strong { color: var(--paper); font-weight: 600; }

.factcard {
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  padding: 26px 24px;
  background: linear-gradient(165deg, rgba(139,127,212,0.09), rgba(255,255,255,0.01));
}
.factcard dl { margin: 0; }
.factcard dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.factcard dd { margin: 5px 0 20px; font-size: 0.96rem; }
.factcard dd:last-child { margin-bottom: 0; }

/* ---------- faq ---------- */
.faq { border-top: 1px solid var(--edge-soft); }
.faq details {
  border-bottom: 1px solid var(--edge-soft);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 40px 20px 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: -0.015em;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  color: var(--gold);
  font-size: 1.2rem;
}
.faq details[open] summary::after { content: "\2212"; }
.faq p { color: var(--muted); margin: 0 0 22px; max-width: 74ch; font-size: 0.97rem; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
}
.field input, .field select, .field textarea {
  font-family: var(--body);
  font-size: 0.98rem;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 13px 15px;
  width: 100%;
}
.field textarea { min-height: 132px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--lilac);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 127, 212, 0.18);
}
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-pair { grid-template-columns: minmax(0, 1fr); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form-note { font-size: var(--step--1); color: var(--dim); max-width: 42ch; line-height: 1.5; }
.form-status {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { border-color: rgba(87, 200, 180, 0.5); color: var(--mint); }
.form-status.err { border-color: rgba(226, 112, 122, 0.5); color: var(--alert); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--edge-soft);
  padding-block: 54px 40px;
  color: var(--dim);
  font-size: var(--step--1);
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 34px;
  margin-bottom: 40px;
}
.footer h4 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--paper); }
.footer-blurb { max-width: 40ch; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid var(--edge-soft);
  padding-top: 22px;
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}

/* ---------- legal pages ---------- */
.legal-hero { padding-block: clamp(48px, 7vw, 88px) 34px; }
.legal-hero h1 { font-size: var(--step-3); max-width: 20ch; }
.legal-hero p { color: var(--muted); margin: 18px 0 0; }
.legal-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--edge-soft);
}
/* The class sits on the .shell element, so capping the shell itself would centre the
   whole column and break alignment with the page title. Cap the children instead. */
.legal-body {
  padding-bottom: clamp(60px, 8vw, 100px);
}
.legal-body > * {
  max-width: 76ch;
}
.legal-body h2 {
  font-size: var(--step-2);
  margin: 46px 0 14px;
  scroll-margin-top: 90px;
}
.legal-body h2 .num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--gold);
  margin-right: 12px;
  letter-spacing: 0.08em;
  vertical-align: 0.25em;
}
.legal-body h3 { font-size: var(--step-1); margin: 28px 0 10px; }
.legal-body p, .legal-body li { color: var(--muted); }
.legal-body p { margin: 0 0 16px; }
.legal-body ul, .legal-body ol { margin: 0 0 18px; padding-left: 22px; }
.legal-body li { margin-bottom: 9px; }
.legal-body strong { color: var(--paper); font-weight: 600; }
.legal-body .callout {
  border-left: 2px solid var(--gold);
  background: rgba(232, 184, 75, 0.055);
  padding: 18px 22px;
  border-radius: 0 10px 10px 0;
  margin: 26px 0;
}
.legal-body .callout p:last-child { margin-bottom: 0; }
.legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 0.93rem;
}
@media (max-width: 640px) {
  .legal-body table { display: block; overflow-x: auto; white-space: normal; }
}
.legal-body th, .legal-body td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--edge-soft);
  vertical-align: top;
}
.legal-body th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.legal-body td { color: var(--muted); }
