/* ============================================================
   Xpereans design system — single shared bundle
   Ported from handoff bundle (claude.ai/design), adapted for
   Django templates and extended with mobile breakpoints.

   ---------- Bundle policy (audit, backlog #28, PR 38) ----------
   Loaded site-wide via templates/base.html for every page that
   extends it: marketing pages, account pages, creator surfaces,
   and player surfaces.

   Current size: ~25 KB raw / ~6 KB gzipped — already inside the
   30 KB player mobile budget the original backlog item targeted.
   See PR 38's commit message for the "why no split today"
   reasoning. tl;dr: the selectors here are heavily shared (e.g.
   `.phone` is used by BOTH the home device-split mockup and the
   player single-experience view), so extracting per-area bundles
   would save very little and risk style regressions.

   The section headers below tag each block with its consumer
   area so if this file grows past 50 KB a future split is
   mechanical — search for "AREA:" comments to find the natural
   seam lines.

   The actual bloat #28 was indirectly targeting (Bootstrap on
   the three legacy landing pages) is broken out as #28a.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #F6F4EF;
  --surface:   #FBFAF5;
  --paper:     #FFFFFF;
  --hairline:  #E2DCCF;
  --rule:      #D7CFBE;

  /* Ink */
  --ink:       #15140F;
  --ink-2:     #38342A;
  --muted:     #807A6F;
  --subtle:    #B4ADA1;

  /* Accent — terracotta */
  --accent:    #D97757;
  --accent-ink:#9F4628;
  --accent-bg: #F4E2D8;

  /* Semantic */
  --ok:        #4F7A52;
  --warn:      #B7843A;
  --err:       #B73A3A;

  /* Type */
  --display:   'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --body:      'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Photo density */
  --photo-scale: 1;

  /* Layout */
  --wrap-max:   1240px;
  --wrap-narrow:920px;
  --wrap-pad:   32px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-feature-settings: 'ss01', 'cv11';
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

main { flex: 1; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ───────── A11Y · skip link + focus rings (pr/115) ─────────
   The skip link is visually offscreen until focused, at which point it
   slides into the top-left so a keyboard user can hit Enter to jump
   past the nav (WCAG 2.4.1). Mirrors the well-trodden pattern from
   GOV.UK / a11yproject.

   Focus rings: most elements get the design-system terracotta as a
   focus outline. We use :focus-visible (not :focus) so mouse-clicked
   buttons don't keep a sticky outline — the ring only shows when the
   user is actually navigating by keyboard. WCAG 2.4.7 (Focus Visible)
   + 2.4.11 (Focus Not Obscured). Form fields already had a focus
   treatment below; we leave it alone. */
.skip-link {
  position: absolute;
  top: -40px;          /* offscreen */
  left: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  z-index: 1000;
  transition: top 120ms ease;
}
.skip-link:focus {
  top: 8px;            /* slide on-screen on focus */
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible:not(input):not(textarea):not(select) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* `<main tabindex="-1">` (set in base.html so the skip link can focus
   it programmatically) shouldn't paint a visible outline when scripted
   focus moves there — only when a keyboard user explicitly tabs in.
   This is the recommended escape hatch per ARIA Authoring Practices. */
main:focus-visible { outline: none; }

/* ───────── Type helpers ───────── */
.t-display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.98;
}
.t-display em, .t-italic { font-style: italic; }

.t-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.t-mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.t-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ───────── Layout primitives ───────── */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
}

.wrap-narrow {
  width: 100%;
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
}

.rule { height: 1px; background: var(--hairline); width: 100%; }
.vrule { width: 1px; background: var(--hairline); align-self: stretch; }

/* ───────── Nav ───────── */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px var(--wrap-pad);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-logo {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.nav-logo .mark {
  width: 22px; height: 22px;
  display: inline-block;
  position: relative;
}

.nav-logo .mark::before, .nav-logo .mark::after {
  content: ''; position: absolute; inset: 0;
  border: 1px solid var(--ink);
}

.nav-logo .mark::after {
  transform: rotate(45deg);
  border-color: var(--accent);
}

.nav-center { display: flex; gap: 28px; justify-content: center; }
.nav-center a {
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms;
}
.nav-center a:hover { border-bottom-color: var(--ink); }
.nav-center a.active { border-bottom-color: var(--accent); color: var(--ink); }

.nav-right {
  display: flex; gap: 12px; justify-content: flex-end; align-items: center;
}

.nav-toggle {
  display: none;
  width: 28px; height: 24px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0; right: 0; height: 1.5px;
  background: var(--ink);
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top:  7px; }

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  transition: transform 200ms ease, background 200ms ease, top 200ms ease;
}

/* Hamburger → X when the drawer is open. The middle bar fades, the top
   and bottom converge and rotate. */
.nav.is-open .nav-toggle span { background: transparent; }
.nav.is-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav.is-open .nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

/* ───────── Mobile drawer (display:none on desktop; the mobile media
   query flips both .nav-drawer and .nav-drawer-backdrop on). ───────── */
.nav-drawer {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--bg);
  z-index: 51;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(.2, .7, .2, 1);
  flex-direction: column;
  padding: 20px 24px 32px;
  overflow-y: auto;
  border-left: 1px solid var(--hairline);
}
.nav.is-open ~ .nav-drawer {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.nav-drawer-close {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
}
.nav-drawer-close:hover { background: rgba(21,20,15,0.06); }

.nav-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-drawer-nav a {
  display: block;
  padding: 14px 4px;
  font-size: 17px;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  transition: color 120ms;
}
.nav-drawer-nav a:hover { color: var(--accent-ink); }
.nav-drawer-nav a.btn { border-bottom: 1px solid var(--ink); }

.nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21, 20, 15, 0.55);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.nav.is-open ~ .nav-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Body scroll lock while drawer is open. The window keeps its
   visual position (no scrollbar reflow). */
body.nav-open { overflow: hidden; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background 120ms, color 120ms, border-color 120ms, transform 120ms;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--ink); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--bg); }

.btn-accent {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }

.btn-ghost { border-color: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(21,20,15,0.06); color: var(--ink); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 22px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* Quick-add preset chips · AREA: creator (step editor, PR 58 / backlog #12).
   The chip the creator last clicked gets the filled (active) treatment
   so the current step shape is obvious at a glance. */
.quick-add-preset[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-arrow::after {
  content: '→';
  font-family: var(--body);
  display: inline-block;
  transition: transform 200ms;
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* ───────── Tags / badges ───────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
}
.tag.tag-accent { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-bg); }
.tag.tag-ok    { color: var(--ok); border-color: var(--ok); }
.tag.tag-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(217, 119, 87, 0.6);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(217,119,87,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(217,119,87,0);    }
  100% { box-shadow: 0 0 0 0   rgba(217,119,87,0);    }
}

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 8px;
}

/* ───────── Inputs ───────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-help {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--subtle);
  text-transform: none;
  letter-spacing: 0;
}
.field-error {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-ink);
}

.input, .textarea, .select {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  border-radius: 0;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 120ms;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--ink);
}
.input.input-error,
.textarea.input-error { border-color: var(--accent); }
.textarea { min-height: 96px; resize: vertical; font-family: var(--body); }

.code-input {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 22px 16px;
  text-transform: uppercase;
}

/* ───────── Cards ───────── */
.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  transition: border-color 150ms, transform 150ms;
}
.card-hover:hover { border-color: var(--ink); }

.surface { background: var(--surface); border: 1px solid var(--hairline); }

/* ───────── Phone frame · AREA: marketing (home device-split) + player (single-experience view) ───────── */
.phone {
  width: 360px;
  height: 720px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 36px;
  padding: 12px;
  position: relative;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 14px 24px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}

/* ───────── Photo frame ───────── */
.photo {
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ───────── Skeleton loaders (PR 29 / backlog #4) ─────────
   Apply `.skel` to any image container or block that should show
   a shimmer placeholder while its child <img> loads. The shimmer
   only animates for users without `prefers-reduced-motion`; for
   those who opt out, it falls back to a static surface tone.

   Wire-up: child <img> starts at opacity 0; once `load` fires the
   tiny JS in base.html flips `.is-loaded` on the img, which fades
   it in over 200ms and the shimmer beneath becomes irrelevant.
   Images that error out (404 / broken) get .is-loaded too (via the
   `error` handler) so we don't leave a perpetual shimmer. */
.skel {
  position: relative;
  background-color: var(--surface);
  background-image: linear-gradient(
    90deg,
    var(--surface) 0%,
    var(--hairline) 50%,
    var(--surface) 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.6s linear infinite;
  overflow: hidden;
}
.skel > img {
  opacity: 0;
  transition: opacity 220ms ease-out;
}
.skel > img.is-loaded {
  opacity: 1;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; background-image: none; }
}
.photo-caption {
  position: absolute;
  left: 12px; bottom: 12px;
  padding: 4px 10px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ───────── Scrollbar ───────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ───────── Animations ───────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 320ms ease-out; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 420ms cubic-bezier(.2,.7,.2,1); }

/* ───────── Step rail · AREA: player + creator (live feed) + memory wall ───────── */
.step-rail { display: flex; gap: 4px; }
.step-rail .step-tick {
  width: 28px; height: 4px;
  background: var(--rule);
  transition: background 200ms;
}
.step-rail.size-sm .step-tick { width: 18px; height: 3px; }
.step-rail .step-tick.done { background: var(--accent); }

/* ───────── Section header · AREA: marketing (home/how-to/pricing/about) + creator ───────── */
.section-header {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  align-items: baseline;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--hairline);
}
.section-header h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 56px;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-header p {
  margin-top: 16px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ───────── Footer ───────── */
.footer {
  border-top: 1px solid var(--hairline);
  background: var(--bg);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding: 48px var(--wrap-pad) 32px;
  max-width: var(--wrap-max);
  margin: 0 auto;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 24px var(--wrap-pad);
  border-top: 1px solid var(--hairline);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13px; color: var(--ink-2); cursor: pointer; }
.footer-col a:hover { border-bottom: 1px solid var(--ink-2); }

/* ───────── Messages ───────── */
.messages {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 360px;
}
.messages .message {
  padding: 12px 18px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  font-size: 13px;
  animation: fadeIn 200ms ease-out;
}
.messages .message.success { border-color: var(--ok); }
.messages .message.error   { border-color: var(--err); color: var(--err); }
.messages .message.warning { border-color: var(--warn); }

/* ───────── Utility ───────── */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.col  { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-subtle { color: var(--subtle); }
.text-accent { color: var(--accent-ink); }
.text-ok { color: var(--ok); }
.text-err { color: var(--err); }
.relative { position: relative; }
.uppercase { text-transform: uppercase; }
.font-mono { font-family: var(--mono); }
.font-display { font-family: var(--display); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: 48px; }

/* ───────── Legal / long-form documents · AREA: marketing only (privacy/terms/cookies) ───────── */
.legal-doc {
  padding: 64px 0 96px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
.legal-doc h1 {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 32px;
  color: var(--ink);
}
.legal-doc h2, .legal-doc h3, .legal-doc h4, .legal-doc h5, .legal-doc h6 {
  font-family: var(--body);
  font-weight: 500;
  color: var(--ink);
  margin: 40px 0 12px;
  letter-spacing: 0;
}
.legal-doc h2 { font-size: 22px; }
.legal-doc h3 { font-size: 18px; }
.legal-doc h4, .legal-doc h5, .legal-doc h6 { font-size: 15px; }
.legal-doc p { margin: 0 0 16px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px; padding-left: 24px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--accent-ink); border-bottom: 1px solid var(--accent); }
.legal-doc a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.legal-doc hr { border: 0; border-top: 1px solid var(--hairline); margin: 32px 0; }
.legal-doc strong, .legal-doc b { color: var(--ink); }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.legal-doc th, .legal-doc td { padding: 8px 12px; border: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.legal-doc th { background: var(--surface); font-weight: 500; color: var(--ink); }
.legal-doc small { font-size: 13px; color: var(--muted); }
.legal-doc .text-muted, .legal-doc .text-secondary { color: var(--muted); }
.legal-doc article > section + section { margin-top: 24px; }
.legal-doc .legal-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.legal-doc .legal-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: -16px 0 32px;
}

/* ───────── Native dialog modal · AREA: creator (cropper modal, purchase modal) ───────── */
dialog {
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  padding: 0;
  max-width: 90vw;
  width: 720px;
  max-height: 90vh;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.4);
}
dialog::backdrop {
  background: rgba(21,20,15,0.55);
  backdrop-filter: blur(4px);
}
dialog.crop-modal { width: 640px; }
dialog.purchase-modal { width: 880px; }

@media (max-width: 719px) {
  dialog { width: 96vw !important; max-height: 95vh; }
  dialog.purchase-modal .purchase-grid { grid-template-columns: 1fr !important; }
}

/* ───────── Photo density (PR 31 / backlog #6) ─────────
   `data-photos` on <html> controls how much decorative imagery the
   user sees. Hydrated from localStorage by the inline script in
   <head> before CSS evaluates, so there's no flash of full-photo
   state for Lite-mode visitors.

   Modes:
     "balanced" — default; show everything (no rules below match)
     "minimal"  — Lite mode; hide every element with .photo-hide-min
                  (decorative only — content photos always show)
     "hero"     — reserved for a future "show extra hero variants"
                  mode (no .photo-show-hero elements in the codebase
                  today, so this currently behaves like balanced) */
[data-photos="minimal"] .photo-hide-min { display: none !important; }
[data-photos="hero"] .photo-show-hero { display: block; }
[data-photos="restrained"] .photo-show-hero { display: none; }
[data-photos="minimal"] .photo-show-hero { display: none; }

/* ───────── Footer toggle pills ───────── */
.photo-density-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.photo-density-toggle .density-pill {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border: 1px solid var(--hairline);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    border-radius: 999px;
    transition: color 120ms, border-color 120ms, background 120ms;
}
.photo-density-toggle .density-pill:hover {
    color: var(--ink-2);
    border-color: var(--ink-2);
}
.photo-density-toggle .density-pill[aria-pressed="true"] {
    color: var(--ink);
    border-color: var(--ink);
    background: var(--surface);
}

/* ============================================================
   Mobile breakpoints
   ============================================================ */

/* Tablet (< 1024px) */
@media (max-width: 1023px) {
  :root {
    --wrap-pad: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .section-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-header h2 { font-size: 44px; }
}

/* Mobile (< 720px) */
@media (max-width: 719px) {
  :root {
    --wrap-pad: 20px;
  }

  body { font-size: 14px; }

  .nav {
    grid-template-columns: 1fr auto;
    padding: 14px var(--wrap-pad);
  }
  .nav-center { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-right .btn-ghost,
  .nav-right .btn-sm:not(.btn-primary) { display: none; }

  /* The mobile drawer + backdrop only render on small screens. Outside
     this breakpoint they're display:none so they can't accidentally
     intercept clicks on desktop. */
  .nav-drawer { display: flex; }
  .nav-drawer-backdrop { display: block; }

  .section-header h2 { font-size: 36px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px var(--wrap-pad);
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    padding: 16px var(--wrap-pad);
  }

  .phone {
    width: 100%;
    max-width: 360px;
    height: auto;
    aspect-ratio: 360 / 720;
  }

  .messages {
    top: 64px; left: 16px; right: 16px;
    max-width: none;
  }
}

/* ============================================================
   Legacy Bootstrap-compat shims
   These keep un-migrated pages from looking completely broken
   while PR 2-5 land. Delete once every template extends the new base.
   ============================================================ */

.container { max-width: var(--wrap-max); margin: 0 auto; padding: 0 var(--wrap-pad); }
.btn-info, .link-info { color: var(--accent-ink); }
.bg-info { background: var(--accent-bg); color: var(--accent-ink); }
.text-dark, .link-dark { color: var(--ink); }
.text-muted { color: var(--muted); }
