/* The Nanovor Field Guide: a night-shift lab's specimen catalogue. Graph paper, specimen slides with a scope
   viewport, typewritten labels, factions as inked stamps. */
:root {
  --paper: #0f1312; --grid: #161c1a; --grid-strong: #1d2522; --card: #151a19; --deep: #090b0b; --raise: #1b2220;
  --ink: #e4e8e2; --ink-2: #a3aca6; --dim: #78827c; --line: #3a4541;
  --scope: #050707; --mark: #f0b43c;
  --magnamod: #6b95ff; --velocitron: #ff6b4f; --hexite: #62c46f;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif; --mono: "Space Mono", ui-monospace, Menlo, monospace; --body: "Work Sans", system-ui, sans-serif;
}
* { box-sizing: border-box }
html { color-scheme: dark; -webkit-text-size-adjust: 100% }
body {
  margin: 0; color: var(--ink); font: 16px/1.5 var(--body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-strong) 1px, transparent 1px), linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 16px 16px, 16px 16px, 80px 80px, 80px 80px;
}
a { color: inherit }
h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: .01em }
button, input, select { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px }
[hidden] { display: none !important }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.muted { color: var(--dim) }

/* Header: the catalogue's title strip */
.top { background: var(--deep); color: var(--ink); border-bottom: 2px solid var(--line) }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none }
.brand b { font-family: var(--display); font-size: 30px; font-weight: 900; letter-spacing: .04em; line-height: 1 }
.brand small { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim) }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap }
.nav a { text-decoration: none; padding: 8px 12px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2) }
.nav a:hover { color: var(--ink) }
.nav a[aria-current="page"] { color: var(--deep); background: var(--mark) }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 70px }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2) }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 2px solid var(--line); background: var(--card); font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; text-decoration: none }
.btn:hover { border-color: var(--ink) }
.btn.primary { background: var(--mark); border-color: var(--mark); color: var(--deep) }
.btn.primary:hover { background: var(--ink); border-color: var(--ink) }
.btn:disabled { opacity: .45; cursor: default }
.field { min-height: 46px; width: 100%; padding: 0 12px; border: 2px solid var(--line); background: var(--card); font-family: var(--mono); font-size: 14px; border-radius: 0 }

/* Faction as an inked stamp */
.stamp { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fc); border: 2px solid var(--fc); padding: 1px 7px; transform: rotate(-4deg) }
.f-magnamod { --fc: var(--magnamod) } .f-velocitron { --fc: var(--velocitron) } .f-hexite { --fc: var(--hexite) }

/* The catalogue */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: end; border-bottom: 3px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px }
.hero > * { min-width: 0 }
.hero h1 { font-size: clamp(44px, 7vw, 88px); line-height: .9 }
.hero p { margin: 0; font-family: var(--mono); font-size: 13px; text-align: right; color: var(--ink-2) }
.tools { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px }
.tools label { min-width: 0 }
.chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px }
.chip { min-height: 38px; padding: 0 12px; border: 2px dashed var(--line); background: transparent; cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fc, var(--ink)) }
.chip[aria-pressed="true"] { border-style: solid; border-color: var(--fc, var(--ink)); background: var(--raise) }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 18px }
/* A specimen slide: number, scope viewport, label */
.slide { position: relative; display: flex; flex-direction: column; min-width: 0; text-decoration: none; background: var(--card); border: 2px solid var(--line) }
.slide:hover { border-color: var(--fc, var(--ink)); --crop: var(--fc, var(--ink)) }
/* Crop marks just outside the corners, like a slide lined up under the scope */
.slide::before, .bench::before { content: ""; position: absolute; inset: -7px; pointer-events: none; --c: var(--crop, var(--line));
  background:
    linear-gradient(var(--c), var(--c)) left top / 12px 2px, linear-gradient(var(--c), var(--c)) left top / 2px 12px,
    linear-gradient(var(--c), var(--c)) right top / 12px 2px, linear-gradient(var(--c), var(--c)) right top / 2px 12px,
    linear-gradient(var(--c), var(--c)) left bottom / 12px 2px, linear-gradient(var(--c), var(--c)) left bottom / 2px 12px,
    linear-gradient(var(--c), var(--c)) right bottom / 12px 2px, linear-gradient(var(--c), var(--c)) right bottom / 2px 12px;
  background-repeat: no-repeat }
.slide .no { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--grid-strong); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-2) }
.slide .view { padding: 14px 14px 10px; display: flex; justify-content: center }
.scope { position: relative; width: 100%; max-width: 200px; aspect-ratio: 1; border-radius: 50%; background: var(--scope); border: 3px solid var(--line); box-shadow: inset 0 0 0 6px var(--card), inset 0 0 0 7px var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center }
.scope canvas { max-width: 82%; max-height: 66%; image-rendering: pixelated; position: relative }
.scope img { width: auto; height: auto; max-width: 82%; max-height: 66%; image-rendering: pixelated; position: relative }
.scope::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(140,200,190,.2), rgba(140,200,190,.2)) 50% 0 / 1px 100% no-repeat, linear-gradient(rgba(140,200,190,.2), rgba(140,200,190,.2)) 0 50% / 100% 1px no-repeat }
.scope::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1px dashed rgba(140,200,190,.35); pointer-events: none }
.slide .label { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; border-top: 2px solid var(--line) }
.slide .name { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere }
.slide .row { display: flex; justify-content: space-between; align-items: center; gap: 8px }
.ver { font-family: var(--mono); font-size: 12px; font-weight: 700 }
.sv { font-family: var(--mono); font-size: 12px; color: var(--ink-2) }
/* Readouts: a ruler with the reading filled in */
.readouts { display: grid; grid-template-columns: 34px 1fr 30px; gap: 4px 8px; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--ink-2) }
.ruler { height: 9px; border: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 9%, var(--grid-strong) 9% 10%); position: relative }
.ruler i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fc, var(--ink)) }
.empty { padding: 40px; text-align: center; border: 2px dashed var(--line); background: var(--card); font-family: var(--mono) }

/* One specimen */
.crumbs { margin-bottom: 12px; font-family: var(--mono); font-size: 13px }
.crumbs a { text-decoration: none; border-bottom: 1px solid currentColor }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 20px }
.head h1 { font-size: clamp(42px, 7vw, 84px); line-height: .9; overflow-wrap: anywhere }
.head .stamp { font-size: 13px; margin-bottom: 8px }
.layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start }
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0 }
.panel { background: var(--card); border: 2px solid var(--line); padding: 16px 18px; margin-top: 20px }
.side .panel { margin-top: 0 }
.panel h2 { font-size: 24px; border-bottom: 1px solid var(--grid-strong); padding-bottom: 6px; margin-bottom: 12px }
.bench { position: relative; background: var(--card); border: 2px solid var(--line); padding: 18px; --crop: var(--fc, var(--line)) }
.bench .scope { max-width: 520px; margin: 0 auto; border-width: 4px }
.bench .scope canvas { width: 90%; height: auto; image-rendering: auto }
.bench .scope.pixel canvas { image-rendering: pixelated }
.readline { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-top: 12px; border-top: 1px dashed var(--grid-strong); padding-top: 10px }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px }
.controls .field { width: auto; min-height: 42px }
.seg { display: inline-flex; border: 2px solid var(--line) }
.seg button { min-height: 38px; padding: 0 12px; border: 0; border-right: 2px solid var(--line); background: var(--card); cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase }
.seg button:last-child { border-right: 0 }
.seg button[aria-pressed="true"] { background: var(--mark); color: var(--deep) }
.seg button:disabled { opacity: .4; cursor: default }
.groups { display: flex; flex-direction: column; gap: 14px }
.group .kicker { margin-bottom: 6px }
.slots { display: flex; flex-wrap: wrap; gap: 6px }
.slot { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--raise); cursor: pointer; font-family: var(--mono); font-size: 12px }
.slot:hover { border-color: var(--ink-2) }
.slot[aria-current="true"] { background: var(--mark); color: var(--deep); border-color: var(--mark) }
.stats { display: grid; grid-template-columns: 44px 1fr 40px; gap: 10px; align-items: center; font-family: var(--mono); font-size: 13px }
.stats .ruler { height: 13px }
.attack { border-top: 1px dashed var(--grid-strong); padding: 12px 0 }
.attack:first-child { border-top: 0; padding-top: 0 }
.attack:last-child { padding-bottom: 0 }
.attack .t { display: flex; justify-content: space-between; align-items: baseline; gap: 10px }
.attack b { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase }
.attack p { margin: 0; color: var(--ink-2) }
.energy { display: inline-flex; gap: 3px; white-space: nowrap }
.energy i { width: 8px; height: 14px; background: var(--fc, var(--ink)) }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 }
.tag { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); background: var(--raise); color: var(--ink-2) }
.versions { display: flex; flex-wrap: wrap; gap: 8px }
.versions a { text-decoration: none; font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 6px 9px; border: 2px solid var(--line); background: var(--raise) }
.versions a[aria-current="page"] { background: var(--mark); border-color: var(--mark); color: var(--deep) }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap }

.foot { background: var(--deep); color: var(--dim); border-top: 2px solid var(--line) }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 12px }
.foot .shield { line-height: 0 }
.foot .shield img { height: 36px; width: auto }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .tools .search { grid-column: 1 / -1 }
}
@media (max-width: 560px) {
  .wrap { padding: 18px 14px 50px }
  .top-in { padding: 10px 14px }
  .nav { margin-left: -12px }
  .hero { grid-template-columns: 1fr }
  .hero p { text-align: left }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
  .slide .view { padding: 10px 10px 8px }
  .slide .name { font-size: 20px }
  .slide .no span:last-child { display: none }
  .readouts { display: none }
  .bench { padding: 12px }
  .panel { padding: 14px }
}
