/* ==========================================================================
   Quester landing page — foundation.css
   Tokens, base, type, layout and the shared components every section uses.
   Section styles: site.css (nav, hero, moment, go, footer, sticky bar),
   story.css (#walked-past, #digging, #companion), product.css (#product,
   #features).

   PLACEHOLDER-ASSET CONVENTION
   ----------------------------
   Every image that is not produced yet is a named slot. Preferred shape
   (a flat field with a dev-only brief):

     <div class="ph" data-slot="city/moment-facade">
       <span class="cap">Photo · looking straight up at an ordinary façade</span>
       <img src="/images/city/moment-facade.webp" alt="…" loading="lazy" decoding="async">
     </div>

   - City stills live at /images/city/<slug>.webp, app screens at
     /images/screens/<screen>.webp.
   - `.ph` is a flat `--ph` field; `.ph.dk` the dark `--ph-dk` field (dusk).
     When the real file lands, the img simply covers the field and caption.
   - `.cap` prints the photo brief, on localhost only (`html.ph-dev`, set by
     site.js), never in production.
   - site.js watches every `img.ph` and `.ph > img`: on `error` (or already
     broken at boot) it adds `.ph--missing` and swaps src to a 1x1
     transparent pixel, so the field shows and the broken-image icon never
     does. The original path is kept in `data-src-missing`.
   - The older shape `<img class="ph" …>` still works (flat field, no cap).
   - Give every slot a size from its layout (aspect-ratio / explicit height).

   REVEAL-ON-SCROLL
   ----------------
   Add `.reveal` to any element; site.js adds `.is-in` when it enters the
   viewport. Motion only under prefers-reduced-motion: no-preference and only
   when JS runs (html.js), so no-JS visitors see everything.
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --band: #F5F5F7;
  --ink: #0F101A;
  --ink-2: #2A2B3A;
  --mute: #6E6F84;
  --line: rgba(15, 16, 26, .10);
  --line-2: rgba(15, 16, 26, .18);
  --accent: #A8360F;
  --ph: #E9E9EE;
  --ph-dk: #1B1B22;
  --lt: #FFFFFF;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-h1: clamp(58px, 8.6vw, 124px);
  --fs-h2: clamp(44px, 5.8vw, 84px);
  --fs-look: clamp(112px, 13.9vw, 200px);

  --gutter: clamp(20px, 5vw - 8px, 64px);
  --wrap: 1312px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 900px) {
  :root { --nav-h: 88px; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[id] { scroll-margin-top: var(--nav-h); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--bg);
  color: var(--ink);
}
.skip:focus { top: 8px; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(96px, 12vw, 160px); }

/* ---------- Type ---------- */

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.012em;
  line-height: .96;
  margin: 0;
}

.i { font-style: italic; }

.h1 { font-size: var(--fs-h1); }

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-h2);
  letter-spacing: -.012em;
  line-height: .96;
  margin: 0;
  max-width: 16ch;
  text-wrap: balance;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}
.eyebrow.mute { color: var(--mute); }

.body,
.lede {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 34em;
}

.small {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--mute);
}

@media (max-width: 639px) {
  .body, .lede { font-size: 17px; }
}

/* ---------- Placeholder slots (.ph) ---------- */

.ph {
  position: relative;
  overflow: hidden;
  background-color: var(--ph);
  color: #5B5C6B;
  object-fit: cover;
}
.ph.dk { background-color: var(--ph-dk); color: #B8B9C6; }

.ph > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent; /* hides alt text painted inside a broken img */
}
img.ph { color: transparent; }

/* No JS: a broken img renders its ::after (a loaded one never does), so this
   paints the placeholder field over the browser's broken-image glyph. */
img.ph::after,
.ph > img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ph);
}
.ph.dk > img::after { background: var(--ph-dk); }

.ph .cap { display: none; }
.ph-dev .ph .cap {
  display: block;
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: .9;
}

/* ---------- Store pills ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.pill svg { flex: none; fill: currentColor; }
.pill:hover { color: var(--accent); }

.pill.lt { color: var(--lt); }
.pill.lt:hover { background: rgba(255, 255, 255, .1); color: var(--lt); }
.pill.lt:focus-visible { outline-color: var(--lt); }

.pill.solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--lt);
}
.pill.solid:hover { background: var(--ink-2); color: var(--lt); }

@media (max-width: 639px) {
  .pill { height: 44px; padding: 0 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .pill { transition: color .2s var(--ease), background-color .2s var(--ease); }
}

/* ---------- Discovery note ---------- */

.note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 340px;
  padding: 16px 18px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid rgba(15, 16, 26, .12);
  box-shadow: 0 14px 36px rgba(15, 16, 26, .12);
}

.note .t {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.note .t img { width: 18px; height: 18px; flex: none; }

.note .b {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
}

/* ---------- Quester line ---------- */

.qline {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 2.8vw, 40px);
  line-height: .96;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.qline img { width: 22px; height: 22px; flex: none; margin-top: .2em; }
.qline > :not(img) { margin: 0; font: inherit; }

/* ---------- Up-mark (the "look up" motif) ---------- */

.upmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.upmark.lt { color: var(--lt); }
.upmark svg { width: 14px; height: 14px; }
.upmark__line {
  display: block;
  width: 1px;
  height: 72px;
  background: currentColor;
  opacity: .7;
}
.upmark__label {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ---------- Hairline ---------- */

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: rgba(15, 16, 26, .14);
}

/* ---------- Phone frame + sketched screen ---------- */

.phone {
  position: relative;
  aspect-ratio: 9 / 19;
  border: 7px solid var(--ink);
  border-radius: 38px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 16, 26, .18);
}

.scr {
  position: absolute;
  inset: 0;
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  line-height: 1.35;
}
.scr .hd {
  margin: 0;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--mute);
}
.scr .me {
  align-self: flex-end;
  max-width: 85%;
  margin: 0;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--lt);
  border-radius: 14px 14px 4px 14px;
}
.scr .q { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.scr .q img { width: 16px; height: 16px; margin-top: 2px; }
.scr .row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.scr .row b { font-weight: 600; }
.scr .bar { height: 5px; background: rgba(15, 16, 26, .13); border-radius: 2px; }

/* ---------- Reveal-on-scroll utility ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
  }
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}
