/* Shared look for every public page: tokens, type, masthead, footer and the
   section patterns. Values come from the accepted "Inside the work" design
   (design/ACCEPTED-DIRECTION.md). The interactive map's own rules live in
   case_study.css, loaded after this file on that page only.

   Color carries meaning, the same way on every page:
   amber = outside services, lavender = app capabilities, cyan = screens,
   coral = business outcomes. */

:root {
  color-scheme: dark;
  --bg: #151518;
  --panel: #1e1e23;
  --panel2: #242329;
  --ink: #f1eee8;
  --muted: #aba8b1;
  --soft: #bcbcbd;
  --line: #3a383f;
  --accent: #ecd8bf;
  --violet: #bda4ec;
  --gold: #e0bd81;
  --service: #dfbd83;
  --core: #bda4ec;
  --surface: #88c8d7;
  --outcome: #e4a593;
  --serif: 'Instrument Serif', Georgia, serif;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 78% 0, #36303b40, transparent 32%), var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Emphasis is the same family: light italic, warmer. One voice, two weights.
   (Was Instrument Serif italic; rejected 2026-09-19. Needs DM Sans 300 italic
   in the layout's font link.) */
em { font-style: italic; font-weight: 300; color: var(--accent); }

h1 { font-size: clamp(40px, 4.3vw, 67px); font-weight: 450; line-height: 1.04; letter-spacing: -.05em; margin: 0; }
h2 { font-size: 32px; line-height: 1.1; font-weight: 450; letter-spacing: -.035em; margin: 0; }
h3 { margin: 0; }

.masthead, main, .site-footer { width: calc(100% - 88px); max-width: 1660px; margin: auto; }

.skip { position: absolute; top: -80px; left: 20px; padding: 12px; background: var(--accent); color: #1a1a1a; z-index: 10; }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Masthead */
.masthead { height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 30px; letter-spacing: -1.5px; font-weight: 550; display: flex; gap: 12px; align-items: center; }
.wordmark span { color: #dec8b1; font-size: 37px; }
.site-nav { display: flex; align-items: center; gap: 30px; font-size: 13px; }
.site-nav a { padding: 10px 0; border-bottom: 1px solid transparent; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: #818182; }
.site-nav .nav-cta { color: var(--ink); border-bottom-color: #818182; }

/* Type helpers */
.eyebrow { font-size: 10px; letter-spacing: .13em; font-weight: 500; margin: 0 0 15px; color: var(--accent); }
.signal { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 8px; box-shadow: 0 0 13px #d9d8da66; }
.fine { font-size: 11px; line-height: 1.7; color: #99999a; max-width: 720px; margin: 22px 0 0; }
.text-link { border-bottom: 1px solid #818182; padding-bottom: 2px; color: var(--ink); white-space: nowrap; }
.figure-label { display: block; font-size: 9px; letter-spacing: .13em; color: var(--muted); margin-bottom: 16px; }

/* Hero and page heads */
.hero, .page-head { padding: 64px 0 56px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 55px; align-items: center; }
.page-head { padding: 52px 0 44px; align-items: end; }
.hero-copy { max-width: 430px; justify-self: end; }
.hero-copy p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 14px 0 0; }
.hero-copy p:first-child { color: var(--ink); font-size: 17px; line-height: 1.5; margin-top: 0; }

.button-primary { margin-top: 23px; display: flex; align-items: center; gap: 14px; background: #eddbc5; color: #242027; border: 1px solid #f5e7d5; padding: 15px 19px; text-align: left; width: 100%; box-shadow: 0 6px 32px #dfb68c0d; }
.button-primary:hover { background: #fff0dc; color: #242027; }
.button-primary > span:last-child { margin-left: auto; font-size: 20px; }
.button-primary strong { font-size: 14px; display: block; font-weight: 550; }
.button-primary small { display: block; font-size: 10px; color: #66594f; margin-top: 5px; }
.button-primary .play { width: 34px; height: 34px; border: 1px solid #776858; border-radius: 50%; display: grid; place-items: center; font-size: 12px; padding-left: 2px; flex-shrink: 0; }

/* Section scaffolding */
main > section { border-top: 1px solid var(--line); padding: 60px 0; }
main > section.hero, main > section.page-head { border-top: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 35px; margin-bottom: 32px; }
.section-heading > p { font-size: 13px; line-height: 1.7; max-width: 460px; color: var(--muted); margin: 0; }

/* Home: drawer of subscriptions -> one connected system */
.shift-figure { display: grid; grid-template-columns: 1fr auto 1.35fr; gap: 28px; align-items: stretch; }
.drawer, .connected { border: 1px solid var(--line); background: var(--panel); padding: 24px; }
.drawer { display: flex; flex-direction: column; }
.drawer-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: auto 0; }
.drawer-chips span { font-size: 12px; padding: 9px 12px; border: 1px dashed #56535c; color: var(--muted); }
.drawer-chips span:nth-child(3n) { transform: rotate(-1.5deg); }
.drawer-chips span:nth-child(4n+1) { transform: rotate(1.2deg) translateY(2px); }
.shift-arrow { align-self: center; font-size: 26px; color: var(--accent); }
.layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.layers > div { display: flex; flex-direction: column; gap: 8px; border-top: 2px solid var(--tone); padding-top: 12px; }
.layers small { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--tone); min-height: 24px; }
.layers span { font-size: 11px; line-height: 1.35; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); background: color-mix(in srgb, var(--tone) 7%, transparent); }
[data-layer="service"], [data-tone="service"] { --tone: var(--service); }
[data-layer="core"], [data-tone="core"] { --tone: var(--core); }
[data-layer="surface"], [data-tone="surface"] { --tone: var(--surface); }
[data-layer="outcome"], [data-tone="outcome"] { --tone: var(--outcome); }

/* Numbered card grid: responsibilities, workflow summary */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card-grid li { background: var(--bg); }
.card-grid li > a, .card-grid li > div { display: block; height: 100%; padding: 26px 24px 28px; }
.card-grid li > a:hover { background: var(--panel); color: inherit; }
.card-grid span { font-size: 10px; letter-spacing: .13em; color: var(--gold); }
.card-grid h3 { font-family: var(--serif); font-size: 23px; line-height: 1.15; font-weight: 400; margin: 14px 0 10px; }
.card-grid p { font-size: 13px; line-height: 1.7; color: var(--soft); margin: 0; }

/* Method: heading left, numbered steps right */
.method { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.method h2 { font-size: 48px; line-height: 1.08; }
.method > div > p:not(.eyebrow) { font-size: 14px; line-height: 1.75; color: var(--soft); margin: 18px 0 20px; max-width: 440px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps span { font-family: var(--serif); font-size: 22px; color: var(--gold); line-height: 1.1; }
.steps h3 { font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.steps p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 6px 0 0; }

/* Home: the interactive stage (app/javascript/home/stage.js) */
main > section.stage { border-top: 0; padding: 0 0 56px; }
.stage-bar { display: flex; align-items: center; gap: 26px; margin-bottom: 8px; }
.stage-toggle { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); flex-shrink: 0; }
.stage-toggle button { font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: background .25s, color .25s; }
.stage-toggle button[aria-pressed="true"] { background: #eddbc5; color: #242027; }
.stage-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage-bar p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--soft); }
.stage-canvas { border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(ellipse at 50% 50%, #2a2530 0, transparent 62%), var(--panel); overflow: hidden; touch-action: pan-y; min-height: 260px; }
.stage-canvas svg { display: block; width: 100%; height: auto; font-family: inherit; }
.stage-node { cursor: default; }

/* Home: off the shelf vs made to fit */
.contrast-table { border: 1px solid var(--line); }
.contrast-head, .contrast-row { display: grid; grid-template-columns: 1fr 1fr; }
.contrast-head span { font-size: 9px; letter-spacing: .13em; padding: 14px 26px; color: var(--muted); }
.contrast-head span:last-child { color: var(--accent); background: var(--panel); border-left: 1px solid var(--line); }
.contrast-row { border-top: 1px solid var(--line); }
.contrast-row p { margin: 0; padding: 22px 26px; font-size: 15px; line-height: 1.55; color: #8f8c95; }
.contrast-row p:last-child { font-family: var(--serif); font-size: 23px; line-height: 1.25; color: var(--ink); background: var(--panel); border-left: 1px solid var(--line); }

/* Home: what we cover */
.coverage-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.coverage-list a { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 30px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--line); }
.coverage-list a:hover { color: inherit; background: linear-gradient(90deg, transparent, var(--panel) 30%, var(--panel) 70%, transparent); }
.coverage-list h3 { font-family: var(--serif); font-size: 30px; font-weight: 400; letter-spacing: -.01em; }
.coverage-list p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--soft); }
.coverage-list span { color: var(--gold); font-size: 18px; }

/* Home: the spine */
.spine { display: grid; grid-template-columns: 1.2fr 1fr; gap: 55px; align-items: start; }
.spine h2 { font-size: 44px; line-height: 1.08; }
.spine p:not(.eyebrow) { font-size: 15px; line-height: 1.75; color: var(--soft); margin: 0 0 16px; }
.spine .spine-note { margin-top: 26px; font-size: 14px; }
.spine-note em { font-size: 21px; margin-right: 10px; }

/* Proof card */
.proof-card { display: grid; grid-template-columns: 1.4fr auto auto; gap: 44px; align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 30px; }
.proof-card:hover { border-color: #6e6066; color: inherit; }
.proof-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: center; }
.proof-map > div { display: flex; flex-direction: column; gap: 6px; }
.proof-map i { display: block; height: 9px; border: 1px solid color-mix(in srgb, var(--tone) 60%, transparent); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.proof-numbers { display: flex; gap: 30px; }
.proof-numbers strong { font-family: var(--serif); font-size: 34px; font-weight: 400; display: block; color: #ece0cf; line-height: 1; }
.proof-numbers span { font-size: 10px; color: var(--muted); display: block; margin-top: 5px; }
.proof-open { display: flex; align-items: center; gap: 12px; background: #eddbc5; color: #242027; padding: 14px 18px; font-size: 14px; font-weight: 550; white-space: nowrap; }
.proof-open .play { width: 30px; height: 30px; border: 1px solid #776858; border-radius: 50%; display: grid; place-items: center; font-size: 11px; padding-left: 2px; }

/* FAQ */
.faq { display: grid; grid-template-columns: 1fr 1.6fr; gap: 50px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.faq summary span { font-family: var(--serif); font-size: 26px; color: var(--gold); transition: transform .2s; }
.faq details[open] summary span { transform: rotate(45deg); }
.faq details p { font-size: 14px; line-height: 1.75; color: var(--soft); margin: 0 0 24px; max-width: 680px; }

/* CTA band */
.cta { display: grid; grid-template-columns: 1.5fr 1fr; gap: 55px; align-items: center; }
.cta h2 { font-size: 44px; line-height: 1.08; }
.cta p:not(.eyebrow) { font-size: 14px; line-height: 1.75; color: var(--soft); margin: 0; }
.cta > div:last-child { max-width: 430px; justify-self: end; }

/* Services */
.service-list article { display: grid; grid-template-columns: 60px 1.2fr 1fr; gap: 30px; padding: 34px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.service-list article:first-child { border-top: 0; padding-top: 0; }
.service-list article > span { font-family: var(--serif); font-size: 30px; color: var(--gold); line-height: 1; }
.service-list h2 { font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -.02em; }
.service-list p { font-size: 14px; line-height: 1.75; color: var(--soft); margin: 12px 0 0; }
.in-practice { border-left: 1px solid var(--line); padding-left: 26px; }
.in-practice h3 { font-size: 9px; letter-spacing: .13em; text-transform: uppercase; font-weight: 500; color: var(--surface); }
.in-practice p { font-size: 13px; color: var(--muted); }
.note-band { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.note-band p:not(.eyebrow) { font-size: 14px; line-height: 1.75; color: var(--soft); margin: 0 0 16px; }

/* Approach */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pair > div { border: 1px solid var(--line); border-top: 2px solid var(--tone); background: var(--panel); padding: 26px 26px 28px; }
.pair h3 { font-family: var(--serif); font-size: 26px; font-weight: 400; color: var(--tone); }
.pair p { font-size: 14px; line-height: 1.75; color: var(--soft); margin: 12px 0 0; }
.principle-list { margin: 0; padding: 0; list-style: none; counter-reset: rule; columns: 2; column-gap: 50px; }
.principle-list li { counter-increment: rule; break-inside: avoid; position: relative; padding: 14px 0 14px 38px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; color: var(--soft); }
.principle-list li::before { content: counter(rule, decimal-leading-zero); position: absolute; left: 0; top: 16px; font-size: 10px; letter-spacing: .1em; color: var(--core); }

/* Work */
.crumbs { display: flex; gap: 10px; padding: 18px 0 0; font-size: 11px; color: var(--muted); }
.crumbs a { border-bottom: 1px solid #56535c; }
.work-card { display: grid; grid-template-columns: auto 1.4fr auto auto; gap: 30px; align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 28px; }
.work-card:hover { border-color: #6e6066; color: inherit; }
.work-card .case-mark { background: #242328; border: 1px solid #6e6066; color: #e9d6bd; border-radius: 4px; font: 18px var(--serif); display: grid; place-items: center; width: 47px; height: 47px; }
.work-card h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; }
.work-card p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 8px 0 0; max-width: 560px; }
.work-card .proof-numbers { gap: 26px; }
.work-card .proof-open { background: none; color: var(--ink); padding: 0 0 6px; font-size: 13px; font-weight: 400; border-bottom: 1px solid #818182; }

/* Prose (privacy) */
.prose { max-width: 720px; }
.prose h2 { font-family: var(--serif); font-size: 26px; font-weight: 400; margin: 34px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 14px; line-height: 1.8; color: var(--soft); margin: 0 0 12px; }
.prose code { font-size: 12px; padding: 2px 6px; border: 1px solid var(--line); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 26px; margin-top: 20px; }
.footer-top { display: flex; justify-content: space-between; gap: 50px; flex-wrap: wrap; }
.footer-top p { font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 300px; margin: 14px 0 0; }
.site-footer nav { display: flex; gap: 64px; flex-wrap: wrap; }
.site-footer nav div { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.site-footer nav h2 { font-size: 9px; letter-spacing: .13em; text-transform: uppercase; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.footer-base { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 10px; color: #989899; }

@media (max-width: 1200px) {
  .masthead, main, .site-footer { width: calc(100% - 48px); }
  .hero, .page-head, .cta { gap: 30px; }
  .proof-card { grid-template-columns: 1fr auto; }
  .proof-map { grid-column: 1 / -1; }
  .work-card { grid-template-columns: auto 1fr auto; }
  .work-card .proof-numbers { grid-column: 2 / -1; }
}

@media (max-width: 850px) {
  h2 { font-size: 29px; }
  .hero, .page-head, .cta, .method, .faq, .note-band, .spine { grid-template-columns: 1fr; gap: 22px; }
  .spine h2 { font-size: 34px; }
  .stage-bar { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
  .hero, .page-head { padding: 36px 0; }
  .hero-copy, .cta > div:last-child { max-width: 540px; justify-self: start; }
  .hero-copy p:first-child { font-size: 15px; }
  .button-primary { max-width: 420px; }
  main > section { padding: 44px 0; }
  .section-heading { display: block; margin-bottom: 26px; }
  .section-heading > p { margin-top: 16px; }
  .shift-figure { grid-template-columns: 1fr; gap: 14px; }
  .shift-arrow { transform: rotate(90deg); justify-self: center; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .method h2 { font-size: 37px; }
  .cta h2 { font-size: 35px; }
  .proof-card { grid-template-columns: 1fr; gap: 24px; }
  .proof-open { justify-self: start; }
  .coverage-list a { grid-template-columns: 1fr auto; gap: 8px 20px; }
  .coverage-list p { grid-column: 1; grid-row: 2; }
  .coverage-list h3 { font-size: 26px; }
  .contrast-row p { padding: 18px; font-size: 14px; }
  .contrast-row p:last-child { font-size: 20px; }
  .contrast-head span { padding: 12px 18px; }
  .service-list article { grid-template-columns: 44px 1fr; }
  .in-practice { grid-column: 2; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .principle-list { columns: 1; }
  .site-nav { gap: 20px; }
}

@media (max-width: 520px) {
  .masthead, main, .site-footer { width: calc(100% - 32px); }
  .masthead { height: auto; padding: 16px 0 12px; flex-wrap: wrap; row-gap: 6px; }
  .wordmark { font-size: 26px; }
  .site-nav { width: 100%; gap: 0; justify-content: space-between; font-size: 12px; }
  h1 { font-size: 41px; }
  h2, .cta h2 { font-size: 30px; }
  .method h2 { font-size: 40px; }
  .eyebrow { font-size: 8px; }
  .layers { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .card-grid, .pair { grid-template-columns: 1fr; }
  .card-grid li > a, .card-grid li > div { padding: 22px 18px; }
  .proof-card, .work-card, .drawer, .connected { padding: 20px; }
  .proof-numbers { flex-wrap: wrap; gap: 18px 24px; }
  .contrast-row p { padding: 14px 12px; font-size: 12px; }
  .contrast-row p:last-child { font-size: 17px; }
  .contrast-head span { padding: 10px 12px; font-size: 8px; }
  .work-card { grid-template-columns: 1fr; gap: 18px; }
  .work-card .proof-numbers { grid-column: auto; }
  .service-list h2 { font-size: 28px; }
  .site-footer nav { gap: 34px; }
  .footer-base { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq summary span, .stage-toggle button { transition: none; }
}
