/* ──────────────────────────────────────────────────────────────
   andrewrwhite.com — "Signal"
   Swiss discipline: a tight uppercase display face, hard 2px
   rules, square edges, nothing decorative. Colour does work
   rather than ornament — ultramarine carries identity and marks
   what is current, signal yellow marks what to look at, and
   everything else is ink on paper.
   ────────────────────────────────────────────────────────────── */

:root {
  /* Colour */
  --paper:    #FFFFFF;
  --paper-2:  #F3F3F1;
  --ink:      #0E0E0E;
  --muted:    #56565A;
  --line:     #0E0E0E;
  --hairline: #D2D2CE;

  --blue:      #1B3FD8;
  --blue-soft: #E3E8FC;
  --yellow:    #F2C230;
  --on-blue:   #FFFFFF;

  /* Type */
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Measure */
  --measure: 34rem;
  --rail: 8rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #0D0D0E;
    --paper-2:  #17171A;
    --ink:      #F2F2EF;
    --muted:    #9A9A9E;
    --line:     #F2F2EF;
    --hairline: #2C2C30;

    --blue:      #2F51E8;
    --blue-soft: #16203F;
    --yellow:    #F2C230;
    --on-blue:   #FFFFFF;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:    #0D0D0E;
  --paper-2:  #17171A;
  --ink:      #F2F2EF;
  --muted:    #9A9A9E;
  --line:     #F2F2EF;
  --hairline: #2C2C30;

  --blue:      #2F51E8;
  --blue-soft: #16203F;
  --yellow:    #F2C230;
  --on-blue:   #FFFFFF;

  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 58rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ── Header ─────────────────────────────────────────────────── */

.site-head {
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2rem;
  padding-block: 1.1rem;
}

.wordmark {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.wordmark::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--blue);
  margin-top: 3px;
}

.site-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-head nav a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 3px solid transparent;
}

.site-head nav a:hover,
.site-head nav a:focus-visible { color: var(--ink); border-bottom-color: var(--yellow); }
.site-head nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); }

/* ── Bands ──────────────────────────────────────────────────── */

.band-blue {
  background: var(--blue);
  color: var(--on-blue);
}

.band-blue .wrap { padding-block: 3.25rem 3.5rem; }
.band-blue .eyebrow { color: var(--yellow); }
.band-blue h1 { color: var(--on-blue); }
.band-blue .lede { color: rgba(255,255,255,0.86); }
.band-blue a { color: var(--on-blue); }

.band-paper { background: var(--paper); }
.band-paper .wrap { padding-block: 3.25rem 3.5rem; }

.band-grey { background: var(--paper-2); }
.band-grey .wrap { padding-block: 3rem 3.25rem; }

/* ── Type ───────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1rem;
}

h1 {
  font-weight: 700;
  font-size: clamp(2rem, 6.6vw, 3.75rem);
  line-height: 0.99;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0 0 1.25rem;
  max-width: 24ch;
}

h2 {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0 0 0.85rem;
}

h3 {
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.3rem;
}

p { margin: 0 0 1.1rem; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: 1.1875rem;
  line-height: 1.52;
  color: var(--muted);
  max-width: var(--measure);
}

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--yellow); }

/* A flat yellow marker behind a short phrase. */
mark {
  background: var(--yellow);
  color: #0E0E0E;
  padding: 0 0.15em;
}

hr.rule {
  border: 0;
  border-top: 2px solid var(--line);
  margin: 2.75rem 0;
}

/* ── Section heading with a blue bar ────────────────────────── */

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  border-top: 2px solid var(--line);
  padding-top: 1.1rem;
  margin-bottom: 1.75rem;
}

.sec-head .num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--on-blue);
  background: var(--blue);
  padding: 0.2rem 0.45rem;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.sec-head h2 { margin: 0; }

/* ── Entry: mono rail beside prose ─────────────────────────── */

.entry {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 0 2.25rem;
  padding-block: 2rem;
  border-top: 1px solid var(--hairline);
}

.entry:first-of-type { border-top: 0; padding-top: 0.25rem; }

.entry .rail {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.4rem;
}

.entry .rail .span {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

.entry .body { min-width: 0; }

/* Current role: colour marks what is live. */
.entry.is-current {
  background: var(--blue-soft);
  border-top: 2px solid var(--blue);
  padding-inline: 1.25rem;
  margin-inline: -1.25rem;
}

.entry.is-current .rail .span { color: var(--blue); }

.now-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--blue);
  color: var(--on-blue);
  padding: 0.15rem 0.4rem;
  margin-top: 0.5rem;
}

.org {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

@media (max-width: 42rem) {
  .entry { grid-template-columns: 1fr; gap: 0; }
  .entry .rail { padding-top: 0; margin-bottom: 0.6rem; }
  .entry .rail .span { display: inline; }
  .now-tag { margin-top: 0; margin-left: 0.4rem; }
}

/* ── Capability chips ───────────────────────────────────────── */

.skills-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 1.6rem 0 0.7rem;
  display: inline-block;
  border-bottom: 3px solid var(--yellow);
  padding-bottom: 1px;
}

.skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
}

.skills li {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  background: var(--blue);
  color: var(--on-blue);
  padding: 0.28rem 0.55rem;
}

/* Tooling chips read as a second category. */
.skills li.tool {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}

/* ── Index cards ────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--line);
}

.card {
  background: var(--paper);
  padding: 1.5rem 1.4rem 1.6rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.card .card-no {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.card .card-title {
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}

.card .card-note { font-size: 0.9375rem; color: var(--muted); line-height: 1.5; }

.card:hover, .card:focus-visible { background: var(--blue); color: var(--on-blue); }
.card:hover .card-no, .card:focus-visible .card-no { color: var(--yellow); }
.card:hover .card-note, .card:focus-visible .card-note { color: rgba(255,255,255,0.86); }

/* ── Stat row ───────────────────────────────────────────────── */

.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.75rem 2rem;
}

.stats li { min-width: 0; border-top: 3px solid var(--yellow); padding-top: 0.7rem; }

.stats .k {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.stats .v {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ── Plain lists ────────────────────────────────────────────── */

.plain { padding-left: 1.1rem; max-width: var(--measure); margin: 0 0 1.1rem; }
.plain li { margin-bottom: 0.4rem; }
.plain li::marker { color: var(--blue); }

/* ── Draft marker — delete these blocks once written ────────── */

.draft {
  background: var(--yellow);
  color: #0E0E0E;
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  max-width: var(--measure);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.draft p { margin-bottom: 0.7rem; color: #0E0E0E; }
.draft p:last-child { margin-bottom: 0; }

.draft .draft-tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.45rem;
}

/* ── Contact ────────────────────────────────────────────────── */

.contact {
  font-family: var(--mono);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  max-width: none;
}

/* ── Footer ─────────────────────────────────────────────────── */

.site-foot {
  background: var(--ink);
  color: var(--paper);
}

.site-foot .wrap {
  padding-block: 1.6rem 2.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-foot a { color: var(--paper); }
.site-foot a:hover { text-decoration-color: var(--yellow); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

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