/* Brand fonts, from OIL/BRAND/oil_brand_tokens.css. SIL Open Font License: fonts/OFL.txt */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-display: swap; src: url("fonts/SchibstedGrotesk-Regular.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 500; font-display: swap; src: url("fonts/SchibstedGrotesk-Medium.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-display: swap; src: url("fonts/SchibstedGrotesk-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-display: swap; src: url("fonts/SchibstedGrotesk-Bold.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 800; font-display: swap; src: url("fonts/SchibstedGrotesk-ExtraBold.woff2") format("woff2"); }
@font-face { font-family: "KT Serif"; font-weight: 400; font-display: swap; src: url("fonts/KTSerif-Regular.woff2") format("woff2"); }
@font-face { font-family: "KT Serif"; font-weight: 600; font-display: swap; src: url("fonts/KTSerif-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "KT Serif"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/KTSerif-Italic.woff2") format("woff2"); }
@font-face { font-family: "KT Mono"; font-weight: 400; font-display: swap; src: url("fonts/KTMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "KT Mono"; font-weight: 500; font-display: swap; src: url("fonts/KTMono-Medium.woff2") format("woff2"); }

/* Layout concept: a case file on a light table. A journey rail runs the page; the demo case opens as a stack of documents. */
:root {
  --paper: #EDF1EE;
  --sheet: #FBFCFA;
  --ink: #1B1F17;
  --muted: #586052;
  --rule: #D0D7CE;
  --teal: #0B7266;
  --teal-soft: #D3ECE6;
  --olive: #2A2C1C;
  --stamp: #8A5A12;
  --clear: #3C7F62;
  --watch: #A87A12;
  --escalate: #C0571A;
  --redzone: #B23A2E;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-doc: "KT Serif", Georgia, "Times New Roman", serif;
  --font-mono: "KT Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
  --radius: 6px;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15160E;
    --sheet: #1E2016;
    --ink: #E7EBE2;
    --muted: #A3AA99;
    --rule: #343829;
    --teal: #3CC7B3;
    --teal-soft: #173A34;
    --olive: #0F100A;
    --stamp: #E0A94C;
    --clear: #6CC39B;
    --watch: #E2B546;
    --escalate: #F08A4B;
    --redzone: #F07466;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15160E;
  --sheet: #1E2016;
  --ink: #E7EBE2;
  --muted: #A3AA99;
  --rule: #343829;
  --teal: #3CC7B3;
  --teal-soft: #173A34;
  --olive: #0F100A;
  --stamp: #E0A94C;
  --clear: #6CC39B;
  --watch: #E2B546;
  --escalate: #F08A4B;
  --redzone: #F07466;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); text-wrap: balance; line-height: 1.12; margin: 0; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); border-top: 1px solid var(--rule); }
.section-head { display: grid; gap: 0.75rem; max-width: 760px; margin-bottom: 2.25rem; }
.section-head h2 { font-size: var(--step-3); font-weight: 750; letter-spacing: -0.01em; }
.section-head p { color: var(--muted); font-size: var(--step-1); max-width: var(--measure); }

/* Demo banner */
.banner {
  background: var(--olive);
  color: #E7EBE2;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}
.banner .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding-block: 0.5rem; justify-content: space-between; }
.banner b { color: #3CC7B3; font-weight: 500; }

/* Top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.02em; font-size: 1.05rem; }
.brand-sub { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.nav a:hover { color: var(--teal); }
@media (max-width: 760px) { .nav { display: none; } }

/* Hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.025em; margin-top: 0.9rem; }
.hero h1 em { font-style: normal; color: var(--teal); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 58ch; margin-top: 1.25rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.fact { font-family: var(--font-mono); font-size: var(--step--1); border: 1px solid var(--rule); background: var(--sheet); padding: 0.35rem 0.65rem; border-radius: 999px; }
.ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.15rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; font-size: 0.98rem; border: 1px solid transparent; cursor: pointer; font-family: var(--font-body); }
.btn-primary { background: var(--teal); color: var(--sheet); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.print-figure { position: relative; aspect-ratio: 1 / 1; max-width: 420px; width: 100%; justify-self: center; }
.print-figure canvas { width: 100%; height: 100%; display: block; }
.print-caption { position: absolute; left: 0; right: 0; bottom: -0.25rem; text-align: center; }

/* Evidence */
.evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .evidence-grid { grid-template-columns: 1fr; } }
.evidence { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.35rem; display: grid; gap: 0.75rem; align-content: start; }
.evidence .num { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); color: var(--teal); letter-spacing: -0.02em; }
.evidence .src { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); line-height: 1.45; }
.bridge { margin-top: 2rem; font-family: var(--font-doc); font-size: var(--step-2); line-height: 1.35; max-width: 34ch; }

/* Pressure areas */
.areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 700px) { .areas { grid-template-columns: 1fr; } }
.area { background: var(--sheet); padding: 1.35rem; display: grid; gap: 0.5rem; align-content: start; }
.area h3 { font-size: var(--step-1); font-weight: 700; }
.channel { display: inline-flex; gap: 0.4rem; align-items: center; font-family: var(--font-mono); font-size: 0.74rem; color: var(--teal); }
.channel b { font-weight: 500; border: 1px solid var(--teal); border-radius: 3px; padding: 0 0.3rem; }
.area p { color: var(--muted); }
.method-note { margin-top: 1rem; font-size: 0.9rem; color: var(--muted); max-width: var(--measure); }

/* Journey: two groups on one rail. Price, name and text share rows across the columns (subgrid), so the names line up. */
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; counter-reset: stage; }
.journey-group { grid-row: 1; grid-column: 1 / span 4; padding-bottom: 1.4rem; font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.journey-group.is-paid { grid-column: 5 / span 2; }
.stage { grid-row: 2 / span 3; grid-template-rows: subgrid; counter-increment: stage; position: relative; padding: 1.1rem 1rem 0 0; display: grid; gap: 0.45rem; align-content: start; border-top: 2px solid var(--rule); }
@media (max-width: 960px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-group, .journey-group.is-paid { grid-row: auto; grid-column: 1 / -1; padding-bottom: 1.25rem; }
  .stage { grid-row: auto / span 3; margin-bottom: 1.5rem; }
}
@media (max-width: 520px) {
  .journey { grid-template-columns: minmax(0, 1fr); }
  .stage { grid-row: auto; grid-template-rows: none; }
}
.stage::before { content: counter(stage); position: absolute; top: -0.85rem; left: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule); display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.stage.is-paid { border-top-color: var(--teal); }
.stage.is-paid::before { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.stage h3 { font-size: 1.02rem; font-weight: 700; margin-top: 0.35rem; }
.stage p { font-size: 0.92rem; color: var(--muted); }
.stage .price { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink); }
.journey-note { margin-top: 2rem; display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start; background: var(--teal-soft); border-radius: var(--radius); padding: 1.1rem 1.25rem; max-width: 820px; }
.journey-note .label { color: var(--teal); }

/* Case file */
.persona { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 760px) { .persona { grid-template-columns: 1fr; } }
.persona h2, .persona h3 { font-size: var(--step-2); font-weight: 750; }
.persona .role { color: var(--muted); margin-top: 0.35rem; }
.persona ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; color: var(--ink); }
.stampline { display: inline-block; margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--stamp); border: 1px solid var(--stamp); padding: 0.15rem 0.45rem; border-radius: 3px; }
.casefile { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .casefile { grid-template-columns: minmax(0, 1fr); } }
.tabs { display: grid; gap: 0.35rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); }
@media (max-width: 900px) { .tabs { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 0.4rem; } }
.tab { text-align: left; background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: 0.6rem 0.75rem; cursor: pointer; color: var(--ink); font-family: var(--font-body); display: grid; gap: 0.1rem; }
.tab .t-stage { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tab .t-name { font-weight: 600; font-size: 0.95rem; }
.tab:hover { border-color: var(--rule); }
.tab[aria-selected="true"] { background: var(--sheet); border-color: var(--teal); }
.tab[aria-selected="true"] .t-stage { color: var(--teal); }
.tab-group { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.75rem 0.75rem 0.15rem; }
@media (max-width: 900px) { .tab-group { display: none; } }

.doc { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 1px 0 var(--rule), 0 12px 32px -24px rgba(20, 24, 16, 0.45); min-width: 0; }
.doc-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: space-between; align-items: center; padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.03em; }
.doc-head .doc-id { color: var(--ink); }
.doc-body { padding: clamp(1.1rem, 0.8rem + 1.5vw, 2.1rem); font-family: var(--font-doc); font-size: 1.04rem; line-height: 1.6; min-width: 0; }
.doc-body > * + * { margin-top: 0.85rem; }
.doc-body .dh1 { font-size: var(--step-2); font-weight: 750; }
.doc-body .dh2 { font-size: var(--step-1); font-weight: 700; margin-top: 1.75rem; }
.doc-body .dh3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.35rem; }
.doc-body p, .doc-body li { max-width: var(--measure); }
.doc-body ul, .doc-body ol { padding-left: 1.25rem; display: grid; gap: 0.3rem; }
.doc-body hr { border: 0; border-top: 1px solid var(--rule); margin-block: 1.5rem; }
.doc-body em { color: var(--muted); }
.doc-body a { word-break: break-word; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 4px; }
.doc-body table { border-collapse: collapse; width: 100%; font-family: var(--font-body); font-size: 0.9rem; line-height: 1.45; }
.doc-body th, .doc-body td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); min-width: 9rem; }
.doc-body th { font-weight: 600; background: color-mix(in srgb, var(--teal-soft) 55%, var(--sheet)); }
.doc-body tr:last-child td { border-bottom: 0; }
.panel[hidden] { display: none !important; }
.demo-note { margin-top: 0.75rem; font-size: 0.9rem; color: var(--muted); border-left: 3px solid var(--stamp); padding: 0.4rem 0.75rem; max-width: 760px; }
.panel-intro { display: grid; gap: 0.4rem; margin-bottom: 1rem; max-width: 760px; }
.panel-intro h2, .panel-intro h3 { font-size: var(--step-2); font-weight: 750; }
.panel-intro p { color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

/* Posture scale (Radar panel) */
.posture { margin-bottom: 1rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.25rem; display: grid; gap: 0.6rem; }
.scale { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.scale span { height: 10px; border-radius: 2px; opacity: 0.35; }
.scale span.on { opacity: 1; outline: 2px solid var(--ink); outline-offset: 2px; }
.scale .s1 { background: var(--clear); } .scale .s2 { background: var(--watch); } .scale .s3 { background: var(--escalate); } .scale .s4 { background: var(--redzone); }
.scale-labels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.scale-labels .on { color: var(--ink); font-weight: 500; }

/* Editions + compare */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem; display: grid; gap: 0.7rem; align-content: start; }
.card h2, .card h3 { font-size: var(--step-1); font-weight: 700; }
#editions .card { grid-template-rows: auto auto 1fr auto; }
#editions .card ul { align-content: start; }
:where(.card) ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; color: var(--muted); }
.compare-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.compare { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule); min-width: 12rem; }
.compare thead th { font-family: var(--font-mono); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.compare tr.oil td { background: var(--teal-soft); font-weight: 600; }
.compare tr:last-child td { border-bottom: 0; }
.aside-line { margin-top: 1rem; font-family: var(--font-doc); font-style: italic; color: var(--muted); }

/* Pricing */
.pricing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; } }
.price-card { border: 2px solid var(--teal); }
.price-tag { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); letter-spacing: -0.02em; line-height: 1.1; }
.price-tag small { display: block; margin-top: 0.4rem; font-size: var(--step-0); font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: 1.4; }
.fee-note { background: var(--teal-soft); border-radius: 4px; padding: 0.7rem 0.85rem; font-size: 0.95rem; }
.fee-note b { color: var(--teal); }
.terms { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.terms li { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.4rem; color: var(--ink); }
.terms li::before { content: "+"; font-family: var(--font-mono); color: var(--teal); font-weight: 500; }
.free-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; color: var(--ink); }
.free-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.free-list li:last-child { border-bottom: 0; }
.free-list .mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* Integrity + about */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }
.principle { display: grid; gap: 0.4rem; align-content: start; }
.principle h3 { font-size: 1.05rem; font-weight: 700; }
.principle p { color: var(--muted); font-size: 0.95rem; }
.about { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 2rem; align-items: start; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }
.about .who { font-family: var(--font-display); font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; line-height: 1.55; }
.about .creds { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }
.about p + p { margin-top: 0.9rem; }

/* Closing */
.closing { background: var(--olive); color: #E7EBE2; border-top: 0; }
.closing h2 { color: #F2F5EE; }
.closing .section-head p { color: #B9C0AE; }
.contact { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.contact code { font-family: var(--font-mono); background: #23251A; color: #E7EBE2; border: 1px solid #3B3F2F; padding: 0.6rem 0.8rem; border-radius: var(--radius); user-select: all; font-size: 0.92rem; }
.copy-btn { background: #3CC7B3; color: #0F100A; border: 0; }
.copy-status { font-family: var(--font-mono); font-size: 0.8rem; color: #B9C0AE; min-height: 1.2em; }
.foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid #3B3F2F; display: grid; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.74rem; color: #9DA492; }

@media (prefers-reduced-motion: no-preference) {
  .doc { animation: rise 260ms ease-out; }
  @keyframes rise { from { transform: translateY(6px); } to { transform: none; } }
}

/* Site additions for the static /oil/ pages. Tokens and components come from template.html, which the build places above this file. */
:root { color-scheme: light; }
body { margin: 0; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

/* Case file without scripts: every document shows, one after another, with no controls that would do nothing.
   The head script in shell.html sets html.js, and oil.js sets tabs-ready once it has taken over the panels. If oil.js
   never runs, the head script takes html.js away again when the page has loaded. */
html.js:not(.tabs-ready) .panel + .panel { display: none; }
html:not(.js) .tabs, html:not(.js) .pager button { display: none; }
html:not(.js) .casefile { grid-template-columns: minmax(0, 1fr); }
html:not(.js) .panel + .panel { margin-top: 3rem; }

/* Short laptop windows: the sticky case index scrolls inside itself, so its last entries stay reachable. */
@media (min-width: 901px) { .tabs { max-height: calc(100vh - 72px - env(safe-area-inset-top, 0px) - 1rem); overflow-y: auto; scrollbar-width: thin; } }
/* Both the index and the phone strip clip at their edges, so the focus ring sits inside the tab. */
.tab:focus-visible { outline-offset: -2px; }

.skip { position: absolute; left: 16px; top: -4rem; z-index: 50; background: var(--sheet); color: var(--ink); padding: 0.5rem 0.75rem; border: 1px solid var(--teal); border-radius: var(--radius); }
.skip:focus { top: 0.5rem; }
section[id], .panel { scroll-margin-top: 5rem; }
/* A deep link (case/#panel-w2) focuses the panel; give its focus ring room around the content. */
.panel:focus-visible { outline-offset: 10px; }
.nav a[aria-current="page"] { color: var(--teal); }
.section-head .page-title { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }

/* The single-page demo hides the nav on phones; a multi-page site needs it, so it becomes a scrolling row. */
@media (max-width: 760px) {
  .topbar .wrap { flex-wrap: wrap; row-gap: 0.4rem; }
  .nav { display: flex; width: 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 0.9rem; padding-bottom: 0.2rem; scrollbar-width: none; }
  .nav a { white-space: nowrap; font-size: 0.86rem; }
}

/* "The full case file" is a heading that looks like the other labels. */
.case-index-head .label { font-weight: 400; line-height: 1.55; }

/* Case preview on the offer page. While collapsed, a table box far below the cut stops being a scroll container, so
   it needs no tab stop, and tabbing cannot scroll the opening of the document out of view (site.js). */
.preview.is-collapsed .doc-body { max-height: 30rem; overflow: hidden; position: relative; }
.preview.is-collapsed .table-wrap { overflow: visible; }
.preview.is-collapsed .doc-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7rem; background: linear-gradient(to bottom, transparent, var(--sheet)); pointer-events: none; }
.preview-toggle { margin-top: 0.75rem; }
.case-index { margin-top: 2.25rem; display: grid; gap: 1rem; }
.case-index-head { display: grid; gap: 0.35rem; max-width: 760px; }
.case-index-head p { color: var(--muted); }
.case-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0.6rem; }
.case-links a { display: grid; gap: 0.15rem; height: 100%; padding: 0.75rem 0.9rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.case-links a:hover { border-color: var(--teal); }
.case-links .t-stage { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.case-links .t-name { font-weight: 600; font-size: 0.95rem; }
.case-index .ctas { margin-top: 0.5rem; }

/* Closing contact and footer on the dark band */
.on-dark { color: #E7EBE2; border-color: #3B3F2F; }
.on-dark:hover { color: #3CC7B3; border-color: #3CC7B3; }
.foot a { color: #E7EBE2; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }

/* Brand lockup (OIL/BRAND/OIL_BRAND_BOOK.md, section 1), directly on the olive band: the mark in the on-dark accent and
   the type in light, the same in both themes. The KamaraTech icon never sits on olive, so it alone has a light tile, as
   in the theme footer. The margins keep the mark's height clear above and below. */
.lockup { margin-top: 3rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.lockup-part { display: inline-flex; align-items: center; gap: 0.75rem; }
.lockup-mark { width: 36px; height: 36px; display: block; flex: none; color: #3CC7B3; }
.lockup .brand-name { font-size: 1.3rem; color: #FBFCFA; }
.lockup .brand-sub, .lockup .lockup-by { color: #E7EBE2; }
.lockup-by { font-family: var(--font-mono); font-size: 0.85rem; }
.lockup-tile { display: grid; place-items: center; width: 38px; height: 38px; flex: none; background: #FBFCFA; border: 1px solid #D0D7CE; border-radius: var(--radius); }
.lockup-kt { display: block; width: 28px; height: 28px; }
.lockup-kt-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.005em; }
.lockup .lockup-kt-name { color: #FBFCFA; }
.lockup + .foot { margin-top: 2.25rem; }

/* The way back to the main site, beside the OIL wordmark. */
.by-kt { margin-left: 1rem; margin-right: auto; font-size: 0.86rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.by-kt b { color: var(--ink); font-weight: 600; }
.by-kt:hover b { color: var(--teal); }
@media (max-width: 760px) { .by-kt { margin-left: auto; margin-right: 0; } }
@media (max-width: 380px) {
  .nav { gap: 0.65rem; }
  /* Small phones: brand and "by KamaraTech" stay on one row, so the sticky header stays short. */
  .topbar .wrap { column-gap: 0.5rem; }
  .by-kt { font-size: 0.78rem; }
  .topbar .brand-sub { letter-spacing: 0.02em; }
}
@media (max-width: 340px) {
  .by-word { display: none; }
  .topbar .brand-sub { font-size: 0.62rem; }
}

/* Jumps land clear of the sticky header. */
.casefile { scroll-margin-top: 5rem; }
@media (max-width: 760px) { section[id], .panel, .casefile, [data-collapsible] { scroll-margin-top: 7rem; } }

/* Comfortable tap targets in the footer. */
.foot a { display: inline-block; padding-block: 0.3rem; }
.price-cta { margin-top: 1.25rem; }

/* Sideways-scrolling boxes fade at the right edge while more is hidden (site.js sets is-scrollable). */
.is-scrollable { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); }
/* A mask also cuts off the focus ring, so it comes off while a box has keyboard focus. */
.is-scrollable:focus-visible { -webkit-mask-image: none; mask-image: none; }

@media (max-width: 640px) {
  /* The comparison stacks on phones, so the column that says what OIL delivers is never off-screen. */
  .compare thead { position: absolute; left: -9999px; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; min-width: 0; }
  .compare tr { border-bottom: 1px solid var(--rule); padding: 0.6rem 0; }
  .compare tr:last-child { border-bottom: 0; }
  .compare td { border: 0; padding: 0.25rem 1rem; }
  .compare td:first-child { font-weight: 700; }
  .compare td:nth-child(2)::before { content: "Typical focus: "; color: var(--muted); font-weight: 400; }
  .compare td:nth-child(3)::before { content: "You typically leave with: "; color: var(--muted); font-weight: 400; }
  .compare tr.oil { background: var(--teal-soft); }
  .compare tr.oil td { background: transparent; }
}
@media (max-width: 560px) {
  .journey-note { grid-template-columns: 1fr; gap: 0.4rem; }
  .lockup { flex-direction: column; align-items: flex-start; }
}

/* Paper: every document, in the light palette whatever the screen is set to, with no controls and nothing cut off. */
@media print {
  :root:not([data-theme="print"]) { --paper: #FFFFFF; --sheet: #FFFFFF; --ink: #1B1F17; --muted: #586052; --rule: #D0D7CE; --teal: #0B7266; --teal-soft: #D3ECE6; --stamp: #8A5A12; --clear: #3C7F62; --watch: #A87A12; --escalate: #C0571A; --redzone: #B23A2E; color-scheme: light; }
  body { background: #FFFFFF; }
  .skip, .nav, .by-kt, .tabs, .pager, .contact, .copy-status, .btn { display: none !important; }
  .topbar { position: static; background: none; backdrop-filter: none; }
  :focus-visible { outline: none !important; }
  /* The figure is decoration, drawn in the screen's palette, and it pushed the hero to a second page. */
  .print-figure { display: none; }
  .hero-grid { display: block; }
  .section { padding-block: 1.5rem; }
  .casefile { display: block; }
  .panel[hidden] { display: block !important; }
  .panel + .panel { margin-top: 0; break-before: page; }
  .doc { box-shadow: none; animation: none; }
  /* The posture scale means nothing without its colours, and browsers drop backgrounds on paper by default. */
  .scale span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap, .compare-wrap, .is-scrollable { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .doc-body th, .doc-body td, .compare th, .compare td { min-width: 0; }
  .preview.is-collapsed .doc-body { max-height: none; overflow: visible; }
  .preview.is-collapsed .doc-body::after { display: none; }
  h1, h2, h3, h4, h5, h6, .doc-head { break-after: avoid; }
  tr, .card, .journey, .journey-note, .case-links li, .panel-intro, .evidence, .principle, .areas, .section-head { break-inside: avoid; }
  .section-head, .section-head .label, .journey-group { break-after: avoid; }
  .closing { background: none; color: var(--ink); border-top: 1px solid var(--rule); }
  .closing h2, .closing .section-head p, .closing .label, .foot, .foot a, .lockup .brand-name, .lockup .brand-sub, .lockup .lockup-by, .lockup .lockup-kt-name { color: var(--ink) !important; }
  .foot { border-top-color: var(--rule); }
  .lockup-mark { color: #0B7266; }
}
