/* ─────────────────────────────────────────────────────────────────────────
   Valdra Co. — the reading rooms off the gallery.
   Static pages (service, cost guide, case study, industries) generated by lab/pages/build-pages.mjs.
   Same tokens, lettering and buttons as the home page (src/styles.css). One idea: every page answers
   one question in its first sentence, and the hard facts sit beside it on a museum wall label.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --wall: #FFFFFF; --paper: #F4F5F7; --ink: #0C0E23; --graphite: #4B515A;
  --mist-text: #5E6670; --ridge: #0A5A96; --blue: #2192C6; --glow: #4CC8F2;
  --line: rgba(12, 14, 35, 0.14); --line-dark: rgba(232, 233, 229, 0.16);
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --t-1: clamp(2.4rem, 1.5rem + 3.4vw, 4.75rem);
  --t-2: clamp(1.75rem, 1.3rem + 1.6vw, 2.6rem);
  --t-3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --t-lead: clamp(1.12rem, 1rem + 0.45vw, 1.32rem);
  --t-small: 0.875rem; --t-micro: 0.78rem;
  --gutter: clamp(20px, 5vw, 72px); --max: 1240px; --measure: 64ch;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--wall); color: var(--ink); font-family: var(--sans);
  font-size: 1.0625rem; line-height: 1.65; letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'ss01', 'cv11';
}
h1, h2, h3, p, dl, dd, figure, ul, ol { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--ridge); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ridge); outline-offset: 4px; border-radius: 2px; }
.on-dark :focus-visible { outline-color: var(--glow); }
.skip { position: fixed; left: 16px; top: 16px; z-index: 100; padding: 12px 18px; background: var(--ink); color: var(--paper); border-radius: 4px; transform: translateY(-160%); transition: transform 180ms var(--ease-out); text-decoration: none; }
.skip:focus-visible { transform: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.pm { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.pm .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 72px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1.12rem; letter-spacing: -0.035em; text-decoration: none; }
.wordmark img { width: 30px; }
.wordmark em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.pm nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 0.92rem; }
.pm nav a { text-decoration: none; }
.pm nav a:hover { color: var(--ridge); }
.pm nav .cta { padding: 10px 16px; border-radius: 4px; background: var(--ink); color: var(--paper); white-space: nowrap; transition: background-color 160ms var(--ease-out); }
.pm nav .cta:hover { background: var(--ridge); color: var(--paper); }
@media (max-width: 720px) { .pm nav .opt { display: none; } }

/* ── Opening: breadcrumb, eyebrow, question, the answer ───────────────── */
.crumbs { padding-top: 28px; font-size: var(--t-micro); color: var(--mist-text); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li + li::before { content: '/'; margin: 0 8px; opacity: 0.6; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ridge); text-decoration: underline; }
.open { padding: clamp(36px, 6vw, 84px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.eyebrow { font-size: var(--t-micro); font-weight: 500; color: var(--ridge); margin-bottom: 22px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: var(--t-1); line-height: 0.98; letter-spacing: -0.022em; max-width: 17ch; text-wrap: balance; }
h1 em, h2 em { font-style: italic; color: var(--ridge); }
.answer { margin-top: clamp(24px, 3vw, 36px); font-size: var(--t-lead); line-height: 1.5; color: var(--graphite); max-width: 58ch; text-wrap: pretty; }
.answer strong { color: var(--ink); font-weight: 500; }
.open__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (prefers-reduced-motion: no-preference) {
  .open > * { animation: rise 900ms var(--ease-out) both; }
  .open > :nth-child(2) { animation-delay: 60ms; } .open > :nth-child(3) { animation-delay: 120ms; } .open > :nth-child(4) { animation-delay: 180ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 16px 26px; border-radius: 4px; font-size: 0.95rem; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; border: 1px solid transparent; text-decoration: none; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms var(--ease-out); }
.btn:active { transform: scale(0.97); }
.btn--ink { background: var(--ink); color: var(--paper); } .btn--ink:hover { background: var(--ridge); }
.btn--line { border-color: var(--line); } .btn--line:hover { border-color: var(--ink); }
.btn--paper { background: var(--paper); color: var(--ink); } .btn--paper:hover { background: #fff; }
.btn--ghost { border-color: var(--line-dark); color: #fff; } .btn--ghost:hover { border-color: #fff; }

/* ── Reading room: article + the wall label ───────────────────────────── */
.room { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(40px, 7vw, 110px); padding-block: clamp(48px, 7vw, 96px) clamp(64px, 8vw, 120px); align-items: start; }
.walllabel { position: sticky; top: 104px; border-top: 2px solid var(--ink); padding-top: 18px; }
.walllabel__title { font-size: var(--t-micro); font-weight: 500; color: var(--mist-text); margin-bottom: 6px; }
.walllabel dl { display: grid; }
.walllabel div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.walllabel dt { font-size: var(--t-micro); color: var(--mist-text); }
.walllabel dd { font-family: var(--serif); font-size: var(--t-3); line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.walllabel dd a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.walllabel .btn { width: 100%; margin-top: 22px; }
@media (max-width: 920px) {
  .room { grid-template-columns: 1fr; }
  .walllabel { position: static; order: -1; }
  .walllabel dl { grid-template-columns: 1fr 1fr; column-gap: 20px; }
}

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-2); line-height: 1.04; letter-spacing: -0.018em; margin-top: 2.2em; text-wrap: balance; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.06rem; font-weight: 600; letter-spacing: -0.015em; margin-top: 1.8em; }
.prose p, .prose li { color: var(--graphite); text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--ridge); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose ul li, .prose ol li { position: relative; padding-left: 26px; }
.prose ul li + li, .prose ol li + li { margin-top: 0.5em; }
.prose ul li::before { content: ''; position: absolute; left: 4px; top: 0.72em; width: 10px; height: 1px; background: var(--ridge); }
.prose ol { counter-reset: n; }
.prose ol li { counter-increment: n; }
.prose ol li::before { content: counter(n, upper-roman); position: absolute; left: 0; font-family: var(--serif); font-style: italic; color: var(--ridge); }
.note { padding: 18px 20px; background: var(--paper); border-left: 2px solid var(--ridge); font-size: 0.97rem; }
.note p { color: var(--graphite); }
.source { font-size: var(--t-small); color: var(--mist-text) !important; }

/* Price ledger */
.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger-scroll { overflow-x: auto; }
.ledger th, .ledger td { text-align: left; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger thead th { font-size: var(--t-micro); font-weight: 500; color: var(--mist-text); border-bottom-color: var(--ink); }
.ledger tbody th { font-weight: 500; color: var(--ink); }
.ledger td { color: var(--graphite); font-size: 0.97rem; }
.ledger .num { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); white-space: nowrap; }

/* A concept or client site, framed */
.plate { margin-top: 1.6em !important; }
.plate a { display: block; text-decoration: none; }
.plate img { width: 100%; border-radius: 8px; border: 1px solid var(--line); transition: transform 500ms var(--ease-out); }
.plate a:hover img { transform: translateY(-4px); }
.plate figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 12px; font-size: var(--t-small); color: var(--mist-text); }
.plate figcaption b { font-weight: 500; color: var(--ink); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 2px; background: var(--paper); font-size: var(--t-micro); font-weight: 500; color: var(--graphite); }
.tag--live { background: var(--ridge); color: #fff; }

/* Questions */
.qa { margin-top: 1.4em !important; border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative; font-family: var(--serif); font-size: var(--t-3); line-height: 1.2; color: var(--ink); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; position: absolute; right: 4px; top: 18px; font-family: var(--sans); font-size: 1.4rem; color: var(--ridge); transition: transform 200ms var(--ease-out); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa details p { padding: 0 0 22px; color: var(--graphite); max-width: 60ch; }

/* Onward: related pages as an index */
.onward { border-top: 1px solid var(--line); padding-block: clamp(48px, 6vw, 80px); }
.onward h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-2); letter-spacing: -0.018em; margin-bottom: 24px; }
.onward ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--line); }
.onward li a { display: grid; gap: 4px; height: 100%; padding: 20px 20px 22px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.onward li a b { font-family: var(--serif); font-weight: 400; font-size: var(--t-3); line-height: 1.15; }
.onward li a span { font-size: var(--t-small); color: var(--mist-text); }
.onward li a:hover b { color: var(--ridge); }

/* Industry index (hub page) */
.index { list-style: none; padding: 0; border-top: 1px solid var(--ink); }
.index li { border-bottom: 1px solid var(--line); }
.index a { display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px 24px; align-items: baseline; padding: 24px 0; text-decoration: none; }
.index .n { font-family: var(--serif); font-style: italic; color: var(--ridge); }
.index b { font-family: var(--serif); font-weight: 400; font-size: var(--t-2); line-height: 1; letter-spacing: -0.018em; }
.index span { color: var(--graphite); font-size: 0.97rem; }
.index i { font-style: normal; color: var(--ridge); transition: transform 200ms var(--ease-out); }
.index a:hover b { color: var(--ridge); } .index a:hover i { transform: translateX(4px); }
@media (max-width: 720px) { .index a { grid-template-columns: 2rem 1fr; } .index span { grid-column: 2; } .index i { display: none; } }

/* ── Night band + colophon ────────────────────────────────────────────── */
.night { background: var(--ink); color: #fff; }
.band { padding-block: clamp(64px, 9vw, 128px); }
.band h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-1); line-height: 0.98; letter-spacing: -0.022em; max-width: 18ch; }
.band h2 em { font-style: italic; color: var(--glow); }
.band p { margin-top: 22px; max-width: 48ch; color: rgba(243, 243, 240, 0.72); font-size: var(--t-lead); line-height: 1.5; }
.band p a { color: #fff; }
.band .open__actions { margin-top: 34px; }
.colophon { border-top: 1px solid var(--line-dark); padding-block: 56px 40px; display: grid; grid-template-columns: 1.1fr 2fr; gap: 40px; }
.colophon__mark { display: flex; align-items: center; gap: 0.3em; font-family: var(--serif); font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.8rem); letter-spacing: -0.02em; line-height: 1; }
.colophon__mark img { width: 0.95em; }
.colophon__mark em { font-style: italic; }
.colophon__line { margin-top: 16px; color: rgba(243, 243, 240, 0.6); font-size: var(--t-small); max-width: 34ch; }
.colophon__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 28px; }
.colophon__cols h3 { font-size: var(--t-micro); font-weight: 500; color: rgba(243, 243, 240, 0.6); margin-bottom: 10px; }
.colophon__cols ul { list-style: none; padding: 0; display: grid; gap: 6px; font-size: var(--t-small); }
.colophon__cols a { text-decoration: none; color: rgba(243, 243, 240, 0.86); }
.colophon__cols a:hover { color: #fff; text-decoration: underline; }
.colophon__legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 22px; font-size: var(--t-micro); color: rgba(243, 243, 240, 0.6); }
.colophon__legal a { text-decoration: none; } .colophon__legal a:hover { color: #fff; }
@media (max-width: 820px) { .colophon { grid-template-columns: 1fr; } }
