:root {
  --bg:        #0A0A0B;
  --bg-shade:  #111113;
  --ink:       #E6E5E0;
  --ink-soft:  #B7B5AE;
  --muted:     #6B6863;
  --rule:      #1E1E20;
  --rule-hi:   #2C2C2F;
  --accent:    #FF3B2E;
  --accent-d:  #C7281C;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 2px,
      rgba(255,255,255,0.012) 2px,
      rgba(255,255,255,0.012) 3px
    ),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  background-blend-mode: soft-light;
  opacity: 0.6;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, transparent 50%, rgba(0,0,0,0.45) 100%);
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2.25rem) clamp(1.5rem, 2.5vw, 2rem);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

/* ─────────── HEADBAR ─────────── */
.headbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.headbar .l, .headbar .r { display: flex; gap: 1.25rem; }
.headbar .r { justify-content: flex-end; }

.headbar a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.headbar a:hover,
.headbar a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.headbar .glyph {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  text-decoration: none;
  border: none;
}

.headbar .glyph::before {
  content: '◼ ';
  color: var(--accent);
  font-size: 0.7em;
}

.headbar .glyph:hover { color: var(--accent); }

.headbar .live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.headbar .live::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ─────────── HERO (index) ─────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

.id-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.id-block .row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
}

.id-block .row .k { color: var(--muted); }
.id-block .row .v { color: var(--ink-soft); letter-spacing: 0.08em; }

h1.name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.75rem, 4.5vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0.25rem 0 1rem;
  text-transform: uppercase;
}

h1.name .first { display: block; }
h1.name .last {
  display: block;
  color: var(--ink);
  position: relative;
}

h1.name .last::after {
  content: '_';
  color: var(--accent);
  margin-left: 0.05em;
  animation: blink 1.1s steps(2, end) infinite;
}

@keyframes blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.role {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--rule-hi);
  background: var(--bg-shade);
  margin-bottom: 1.25rem;
}

.role::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  background: var(--accent);
}

.dek {
  font-family: var(--mono);
  font-size: clamp(0.82rem, 0.95vw, 0.92rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 54ch;
  font-weight: 300;
}

.dek a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s, background 0.2s;
}

.dek a:hover,
.dek a:focus-visible {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}

/* ─────────── PORTRAIT ─────────── */
.portrait {
  position: relative;
  width: clamp(130px, 16vw, 190px);
  aspect-ratio: 1 / 1;
  background: var(--bg-shade) url('photo.jpg') center/cover no-repeat;
  border: 1px solid var(--rule-hi);
  filter: grayscale(1) contrast(1.05) brightness(0.92);
}

.portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 60%, rgba(10,10,11,0.45)),
    repeating-linear-gradient(180deg, transparent 0, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 3px);
  pointer-events: none;
}

.portrait::after {
  content: '';
  position: absolute;
  top: -5px; left: -5px;
  width: 12px; height: 12px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}

.portrait-tag {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 0.25rem 0.5rem;
  z-index: 2;
}

.portrait-meta {
  position: absolute;
  bottom: -1.6rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ─────────── ELSEWHERE ─────────── */
.elsewhere {
  border-top: 1px solid var(--rule);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-head .count {
  color: var(--ink-soft);
  font-weight: 500;
}

.links {
  display: flex;
  flex-direction: column;
}

.links a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto 1.6rem;
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem 0.5rem 0.7rem 0.25rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  transition: background 0.2s, padding-left 0.25s;
}

.links a:first-child { border-top: 1px solid var(--rule); }

.links a .num {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 400;
}

.links a .label {
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.links a .label .at {
  color: var(--muted);
  font-weight: 300;
}

.links a .meta {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.links a .arrow {
  text-align: right;
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.links a:hover,
.links a:focus-visible {
  background: var(--bg-shade);
  padding-left: 0.75rem;
  outline: none;
}

.links a:hover .arrow,
.links a:focus-visible .arrow {
  transform: translateX(0.4rem);
  color: var(--accent);
}

/* ─────────── LEGAL PAGES ─────────── */
.legal {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.legal-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.legal-head .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.legal-head .kicker::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}

h1.legal-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 70ch;
}

.legal-section {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
}

.legal-section:last-child {
  border-bottom: 1px solid var(--rule);
}

.legal-section .num {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 0.15rem;
}

.legal-section .body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legal-section h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
}

.legal-section p,
.legal-section address,
.legal-section ul {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-soft);
  font-style: normal;
  max-width: 64ch;
}

.legal-section ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.legal-section ul li { padding-left: 1.25rem; position: relative; }
.legal-section ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.legal-section address {
  font-style: normal;
  white-space: pre-line;
}

.legal-section .placeholder {
  display: inline-block;
  background: var(--bg-shade);
  border: 1px dashed var(--rule-hi);
  padding: 0.05rem 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.legal-section a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s, background 0.2s;
}

.legal-section a:hover,
.legal-section a:focus-visible {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}

.legal-foot-nav {
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.legal-foot-nav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s, border-color 0.2s;
}

.legal-foot-nav a:hover,
.legal-foot-nav a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

/* ─────────── FOOTER ─────────── */
footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

footer .l, footer .r { display: flex; gap: 1.25rem; }
footer .r { justify-content: flex-end; }

footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

footer a:hover,
footer a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

footer .center {
  color: var(--ink-soft);
  font-weight: 500;
}

/* ─────────── MOBILE ─────────── */
@media (max-width: 760px) {
  .headbar {
    grid-template-columns: 1fr 1fr;
    font-size: 0.62rem;
  }
  .headbar .center { display: none; }
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .portrait {
    order: -1;
    width: 65%;
    max-width: 240px;
  }
  .portrait-meta { font-size: 0.55rem; }
  .links a {
    grid-template-columns: 2rem minmax(0, 1fr) 1.5rem;
    gap: 0.75rem;
  }
  .links a .meta { display: none; }
  footer {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    text-align: left;
  }
  footer .r { justify-content: flex-start; }

  .legal-section {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

/* ─────────── REVEAL ─────────── */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.headbar    { animation: rise 0.8s 0.05s both ease-out; }
.id-block   { animation: rise 0.8s 0.20s both ease-out; }
h1.name .first { animation: rise 0.9s 0.30s both cubic-bezier(0.2, 0.7, 0.2, 1); }
h1.name .last  { animation: rise 0.9s 0.42s both cubic-bezier(0.2, 0.7, 0.2, 1); }
.role       { animation: rise 0.8s 0.55s both ease-out; }
.dek        { animation: rise 0.8s 0.65s both ease-out; }
.portrait   { animation: rise 1.0s 0.40s both ease-out; }
.elsewhere  { animation: rise 0.8s 0.78s both ease-out; }
footer      { animation: rise 0.8s 0.92s both ease-out; }

.legal-head { animation: rise 0.8s 0.20s both ease-out; }
.legal-body { animation: rise 0.8s 0.35s both ease-out; }
.legal-foot-nav { animation: rise 0.8s 0.55s both ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

::selection {
  background: var(--accent);
  color: var(--bg);
}
