/* ==========================================================================
   PassCollect — site styles
   Minimal: neutral surfaces, one orange accent (from the app icon), hairlines.
   ========================================================================== */

/* — Tokens — */
:root {
  color-scheme: light dark;

  --bg: #fafaf9;
  --surface: #ffffff;
  --fg: #111110;
  --fg-muted: #5f5f5c;      /* 6.1:1 on --bg */
  --line: #e6e5e3;
  --accent: #ff5a1f;        /* app icon orange; decorative only (2.99:1) */
  --accent-text: #c2410c;   /* 4.96:1 on --bg, safe for body text */

  --font: "Archivo", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #121212;
    --fg: #f4f4f3;
    --fg-muted: #a1a19d;    /* 7.6:1 */
    --line: #232322;
    --accent: #ff6a2e;
    --accent-text: #ff8a57; /* 8.5:1 */
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; }
p, li { text-wrap: pretty; }

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

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* — Header — */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
}
.site-header .wrap {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; text-decoration: none;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav ul { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); list-style: none; padding: 0; }
.site-nav a { text-decoration: none; font-size: .9375rem; color: var(--fg-muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav .nav-cta {
  color: var(--bg); background: var(--fg);
  padding: 7px 14px; border-radius: 999px; font-weight: 500;
}
.site-nav .nav-cta:hover { color: var(--bg); opacity: .85; }
@media (max-width: 560px) {
  .site-nav .hide-sm { display: none; }
}

/* — Sections — */
.section { padding-block: clamp(64px, 10vw, 120px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 620px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); margin-block: 10px 12px; }
.section-head p { color: var(--fg-muted); font-size: 1.0625rem; }
.section-head.center { margin-inline: auto; text-align: center; }

/* — Hero — */
.hero {
  position: relative; isolation: isolate;
  /* Extend under the sticky header so the background runs behind it. */
  margin-top: calc(-1 * var(--header-h));
  padding-block: calc(var(--header-h) + clamp(40px, 8vw, 96px)) clamp(48px, 8vw, 96px);
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(24px, 5vw, 64px);
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 650; letter-spacing: -0.04em; margin-block: 14px 20px; }
.hero-lede { font-size: clamp(1.0625rem, 1.8vw, 1.25rem); color: var(--fg-muted); max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 32px; }
.hero-note { font-size: .875rem; color: var(--fg-muted); }
.hero-figure { justify-self: center; width: min(100%, 440px); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-figure { width: min(78%, 360px); }
}

/* App Store badge */
.store-badge { display: inline-block; border-radius: 12px; text-decoration: none; }
.store-badge img { height: 52px; width: auto; }

/* — Features — */
.features {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--line); gap: 1px;
}
.features li { background: var(--surface); padding: clamp(24px, 3vw, 32px); grid-column: span 2; }
.features h3 { font-size: 1.125rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.features p { color: var(--fg-muted); font-size: .9688rem; }
.feature-num { display: block; font-size: .8125rem; color: var(--accent-text); font-variant-numeric: tabular-nums; margin-bottom: 16px; }
@media (max-width: 860px) {
  .features { grid-template-columns: 1fr 1fr; }
  .features li { grid-column: span 1; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
}

/* — Showcase (iPhone Duo) — */
.showcase-figure { margin-top: 8px; }
.showcase-figure img { width: 100%; }
.showcase-figure figcaption { margin-top: 16px; text-align: center; color: var(--fg-muted); font-size: .9375rem; }
.duo-points {
  list-style: none; padding: 0; margin-top: clamp(24px, 4vw, 40px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.duo-points h3 { font-size: 1rem; margin-bottom: 4px; letter-spacing: -0.01em; }
.duo-points p { color: var(--fg-muted); font-size: .9375rem; }
@media (max-width: 760px) { .duo-points { grid-template-columns: 1fr; } }

/* — Screenshot strip — */
.shots { position: relative; }
.shots-track {
  display: flex; gap: clamp(12px, 2vw, 20px);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-inline: max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter)));
  padding-block: 4px 16px;
  scrollbar-width: none;
}
.shots-track::-webkit-scrollbar { display: none; }
.shots-track figure { flex: 0 0 auto; width: clamp(200px, 26vw, 260px); scroll-snap-align: center; }
.shots-track img {
  width: 100%; aspect-ratio: 1206 / 2622; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
}
.shots-track figcaption { margin-top: 12px; font-size: .875rem; color: var(--fg-muted); text-align: center; }
.shots-hint { margin-top: 8px; text-align: center; font-size: .8125rem; color: var(--fg-muted); }

/* — Guides teaser + blog lists — */
.post-list { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.post-list li { background: var(--bg); }
.post-list a.post-link {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: baseline;
  padding: 22px 0; text-decoration: none;
}
.post-list h2, .post-list h3 { font-size: 1.1875rem; letter-spacing: -0.015em; }
.post-list .post-summary { grid-column: 1 / -1; color: var(--fg-muted); font-size: .9688rem; max-width: 44em; }
.post-list time { color: var(--fg-muted); font-size: .875rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-list a.post-link:hover h2, .post-list a.post-link:hover h3 { color: var(--accent-text); }
.more-link { display: inline-block; margin-top: 24px; font-weight: 500; }

.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a {
  display: inline-block; font-size: .8125rem; text-decoration: none; color: var(--fg-muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px;
}
.tag-list a:hover { color: var(--fg); border-color: var(--fg-muted); }

/* — FAQ — */
.faq { max-width: 760px; margin-inline: auto; border-top: 1px solid var(--line); }
.faq-item { padding-block: 24px; border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 1.0625rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.faq-item p { color: var(--fg-muted); }

/* — Prose (articles, privacy) — */
.page { padding-block: clamp(40px, 7vw, 80px) clamp(64px, 9vw, 112px); }
.prose { max-width: 680px; margin-inline: auto; }
.prose > * + * { margin-top: 1.1em; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.035em; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.1875rem; margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose p, .prose li { font-size: 1.0625rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--fg-muted); }
.prose strong { font-weight: 600; }
.prose code { font-size: .92em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em; }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 1em; color: var(--fg-muted); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9688rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line); margin-inline: auto; max-height: 640px; width: auto; }
.prose figcaption { margin-top: 10px; text-align: center; font-size: .875rem; color: var(--fg-muted); }

.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .875rem; color: var(--fg-muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.breadcrumbs a { text-decoration: none; }

.article-header { margin-top: 24px; }
.article-header h1 { margin-top: 0; }
.tldr {
  margin-top: 20px; padding: 18px 20px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); font-size: 1.0625rem;
}
.tldr strong { font-weight: 600; }
.byline { margin-top: 16px; font-size: .9375rem; color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.byline a { color: var(--fg); }

.article-footer { max-width: 680px; margin: 56px auto 0; padding-top: 32px; border-top: 1px solid var(--line); }
.article-footer h2 { font-size: 1.125rem; margin-bottom: 8px; }
.article-footer .tag-list { margin-bottom: 40px; }
.cta-card {
  margin-top: 40px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.cta-card p { color: var(--fg-muted); }
.cta-card strong { display: block; color: var(--fg); font-weight: 600; }

/* — Footer — */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px; font-size: .9375rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; }
.site-footer a { color: var(--fg-muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }
.site-footer small { color: var(--fg-muted); font-size: .875rem; }

/* ==========================================================================
   Phase 1 — Animated gradients
   Static by default; motion only under prefers-reduced-motion: no-preference.
   Only transform, opacity and registered custom properties are animated.
   ========================================================================== */

@property --blob-color { syntax: "<color>"; inherits: false; initial-value: transparent; }
@property --cta-angle  { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --mesh-fade  { syntax: "<percentage>"; inherits: false; initial-value: 70%; }

:root {
  --mesh-1: rgb(255 90 31 / .16);    /* app icon orange */
  --mesh-2: rgb(139 124 246 / .14);  /* violet from the app's card colors */
}
@media (prefers-color-scheme: dark) {
  :root {
    --mesh-1: rgb(255 106 46 / .13);
    --mesh-2: rgb(139 124 246 / .12);
  }
}

.mesh {
  position: absolute; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
          mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.blob {
  position: absolute; width: min(70vmax, 900px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--blob-color), transparent var(--mesh-fade));
}
.blob-1 { --blob-color: var(--mesh-1); top: -35%; right: -18%; }
.blob-2 { --blob-color: var(--mesh-2); top: 0;   left: -30%; }

@keyframes drift-1 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-9%, 7%, 0) scale(1.08); }
  100% { transform: translate3d(5%, -3%, 0) scale(.95); }
}
@keyframes drift-2 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(10%, -6%, 0) scale(.94); }
  100% { transform: translate3d(-4%, 8%, 0) scale(1.06); }
}
@keyframes tint {
  0%   { --blob-color: var(--mesh-1); --mesh-fade: 70%; }
  100% { --blob-color: var(--mesh-2); --mesh-fade: 62%; }
}

/* Gradient text — hero heading only. Both stops meet WCAG AA for large text. */
.gradient-text {
  width: fit-content;
  background: linear-gradient(100deg, var(--fg) 45%, var(--accent-text) 110%);
  background: linear-gradient(in oklch 100deg, var(--fg) 45%, var(--accent-text) 110%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@media (max-width: 860px) { .gradient-text { margin-inline: auto; } }

/* Animated gradient ring around the primary CTA (mask-composite trick). */
.cta-ring { position: relative; isolation: isolate; }
.cta-ring::before {
  content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: 13px; padding: 1.5px;
  background: conic-gradient(from var(--cta-angle), var(--accent), transparent 30%, var(--mesh-2) 50%, transparent 70%, var(--accent));
  -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 exclude, linear-gradient(#000 0 0);
  --cta-angle: 200deg;
}
@keyframes spin-angle { to { --cta-angle: 560deg; } }

@media (prefers-reduced-motion: no-preference) {
  .blob { will-change: transform; }
  .blob-1 { animation: drift-1 28s ease-in-out infinite alternate, tint 34s ease-in-out infinite alternate; }
  .blob-2 { animation: drift-2 36s ease-in-out infinite alternate; }
  .cta-ring::before { animation: spin-angle 8s linear infinite; }
  .is-paused .blob, .is-paused .cta-ring::before { animation-play-state: paused; }
}

/* ==========================================================================
   Phase 2 — Progressive blur
   Usage: <div class="pblur" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i></div>
   Knobs (custom properties on .pblur):
     --pb-dir       direction toward the strongest blur: to top | to bottom | to left | to right
     --pb-strength  multiplier for every layer's blur radius (default 1 → 0.5px … 16px)
     --pb-tint      color laid over the blur for legibility; also the no-backdrop-filter fallback
   Size and position come from normal CSS (height/width/inset).
   ========================================================================== */
.pblur {
  --pb-dir: to top;
  --pb-strength: 1;
  --pb-tint: transparent;
  position: absolute; pointer-events: none;
}
.pblur > i {
  position: absolute; inset: 0;
  -webkit-backdrop-filter: blur(calc(var(--b) * var(--pb-strength)));
          backdrop-filter: blur(calc(var(--b) * var(--pb-strength)));
  -webkit-mask-image: linear-gradient(var(--pb-dir), var(--m));
          mask-image: linear-gradient(var(--pb-dir), var(--m));
}
.pblur > i:nth-child(1) { --b: .5px; --m: transparent 0%, #000 14.3%, #000 28.6%, transparent 42.9%; }
.pblur > i:nth-child(2) { --b: 1px;  --m: transparent 14.3%, #000 28.6%, #000 42.9%, transparent 57.1%; }
.pblur > i:nth-child(3) { --b: 2px;  --m: transparent 28.6%, #000 42.9%, #000 57.1%, transparent 71.4%; }
.pblur > i:nth-child(4) { --b: 4px;  --m: transparent 42.9%, #000 57.1%, #000 71.4%, transparent 85.7%; }
.pblur > i:nth-child(5) { --b: 8px;  --m: transparent 57.1%, #000 71.4%, #000 85.7%, transparent 100%; }
.pblur > i:nth-child(6) { --b: 16px; --m: transparent 71.4%, #000 85.7%, #000 100%; }
.pblur::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(var(--pb-dir), transparent, var(--pb-tint));
}
/* Narrow screens: drop the two faintest layers to cut compositing cost. */
@media (max-width: 600px) {
  .pblur > i:nth-child(-n+2) { display: none; }
  .pblur > i:nth-child(3) { --m: transparent 0%, #000 42.9%, #000 57.1%, transparent 71.4%; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pblur > i { display: none; }
  .pblur::after { background: linear-gradient(var(--pb-dir), transparent, var(--pb-tint-fallback, var(--bg))); }
}

/* Sticky header: content dissolves as it scrolls up underneath. */
.pblur-header {
  inset: 0 0 auto 0; height: calc(var(--header-h) + 28px);
  --pb-dir: to top;
  --pb-tint: color-mix(in srgb, var(--bg) 72%, transparent);
}

/* Screenshot strip: soft fade-blur at both scroll edges. */
.pblur-edge { top: 0; bottom: 16px; width: clamp(20px, 6vw, 80px); --pb-strength: .75; --pb-tint: color-mix(in srgb, var(--bg) 55%, transparent); }
.pblur-edge.start { left: 0;  --pb-dir: to left; }
.pblur-edge.end   { right: 0; --pb-dir: to right; }

/* — List components inside .prose: opt out of prose list/heading spacing — */
.prose .post-list, .prose .tag-list, .breadcrumbs ol { padding-left: 0; }
.prose .post-list li + li, .prose .tag-list li + li, .breadcrumbs li + li { margin-top: 0; }
.post-list h2, .post-list h3 { margin-top: 0; }
.prose h2.eyebrow { font-size: .8125rem; letter-spacing: .08em; margin-top: 2.5em; }
.prose h2.eyebrow + .tag-list { margin-top: 12px; }
.prose .post-list { margin-top: 32px; }
.prose .post-list p.post-summary { font-size: .9688rem; }
@media (max-width: 560px) {
  .post-list a.post-link { grid-template-columns: 1fr; }
  .post-list time { grid-row: 2; }
}
