/* chadwicklabs.com: index of works, v2. Dark first, light on request. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/big-shoulders-display-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("fonts/silkscreen.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #05060b;
  --bg-2: #0c0e1a;
  --fg: #eef0f7;
  --fg-2: #a9aec6;
  --line: #22263c;
  --line-strong: #6a7096;
  --blue: #1b26f2;        /* fills; white text on it is 7.7:1 */
  --blue-ink: #ffffff;
  --link: #9aa3ff;        /* text-safe blue on --bg */
  --live: #5dff9a;
  --dev: #ffc857;
  --dot: rgba(154, 163, 255, 0.16);
  --focus: #9aa3ff;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --px: "Silkscreen", "JetBrains Mono", ui-monospace, monospace;

  --wrap: 80rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f2ee;
  --bg-2: #e6e6df;
  --fg: #0a0b18;
  --fg-2: #444860;
  --line: #c9cad6;
  --line-strong: #6b6f88;
  --blue: #1414e0;
  --blue-ink: #ffffff;
  --link: #1212c8;
  --live: #07743a;
  --dev: #8a5600;
  --dot: rgba(20, 20, 224, 0.13);
  --focus: #1212c8;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.55 var(--sans);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
body::before {
  /* faint dot grid, the page's paper texture */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 6px 6px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 70vh);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 70vh);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--link); color: var(--bg); }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.px { font-family: var(--px); font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }

.skip {
  position: absolute; left: 1rem; top: 0.75rem; z-index: 10;
  background: var(--blue); color: var(--blue-ink); padding: 0.6rem 0.9rem;
  font: 600 0.9rem var(--mono); text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* top bar */
.bar { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bar__row { display: flex; align-items: center; gap: 1rem 1.5rem; min-height: 3.5rem; flex-wrap: wrap; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.mark { color: var(--fg); text-decoration: none; font-size: 0.95rem; }
.mark span { color: var(--link); }
.bar__nav { display: flex; gap: 1.25rem; margin-left: auto; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.bar__nav a { color: var(--fg-2); text-decoration: none; padding: 0.35rem 0; }
.bar__nav a:hover { color: var(--fg); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--fg-2);
  border: 1px solid var(--line-strong); border-radius: 0;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0.65rem; cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--fg); }
.theme-toggle__box { width: 0.8rem; height: 0.8rem; border: 1px solid currentColor; }
@media (max-width: 30rem) {
  .theme-toggle { padding: 0.55rem; }
  .theme-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bar__row { gap: 0.6rem 0.75rem; }
  .bar__nav { gap: 0.7rem; font-size: 0.7rem; letter-spacing: 0.04em; }
  .mark { font-size: 0.8rem; }
}
.theme-toggle[aria-pressed="true"] .theme-toggle__box { background: currentColor; }

/* hero */
.hero { padding-top: clamp(2.5rem, 7vw, 5.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.kicker { font-size: 0.8rem; color: var(--link); display: flex; align-items: center; gap: 0.5rem; }
.kicker::before { content: ""; width: 0.6rem; height: 0.6rem; background: currentColor; }
.cursor { display: inline-block; width: 0.55em; height: 1.05em; background: currentColor; margin-left: 0.15rem; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__name {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(4.2rem, 24vw, 16.5rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  margin-top: 1.25rem;
}
.hero__name span { display: block; }
.hero__name span + span { color: transparent; -webkit-text-stroke: 2px var(--fg); }
@supports not (-webkit-text-stroke: 2px #000) { .hero__name span + span { color: var(--fg); } }

.hero__foot { display: grid; gap: 1.5rem; margin-top: clamp(1.75rem, 4vw, 3rem); align-items: end; }
@media (min-width: 60rem) { .hero__foot { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.hero__line { font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.35; max-width: 36ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (min-width: 60rem) { .hero__cta { justify-content: flex-end; } }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 2.9rem; padding: 0.7rem 1.1rem;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: var(--fg);
  border: 1px solid var(--line-strong);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--fg); }
.btn--fill { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.btn--fill:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.readout {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}

@media (min-width: 48rem) { .readout { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.readout div { padding: 0.9rem clamp(0.6rem, 2vw, 1rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.readout dt { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); }
.readout dd { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.05; margin-top: 0.3rem; text-transform: uppercase; overflow-wrap: anywhere; }

/* blue slab with ASCII terrain */
.slab { position: relative; background: var(--blue); color: var(--blue-ink); overflow: hidden; }
.slab__field {
  position: absolute; inset: 0; margin: 0;
  font: 400 clamp(0.55rem, 1.05vw, 0.95rem)/1.12 var(--mono);
  color: rgba(255, 255, 255, 0.38);
  white-space: pre; overflow: hidden;
  display: flex; align-items: flex-end;
}
.slab__inner { position: relative; padding-top: clamp(3rem, 9vw, 7rem); padding-bottom: clamp(3rem, 9vw, 7rem); }
.slab__title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 9vw, 8rem); line-height: 0.88; max-width: 12ch; }
.slab__note { margin-top: 1.25rem; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; background: var(--blue); display: inline-block; padding: 0.2rem 0.4rem 0.2rem 0; }

/* section heads */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line-strong); padding-bottom: 0.75rem; }
.section-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(3rem, 9vw, 7rem); line-height: 0.85; }
.section-note { font-size: 0.75rem; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.08em; }
.works:focus, .history:focus { outline: none; }
.works { padding-top: clamp(3.5rem, 8vw, 6rem); }

/* entries */
.entry { border-bottom: 1px solid var(--line); }
.entry article { display: grid; gap: 1.5rem; padding: clamp(1.75rem, 4vw, 3rem) 0; }
@media (min-width: 60rem) {
  .entry article { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: start; }
}
.entry__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.entry__no { font-size: 0.8rem; color: var(--fg-2); }
.entry__name { flex-basis: 100%; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 0.92; margin-top: 0.35rem; overflow-wrap: anywhere; }
.entry__sub { display: block; font-family: var(--mono); font-weight: 400; text-transform: none; font-size: 0.85rem; line-height: 1.4; color: var(--fg-2); margin-top: 0.4rem; }
.entry__pitch { margin-top: 1rem; font-size: 1.08rem; max-width: 44ch; }
.entry__meta { margin-top: 1rem; font-size: 0.8rem; line-height: 1.5; color: var(--fg-2); display: grid; gap: 0.35rem; max-width: 52ch; }
.entry__meta li { padding-left: 1.1rem; position: relative; }
.entry__meta li::before { content: "»"; position: absolute; left: 0; color: var(--link); }
.entry__links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.entry__links a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: 600 0.8rem var(--mono); letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem; border: 1px solid var(--line-strong);
  color: var(--fg); text-decoration: none; overflow-wrap: anywhere;
}
.entry__links a:hover { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.arrow { color: var(--link); }
.entry__links a:hover .arrow { color: inherit; }

.tag { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.2rem 0.5rem; border: 1px solid currentColor; }
.tag::before { content: ""; width: 0.45rem; height: 0.45rem; background: currentColor; }
.tag--live { color: var(--live); }
.tag--dev { color: var(--dev); }

/* screenshot slot. Every card has one: a figure with a picture, or the
   empty treatment when no safe capture exists yet. */
.shot {
  position: relative; margin: 0;
  border: 1px solid var(--line-strong);
  background-color: var(--bg-2);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 5px 5px;
  padding: clamp(0.6rem, 1.5vw, 1rem);
}
.shot::before, .shot::after {
  /* corner ticks */
  content: ""; position: absolute; width: 0.7rem; height: 0.7rem; border-color: var(--link); border-style: solid;
}
.shot::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.shot::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.shot picture, .shot img { margin: 0 auto; }
.shot img { border: 1px solid var(--line); background: #000; }
.shot--tall img { width: 200px; }
.shot--native img { width: 340px; }
.shot figcaption { margin-top: 0.7rem; font-size: 0.72rem; color: var(--fg-2); letter-spacing: 0.04em; }
.shot figcaption span { color: var(--link); text-transform: uppercase; }
.shot--empty, .shot:not(:has(img)) {
  display: grid; place-items: center; min-height: 14rem;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 9px, var(--dot) 9px 10px),
    radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: auto, 5px 5px;
}
.shot--empty span { font-size: 0.8rem; color: var(--fg-2); background: var(--bg-2); padding: 0.35rem 0.6rem; border: 1px solid var(--line); }

/* history */
.history { padding-top: clamp(4rem, 9vw, 7rem); }
.log { border-left: 1px solid var(--line-strong); margin-top: 1.5rem; }
.log__row { display: grid; gap: 0.35rem 2rem; padding: 1.1rem 0 1.1rem 1.25rem; position: relative; border-bottom: 1px solid var(--line); }
.log__row::before { content: ""; position: absolute; left: -0.3rem; top: 1.55rem; width: 0.55rem; height: 0.55rem; background: var(--link); }
@media (min-width: 48rem) { .log__row { grid-template-columns: 11rem minmax(0, 1fr); } }
.log__when { font-size: 0.82rem; color: var(--link); letter-spacing: 0.04em; padding-top: 0.35rem; }
.log__role { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1; }
.log__org { font-size: 0.8rem; color: var(--fg-2); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.06em; }
.log__line { margin-top: 0.4rem; max-width: 60ch; }
.toolkit { margin-top: 1.5rem; font-size: 0.8rem; color: var(--fg-2); line-height: 1.7; }
.toolkit__label { color: var(--fg); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.75rem; padding: 0.15rem 0.45rem; border: 1px solid var(--line-strong); }


/* footer */
.colophon { padding: 2rem 0 2.5rem; margin-top: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--fg-2); }
.colophon__grid { display: grid; gap: 0.5rem 2rem; }
@media (min-width: 48rem) { .colophon__grid { grid-template-columns: auto 1fr; } .colophon__grid p:last-child { text-align: right; } }

/* 404 */
.lost { padding-top: clamp(3rem, 10vw, 7rem); padding-bottom: clamp(3rem, 10vw, 7rem); }
.lost h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(5rem, 24vw, 18rem); line-height: 0.82; margin-top: 1rem; }
.lost h1:focus { outline: none; }
.lost p.lost__line { font-size: clamp(1.15rem, 2.2vw, 1.5rem); margin: 1.5rem 0 2rem; }

/* staggered reveal */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.entry.reveal { animation-delay: 0ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
