/* Chainmail Jack. One motif: the ring. Graphite ground, one orange accent, Jost throughout. */
:root {
  --bg: #18191b;
  --surface: #222427;
  --surface-2: #2c2e32;
  --ink: #eff0f1;
  --muted: #a7a9ae;
  --accent: #ff4a1f;
  --accent-ink: #18191b;
  --field: #eff0f1;
  --field-ink: #18191b;
  --field-muted: #4a4c51;
  --gutter: clamp(16px, 3vw, 40px);
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(2.6rem, 1.4rem + 5.6vw, 6.6rem);
  --gap-section: clamp(80px, 11vw, 180px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.55 "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.skip { position: absolute; left: -999px; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1, h2 { text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.95; }
h1 { font-size: var(--step-display); }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.lead { font-size: var(--step-lead); line-height: 1.4; max-width: 34ch; }
.small { font-size: var(--step-small); color: var(--muted); }

.topbar { height: 10px; background: var(--accent); }

/* header */
.site-header {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 48px);
  padding: 18px var(--gutter); background: var(--bg);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.25rem; text-transform: uppercase; letter-spacing: -0.02em; color: var(--ink); }
.wordmark .mark { color: var(--accent); }
.site-header nav { display: flex; gap: clamp(14px, 2.4vw, 36px); margin-left: auto; font-weight: 500; }
.site-header nav a { text-decoration: none; padding: 6px 0; }
.site-header nav a[aria-current] { color: var(--accent); }

/* buttons: the pill is the ring opened out */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1.0625rem/1 "Jost", sans-serif; text-decoration: none; cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.btn:hover { background: var(--ink); color: var(--accent-ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 1rem; }
.btn-quiet { background: var(--surface-2); color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--accent-ink); }

/* hero: one enormous ring, cropped, with the photograph inside it */
.hero { position: relative; overflow: hidden; min-height: min(92svh, 920px); display: grid; align-items: center; padding: clamp(40px, 6vw, 80px) var(--gutter); }
.hero-copy { position: relative; z-index: 1; width: min(52%, 780px); }
.hero h1 { font-size: clamp(2.6rem, 1rem + 4.6vw, 5.6rem); }
.hero .lead { margin-top: clamp(28px, 3vw, 44px); }
.hero .btn { margin-top: 36px; }
.hero-ring {
  position: absolute; right: -14vh; top: 50%; translate: 0 -50%;
  width: min(105vh, 62vw); aspect-ratio: 1; border-radius: 50%;
  border: clamp(40px, 11vh, 110px) solid var(--accent); background: var(--surface); overflow: hidden;
}
.hero-ring img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 40%; filter: grayscale(1) contrast(1.05); }

/* generic sections */
.section { padding: var(--gap-section) var(--gutter) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--gutter); align-items: end; margin-bottom: clamp(36px, 5vw, 72px); }
.section-head p { margin: 0; font-size: var(--step-lead); line-height: 1.4; max-width: 36ch; }
.band { background: var(--field); color: var(--field-ink); margin-top: var(--gap-section); padding: clamp(56px, 8vw, 120px) var(--gutter); }
.band a:hover { color: var(--accent); }
.band .small { color: var(--field-muted); }

/* circle masks: every photograph is cut by the ring */
.disc { border-radius: 50%; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.disc img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }

/* the live thing */
.checker { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 96px); align-items: center; }
.checker .disc { width: 100%; max-width: 640px; }
.calc h2 { margin-bottom: 20px; }
.calc form { display: grid; gap: 18px; margin-top: 28px; }
.calc label { display: grid; gap: 6px; font-weight: 500; }
.calc .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc select, .calc input {
  width: 100%; min-height: 52px; padding: 0 16px; font: 500 1.0625rem "Jost", sans-serif;
  background: var(--ink); color: var(--accent-ink); border: 0; border-radius: 12px;
}
.band .calc select, .band .calc input { background: var(--bg); color: var(--ink); }
.calc output.result { display: block; margin-top: 8px; padding: 22px 24px; background: var(--bg); color: var(--ink); border-radius: 12px; min-height: 8.5rem; }
.band .calc output.result { background: var(--bg); }
.result .ar { font-size: clamp(2.6rem, 6vw, 4.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--accent); }
.result ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.result li { display: flex; justify-content: space-between; gap: 16px; }
.result li b { font-weight: 700; }
.result .ok { color: var(--accent); }
.calc .presets { display: flex; flex-wrap: wrap; gap: 8px; }
.calc .presets button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 500 0.9375rem "Jost", sans-serif; cursor: pointer; }
.band .calc .presets button { background: #d9dadc; color: var(--field-ink); }
.calc .presets button:hover { background: var(--accent); color: var(--accent-ink); }

/* guide list: two columns, a ring where a bullet would be */
.cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: clamp(48px, 6vw, 96px) 0 28px; }
.cat-head:first-of-type { margin-top: 0; }
.cat-head h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem); }
.cat-head span { color: var(--muted); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px clamp(32px, 4vw, 64px); }
.guide-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; align-items: start; }
.guide-list .disc { width: 72px; }
.guide-list a.t { font-weight: 700; font-size: 1.1875rem; line-height: 1.2; text-decoration: none; display: block; }
.guide-list a.t:hover { color: var(--accent); }
.guide-list p { margin: 6px 0 0; color: var(--muted); font-size: 1rem; max-width: 40ch; }

/* accordion of tinted panels */
.stages { display: flex; min-height: 520px; }
.stage { position: relative; flex: 1 1 0; min-width: 76px; padding: 0; margin: 0; border: 0; color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: flex-grow 0.45s ease; overflow: hidden; }
.stage[aria-expanded="true"] { flex: 6 1 0; cursor: default; }
.stage .s-name { position: absolute; left: 24px; bottom: 24px; font-weight: 700; font-size: 1.25rem; writing-mode: vertical-rl; transform: rotate(180deg); transform-origin: center; white-space: nowrap; }
.stage .s-body { display: none; padding: 32px; height: 100%; flex-direction: column; justify-content: space-between; }
.stage[aria-expanded="true"] .s-name { display: none; }
.stage[aria-expanded="true"] .s-body { display: flex; }
.stage .s-body h3 { font-size: 2.5rem; text-transform: uppercase; letter-spacing: -0.03em; }
.stage .s-body p { max-width: 40ch; margin: 0; font-size: 1.125rem; }
.stage:nth-child(1) { background: #0f1011; color: var(--ink); }
.stage:nth-child(2) { background: #303236; color: var(--ink); }
.stage:nth-child(3) { background: #62656b; color: #fff; }
.stage:nth-child(4) { background: #a9acb1; color: #18191b; }
.stage:nth-child(5) { background: #dcdde0; color: #18191b; }

/* faq: index cards */
.faq-cards { display: grid; gap: 0; max-width: 980px; margin-left: auto; margin-right: auto; }
.card { margin-top: -26px; border-radius: 18px 18px 0 0; }
.card:first-child { margin-top: 0; }
.card button { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; width: 100%; text-align: left; padding: 22px 32px 52px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.card button b { font-size: 1.25rem; line-height: 1.25; font-weight: 500; }
.card .tab { font-size: var(--step-small); font-weight: 700; text-transform: none; opacity: 0.9; }
.card .ans { display: none; padding: 0 32px 56px; max-width: 62ch; font-size: 1.0625rem; }
.card.open .ans { display: block; }
.card.open button { padding-bottom: 14px; }
.card:nth-child(3n+1) { background: var(--surface); }
.card:nth-child(3n+2) { background: var(--surface-2); }
.card:nth-child(3n+3) { background: #3a3c41; }

/* footer: the ring row and the name returning at full width */
.site-footer { margin-top: var(--gap-section); background: var(--surface); padding: clamp(48px, 7vw, 100px) var(--gutter) 28px; }
.footer-art { display: grid; gap: 0; }
.footer-rings { width: 100%; height: auto; }
.footer-word { margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.85; font-size: clamp(2.4rem, 11.6vw, 12.4rem); white-space: nowrap; color: var(--ink); }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); margin-top: clamp(40px, 5vw, 72px); }
.footer-cols h2 { font-size: 1.125rem; letter-spacing: 0; text-transform: none; margin-bottom: 14px; color: var(--muted); }
.footer-cols nav { display: grid; align-content: start; gap: 8px; }
.footer-cols a { text-decoration: none; font-size: 1rem; }
.footer-cols a:hover { color: var(--accent); text-decoration: underline; }
.footer-cols p { font-size: 1rem; color: var(--muted); margin: 0; max-width: 34ch; }
.credits { margin: 44px 0 0; font-size: var(--step-small); color: var(--muted); max-width: 72ch; }

/* articles */
.art-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--gutter); align-items: center; padding: clamp(40px, 6vw, 88px) var(--gutter) 0; }
.art-head h1 { font-size: clamp(2.2rem, 1.2rem + 4.2vw, 5rem); max-width: 20ch; }
.art-head .lead { margin-top: 28px; max-width: 40ch; }
.art-head .meta { margin-top: 18px; color: var(--muted); font-size: var(--step-small); }
.art-head .disc { width: min(100%, 440px); justify-self: end; }
.crumbs { font-size: var(--step-small); color: var(--muted); margin-top: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.disclose { margin-top: 20px; padding: 14px 18px; background: var(--surface); border-radius: 12px; font-size: var(--step-small); max-width: 62ch; color: var(--ink); }
.art-grid { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 720px) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); padding: clamp(56px, 7vw, 110px) var(--gutter) 0; align-items: start; }
.toc, .side { position: sticky; top: 24px; font-size: 1rem; }
.toc h2, .side h2 { font-size: 1.125rem; text-transform: none; letter-spacing: 0; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.toc a { text-decoration: none; }
.toc a:hover { color: var(--accent); }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 34ch; }
.side a { text-decoration: none; font-weight: 500; line-height: 1.25; display: block; }
.side a:hover { color: var(--accent); }
.prose { font-size: 1.1875rem; line-height: 1.6; }
.prose h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.6rem); margin: 2.2em 0 0.6em; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.8em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { font-weight: 700; }
.prose code { font-family: inherit; font-weight: 500; background: var(--surface-2); padding: 0 0.3em; border-radius: 4px; }
.note { background: var(--surface); padding: 4px 22px; border-radius: 12px; margin: 1.5em 0; }
.table-scroll { overflow-x: auto; margin: 1.4em 0; }
table { border-collapse: collapse; width: 100%; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; }
tbody tr:nth-child(even) { background: var(--surface); }
tbody th { font-weight: 500; }
.diagram { margin: 2em 0; padding: 20px; background: var(--surface); border-radius: 12px; }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--muted); max-width: 70ch; }
.d-ring { stroke: var(--accent); }
.d-ring.d-alt { stroke: var(--ink); }
.d-wd { fill: var(--ink); } .d-id { fill: var(--accent); }
.d-t { fill: var(--ink); font: 500 15px "Jost", sans-serif; } .d-b { font-weight: 700; font-size: 18px; } .d-s { font-size: 13px; fill: var(--muted); }
.d-bar { fill: var(--accent); }
.d-scale { fill: #62656b; } .d-scale.d-alt2 { fill: #a9acb1; } .d-hole { fill: var(--surface); }
.faq-block { margin-top: 3em; }
.faq-block details { background: var(--surface); border-radius: 12px; margin-bottom: 10px; }
.faq-block summary { cursor: pointer; padding: 18px 22px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 14px; }
.faq-block summary::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 4px solid var(--accent); flex: none; }
.faq-block details[open] summary::before { background: var(--accent); }
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block details p { padding: 0 22px 18px 52px; margin: 0; }

/* hubs */
.page-head { padding: clamp(48px, 7vw, 110px) var(--gutter) 0; display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: var(--gutter); align-items: center; }
.page-head h1 { font-size: clamp(2.4rem, 1.2rem + 5vw, 6rem); max-width: 20ch; }
.page-head .lead { margin-top: 26px; }
.page-head .disc { width: min(100%, 320px); justify-self: end; }
.prose-wide { max-width: 760px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 96px); }
.legal { max-width: 760px; padding: clamp(48px, 7vw, 110px) var(--gutter) 0; margin: 0 auto 0 0; }
.legal h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.4rem); margin-bottom: 36px; }
.legal h2 { font-size: 1.75rem; margin: 1.8em 0 0.5em; }
.nf { padding: clamp(60px, 10vw, 160px) var(--gutter) 0; }

/* ads from the loader stay inside the gutter */
.cmj-ad, .cmj-ad-top, [class*="adslot"] { max-width: 100%; }

/* motion: transform and opacity only */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1); } }
.hero-ring img { animation: drift 24s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-ring img { animation: none; }
  html { scroll-behavior: auto; }
  .stage { transition: none; }
}

@media (max-width: 1100px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); }
  .toc, .side { position: static; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .site-header { flex-wrap: wrap; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .hero { min-height: 0; padding-bottom: 0; }
  .hero-copy { width: 100%; }
  .hero-ring { position: relative; right: auto; top: auto; translate: none; width: 118vw; margin: 40px 0 -30vw -9vw; border-width: 9vw; }
  .section-head, .checker, .art-head, .page-head, .cols-2, .guide-list { grid-template-columns: minmax(0, 1fr); }
  .art-head .disc, .page-head .disc { justify-self: start; width: min(70%, 280px); order: -1; }
  .stages { flex-direction: column; min-height: 0; }
  .stage { flex: none; min-height: 64px; width: 100%; }
  .stage[aria-expanded="true"] { flex: none; }
  .stage .s-name { position: static; writing-mode: horizontal-tb; transform: none; padding: 20px 24px; display: block; }
  .stage .s-body { padding: 24px; gap: 14px; }
  .stage .s-body h3 { font-size: 1.75rem; }
  .card button { padding: 18px 20px 44px; }
  .card .ans { padding: 0 20px 48px; }
  .footer-cols { grid-template-columns: minmax(0, 1fr); }
}

/* fixes after first inspection */
.band .result .small, .result .small { color: var(--muted); }
.hero { grid-template-columns: minmax(0, 1fr); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.trio figure { margin: 0; }
.trio .disc { width: 100%; }
.trio figcaption { margin-top: 20px; max-width: 34ch; }
.trio figcaption b { display: block; font-size: var(--step-lead); line-height: 1.15; margin-bottom: 6px; }
.trio figcaption span { color: var(--muted); display: block; margin-bottom: 8px; font-size: var(--step-small); }
@media (max-width: 820px) { .trio { grid-template-columns: minmax(0, 1fr); } }
