/* labs.square8.studio
   Values taken from square8.studio: pure black ground, #f6f4f2 off-white,
   Archivo 800 at -5.5% tracking, JetBrains Mono for labels at 0.3em,
   hairline #232326 rules, 3px radii. No colour, no shadows, no serif. */

:root {
  --black:  #000000;
  --l1:     #050506;
  --l2:     #08080a;
  --l3:     #0d0d0f;
  --l4:     #171719;
  --line:   #232326;
  --line-2: #333337;
  --paper:  #f6f4f2;
  --dim:    #8a8a90;   /* 6.1:1 on black — body and secondary copy */
  /* The parent site sets its section numbers in #5c5c60, which measures
     3.15:1 and fails AA for anything you are meant to read. Lifted to the
     nearest tone that passes (4.5:1); the difference is barely visible and
     the labels stay legible. */
  --muted:  #74747a;
  --hair:   #5c5c60;   /* decorative only — never used for text */

  /* the ring stack, light at the rim to dark at the pupil */
  --r1: #d9d9d6; --r2: #b6b6b3; --r3: #959593; --r4: #757574;
  --r5: #565657; --r6: #484849;

  --sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --pad:  clamp(20px, 5vw, 76px);
  --maxw: 1180px;
  --r: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }
body {
  margin: 0; background: var(--black); color: var(--paper);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
svg { display: block; }
::selection { background: var(--paper); color: var(--black); }

.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; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 62px; z-index: 90; background: var(--paper);
  color: var(--black); padding: 10px 16px; border-radius: var(--r); }

/* ---- type ------------------------------------------------------------- */

.giant, .big, h2.sec {
  font-family: var(--sans); font-weight: 800;
  letter-spacing: -0.055em; margin: 0; text-wrap: balance;
}
.giant { font-size: clamp(40px, 9.2vw, 132px); line-height: 0.88; }
.big   { font-size: clamp(30px, 5.6vw, 84px);  line-height: 0.92; }
h2.sec { font-size: clamp(26px, 4vw, 56px);    line-height: 0.95; margin-bottom: 18px; }
h3 { font-family: var(--sans); font-weight: 700; font-size: clamp(16px, 1.6vw, 20px);
  letter-spacing: -0.03em; line-height: 1.2; margin: 0 0 9px; }
h4 { font-family: var(--sans); font-weight: 700; font-size: 13px;
  letter-spacing: -0.02em; margin: 0 0 7px; }

.lede { font-size: clamp(16px, 1.8vw, 22px); line-height: 1.42;
  letter-spacing: -0.015em; color: var(--dim); max-width: 58ch; }
.lede b, .lede em { color: var(--paper); font-weight: 500; font-style: normal; }
.body { font-size: 15px; line-height: 1.6; color: var(--dim); max-width: 66ch; }
.fine { font-size: 12.5px; line-height: 1.6; color: var(--muted); max-width: 70ch; }

/* mono labels, exactly as the parent site sets them */
.num, .label, .chip, .stat .k, .field > label, .seg button, .ghost, .btn {
  font-family: var(--mono); font-weight: 400;
  font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase;
}
.num { color: var(--muted); display: block; margin-bottom: 20px; }
.label { color: var(--muted); }

/* ---- chrome ----------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px var(--pad);
  background: rgba(0,0,0,0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px;
  font-weight: 700; font-size: 13px; letter-spacing: -0.03em; }
.brand .ring { width: 20px; height: 20px; flex: none; }
.brand span.sub { font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
  margin-left: 4px; }
.navlinks { display: flex; gap: 2px; }
.navlinks a {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted);
  padding: 7px 13px; border-radius: 999px; border: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.navlinks a:hover { color: var(--paper); }
.navlinks a[aria-current="page"] { color: var(--paper); border-color: var(--line-2); }
@media (max-width: 640px) { .brand span.sub { display: none; } }

/* ---- layout ----------------------------------------------------------- */

section, header.hero, footer { position: relative; }
.hero { padding: clamp(60px, 13vh, 150px) var(--pad) clamp(48px, 9vh, 100px); }
.band { padding: clamp(56px, 10vh, 116px) var(--pad); border-top: 1px solid var(--line); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.wrap.wide { max-width: 1360px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: clamp(26px,5vh,48px) 0; }

.head { margin-bottom: clamp(30px, 5vh, 56px); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: clamp(18px, 3vw, 40px); }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; }
.cols3 > div { background: var(--black); padding: clamp(18px,2.6vw,26px); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- the ring mark ---------------------------------------------------- */

.ringwrap { display: flex; justify-content: center; align-items: center; }
.ring circle { transform-origin: center; }

/* hero ring sits behind, very large, very quiet */
.hero-ring { position: absolute; right: -14%; top: 50%;
  transform: translateY(-50%); width: min(640px, 58vw);
  opacity: .5; pointer-events: none; z-index: 0; }
.hero .wrap { position: relative; z-index: 1; }
@media (max-width: 860px) { .hero-ring { right: -34%; opacity: .28; } }

/* ---- forms ------------------------------------------------------------ */

.field { margin-bottom: 20px; }
.field > label { display: block; color: var(--muted); margin-bottom: 8px; }
.field .help { font-size: 14px; color: var(--dim); margin: 0 0 9px; line-height: 1.5; }
input[type=text], input[type=email], input[type=number], input[type=url],
textarea, select {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--paper);
  background: var(--l2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; line-height: 1.45; transition: border-color .2s, background .2s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--paper); background: var(--l3);
}
select { appearance: none; }
::placeholder { color: #4a4a4e; }

.hero-search textarea {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(20px, 3vw, 40px); line-height: 1.12; letter-spacing: -0.05em;
  min-height: 130px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 2px 16px;
}
.hero-search textarea:focus { background: transparent; border-bottom-color: var(--paper); }

.btn, .ghost {
  cursor: pointer; border-radius: 999px; transition: background .2s, color .2s, border-color .2s;
}
.btn { border: 1px solid var(--paper); background: var(--paper); color: var(--black);
  padding: 13px 26px; }
.btn:hover { background: transparent; color: var(--paper); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--dim);
  padding: 9px 17px; }
.ghost:hover { color: var(--black); background: var(--paper); border-color: var(--paper); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); border: 0;
  padding: 10px 17px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--black); }

/* ---- cards, lists ----------------------------------------------------- */

.card { border: 1px solid var(--line); border-radius: var(--r);
  background: var(--l2); padding: clamp(18px,3vw,28px); }
.card + .card { margin-top: 12px; }

.listing { display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { background: var(--black); padding: clamp(18px,2.6vw,26px);
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: clamp(14px,2.6vw,30px); align-items: start;
  transition: background .22s; }
.item:hover { background: var(--l3); }
.item .votes { text-align: center; }
.item .votes .n { font-family: var(--sans); font-weight: 800; font-size: 24px;
  letter-spacing: -0.05em; line-height: 1; display: block; }
.item .votes button { margin-top: 7px; width: 100%; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); padding: 4px 0; font-family: var(--mono);
  font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; }
.item .votes button:hover { color: var(--black); background: var(--paper); border-color: var(--paper); }
.item h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 11px;
  align-items: center; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.item .price { text-align: right; font-family: var(--mono); font-size: 12.5px;
  white-space: nowrap; letter-spacing: 0.02em; }
.item .price small { display: block; color: var(--muted); font-size: 9.5px;
  letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 5px; }
@media (max-width: 720px) {
  .item { grid-template-columns: 48px 1fr; }
  .item .price { grid-column: 2; text-align: left; margin-top: 12px; }
}

.chip { display: inline-block; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); font-size: 9px;
  letter-spacing: 0.18em; }
.chip.on { color: var(--paper); border-color: var(--paper); }

.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.stat { background: var(--black); padding: 18px 20px; }
.stat .k { display: block; color: var(--muted); margin-bottom: 7px; }
.stat .v { font-family: var(--sans); font-weight: 800; font-size: 27px;
  letter-spacing: -0.05em; }

.bar { height: 1px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--paper); width: 0; }

/* the split reads as a single hairline strip, divided */
.split-bar { display: flex; height: 40px; border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.split-bar span { display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em;
  border-right: 1px solid var(--line); }
.split-bar span:last-child { border-right: 0; }
.split-bar .b0 { background: var(--paper); color: var(--black); }
.split-bar .b1 { background: var(--r3); color: var(--black); }
.split-bar .b2 { background: var(--r5); color: var(--paper); }
.split-bar .b3 { background: var(--l4); color: var(--dim); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12px; }
thead th { background: var(--l2); color: var(--muted); text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  font-weight: 400; font-size: 9.5px; letter-spacing: 0.24em; text-transform: uppercase; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--l2); }
th.num, td.num { text-align: right; }
td .num { display: inline; margin: 0; }

/* steps — hairline separated, mono index */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; display: grid;
  grid-template-columns: 62px 1fr; gap: clamp(14px,3vw,36px);
  padding: clamp(18px,2.6vh,26px) 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s,decimal-leading-zero);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.3em;
  color: var(--muted); padding-top: 5px; }
.steps p { font-size: 15px; line-height: 1.55; color: var(--dim); margin: 0; }

.notice { border-left: 1px solid var(--line-2); padding: 2px 0 2px 20px; }
.msg { padding: 12px 16px; border-radius: var(--r); font-size: 13px;
  border: 1px solid var(--line-2); font-family: var(--mono); letter-spacing: 0.04em; }
.msg.ok { border-color: var(--paper); color: var(--paper); }
.msg.err { border-color: var(--r3); color: var(--r1); }
.empty, .loading { padding: 30px; color: var(--muted); font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; text-align: center; }

/* footer */
footer { padding: clamp(52px,9vh,104px) var(--pad) clamp(36px,6vh,64px);
  border-top: 1px solid var(--line); }
.footmark { font-family: var(--sans); font-weight: 800;
  font-size: clamp(44px,12vw,150px); letter-spacing: -0.07em; line-height: 0.82;
  margin: 0 0 26px; }
footer p { font-size: 13px; color: var(--dim); }
footer .fine { color: var(--muted); }

/* ---- motion ----------------------------------------------------------- */
/* Nothing here hides anything.
   An earlier pass hid [data-anim] and the ring circles in CSS and left it to
   anime.js to reveal them, which meant a blocked CDN, a strict CSP or a
   suspended rAF rendered the page blank. The pre-animation state is now set
   from JavaScript, after the library has actually loaded, so the worst case
   is a page that does not animate rather than a page that is not there. */
[data-anim] { will-change: transform, opacity; }
.split-bar span { transform-origin: left; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
