/* Curlingle — same tokens as the iOS app (Theme.swift). */
:root {
  --canvas: #f4f4f6;
  --surface: #ffffff;
  --sunken: #eaeaed;
  --ink: #121217;
  --ink-2: #6f717a;
  --hairline: rgba(0, 0, 0, 0.07);
  --accent: #7d54f5;
  --radius-hero: 30px;
  --radius-card: 22px;
  --gutter: 20px;
  --shadow: 0 6px 28px rgba(18, 18, 23, 0.06), 0 1px 2px rgba(18, 18, 23, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", "New York", ui-serif, Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0b0e;
    --surface: #1c1c20;
    --sunken: #29292e;
    --ink: #f5f5f7;
    --ink-2: #9ea0aa;
    --hairline: rgba(255, 255, 255, 0.09);
    --shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }

/* ---------- Progressive blur header (the app's signature effect) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }
.site-header .blur-stack { position: absolute; inset: 0 0 -28px 0; pointer-events: none; }
.site-header .blur-stack > div { position: absolute; inset: 0; }
.site-header .blur-stack > div:nth-child(1) { backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px); mask: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%); }
.site-header .blur-stack > div:nth-child(2) { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); mask: linear-gradient(to bottom, #000 0%, #000 45%, transparent 80%); }
.site-header .blur-stack > div:nth-child(3) { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); mask: linear-gradient(to bottom, #000 0%, #000 30%, transparent 62%); }
.site-header .blur-stack > div:nth-child(4) { background: linear-gradient(to bottom, color-mix(in srgb, var(--canvas) 70%, transparent), transparent); }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.pill {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px;
  border-radius: 999px; font: 500 16px var(--font); text-decoration: none; border: 0; cursor: pointer;
  transition: transform .2s ease, opacity .2s;
}
.pill:active { transform: scale(.97); }
.pill-ink { background: var(--ink); color: var(--canvas); }
.pill-white { background: #fff; color: #000; }
.pill-glass { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); backdrop-filter: blur(12px); }
.nav .pill { height: 38px; padding: 0 16px; font-size: 14px; }
@media (max-width: 760px) { .nav-links a:not(.pill) { display: none; } }

/* ---------- Gradient art (CSS port of GradientArt.swift) ---------- */
.art { position: relative; overflow: hidden; isolation: isolate; background:
  radial-gradient(120% 80% at 0% 0%, #9cc7ff 0%, transparent 55%),
  radial-gradient(90% 70% at 100% 10%, #d9d3e8 0%, transparent 60%),
  linear-gradient(160deg, #3d6fe0 0%, #8e9fd6 45%, #c9b5c9 100%); }
.art::before { /* the sphere */
  content: ""; position: absolute; z-index: -1; left: 50%; top: var(--sphere-top, 22%);
  width: var(--sphere, 118%); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background:
    radial-gradient(55% 40% at 50% 6%, rgba(255, 244, 214, .95) 0%, rgba(255, 220, 190, .0) 70%),
    radial-gradient(70% 60% at 62% 30%, #ff9db0 0%, transparent 70%),
    radial-gradient(80% 70% at 35% 55%, #a96df2 0%, transparent 70%),
    radial-gradient(90% 80% at 20% 80%, #5b7bf0 0%, transparent 70%),
    linear-gradient(180deg, #f6c79f 0%, #e083b8 35%, #9a6af0 65%, #5674ea 100%);
  box-shadow: 0 -6px 40px 6px rgba(255, 236, 204, .45);
  -webkit-mask: linear-gradient(to bottom, #000 50%, rgba(0,0,0,.45) 100%); mask: linear-gradient(to bottom, #000 50%, rgba(0,0,0,.45) 100%);
}
.art::after { /* hatching at the edges + film grain */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.35'/></svg>"),
    repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 1px, transparent 1px 5px);
  -webkit-mask: linear-gradient(90deg, #000 0%, transparent 30%, transparent 70%, #000 100%); mask: linear-gradient(90deg, #000 0%, transparent 30%, transparent 70%, #000 100%);
  mix-blend-mode: soft-light;
}
.art.warm { background:
  radial-gradient(100% 70% at 100% 0%, #ffe1c2 0%, transparent 55%),
  linear-gradient(170deg, #f0b48f 0%, #e597b3 45%, #b48ae6 100%); }
.art.warm::before { --sphere-top: 34%; }
.art.dusk { background: radial-gradient(90% 70% at 10% 0%, #ffb9a8 0%, transparent 60%), linear-gradient(160deg, #e9a2b9 0%, #b78be8 55%, #6f86ef 100%); }
.art.tile::before { display: none; }
.art.tile { filter: saturate(1.05); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(44px, 7vw, 84px); font-weight: 650; }
h1 em, h2 em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 650; }
h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 34ch; margin: 22px 0 32px; line-height: 1.5; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.note { font-size: 13px; color: var(--ink-2); margin-top: 14px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero { padding-top: 16px; } }

/* ---------- Phone mockup (the real Home screen) ---------- */
.phone-stage { position: relative; display: grid; place-items: center; padding: 24px 0; }
.phone-stage .halo { position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px); opacity: .55;
  background: conic-gradient(from 200deg, #f6c79f, #e083b8, #9a6af0, #5674ea, #f6c79f); animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.phone { position: relative; width: min(340px, 82vw); aspect-ratio: 9 / 19.5; border-radius: 54px; padding: 12px;
  background: #0b0b0e; box-shadow: 0 0 0 2px #2a2a30, 0 40px 80px -20px rgba(30, 20, 60, .45), 0 18px 36px -18px rgba(0,0,0,.4); }
.screen { position: relative; height: 100%; border-radius: 43px; overflow: hidden; background: #0b0b0e; color: #f5f5f7; padding: 54px 16px 0; font-size: 12px; }
.screen .island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #000; }
.screen .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.screen .top b { font-size: 25px; letter-spacing: -.02em; }
.screen .circles { display: flex; gap: 8px; }
.screen .circles i { width: 34px; height: 34px; border-radius: 50%; background: #26262b; display: block; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.screen .card { border-radius: 24px; height: 58%; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.screen .card .title { position: relative; z-index: 2; font-size: 21px; font-weight: 550; line-height: 1.15; letter-spacing: -.015em; margin-bottom: 14px; }
.screen .card .row { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.screen .card .src { display: flex; align-items: center; gap: 8px; font-size: 11px; opacity: .92; }
.screen .card .src i { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: block; }
.screen .card .go { background: #fff; color: #000; font-weight: 550; font-size: 12px; padding: 8px 14px; border-radius: 99px; }
.screen .more { display: flex; justify-content: space-between; margin: 16px 2px 10px; font-weight: 600; font-size: 15px; }
.screen .more span { color: #9ea0aa; font-weight: 400; font-size: 12px; }
.screen .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.screen .tiles div { height: 74px; border-radius: 16px; }
.screen .tabbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; padding: 5px; border-radius: 99px;
  background: rgba(40, 40, 46, .72); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); font-size: 10px; }
.screen .tabbar span { padding: 7px 16px; border-radius: 99px; }
.screen .tabbar span:first-child { background: rgba(255,255,255,.14); }
/* The card "develops" like the app's reveal: progressive blur clearing top to bottom. */
.develop .title, .develop .row { animation: develop 2.2s cubic-bezier(.2,.7,.2,1) .4s both; }
@keyframes develop { from { filter: blur(14px); opacity: .25; clip-path: inset(0 0 0 0); } to { filter: blur(0); opacity: 1; } }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head p { color: var(--ink-2); font-size: 19px; margin: 18px 0 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; }
.step .art { height: 180px; display: grid; place-items: center; }
.step .body { padding: 22px 24px 26px; }
.step .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--canvas); font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.step p { color: var(--ink-2); margin: 8px 0 0; font-size: 16px; }
.glass { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 10px 30px rgba(0,0,0,.08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; border-radius: 18px; }
.emblem { position: relative; z-index: 2; width: 64px; height: 64px; display: grid; place-items: center; }
.share-row { position: relative; z-index: 2; display: flex; gap: 10px; padding: 12px; }
.share-row span { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.35); display: block; }
.share-row span.me { background: url(/icon-512.png) center/cover; box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(0,0,0,.25); transform: scale(1.12); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Bridge feature */
.bridge > *, .closing > * { position: relative; z-index: 2; }
.scrim { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; background: linear-gradient(100deg, rgba(40, 16, 60, .42) 0%, rgba(40, 16, 60, .12) 55%, transparent 80%); }
.closing .scrim { background: radial-gradient(70% 60% at 50% 50%, rgba(30, 14, 60, .38), transparent 75%); }
.bridge { border-radius: var(--radius-hero); min-height: 520px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 56px; color: #fff; }
.bridge h2 { color: #fff; position: relative; z-index: 2; }
.bridge p { position: relative; z-index: 2; color: rgba(255,255,255,.88); font-size: 18px; max-width: 36ch; margin: 18px 0 0; }
.bridge .diagram { position: relative; z-index: 2; height: 380px; }
.bridge .bubble { position: absolute; padding: 14px 16px; width: 250px; display: flex; gap: 12px; align-items: center; }
.bridge .bubble small { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 600; opacity: .8; }
.bridge .bubble b { font-weight: 550; font-size: 15px; line-height: 1.3; }
.bridge .bubble .ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; }
.bridge .b1 { top: 4%; left: 0; } .bridge .b2 { bottom: 4%; right: 0; }
.bridge .chip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.bridge svg.curve { position: absolute; inset: 0; width: 100%; height: 100%; }
.bridge svg.curve path { stroke-dasharray: 2 8; stroke-linecap: round; }
@media (max-width: 860px) { .scrim { background: linear-gradient(180deg, rgba(40,16,60,.42), rgba(40,16,60,.1) 60%, transparent) !important; } .bridge { grid-template-columns: minmax(0, 1fr); padding: 32px 24px; } .bridge .diagram { height: 340px; } .bridge .bubble { width: 220px; } }

/* Principles */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); }
.grid-3 > div { background: var(--surface); padding: 30px 28px; }
.grid-3 svg { width: 26px; height: 26px; margin-bottom: 18px; color: var(--accent); }
.grid-3 p { color: var(--ink-2); margin: 8px 0 0; font-size: 16px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

/* FAQ */
details { border-bottom: 1px solid var(--hairline); padding: 22px 0; }
details summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; font-size: 19px; font-weight: 550; letter-spacing: -.01em; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-weight: 300; font-size: 26px; line-height: 1; color: var(--ink-2); transition: transform .3s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--ink-2); margin: 12px 0 0; max-width: 62ch; }

/* Closing band */
.closing { border-radius: var(--radius-hero); text-align: center; padding: 120px 24px; color: #fff; }
.closing h2 { position: relative; z-index: 2; color: #fff; }
.closing p { position: relative; z-index: 2; color: rgba(255,255,255,.9); font-size: 19px; margin: 18px auto 32px; max-width: 40ch; }
.closing .cta-row { position: relative; z-index: 2; justify-content: center; }

/* Footer */
footer { padding: 48px 0 64px; color: var(--ink-2); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer a { text-decoration: none; } footer a:hover { color: var(--ink); }

/* ---------- Long-form pages (policy, article) ---------- */
.doc { padding: 40px 0 80px; }
.doc header.doc-head { margin-bottom: 40px; }
.doc h1 { font-size: clamp(40px, 6vw, 64px); }
.doc .meta { color: var(--ink-2); font-size: 15px; margin-top: 16px; }
.prose { font-size: 18px; line-height: 1.7; }
.prose h2 { font-size: 28px; margin: 52px 0 12px; letter-spacing: -.02em; line-height: 1.2; }
.prose h3 { margin: 32px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 86%, var(--canvas)); }
.prose ul { padding-left: 22px; } .prose li { margin: 6px 0; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose blockquote { margin: 36px 0; padding: 0 0 0 22px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 28px; line-height: 1.3; font-style: italic; }
.callout { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 22px 24px; margin: 28px 0; font-size: 16px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.toc a { font-size: 14px; text-decoration: none; padding: 7px 14px; border-radius: 99px; background: var(--sunken); color: var(--ink-2); }
.article-hero { height: clamp(260px, 42vw, 440px); border-radius: var(--radius-hero); margin: 8px 0 44px; }
.article-hero.art::before { --sphere: 70%; --sphere-top: 30%; }

/* Scroll reveal: content "develops" from a blur, like the app. */
.reveal { opacity: 0; filter: blur(14px); transform: translateY(14px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), filter 1.1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; filter: blur(0); transform: none; }
.no-js .reveal { opacity: 1; filter: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; filter: none; transform: none; transition: none; }
  .develop .title, .develop .row, .phone-stage .halo { animation: none; }
  html { scroll-behavior: auto; }
}
