/* ============================================================================
   4xavior.com — portfolio
   Design system
   Surface: Decide/Learn (portfolio) whose centrepiece is a Monitor-style
   interactive diagram. Hero is left-weighted, never a centred stack.
   Palette: warm near-black + sodium amber accent, signal green for live state
   only, red for unverified state only. No violet, no tech gradients.
   ==========================================================================*/

:root {
  /* surfaces */
  --bg: #0a0b0a;
  --bg-2: #101210;
  --bg-3: #161915;
  --line: #262a25;
  --line-2: #343932;

  /* ink */
  --ink: #ebe8e1;
  --ink-2: #a8a89e;
  --ink-3: #6f7169;

  /* accents */
  --amber: #e8a33d;
  --amber-soft: rgba(232, 163, 61, 0.14);
  --live: #74d68a;
  --warn: #e0715c;

  /* type */
  --display: "Space Grotesk", "Segoe UI Variable Display", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* rhythm */
  --gut: clamp(20px, 5vw, 64px);
  --max: 1180px;
  --step-1: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="paper"] {
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --bg-3: #e6e2d8;
  --line: #d8d3c7;
  --line-2: #c2bcac;
  --ink: #161814;
  --ink-2: #55574e;
  --ink-3: #83857a;
  --amber: #a75f0d;
  --amber-soft: rgba(167, 95, 13, 0.12);
  --live: #2e7d43;
  --warn: #b03c25;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-1);
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* faint engineering grid + pointer spotlight; the grid is the texture, not a photo */
#backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.32;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

#spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 20%), var(--amber-soft), transparent 68%);
  transition: opacity 400ms var(--ease);
}

main {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--amber);
  color: #0a0b0a;
}

/* ---------- layout ---------- */
.wrap {
  width: min(100% - (var(--gut) * 2), var(--max));
  margin-inline: auto;
}

section {
  padding-block: clamp(64px, 10vh, 132px);
  border-top: 1px solid var(--line);
}

section:first-of-type {
  border-top: 0;
}

/* section heading: number + rule + label. type does the hierarchy work. */
.shead {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(28px, 4vh, 52px);
}

.shead .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--amber);
  letter-spacing: 0.1em;
  flex: none;
}

.shead h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.65rem, 1.25rem + 1.9vw, 2.75rem);
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.1;
}

.shead .rule {
  flex: 1;
  height: 1px;
  background: var(--line-2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms var(--ease);
}

.in .shead .rule,
.shead.in .rule {
  transform: scaleX(1);
}

.lede {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 0.99rem + 0.35vw, 1.2rem);
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

a {
  color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--amber) 40%, transparent);
}

a:hover {
  text-decoration-color: var(--amber);
}

/* ---------- top bar ---------- */
header.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.bar-in {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
}

.sig {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.sig b {
  color: var(--amber);
}

nav.top {
  display: flex;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

nav.top::-webkit-scrollbar {
  display: none;
}

nav.top a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 180ms, background 180ms;
}

nav.top a:hover {
  color: var(--ink);
  background: var(--bg-3);
}

nav.top a[aria-current="true"] {
  color: var(--amber);
}

.iconbtn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  width: 34px;
  height: 34px;
  border-radius: 2px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  transition: color 180ms, border-color 180ms;
}

.iconbtn:hover {
  color: var(--amber);
  border-color: var(--amber);
}

#progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1.5px;
  width: 100%;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- hero ---------- */
#hero {
  padding-block: clamp(48px, 9vh, 104px) clamp(40px, 6vh, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 12px 5px 9px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent);
  animation: pulse 2.8s infinite;
  flex: none;
}

@keyframes pulse {
  0%,
  70% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 9px transparent;
  }
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 1.4rem + 5.6vw, 5.1rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  margin: 22px 0 0;
}

h1 .l2 {
  display: block;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: -0.03em;
  font-size: 0.44em;
  line-height: 1.25;
  margin-top: 0.5em;
  max-width: 30ch;
}

h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 2px;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: #0a0b0a;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: transform 180ms var(--ease), box-shadow 180ms, background 180ms;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -12px var(--amber);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn.ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: none;
}

/* terminal */
.term {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--bg-2);
  overflow: hidden;
  box-shadow: 0 24px 60px -40px #000;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.05em;
}

.term-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  font-style: normal;
}

.term-bar i:first-of-type {
  background: var(--warn);
}

.term-bar i:nth-of-type(2) {
  background: var(--amber);
}

.term-bar span {
  margin-left: 6px;
}

/* topology hint sits above the svg */
#topo-shell .hint + #topo-detail {
  margin-top: 0;
}

.term-body {
  padding: 14px 14px 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.75;
  min-height: 236px;
  max-height: 44vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.term-body .out {
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.term-body .out strong {
  color: var(--ink);
  font-weight: 600;
}

.term-body .out a {
  color: var(--amber);
}

.term-form {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px dashed var(--line);
  margin-top: 12px;
  padding-top: 11px;
}

.term-form .ps {
  color: var(--amber);
}

.term-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  background: var(--amber);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- proof strip ---------- */
#proof {
  padding-block: 0;
  border-top: 0;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-2);
}

.proof {
  padding: 22px 20px 24px;
  border-right: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background 220ms;
}

.proof:last-child {
  border-right: 0;
}

.proof:hover {
  background: var(--bg-3);
}

.proof .v {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.proof .l {
  font-size: 0.88rem;
  margin-top: 8px;
  color: var(--ink);
}

.proof .d {
  font-size: 0.78rem;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 6px;
}

/* ---------- capability matrix ---------- */
.matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.mcol {
  background: var(--bg);
  padding: 22px 20px 26px;
}

.mcol h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
  font-weight: 500;
}

.cap {
  position: relative;
  padding: 8px 0;
  border-top: 1px dotted var(--line-2);
  font-size: 0.925rem;
  color: var(--ink);
  cursor: default;
  transition: color 180ms, padding-left 220ms var(--ease);
}

.cap:first-of-type {
  border-top: 0;
}

.cap::before {
  content: "↳";
  font-family: var(--mono);
  color: var(--amber);
  position: absolute;
  left: -16px;
  opacity: 0;
  transition: opacity 180ms;
}

.cap:hover {
  color: var(--amber);
  padding-left: 16px;
}

.cap:hover::before {
  opacity: 1;
}

.cap .p {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-3);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 320ms var(--ease), margin-top 320ms;
}

.cap:hover .p,
.cap:focus .p {
  max-height: 7em;
  margin-top: 5px;
}

/* ---------- work timeline ---------- */
.job {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(18px, 4vw, 48px);
  padding-block: clamp(26px, 4vh, 44px);
  border-top: 1px solid var(--line);
}

.job:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.job-when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  padding-top: 6px;
}

.job-when .now {
  color: var(--live);
}

.job h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.18rem, 1.05rem + 0.6vw, 1.6rem);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.job .org {
  color: var(--amber);
  font-weight: 500;
}

.job .place {
  color: var(--ink-3);
  font-size: 0.85rem;
}

.job .jlede {
  color: var(--ink-2);
  margin: 10px 0 14px;
  max-width: 66ch;
}

.job ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.job li {
  position: relative;
  padding-left: 20px;
  font-size: 0.93rem;
  color: var(--ink-2);
  max-width: 74ch;
}

.job li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 8px;
  height: 1px;
  background: var(--amber);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------- lab / topology ---------- */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

#topo-shell {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--bg-2);
  overflow: hidden;
}

#topo-shell .hint {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
}

#topo {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.link.dashed {
  stroke-dasharray: 2 4;
}

.node .mark {
  font-size: 8px;
  fill: var(--amber);
  opacity: 0.85;
}

.node.has-note rect {
  stroke: color-mix(in srgb, var(--amber) 45%, var(--line-2));
}

.node rect {
  fill: var(--bg-3);
  stroke: var(--line-2);
  stroke-width: 1;
  transition: fill 220ms, stroke 220ms;
}

.node .nt {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink);
}

.node .ns {
  font-family: var(--mono);
  font-size: 9.2px;
  fill: var(--ink-3);
  letter-spacing: 0.03em;
}

.node {
  cursor: pointer;
  outline: none;
}

.node:hover rect,
.node.sel rect {
  fill: var(--amber-soft);
  stroke: var(--amber);
}

.node:focus-visible rect {
  stroke: var(--amber);
  stroke-dasharray: 3 2;
}

.node.sel .nt {
  fill: var(--amber);
}

.link {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1.25;
  transition: stroke 240ms, stroke-width 240ms, opacity 240ms;
}

.link.wg,
.link.tunnel {
  stroke-dasharray: 5 4;
  animation: flow 3.4s linear infinite;
}

.link.hot {
  stroke: var(--amber);
  stroke-width: 2;
}

.link.dim {
  opacity: 0.22;
}

@keyframes flow {
  to {
    stroke-dashoffset: -80;
  }
}

.edge-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink-3);
  letter-spacing: 0.04em;
}

#topo-detail {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  min-height: 92px;
  font-size: 0.88rem;
  color: var(--ink-2);
}

#topo-detail strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}

.lab-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.lab-stats div {
  background: var(--bg);
  padding: 12px 13px;
}

.lab-stats .k {
  font-size: 0.72rem;
  color: var(--ink-3);
  display: block;
}

.lab-stats .v {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 26px;
  margin-top: 26px;
}

.note {
  border-top: 1px solid var(--line);
  padding: 16px 0 18px;
  cursor: pointer;
  transition: border-color 220ms, padding-left 260ms var(--ease);
}

.note:hover,
.note.sel {
  border-color: var(--amber);
}

.note.sel {
  padding-left: 12px;
}

.note h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.note.sel h4 {
  color: var(--amber);
}

.note p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.6;
}

.note .tags {
  margin-top: 10px;
}

/* ---------- projects ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
  transition: color 180ms, border-color 180ms, background 180ms;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.chip[aria-pressed="true"] {
  color: #0a0b0a;
  background: var(--amber);
  border-color: var(--amber);
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  background: var(--bg);
  padding: 24px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: background 240ms, transform 300ms var(--ease);
}

.card:hover {
  background: var(--bg-2);
}

.card[hidden] {
  display: none;
}

.card .kind {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -0.025em;
  margin: 0;
}

.card.wide {
  grid-column: span 2;
}

.card .sum {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.card .why {
  font-size: 0.84rem;
  color: var(--ink-2);
  border-left: 1px solid var(--amber);
  padding-left: 12px;
  margin: 2px 0 0;
}

.card .why b {
  color: var(--amber);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 3px;
}

.card .safety {
  font-size: 0.76rem;
  color: var(--ink-3);
  font-family: var(--mono);
  line-height: 1.55;
}

.card .safety::before {
  content: "⚠ ";
  color: var(--warn);
}

.card .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.card .links {
  display: flex;
  gap: 12px;
}

.card .links a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--live);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status.wip {
  color: var(--warn);
}

.status .dot {
  width: 6px;
  height: 6px;
  animation: none;
  box-shadow: none;
  background: currentColor;
}

/* ---------- principles ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(20px, 3vw, 40px);
  counter-reset: p;
}

.principle {
  counter-increment: p;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

.principle::before {
  content: "0" counter(p);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  letter-spacing: 0.08em;
}

.principle h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 8px 0 8px;
  letter-spacing: -0.015em;
}

.principle p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* ---------- contact ---------- */
#contact .big {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.3rem + 3vw, 3.7rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0 0 26px;
  max-width: 24ch;
}

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

.contact-grid a,
.contact-grid div {
  background: var(--bg);
  padding: 18px 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 200ms;
}

.contact-grid a:hover {
  background: var(--bg-3);
}

.contact-grid .k {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 5px;
}

.contact-grid .v {
  font-size: 0.95rem;
  color: var(--ink);
  word-break: break-word;
}

footer {
  border-top: 1px solid var(--line);
  padding-block: 26px 40px;
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: baseline;
}

footer .spacer {
  flex: 1;
}

footer a {
  color: var(--ink-2);
}

/* ---------- reveal ---------- */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.rv.in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ----------
   Mobile: the topology becomes a vertical chain, hero single-column,
   work timeline stacks. Nothing relies on hover for content.
   --------------------------------------------------------------- */
@media (max-width: 1000px) {
  .lab-grid,
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card.wide {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 72px;
  }

  .job {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof:nth-child(2n) {
    border-right: 0;
  }

  .proof {
    border-top: 1px solid var(--line);
  }

  .proof:nth-child(-n + 2) {
    border-top: 0;
  }

  /* capabilities show their proof inline — no hover on touch */
  .cap .p {
    max-height: 7em;
    margin-top: 5px;
  }

  .cap {
    padding-left: 0;
  }

  .cap::before {
    display: none;
  }

  #spotlight {
    display: none;
  }
}

@media (max-width: 460px) {
  .proof-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .proof {
    border-right: 0;
  }

  .proof:nth-child(n) {
    border-top: 1px solid var(--line);
  }

  .proof:first-child {
    border-top: 0;
  }
}

/* ---------- accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  background: var(--amber);
  color: #0a0b0a;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.skip:focus {
  left: 8px;
  top: 8px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .rv {
    opacity: 1;
    transform: none;
  }

  .shead .rule {
    transform: scaleX(1);
  }
}

/* ---------- print: a real résumé, not a screenshot of a dark site ---------- */
@media print {
  :root {
    --bg: #fff;
    --bg-2: #fff;
    --bg-3: #fff;
    --ink: #000;
    --ink-2: #222;
    --ink-3: #555;
    --line: #ccc;
    --line-2: #999;
    --amber: #000;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.45;
  }

  #backdrop,
  #spotlight,
  header.bar,
  #topo-shell,
  .term,
  .filters,
  .hero-actions,
  #hero .eyebrow,
  .rv {
    display: none !important;
  }

  section {
    padding-block: 10pt;
    border-top: 0.5pt solid #ccc;
    break-inside: auto;
  }

  h1 {
    font-size: 22pt;
  }

  h1 .l2 {
    font-size: 10pt;
  }

  .rv {
    opacity: 1;
  }

  .card,
  .job,
  .mcol,
  .principle {
    break-inside: avoid;
  }

  .card .why::before {
    content: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .contact-grid .v::after {
    content: none;
  }
}
