:root {
  /* palette */
  --bg: #0A0908;
  --bg-2: #110F0D;
  --bg-3: #181513;
  --line: #2A2520;
  --line-2: #3A332C;
  --ink: #F2EAD6;
  --ink-2: #C9BFA8;
  --ink-dim: #8C8475;
  --ink-faint: #5A544B;
  --accent: #E8703A;
  /* burnt orange */
  --accent-2: #F4A261;
  /* warm amber */
  --accent-glow: rgba(232, 112, 58, 0.45);

  /* type */
  --font-sans: -apple-system, "SF Pro Display", "SF Pro Text",
    BlinkMacSystemFont, "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* scale */
  --t-display: clamp(48px, 7vw, 96px);
  --t-h1: clamp(36px, 4.4vw, 60px);
  --t-h2: clamp(26px, 2.6vw, 36px);
  --t-h3: 20px;
  --t-body: 17px;
  --t-small: 14px;
  --t-micro: 12px;

  /* layout */
  --max: 1280px;
  --gutter: clamp(24px, 5vw, 64px);
  --nav-h: 72px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* subtle film grain on the whole document */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* page-load fade */
main,
.page-fade {
  animation: pageIn 600ms cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: var(--t-h1);
  line-height: 1.05;
}

h2 {
  font-size: var(--t-h2);
  line-height: 1.15;
}

h3 {
  font-size: var(--t-h3);
  line-height: 1.3;
  font-weight: 600;
}

p {
  margin: 0;
  color: var(--ink-2);
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  transition: color 160ms ease, border-color 160ms ease;
}

a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.dim {
  color: var(--ink-dim);
}

.faint {
  color: var(--ink-faint);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

/* ──── nav ──── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  border: none;
  font-size: 14px;
  color: var(--ink-dim);
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.active {
  color: var(--ink);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
}

/* ──── layout helpers ──── */
.page {
  padding-top: var(--nav-h);
}

.section {
  padding: clamp(80px, 10vh, 140px) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}

.section--narrow {
  max-width: 880px;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line) 30%, var(--line) 70%, transparent);
  border: none;
  margin: 0;
}

/* ──── footer ──── */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px var(--gutter) 56px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
}

.footer a {
  border: none;
  color: var(--ink-dim);
}

.footer a:hover {
  color: var(--accent);
}

/* ──── hero ──── */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  padding: var(--nav-h) var(--gutter) 60px;
  overflow: hidden;
}

.hero-sim {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-sim canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 50% 50%, transparent 0%, transparent 35%, var(--bg) 88%),
    linear-gradient(to bottom, transparent 0%, transparent 60%, var(--bg) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 880px;
  pointer-events: none;
}

.hero-content>* {
  pointer-events: auto;
}

.hero-name {
  font-size: var(--t-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin-bottom: 28px;
}

.hero-tagline {
  font-size: clamp(18px, 1.5vw, 22px);
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 auto;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.hero-meta {
  margin-top: 48px;
  display: flex;
  gap: 24px;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-meta .sep {
  color: var(--ink-faint);
}

/* ──── orbit picker (below hero) ──── */
.orbit-bar {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.orbit-bar-inner {
  pointer-events: auto;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: color-mix(in oklab, var(--bg-2) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: calc(100vw - 48px);
  overflow-x: auto;
  scrollbar-width: none;
}

.orbit-bar-inner::-webkit-scrollbar {
  display: none;
}

.orbit-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}

.orbit-btn:hover {
  color: var(--ink);
}

.orbit-btn.active {
  color: var(--bg);
  background: var(--accent);
}

/* ──── about / portrait section ──── */
.about-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 80px;
  align-items: start;
}

@media (max-width: 880px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.04) brightness(0.95);
  display: block;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg,
      rgba(232, 112, 58, 0.06) 0%,
      transparent 40%,
      rgba(10, 9, 8, 0.4) 100%);
  pointer-events: none;
}

.portrait-caption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-body p+p {
  margin-top: 1.2em;
}

.about-body p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2);
}

.about-body strong {
  color: var(--ink);
  font-weight: 500;
}

/* ──── keyword chips ──── */
.kw-block {
  margin-top: 48px;
}

.kw-block+.kw-block {
  margin-top: 32px;
}

.kw-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--bg-2);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  transition: border-color 200ms, color 200ms, background 200ms;
}

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

/* ──── contact line ──── */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.contact-row a {
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
}

/* ──── resume page ──── */
.resume-header {
  padding: calc(var(--nav-h) + 80px) var(--gutter) 60px;
  max-width: var(--max);
  margin: 0 auto;
}

.resume-header h1 {
  font-size: var(--t-h1);
  margin-bottom: 16px;
}

.resume-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
  margin-top: 24px;
}

.resume-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px var(--gutter);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  border-top: 1px solid var(--line);
}

@media (max-width: 880px) {
  .resume-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.resume-section h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 500;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
}

.entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.entry:first-child {
  border-top: none;
  padding-top: 0;
}

@media (max-width: 720px) {
  .entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.entry-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  padding-top: 4px;
}

.entry-title {
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.entry-org {
  font-size: 14px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.entry-org .sup {
  color: var(--ink-faint);
  margin-left: 8px;
}

.entry-desc {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 56ch;
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.skill-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.skill-row:first-child {
  border-top: none;
  padding-top: 0;
}

@media (max-width: 720px) {
  .skill-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.skill-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  padding-top: 4px;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 16px;
  color: var(--ink);
}

.skill-items span {
  position: relative;
}

.skill-items span+span::before {
  content: "·";
  color: var(--ink-faint);
  margin-right: 18px;
  margin-left: -10px;
}

/* ──── projects page ──── */
.projects-header {
  padding: calc(var(--nav-h) + 80px) var(--gutter) 40px;
  max-width: var(--max);
  margin: 0 auto;
}

.projects-header h1 {
  font-size: var(--t-h1);
  margin-bottom: 20px;
}

.projects-header p {
  font-size: 19px;
  max-width: 64ch;
  color: var(--ink-2);
}

.project {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px var(--gutter);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 880px) {
  .project {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.project-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-top: 6px;
}

.project-body h3 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.project-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.project-desc {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
  max-width: 56ch;
}

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

.project-tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  border: 1px solid var(--line-2);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* visual / preview */
.project-visual {
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.project-visual canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.project-visual .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background-image: repeating-linear-gradient(45deg,
      transparent 0 6px,
      color-mix(in oklab, var(--line) 50%, transparent) 6px 7px);
}

/* ──── tweaks button trigger styling ──── */
.tweaks-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: none;
  /* shown by JS once available */
}

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

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