:root {
  --steel: #E6EAEE;      /* bench-top grey */
  --plate: #FFFFFF;
  --ink: #14202B;
  --dye: #1B4B8F;        /* layout-dye blue */
  --dye-deep: #123766;
  --mark: #F5B700;       /* paint-marker yellow */
  --rule: #B7C1CB;
  --muted: #51606E;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--steel); color: var(--ink); font: 400 1.0625rem/1.55 var(--body); }
a { color: var(--dye); }
a:focus-visible, select:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; }
h2 { font-size: 1.75rem; margin-bottom: .6rem; }
main, .top, .crumbs, .foot { max-width: 1080px; margin-inline: auto; padding-inline: 20px; }
main > section, article.size > section { margin-top: 2.75rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.45rem var(--display); color: var(--ink); text-decoration: none; }
.brand svg { color: var(--dye); }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.top nav a { color: var(--ink); font-weight: 500; text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover { border-color: var(--mark); }
.crumbs { font-size: .9rem; color: var(--muted); padding-block: 4px 12px; }
.crumbs a { color: var(--muted); }

/* ---- answer block: reads like a blueprint ---- */
.answer, .hero { background: var(--dye); color: #fff; border-radius: 6px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem 2rem; align-items: center; padding: 2rem 2.25rem;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 24px 24px; }
article.size > section.answer { margin-top: 0; }
.answer h1 { font-size: 1.5rem; font-weight: 500; opacity: .9; }
.big { font: 700 clamp(4rem, 13vw, 7.5rem)/.95 var(--display); margin: .35rem 0 .9rem; letter-spacing: -.01em; }
.eq { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0 0 1rem; }
.eq dt { font-size: .85rem; opacity: .8; }
.eq dd { margin: 0; font: 600 1.6rem var(--display); }
.lede { max-width: 46ch; margin: 0; }
.draw { width: 100%; max-width: 340px; justify-self: center; }
.draw .cl { stroke: rgba(255,255,255,.35); stroke-width: 1; stroke-dasharray: 14 4 3 4; }
.draw .major { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 6 5; }
.draw .hole { fill: var(--dye-deep); stroke: var(--mark); stroke-width: 2.5; }
.draw .dim { stroke: var(--mark); stroke-width: 1.5; }
.draw text { font-family: var(--display); fill: #fff; }
.draw .dimt { font-size: 17px; font-weight: 600; fill: var(--mark); }
.draw .majt { font-size: 14px; }

.sub { background: var(--plate); border-left: 6px solid var(--mark); padding: .9rem 1.1rem; margin: 1rem 0 0; border-radius: 0 6px 6px 0; }

.spec { width: 100%; border-collapse: collapse; background: var(--plate); border-radius: 6px; overflow: hidden; }
.spec th, .spec td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--steel); vertical-align: baseline; }
.spec th { font-weight: 500; color: var(--muted); width: 44%; }
.spec td { font-weight: 600; }
.spec small { font-weight: 400; color: var(--muted); font-size: .92rem; margin-left: .4rem; }
article.size p { max-width: 68ch; }

/* ---- drill-index grid: each cell is a stamped hole ---- */
.index { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.cell { background: var(--plate); border: 1px solid var(--rule); border-radius: 4px; padding: .55rem .7rem .6rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; box-shadow: inset 0 -3px 0 var(--steel); }
.cell span { font-size: .82rem; color: var(--muted); }
.cell b { font: 600 1.3rem var(--display); }
.cell:hover { border-color: var(--dye); box-shadow: inset 0 -3px 0 var(--mark); }
.cell.wide { grid-column: span 2; }
.note { color: var(--muted); margin: 0 0 .9rem; }

/* ---- home ---- */
.hero { align-items: stretch; margin-top: .5rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 700; }
.hero .lede { margin: .8rem 0 1.4rem; }
.lookup { display: flex; flex-wrap: wrap; gap: .8rem; }
.lookup label { display: flex; flex-direction: column; font-size: .88rem; gap: .25rem; flex: 1 1 150px; }
.lookup select { font: 500 1.1rem var(--body); padding: .6rem .7rem; border-radius: 4px; border: 0; background: #fff; color: var(--ink); }
.result { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 1rem; margin-top: 1rem; padding: 1rem 1.2rem; background: var(--dye-deep); border: 2px solid var(--mark); border-radius: 6px; color: #fff; text-decoration: none; }
.result span { grid-column: 1 / -1; opacity: .85; }
.result b { font: 700 3.4rem/1 var(--display); color: var(--mark); }
.result em { font-style: normal; text-decoration: underline; align-self: center; }
.result small { grid-column: 1 / -1; font-size: 1rem; margin-top: .3rem; }
.hero-img { border-radius: 4px; overflow: hidden; min-height: 260px; background: var(--dye-deep); display: block; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-img.missing img { display: none; }

.foot { margin-top: 4rem; padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .93rem; }
.foot a { color: var(--muted); margin-right: 1rem; }

@media (max-width: 720px) {
  .answer, .hero { grid-template-columns: 1fr; padding: 1.4rem 1.2rem; }
  .hero-img { min-height: 180px; order: -1; }
  .hero-img.missing { display: none; }
  .spec th { width: 50%; }
}
@media print {
  .top nav, .foot, .crumbs { display: none; }
  body { background: #fff; }
}

/* ---- stage 3: charts, banners, pairs ---- */
.answer.solo { grid-template-columns: 1fr; }
.pair { display: flex; flex-wrap: wrap; gap: .4rem 2.5rem; margin: .35rem 0 .9rem; }
.pair span { font-size: .95rem; opacity: .85; }
.pair .big { font-size: clamp(3rem, 9vw, 5.2rem); margin: 0; }
.pair.small .big { font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.05; }
.banner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 2rem; align-items: center; margin-top: .5rem; }
.banner img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 6px; display: block; }
.banner h1, .chart-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; }
.lede.dark { color: var(--muted); margin-top: .6rem; }
.chart-head { margin-top: .5rem; }
.print { margin-top: 1rem; font: 600 1rem var(--body); background: var(--dye); color: #fff; border: 0; padding: .6rem 1.1rem; border-radius: 4px; cursor: pointer; }
.print:hover { background: var(--dye-deep); }
.wrap { overflow-x: auto; margin-top: 1.5rem; }
.chart { width: 100%; border-collapse: collapse; background: var(--plate); font-size: .97rem; }
.chart caption { position: absolute; left: -9999px; }
.chart th, .chart td { text-align: left; padding: .45rem .75rem; border-bottom: 1px solid var(--steel); white-space: nowrap; }
.chart thead th { background: var(--dye); color: #fff; font-weight: 600; }
.chart tbody tr:nth-child(even) { background: #F4F6F8; }
.chart tbody th { font-weight: 600; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; align-items: start; }
.sp { margin-top: 2rem; }
.big-cells { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 720px) { .banner { grid-template-columns: 1fr; } .banner img { order: -1; max-height: 220px; } }
@media print {
  .print, .banner img { display: none; }
  .chart { font-size: 9.5pt; }
  .chart th, .chart td { padding: 2pt 5pt; white-space: normal; }
  .chart thead th { background: #fff; color: #000; border-bottom: 1.5pt solid #000; }
  .wrap { overflow: visible; }
  a { color: #000; text-decoration: none; }
}

/* ---- stage 4: gear, ads, prose ---- */
.gear { background: var(--plate); border: 1px solid var(--rule); border-radius: 6px; padding: 1.1rem 1.3rem; }
.gear ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem .5rem; }
.gear li a { display: inline-block; padding: .45rem .8rem; border: 1px solid var(--dye); border-radius: 4px; text-decoration: none; font-weight: 500; }
.gear li a:hover { background: var(--dye); color: #fff; }
.gear .disc { font-size: .88rem; color: var(--muted); margin: .8rem 0 0; }
.ad { min-height: 100px; margin-top: 2.5rem; text-align: center; }
.prose h1.plain { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 700; }
.prose h2 { margin-top: 1.8rem; }
@media print { .gear, .ad { display: none; } }
