:root {
  color-scheme: dark;
  --bg: #0a0a09;
  --surface: #11110f;
  --surface-2: #161613;
  --text: #f4f1e8;
  --muted: #99978f;
  --faint: #6f6d67;
  --line: #292824;
  --accent: #ff4a4a;
  --accent-strong: #ff6262;
  --code: #c8c5bc;
  --shadow: 0 18px 50px rgba(0,0,0,.18);
  --max: 860px;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3eb;
  --surface: #efebe1;
  --surface-2: #e9e4d8;
  --text: #171714;
  --muted: #6f6c64;
  --faint: #8d8980;
  --line: #d9d3c5;
  --accent: #c92e2e;
  --accent-strong: #a91f1f;
  --code: #36342f;
  --shadow: 0 18px 50px rgba(37,32,23,.08);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 220ms ease, color 220ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .35;
  pointer-events: none;
  z-index: 100;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: #fff; }

.shell {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 999;
  transform: translateY(-160%);
  padding: 8px 10px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.signature-mark {
  width: 130px;
  height: 52px;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
}
.signature-mark img {
  width: 434px;
  max-width: none;
  height: auto;
  display: block;
  transform: translate(-153px, -7px);
  filter: invert(1);
  opacity: .96;
  transition: filter 220ms ease, opacity 180ms ease, transform 180ms ease;
}
:root[data-theme="light"] .signature-mark img { filter: none; }
.signature-mark:hover img { opacity: .78; transform: translate(-153px, -9px); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.primary-nav { display: flex; align-items: center; gap: 18px; }
.primary-nav a, .text-link {
  color: var(--muted);
  font-size: 12px;
  position: relative;
  transition: color 160ms ease;
}
.primary-nav a::after, .text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transition: right 180ms ease;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"], .text-link:hover { color: var(--text); }
.primary-nav a:hover::after, .primary-nav a[aria-current="page"]::after, .text-link:hover::after { right: 0; }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(8deg); }
.theme-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }

main { display: block; }

.hero {
  padding: clamp(90px, 14vw, 150px) 0 clamp(90px, 13vw, 132px);
}
.kicker {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
}
.kicker .accent { color: var(--accent); }

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
  margin: 0 0 14px;
  max-width: 780px;
  font-size: clamp(2.55rem, 8vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.075em;
  font-weight: 600;
}
.hero-role {
  margin: 0 0 26px;
  min-height: 1.8em;
  color: var(--code);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
}
.typewriter-text { color: var(--accent); }
.type-cursor {
  display: inline-block;
  width: 1px;
  height: 1.08em;
  margin-left: 4px;
  vertical-align: -0.14em;
  background: var(--accent);
  animation: cursor-blink .72s steps(1, end) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

.hero-lede {
  max-width: 665px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(.98rem, 2vw, 1.08rem);
}
.inline-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.inline-links a {
  color: var(--text);
  font-size: 12px;
  transition: color 160ms ease, transform 160ms ease;
}
.inline-links a:hover { color: var(--accent); transform: translateY(-1px); }

.home-section, .page-section {
  padding: clamp(64px, 10vw, 96px) 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.section-head h2, .page-section h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.02em;
}
.section-head h2::before, .page-section h2::before { content: "# "; color: var(--accent); }

.about-preview p {
  max-width: 710px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

.project-list { border-top: 1px solid var(--line); }
.project-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 180ms ease, color 180ms ease, background 180ms ease;
}
.project-row:hover {
  padding-left: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 52%);
}
.project-row h3 { margin: 0; font-size: 14px; font-weight: 500; }
.project-meta { margin: 0; color: var(--faint); font-size: 11px; white-space: nowrap; }

.more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.more-card {
  min-height: 118px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 180ms ease, transform 180ms ease;
}
.more-card:hover { background: var(--surface); transform: translateY(-2px); }
.more-card span:first-child { font-size: 13px; }
.more-card span:last-child { color: var(--faint); font-size: 11px; }

.page-hero {
  padding: clamp(76px, 12vw, 118px) 0 64px;
}
.page-eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; }
.page-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.065em;
  font-weight: 600;
}
.page-hero p:last-child { max-width: 650px; margin-bottom: 0; color: var(--muted); }

.prose { max-width: 720px; }
.prose p { color: var(--muted); }
.fact-list { border-top: 1px solid var(--line); margin-top: 34px; }
.fact-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.fact-row span:first-child { color: var(--faint); }

.award-list, .simple-list { border-top: 1px solid var(--line); }
.award-item, .simple-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.award-item p, .simple-item p { margin: 0; }
.award-item .year, .simple-item .year { color: var(--faint); font-size: 11px; }

.empty-panel {
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 38px);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.empty-panel .label { color: var(--accent); font-size: 11px; margin-bottom: 14px; }
.empty-panel h2 { margin: 0 0 8px; font-size: 17px; font-weight: 500; }
.empty-panel p { margin: 0; color: var(--muted); font-size: 13px; }

.contact-card {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.contact-email {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 20px;
  font-size: clamp(1rem, 4vw, 1.7rem);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease, opacity 160ms ease;
}
.button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.button.is-copied { border-color: var(--accent); color: var(--accent); transform: scale(.985); }
.copy-label { display: inline-block; }
.button.is-copied .copy-label { animation: copy-feedback 220ms ease; }
@keyframes copy-feedback { 0% { opacity: .25; transform: translateY(2px); } 100% { opacity: 1; transform: translateY(0); } }

.site-footer { border-top: 1px solid var(--line); margin-top: 30px; }
.footer-inner {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-copy { margin: 0; color: var(--faint); font-size: 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; }
.footer-nav a { color: var(--muted); font-size: 10px; transition: color 160ms ease; }
.footer-nav a:hover { color: var(--accent); }

/* Fade-up reveal: only active when JavaScript is available. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms ease, transform 500ms ease;
}

@media (max-width: 680px) {
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 64px; }
  .signature-mark { width: 112px; height: 46px; }
  .signature-mark img { width: 370px; transform: translate(-131px, -6px); }
  .signature-mark:hover img { transform: translate(-131px, -7px); }
  .primary-nav { gap: 12px; }
  .primary-nav a { font-size: 11px; }
  .primary-nav a:nth-child(3) { display: none; }
  .header-actions { gap: 12px; }
  .hero { padding-top: 82px; }
  .more-grid { grid-template-columns: 1fr; }
  .fact-row { grid-template-columns: 1fr; gap: 3px; }
  .award-item, .simple-item { grid-template-columns: 1fr; gap: 5px; }
  .footer-inner { padding: 24px 0; align-items: flex-start; flex-direction: column; }
  .footer-nav { justify-content: flex-start; }
}

@media (max-width: 430px) {
  .primary-nav a:nth-child(2) { display: none; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 4rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .type-cursor { animation: none !important; opacity: 1; }
}
