/* ===========================================================================
   ASHLEY BRADLEY — signal yellow on grey.
   ---------------------------------------------------------------------------
   Carried over from the arcade, cut down to what a portfolio needs.

   Two rules hold the whole thing together:
     1. YELLOW IS A SIGNAL. It marks the live thing and nothing else: the
        wordmark, a link, focus. Used four times a page it reads as
        deliberate; used forty it reads as decoration.
     2. STRUCTURE, NOT WHITESPACE. Character comes from visible hairlines and
        a strict grid rather than from generous padding, because there is no
        webfont here doing that work — nothing is fetched from anyone.
   =========================================================================== */

:root {
  /* Dark is the primary design; light is derived from it, not the reverse. */
  --bg: #131313;
  --bg-deep: #0b0b0b;
  --surface: #1a1a1a;
  --edge: #2f2f2f;
  --edge-soft: #232323;
  --ink: #ededed;
  --ink-mid: #b5b5b5;
  --muted: #8a8a8a;
  --accent: #facc15;

  --rule: 1px solid var(--edge);
  --shell: 1240px;
  --gutter: clamp(16px, 4vw, 40px);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #fcfcfc;
    --bg-deep: #eeeeee;
    --surface: #ffffff;
    --edge: #e0e0e0;
    --edge-soft: #ebebeb;
    --ink: #131313;
    --ink-mid: #454545;
    --muted: #626262;
    /* Bright yellow is illegible as text on white; this is the same signal
       at a weight that actually reads. */
    --accent: #8a6a06;
  }
}

:root[data-theme='light'] {
  --bg: #fcfcfc;
  --bg-deep: #eeeeee;
  --surface: #ffffff;
  --edge: #e0e0e0;
  --edge-soft: #ebebeb;
  --ink: #131313;
  --ink-mid: #454545;
  --muted: #626262;
  --accent: #8a6a06;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; display: flex; flex-direction: column; }

/* The content column is bounded by real hairlines running the full height, so
   the page reads as a drawing sheet rather than as text floating in space. */
.wrap {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
  border-left: var(--rule);
  border-right: var(--rule);
}
main > .wrap:last-child { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- header ------------------------------------------------------ */
.site-head {
  border-bottom: var(--rule);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
}

/* The wordmark carries the only permanent piece of yellow on the page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 640;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand::before {
  content: '';
  width: 9px;
  height: 9px;
  background: var(--accent);
  /* A cut corner: a marker, not a logo. */
  clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
}

/* `.theme-toggle` is the behaviour hook theme.js listens for, not a look. */
.theme-toggle {
  margin-left: auto;
  border: var(--rule);
  background: transparent;
  color: var(--muted);
  border-radius: 3px;
  height: 28px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- title card -------------------------------------------------- */
/* padding-top ONLY. A `padding: X 0 0` shorthand would silently reset the
   horizontal gutter that .wrap sets. */
.hero { padding-top: clamp(40px, 6vw, 68px); }
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(27px, 3.9vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 660;
  max-width: 24ch;
}
/* Yellow marks ONE phrase, not half the sentence. */
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  margin: 0;
  max-width: 54ch;
  color: var(--ink-mid);
  font-size: 16px;
}

/* ---------- section headings -------------------------------------------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 56px 0 14px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
}
.section-head .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- work -------------------------------------------------------- */
/* A ledger rather than a card shelf: one entry reads as deliberate, and the
   list grows a row at a time. Hairline rows; the grid itself is the graphic. */
.work {
  list-style: none;
  margin: 0 0 96px;
  padding: 0;
  border-top: var(--rule);
}
.entry {
  display: grid;
  grid-template-columns: 44px minmax(200px, 320px) minmax(0, 1fr);
  border-bottom: var(--rule);
  color: inherit;
  transition: background 0.15s;
}
.entry:hover { background: var(--surface); text-decoration: none; }

.entry-index {
  padding: 18px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.entry-tile {
  aspect-ratio: 2 / 1;
  align-self: start;
  margin: 18px 0;
  position: relative;
  border: var(--rule);
  background-color: var(--bg-deep);
  overflow: hidden;
}
/* A vignette, so a tile has depth without the motif having to shout. */
.entry-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(140% 110% at 50% -10%, transparent 46%, var(--bg-deep) 108%);
  opacity: 0.5;
}

/* Tile motifs — generated, not drawn: CSS gradients mixed against --accent so
   they stay on-palette in both themes. Give each entry a different one.
   `background-size` is set separately because `background-image` cannot carry
   a size; the `/ 15px 15px` shorthand is only legal in `background`. */
.motif-dots {
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 58%, transparent) 1.4px, transparent 1.5px),
    radial-gradient(130% 100% at 30% 4%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0%, var(--bg-deep) 74%);
  background-size: 15px 15px, cover;
}
.motif-strata {
  background-image:
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 2px, transparent 2px 13px),
    radial-gradient(130% 100% at 60% 4%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0%, var(--bg-deep) 74%);
}
.motif-lanes {
  background-image:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent) 0 3px, transparent 3px 26px),
    radial-gradient(130% 100% at 20% 4%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0%, var(--bg-deep) 74%);
}
.motif-arcs {
  background-image:
    repeating-radial-gradient(circle at 50% 128%, transparent 0 20px, color-mix(in srgb, var(--accent) 34%, transparent) 20px 22px),
    radial-gradient(130% 100% at 70% 4%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0%, var(--bg-deep) 74%);
}
.motif-hatch {
  background-image:
    repeating-linear-gradient(48deg, color-mix(in srgb, var(--accent) 22%, transparent) 0 1px, transparent 1px 13px),
    radial-gradient(130% 100% at 45% 4%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0%, var(--bg-deep) 74%);
}

.entry-body {
  padding: 16px 0 18px 24px;
  display: flex;
  flex-direction: column;
}
.entry-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.entry-kind {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.entry-body p.entry-desc {
  margin: 0 0 14px;
  max-width: 64ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mid);
}
.entry-go {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--edge-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

@media (max-width: 720px) {
  .entry { grid-template-columns: 32px minmax(0, 1fr); }
  .entry-tile { grid-column: 2; margin-bottom: 0; }
  .entry-body { grid-column: 2; padding-left: 0; }
}

/* ---------- 404 --------------------------------------------------------- */
.lost { padding-top: clamp(48px, 8vw, 96px); padding-bottom: 96px; }
.lost .code {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.lost h1 {
  margin: 0 0 16px;
  font-size: clamp(27px, 3.9vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 660;
}
.lost p { max-width: 54ch; color: var(--ink-mid); }

/* ---------- footer ------------------------------------------------------ */
.site-foot { border-top: var(--rule); }
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 28px;
  padding-bottom: 56px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.site-foot a { color: var(--ink-mid); }

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