/* ==========================================================================
   Varshal Nirbhavane — Case File
   Palette: Ink #14181F · Paper #F7F6F3 · Brief Blue #1D3A5F · Signal Red #A3242A
            Slate #5A6270 · Rule #C9C7C1
   Type: IBM Plex Serif (display) / IBM Plex Sans (body) / IBM Plex Mono (data)
   ========================================================================== */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-serif-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-serif-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #14181F;
  --paper: #F7F6F3;
  --blue: #1D3A5F;
  --red: #A3242A;
  --slate: #5A6270;
  --rule: #C9C7C1;
  --panel: #FFFFFF;
  --serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
  --container: 1080px;
  --measure: 72ch;
}

/* --- Reset (minimal) --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; height: auto; }
table { border-collapse: collapse; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.65;
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); margin-bottom: 0.9rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.55rem; }
h4 { font-family: var(--sans); font-weight: 600; font-size: 1.02rem; margin-bottom: 0.4rem; }
p { margin-bottom: 1.05rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
strong { font-weight: 600; }
ul, ol { padding-left: 1.35rem; margin-bottom: 1.05rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--slate); }

.lede { font-family: var(--serif); font-weight: 400; font-size: 1.28rem; line-height: 1.55; color: var(--ink); }
.prose { max-width: var(--measure); }
.muted { color: var(--slate); }
.small { font-size: 0.92rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 0.85rem;
}
.source {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--slate);
  margin-top: 0.5rem;
}
.source a { color: var(--slate); }

/* --- Layout --- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 2.2rem; max-width: var(--measure); }

/* --- Skip link + focus --- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 18px;
  font-family: var(--mono); font-size: 0.85rem; z-index: 100;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 1px; }

/* --- Header --- */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-block: 1rem;
}
.brand { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.brand-tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--slate); }
.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.4vw, 1.6rem); flex-wrap: wrap; }
.site-nav a:not(.btn) {
  font-size: 0.92rem; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 1px;
}
.site-nav a:not(.btn):hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); font-weight: 500; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1.2;
  padding: 0.78rem 1.35rem;
  border: none;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #841B20; color: #fff; }
.btn-quiet {
  display: inline-block;
  font-size: 0.98rem; font-weight: 500; color: var(--blue);
  text-decoration: none; border-bottom: 1.5px solid var(--blue); padding-bottom: 2px;
}
.btn-quiet:hover { color: var(--ink); border-bottom-color: var(--ink); }
.cta-row { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* --- A/B variant switching (assignment set on <html> by inline head script) --- */
[data-variant="A"] .v-b { display: none !important; }
[data-variant="B"] .v-a { display: none !important; }
html:not([data-variant]) .v-b { display: none !important; } /* no-JS fallback: show A */

/* --- Hero --- */
.hero { padding-block: clamp(3rem, 8vw, 6rem); }
.hero h1 { max-width: 21ch; margin-bottom: 1.3rem; }
.hero .lede { max-width: 56ch; }

/* --- Stat rows --- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.6rem 2.2rem;
  margin-block: 2rem;
}
.stat b { display: block; font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; }
.stat span { display: block; font-size: 0.92rem; color: var(--ink); margin-top: 0.3rem; }

/* --- Exhibit cards --- */
.exhibit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem; }
.exhibit {
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 1.7rem 1.7rem 1.5rem;
  display: flex; flex-direction: column;
}
.exhibit .eyebrow { margin-bottom: 0.7rem; }
.exhibit h3 { font-size: 1.22rem; line-height: 1.3; }
.exhibit h3 a { color: var(--ink); text-decoration: none; }
.exhibit h3 a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.exhibit-sub { font-size: 0.92rem; color: var(--slate); margin: 0.5rem 0 1.1rem; }
.exhibit table { width: 100%; font-size: 0.9rem; margin-bottom: 1rem; }
.exhibit td { padding: 0.42rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.exhibit td:last-child { text-align: right; font-family: var(--mono); font-size: 0.84rem; white-space: nowrap; }
.exhibit tr:last-child td { border-bottom: none; }
.exhibit-link { margin-top: auto; font-size: 0.94rem; font-weight: 500; }

/* --- Results tables --- */
.results { width: 100%; margin-block: 1.6rem; background: var(--panel); border: 1px solid var(--rule); }
.results caption {
  text-align: left; font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate);
  padding: 0.7rem 1rem; border: 1px solid var(--rule); border-bottom: none; background: var(--panel);
}
.results th {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--slate);
  text-align: left; padding: 0.7rem 1rem; border-bottom: 2px solid var(--ink);
}
.results td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); font-size: 0.95rem; vertical-align: top; }
.results tr:last-child td { border-bottom: none; }
/* nowrap is right for actual figures; .num-wrap keeps the mono face for short
   labels that are really prose and must be allowed to break. */
.results td.num { font-family: var(--mono); font-size: 0.88rem; white-space: nowrap; }
.results td.num-wrap { font-family: var(--mono); font-size: 0.88rem; white-space: normal; }
.results td, .results th { overflow-wrap: break-word; }
.table-scroll { overflow-x: auto; }

/* Narrow viewports: multi-column tables become one card per row rather than a
   horizontal scroller. Each cell carries its column name in data-label; the
   real <thead> stays in the DOM for screen readers and for copy-paste. */
@media (max-width: 760px) {
  .results.stack { border: none; background: none; }
  .results.stack caption { border: 1px solid var(--rule); margin-bottom: 0.9rem; }
  .results.stack thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .results.stack tbody, .results.stack tr, .results.stack td { display: block; }
  .results.stack tr {
    background: var(--panel); border: 1px solid var(--rule);
    margin-bottom: 0.9rem;
  }
  .results.stack tr:last-child { margin-bottom: 0; }
  .results.stack td { border-bottom: 1px solid var(--rule); padding: 0.7rem 1rem; }
  .results.stack td:last-child { border-bottom: none; }
  .results.stack td[data-label]::before {
    content: attr(data-label);
    display: block; margin-bottom: 0.28rem;
    font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
    letter-spacing: 0.09em; text-transform: uppercase; color: var(--slate);
  }
  /* figures keep the mono face but must be free to wrap once stacked */
  .results.stack td.num { white-space: normal; }
}

/* --- Phase blocks (90-day plan: numbering is earned here) --- */
.phase { border-top: 2px solid var(--ink); padding-top: 1.6rem; margin-top: 3rem; }
.phase-num {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--red);
  display: block; margin-bottom: 0.6rem;
}

/* --- Callouts --- */
.hypothesis {
  border-left: 3px solid var(--blue);
  background: var(--panel);
  border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 1.1rem 1.3rem;
  margin-block: 1.4rem;
  max-width: var(--measure);
}
.hypothesis .eyebrow { color: var(--blue); margin-bottom: 0.4rem; }
.hypothesis p { font-size: 0.97rem; }
.flag {
  border-left: 3px solid var(--red);
  background: var(--panel);
  border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 1.1rem 1.3rem;
  margin-block: 1.4rem;
  max-width: var(--measure);
}
.flag .eyebrow { color: var(--red); margin-bottom: 0.4rem; }
.flag p { font-size: 0.97rem; }

/* --- Definition/FAQ list --- */
.faq { max-width: var(--measure); }
.faq h3 { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; margin-top: 1.8rem; }
.faq p { font-size: 0.99rem; }

/* --- Footer (signature block) --- */
.site-foot { border-top: 2px solid var(--ink); margin-top: clamp(3rem, 7vw, 5rem); background: var(--paper); }
.site-foot .container { padding-block: 2.4rem; }
.foot-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.foot-id .name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.foot-id p { font-size: 0.92rem; color: var(--slate); margin: 0.25rem 0 0; }
.foot-links { display: flex; flex-direction: column; gap: 0.4rem; }
.foot-links a { font-size: 0.92rem; }
.foot-note {
  font-family: var(--mono); font-size: 0.72rem; color: var(--slate);
  border-top: 1px solid var(--rule); margin-top: 1.8rem; padding-top: 1.1rem;
  line-height: 1.7;
}

/* --- Scroll reveal (metrics only; motion is minimal and purposeful).
       Gated on [data-variant] (set by inline JS) so content never hides without JS. --- */
html[data-variant] .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
html[data-variant] .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html[data-variant] .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Breadcrumb --- */
.crumbs { font-family: var(--mono); font-size: 0.75rem; color: var(--slate); padding-top: 1.4rem; }
.crumbs a { color: var(--slate); }
.crumbs span[aria-hidden] { padding-inline: 0.4rem; }

/* --- Utility --- */
.divider-label {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--slate); margin-block: 2.4rem 1.4rem;
}
.divider-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

@media (max-width: 640px) {
  .site-head .container { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .site-nav { gap: 0.85rem; }
  .site-nav a:not(.btn) { font-size: 0.88rem; }
  .btn { padding: 0.7rem 1.1rem; font-size: 0.93rem; }
  .stat b { font-size: 1.7rem; }
}
