/*
 * Shared base styles for the Révéler marketing site.
 *
 * Anything page-specific (the hero develop-bath animation, the film-stock
 * switcher, the pledge gradient, etc.) lives in a <style> block on its
 * own page. This file covers the chrome that every page has in common:
 * the palette, typography, nav, buttons, layout utilities, scroll-reveal
 * helper, and footer.
 */

:root {
  --paper:        #F4EFE6;
  --paper-2:      #FBF7EE;
  --cream:        #FFFFFF;
  --ink:          #1A1816;
  --ink-80:       rgba(26, 24, 22, 0.80);
  --ink-65:       rgba(26, 24, 22, 0.65);
  --ink-45:       rgba(26, 24, 22, 0.45);
  --ink-20:       rgba(26, 24, 22, 0.20);
  --ink-10:       rgba(26, 24, 22, 0.10);
  --ink-05:       rgba(26, 24, 22, 0.05);
  --safelight:    #E8862B;
  --safelight-2:  #F2A24A;
  --ember:        #C85A1F;
  --oxide:        #9C2A1F;

  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
  --mono:  ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --max:     1120px;
  --max-md:  780px;
  --max-sm:  560px;

  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
  --develop-ease: cubic-bezier(0.4, 0, 0.15, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #1A1614;
    --paper-2:      #221F1C;
    --cream:        #2B2723;
    --ink:          #FCF4EC;
    --ink-80:       rgba(252, 244, 236, 0.82);
    --ink-65:       rgba(252, 244, 236, 0.68);
    --ink-45:       rgba(252, 244, 236, 0.45);
    --ink-20:       rgba(252, 244, 236, 0.20);
    --ink-10:       rgba(252, 244, 236, 0.10);
    --ink-05:       rgba(252, 244, 236, 0.06);
    --safelight:    #FF8233;
    --safelight-2:  #FFA96A;
    --ember:        #E6742E;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[data-reduced-motion="true"] { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--safelight); color: var(--paper); }

/* Subtle film-grain texture painted over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; opacity: 0.05; }
}

/* ─── Nav ───────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  border-bottom: 1px solid var(--ink-05);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.mark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-weight: 600;
  font-size: 19px; letter-spacing: 0.005em;
}
/*
 * The nav mark's "disc" is now backed by the actual app icon. We keep
 * the element as a `<span>` (not `<img>`) across the 4 pages so the
 * icon swap is one CSS change instead of four HTML edits. Image served
 * at 64×64 for 2× retina sharpness on a 28×28 logical display size.
 */
.mark .disc {
  width: 28px; height: 28px; flex: none;
  border-radius: 7px;
  background:
    url("/icon-64.png") center / cover no-repeat,
    var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s var(--ease-out);
}
.mark:hover .disc { transform: rotate(-4deg) scale(1.04); }
.nav-spacer { flex: 1; }
.nav-links { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.nav-links a {
  color: var(--ink-65); text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .nav-links a:not(.cta) { display: none; }
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font: 600 14px var(--sans); letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer; border: 0;
  transition:
    transform 0.24s var(--ease-out),
    background 0.24s var(--ease-out),
    color 0.24s var(--ease-out),
    box-shadow 0.24s var(--ease-out);
  will-change: transform;
}

/*
 * IMPORTANT — specificity note:
 * `.nav-links a` has specificity (0,1,1) and sets `color: var(--ink-65)`.
 * A plain `.btn-primary { color: var(--paper); }` rule (0,1,0) would
 * LOSE to `.nav-links a`, so the nav's Download button ended up
 * rendering paper-text on paper-background (invisible). We hoist the
 * button color rules to specificity (0,1,1) with `a.btn-primary` so
 * they win wherever the nav sits them.
 */
.btn-primary,
a.btn-primary,
button.btn-primary {
  background: var(--ink); color: var(--paper);
}
.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
  background: var(--safelight); color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--safelight) 60%, transparent);
}
.btn-primary:active,
a.btn-primary:active { transform: translateY(0); }

.btn-ghost,
a.btn-ghost,
button.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink-20);
}
.btn-ghost:hover,
a.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* App Store badge — paper-ink contrast so it matches the brand */
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 22px 13px 18px;
  background: var(--ink); color: var(--paper);
  border-radius: 14px;
  text-decoration: none;
  font: 500 15px var(--sans);
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    background 0.3s var(--ease-out);
  will-change: transform;
}
.appstore .apple {
  width: 26px; height: 26px; flex: none;
  fill: var(--paper);
}
.appstore .labels {
  display: flex; flex-direction: column; line-height: 1.1;
}
.appstore .pre { font-size: 10px; letter-spacing: 0.04em; opacity: 0.8; text-transform: uppercase; }
.appstore .store { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.appstore:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -14px color-mix(in srgb, var(--ink) 80%, transparent);
}
.appstore:hover .apple { fill: var(--safelight); }

/* ─── Layout ────────────────────────────────────────────────────── */
section { padding: 110px 24px; position: relative; }
.wrap    { max-width: var(--max);    margin: 0 auto; }
.wrap-md { max-width: var(--max-md); margin: 0 auto; }
.wrap-sm { max-width: var(--max-sm); margin: 0 auto; }

.eyebrow {
  font: 800 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--safelight);
  margin: 0 0 18px;
}

/* ─── Typography ────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 0 20px;
}
h1 {
  font-size: clamp(42px, 8vw, 88px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
}
h3 {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.2;
}
p.lede {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: var(--ink-80);
  max-width: 560px;
}
p  { margin: 0 0 14px; color: var(--ink-80); }
ul { margin: 0 0 14px 22px; padding: 0; }
ul li { margin-bottom: 6px; color: var(--ink-80); }
a  {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--safelight);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease-out);
}
a:hover { color: var(--safelight); }

/* ─── Divider with label ────────────────────────────────────────── */
.rule {
  display: flex; align-items: center; gap: 16px;
  color: var(--ink-45);
  font: 700 10px var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 24px;
}
.rule::before, .rule::after {
  content: ""; flex: 1;
  height: 1px; background: var(--ink-10);
}

/* ─── Scroll-triggered reveal ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Footer ────────────────────────────────────────────────────── */
footer {
  padding: 40px 24px 60px;
  border-top: 1px solid var(--ink-10);
  background: var(--paper);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-45);
  font-size: 13px;
}
footer a { color: var(--ink-65); text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ─── Article pages (privacy / support / terms) ─────────────────── */
.article {
  padding: 70px 24px 100px;
}
.article h1 {
  font-size: clamp(38px, 6vw, 64px);
  margin-bottom: 10px;
}
.article .article-meta {
  font: 700 11px var(--mono);
  letter-spacing: 0.15em;
  color: var(--ink-45);
  text-transform: uppercase;
  margin: 0 0 36px;
}
.article h2 {
  font-size: clamp(22px, 2.5vw, 28px);
  margin-top: 48px;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}
.article h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-top: 28px;
  margin-bottom: 6px;
  letter-spacing: 0;
}
.article p {
  color: var(--ink-80);
  margin-bottom: 14px;
  font-size: 17px;
  line-height: 1.6;
}
.article ul {
  margin: 0 0 20px 22px;
}
.article ul li {
  color: var(--ink-80);
  line-height: 1.55;
  margin-bottom: 8px;
}
.article strong { color: var(--ink); font-weight: 600; }
.article .callout {
  margin: 24px 0 36px;
  padding: 20px 24px;
  background: var(--paper-2);
  border-left: 3px solid var(--safelight);
  border-radius: 0 10px 10px 0;
}
.article .callout p:last-child { margin-bottom: 0; }
.article .callout em { font-style: italic; color: var(--ink); }

/* Per-page TOC — small floating list of sections for long pages */
.toc {
  margin: 20px 0 40px;
  padding: 14px 18px;
  background: var(--paper-2);
  border: 1px solid var(--ink-10);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-65);
}
.toc strong {
  display: block;
  font: 700 10px var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin-bottom: 8px;
}
.toc ol {
  margin: 0; padding-left: 22px;
  columns: 2; column-gap: 24px;
}
@media (max-width: 640px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: 4px; }
.toc a {
  color: var(--ink-65);
  text-decoration: none;
  text-decoration-color: transparent;
}
.toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--safelight); }

/* Inline email / contact card used on support page */
.contact-card {
  margin-top: 28px;
  padding: 22px 24px;
  background: var(--paper-2);
  border: 1px solid var(--ink-10);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.contact-card .pre {
  font: 700 11px var(--mono);
  letter-spacing: 0.15em;
  color: var(--ink-65);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.contact-card .email {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink);
  text-decoration-color: var(--safelight);
}

/* FAQ block used on support page */
.faq dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 22px;
  font-size: 17px;
}
.faq dd {
  margin: 6px 0 0;
  color: var(--ink-65);
  line-height: 1.55;
}
