/* Parea landing — zine bands. Tokens mirror packages/ui/src/theme (light.ts / dark.ts). */
:root {
  --brand: #006B54;
  --on-brand: #fff;
  --neon: #00FFCC;
  --paper: #eef3ff;
  --paper-dim: #e4ecff;
  --mint: #D7FBF1;
  --ink: #131B2E;
  --ink-soft: #3A4A44;
  --card: #fff;
  --alert: #ba1a1a;
  --shadow: rgba(19, 27, 46, 0.25);
  --kicker: var(--brand);
  --focus: var(--brand);
  /* Polaroid paper and its ink stay light in both themes, like the app. */
  --polaroid: #fff;
  --polaroid-ink: #131B2E;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Geist', 'Inter', system-ui, sans-serif;
  --torn: polygon(0 0, 100% 0, 100% calc(100% - 22px), 94% calc(100% - 8px),
    86% calc(100% - 20px), 77% calc(100% - 4px), 68% calc(100% - 18px),
    58% calc(100% - 6px), 47% calc(100% - 22px), 36% calc(100% - 8px),
    25% calc(100% - 20px), 14% calc(100% - 5px), 5% calc(100% - 18px),
    0 calc(100% - 10px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1117;
    --paper-dim: #161b22;
    --mint: #0f2a24;
    --ink: #E6EDF3;
    --ink-soft: #8B949E;
    --card: #161b22;
    --alert: #ff8a80;
    --shadow: rgba(0, 0, 0, 0.55);
    --kicker: #00FFCC;
    --focus: #00FFCC;
  }
}

/* The hidden attribute always wins over a display rule (the Worker un-hides slots by removing it). */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
  --focus: var(--neon);
}
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Bands: later bands tuck under the earlier band's torn edge (z-index descends). */
.band { position: relative; z-index: var(--z, 1); padding: 72px 0 96px; }
.band + .band { margin-top: -22px; padding-top: 94px; }
.band--torn { clip-path: var(--torn); }
.band--brand { background: var(--brand); color: var(--on-brand); --focus: var(--neon); }
.band--mint { background: var(--mint); }
.band--paper { background: var(--paper-dim); }

.kicker {
  font: 700 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase;
  color: var(--kicker);
}
.band--brand .kicker { color: var(--neon); }

.top { display: flex; align-items: center; justify-content: space-between; }
header.band--brand { position: relative; z-index: var(--z, 1); padding: 20px 0 0; }
#hero { margin-top: -1px; padding-top: 33px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 24px/1 var(--display); text-decoration: none; }
.brand__mark { display: block; border-radius: 8px; }
.brand--footer { font-size: 18px; margin-bottom: 10px; color: var(--ink); }
.top nav { display: none; gap: 24px; }
.top nav a { text-decoration: none; opacity: .9; }
footer nav a, .top nav a { display: inline-flex; align-items: center; min-height: 44px; }
.top nav a:hover { text-decoration: underline; }

/* Hero */
.hero { display: grid; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 8vw, 72px); letter-spacing: -.02em; margin: 14px 0 18px; }
.lede { font-size: 19px; max-width: 34ch; opacity: .95; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 20px;
  border-radius: 14px; background: #131B2E; color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .35);
  transition: transform .15s ease;
}
.store__logo { width: 22px; height: 26px; flex: none; fill: currentColor; }
.store__text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store__text small { font-size: 11px; font-weight: 400; letter-spacing: .02em; opacity: .9; }
.store__text strong { font: 600 19px/1.1 var(--display); }
.store:hover { transform: translateY(-2px); }

/* Polaroid collage */
.collage { position: relative; height: 320px; max-width: 420px; width: 100%; margin: 0 auto; }
.polaroid {
  position: absolute; width: 170px; padding: 10px 10px 34px; background: var(--polaroid);
  color: var(--polaroid-ink); box-shadow: 0 10px 24px var(--shadow);
  transform: rotate(var(--r)); animation: settle .7s cubic-bezier(.2, .8, .2, 1) both;
}
.polaroid::before {
  content: ''; position: absolute; top: -10px; left: 50%; width: 64px; height: 20px;
  margin-left: -32px; background: rgba(255, 255, 255, .65); transform: rotate(-3deg);
}
.polaroid .photo { position: relative; overflow: hidden; height: 150px; background: var(--g); }
.polaroid small { position: absolute; left: 12px; bottom: 9px; font: 600 12px var(--display); }
.p1 { --r: 6deg; --g: linear-gradient(135deg, #d7fbf1, #7fdcc2); right: 0; top: 0; }
.p2 { --r: -8deg; --g: linear-gradient(135deg, #ffe3b0, #f0a56a); left: 0; top: 70px; animation-delay: .12s; }
.p3 { --r: 3deg; --g: linear-gradient(135deg, #e3dcff, #a08cf2); right: 34px; bottom: 0; animation-delay: .24s; }
@keyframes settle {
  from { opacity: 0; transform: translateY(24px) rotate(0deg); }
  to { opacity: 1; transform: rotate(var(--r)); }
}

/* Sections */
.band h2 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -.01em; margin: 10px 0 12px; }
.sub { max-width: 52ch; color: var(--ink-soft); }
.band--brand .sub { color: var(--on-brand); opacity: .92; }

.cards { display: grid; gap: 20px; margin-top: 36px; }
.card {
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 20px var(--shadow); transition: transform .2s ease;
}
.card:hover { transform: translateY(-4px) rotate(-.4deg); }
.card .photo { height: 150px; background: var(--g); }
.card div.body { padding: 16px 18px 20px; }
.card h3 { font-size: 22px; margin: 8px 0 6px; }
.card p { color: var(--ink-soft); font-size: 15px; }
.note { margin-top: 20px; font-size: 14px; color: var(--ink-soft); }

.steps { display: grid; gap: 28px; margin: 36px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding-left: 64px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 50%; background: var(--brand);
  color: #fff; font: 700 22px var(--display); transform: rotate(-6deg);
}
.steps h3 { font-size: 22px; margin-bottom: 4px; }
.steps p { color: var(--ink-soft); }

.privacy { display: grid; gap: 40px; align-items: center; }
.grid-art { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 260px; }
.grid-art span { aspect-ratio: 1; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.grid-art .on { background: var(--neon); box-shadow: 0 0 0 4px rgba(0, 255, 204, .3); }

.download { text-align: center; }
.download .stores { justify-content: center; }
.download .sub { margin: 0 auto; }

footer { padding: 40px 0 56px; background: var(--paper); color: var(--ink-soft); font-size: 15px; }
footer .wrap { display: grid; gap: 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
footer a { color: var(--ink); }
footer .invite-line { color: var(--ink); font-weight: 600; }

@media (min-width: 800px) {
  .top nav { display: flex; }
  .hero { grid-template-columns: 1.1fr .9fr; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .privacy { grid-template-columns: 1.2fr .8fr; }
  footer .wrap { grid-template-columns: 1fr auto; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .polaroid { animation: none; }
  .card, .store { transition: none; }
  .card:hover, .store:hover { transform: none; }
}

/* Invite page: personalised hero slots filled by the Worker. */
.inviter {
  display: flex; align-items: center; gap: 12px; width: fit-content; margin-top: 22px;
  padding: 8px 18px 8px 8px; border-radius: 999px; background: var(--polaroid);
  color: var(--polaroid-ink); font-weight: 600; box-shadow: 0 6px 16px var(--shadow);
}
.inviter__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--mint); }
.stamp {
  display: inline-block; margin: 16px 0 0; padding: 6px 14px; border: 2px dashed currentColor;
  border-radius: 8px; color: var(--neon); transform: rotate(-2deg);
  font: 700 13px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
}
.cta {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px; border-radius: 14px;
  background: var(--neon); color: #131B2E; text-decoration: none; font: 700 18px/1 var(--display);
  transition: transform .15s ease;
}
.cta:hover { transform: translateY(-2px); }
.polaroid__hero { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) {
  .cta { transition: none; }
  .cta:hover { transform: none; }
}

/* Photos fill their polaroid or card frame; the frame's gradient shows while they load. */
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Legal documents: privacy, terms, contact and child safety. */
.band--page { background: var(--paper); }
.doc-hero { margin-top: -1px; padding-top: 40px; padding-bottom: 64px; }
.doc-hero__inner { max-width: 800px; }
.doc-hero h1 { font-size: clamp(36px, 7vw, 60px); letter-spacing: -.02em; margin: 10px 0 16px; }
.doc-hero .lede { max-width: 58ch; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 14px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs span::before { content: '/'; margin-right: 8px; opacity: .6; }
.doc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px;
  background: var(--polaroid); color: var(--polaroid-ink); font: 600 13px/1.2 var(--body);
}
.chip--alert { background: #ffdad6; color: #93000a; }
.chip-note { font-size: 14px; opacity: .92; }

.doc { padding-top: 80px; padding-bottom: 80px; }
.doc__col { max-width: 800px; }
.doc h2 {
  margin: 52px 0 16px; padding-left: 14px; border-left: 6px solid var(--kicker);
  font: 700 clamp(24px, 4vw, 32px)/1.15 var(--display); letter-spacing: -.01em;
}
.doc h2:first-child, .doc-section:first-child h2 { margin-top: 0; }
.doc h3 { margin: 28px 0 10px; font: 700 22px/1.2 var(--display); }
.doc h4 { margin: 0 0 4px; font: 700 17px/1.3 var(--display); }
.doc p { margin: 0 0 16px; }
.doc ul { margin: 0 0 18px; padding-left: 22px; }
.doc li { margin-bottom: 8px; padding-left: 4px; }
.doc li::marker { color: var(--kicker); }
.doc a { color: var(--kicker); font-weight: 600; text-underline-offset: 3px; }
.doc strong { font-weight: 700; }
.doc-small { font-size: 14px; color: var(--ink-soft); }
.doc-section { scroll-margin-top: 24px; }
.doc-block { margin: 0 0 40px; }

.doc-card {
  margin: 0 0 18px; padding: 20px 22px; border-radius: 16px; background: var(--card);
  box-shadow: 0 8px 20px var(--shadow);
}
.doc-card > :last-child { margin-bottom: 0; }
.doc-card h2 { margin: 12px 0 10px; padding-left: 0; border-left: 0; font-size: 24px; }
.doc-card .chip { background: var(--mint); color: var(--ink); }
.doc-card--alert { border-left: 6px solid var(--alert); }
.doc-card--center { margin-top: 40px; padding: 32px 24px; text-align: center; }
.doc-card--link { transition: transform .2s ease; }
.doc-card--link:hover { transform: translateY(-4px) rotate(-.4deg); }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.doc-grid { display: grid; gap: 18px; margin: 18px 0 26px; }
.doc-grid .doc-card { margin: 0; }
.doc-callout {
  margin: 22px 0; padding: 18px 22px; border-left: 6px solid var(--kicker);
  border-radius: 0 14px 14px 0; background: var(--card); box-shadow: 0 8px 20px var(--shadow);
}
.doc-callout > :last-child { margin-bottom: 0; }
.doc-toc-card {
  margin-bottom: 40px; padding: 22px 24px; border-radius: 16px; background: var(--card);
  box-shadow: 0 8px 20px var(--shadow);
}
.doc-toc-card h3 {
  margin: 0 0 10px; color: var(--kicker); font: 700 13px/1 var(--body);
  letter-spacing: .14em; text-transform: uppercase;
}
.doc-toc { display: grid; gap: 0 32px; }
.doc-toc a { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }
.doc-button, .doc-link {
  display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; text-decoration: none;
}
.doc-button { padding: 0 22px; border: 2px solid var(--kicker); border-radius: 14px; }
.doc-link:hover, .doc-button:hover { text-decoration: underline; }

@media (min-width: 720px) {
  .doc-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .doc-toc { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .doc-card--link { transition: none; }
  .doc-card--link:hover { transform: none; }
}
