:root {
  --canvas: #181818;
  --canvas-elevated: #303030;
  --ink: #ffffff;
  --body: #969696;
  --muted: #666666;
  --muted-soft: #8f8f8f;
  --hairline: #303030;
  --primary: #da291c;
  --primary-hover: #9d2211;
  --primary-active: #b01e0a;
  --on-primary: #ffffff;
  --nav-bg: rgba(24, 24, 24, 0.82);
  --outline-border: rgba(255, 255, 255, 0.65);
  --outline-hover-bg: rgba(255, 255, 255, 0.06);
  --border: #ffffff;
  --shadow: #ffffff;
  --card: #303030;

  --s-xxxs: 4px;
  --s-xxs: 8px;
  --s-xs: 16px;
  --s-sm: 24px;
  --s-md: 32px;
  --s-lg: 48px;
  --s-xl: 64px;
  --s-xxl: 96px;

  --font: "Inter", -apple-system, system-ui, sans-serif;
  --container: 1280px;
  --nav-h: 64px;
  --grid-line: rgba(255, 255, 255, 0.05);
  --grid-size: 80px;

  /* Semantic aliases (OS theme follows source values above) */
  --background: var(--canvas);
  --surface: var(--canvas-elevated);
  --text: var(--ink);
  --text-2: var(--body);
  --text-muted: var(--muted);
  --accent: var(--primary);
  --accent-hover: var(--primary-hover);

  /* Z-index scale */
  --z-grid: -1;
  --z-content: 1;
  --z-nav: 100;
  --z-grain: 9999;
  --z-lightbox: 1000;
  --z-intro: 2000;
  --z-wipe: 3000;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #ffffff;
    --canvas-elevated: #f7f7f7;
    --ink: #181818;
    --body: #555555;
    --muted: #666666;
    --muted-soft: #8a8a8a;
    --hairline: #d2d2d2;
    --primary: #c81e12;
    --primary-hover: #a31a0e;
    --primary-active: #8f160b;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --outline-border: rgba(24, 24, 24, 0.5);
    --outline-hover-bg: rgba(24, 24, 24, 0.06);
    --grid-line: rgba(0, 0, 0, 0.06);
    --border: #181818;
    --shadow: #181818;
    --card: #f7f7f7;
  }
}

:root[data-mode="dyslexic"] {
  --font: "OpenDyslexic", "Inter", -apple-system, system-ui, sans-serif;
}

/* Dyslexic mode switch: single red wipe (class lives ~1.2s per toggle) */
.dyslexic-wipe {
  position: fixed;
  inset: 0;
  background: var(--primary);
  z-index: var(--z-wipe);
  pointer-events: none;
  transform: translate3d(-101%, 0, 0);
}

html.mode-flip .dyslexic-wipe {
  will-change: transform;
  animation: wipeAcross 1.15s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes wipeAcross {
  0% {
    transform: translate3d(-101%, 0, 0);
  }
  45%,
  55% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(101%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.mode-flip .dyslexic-wipe {
    animation: none;
  }
}

/* Dyslexic mode: wider glyphs need smaller display sizes + roomier text */
:root[data-mode="dyslexic"] body {
  line-height: 1.65;
}

:root[data-mode="dyslexic"] .hero-title {
  font-size: clamp(1.9rem, 1rem + 4.5vw, 3.75rem);
}

:root[data-mode="dyslexic"] .section-title {
  font-size: clamp(1.4rem, 1rem + 1.5vw, 1.7rem);
}

:root[data-mode="dyslexic"] .project-num {
  font-size: clamp(2.25rem, 1.5rem + 3.75vw, 3rem);
}

:root[data-mode="dyslexic"] .collab-name {
  font-size: clamp(1.5rem, 1.1rem + 3vw, 1.9rem);
}

/* ============ OVERSIMPLIFIED MODE (karpathy-clean, forced paper) ============ */
:root[data-mode="oversimplified"] {
  --font: Georgia, "Times New Roman", serif;
  --font-ui: Georgia, "Times New Roman", serif;
  --canvas: #ffffff;
  --canvas-elevated: transparent;
  --ink: #1a1a1a;
  --body: #333333;
  --muted: #555555;
  --muted-soft: #666666;
  --hairline: #e2e2e2;
  --primary: #1a0dab;
  --primary-hover: #120a8a;
  --primary-active: #0d0670;
  --on-primary: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --outline-hover-bg: rgba(0, 0, 0, 0.04);
  --grid-line: transparent;
  --border: #1a1a1a;
  --shadow: transparent;
  --card: transparent;
}

:root[data-mode="oversimplified"] body {
  line-height: 1.7;
}

:root[data-mode="oversimplified"] body::before,
:root[data-mode="oversimplified"] body::after {
  display: none;
}

/* sentence case + calm spacing everywhere */
:root[data-mode="oversimplified"] body,
:root[data-mode="oversimplified"] body * {
  text-transform: none;
  letter-spacing: normal;
}

/* Arial for UI chrome, Georgia everywhere else */
:root[data-mode="oversimplified"] .nav-links a,
:root[data-mode="oversimplified"] .mode-toggle,
:root[data-mode="oversimplified"] .btn,
:root[data-mode="oversimplified"] .hero-label,
:root[data-mode="oversimplified"] .hero-details,
:root[data-mode="oversimplified"] .hero-meta,
:root[data-mode="oversimplified"] .skill-tag,
:root[data-mode="oversimplified"] .project-tech span,
:root[data-mode="oversimplified"] .project-link,
:root[data-mode="oversimplified"] .info-label,
:root[data-mode="oversimplified"] .info-value,
:root[data-mode="oversimplified"] .exp-date,
:root[data-mode="oversimplified"] .exp-company,
:root[data-mode="oversimplified"] .edu-date,
:root[data-mode="oversimplified"] .edu-meta,
:root[data-mode="oversimplified"] .edu-school,
:root[data-mode="oversimplified"] .cert-issuer,
:root[data-mode="oversimplified"] .cert-view,
:root[data-mode="oversimplified"] .collab-eyebrow,
:root[data-mode="oversimplified"] .collab-social,
:root[data-mode="oversimplified"] .collab-copy,
:root[data-mode="oversimplified"] .lightbox-link {
  font-family: var(--font-ui);
}

/* full-bleed dense column: tiny side margins, info sooner */
:root[data-mode="oversimplified"] .container,
:root[data-mode="oversimplified"] .hero-inner {
  max-width: none;
}

:root[data-mode="oversimplified"] section {
  padding: 28px 20px;
}

:root[data-mode="oversimplified"] .hero {
  padding: calc(var(--nav-h) + 16px) 20px 24px;
}

:root[data-mode="oversimplified"] .hero-inner {
  grid-template-columns: 1fr auto;
  gap: var(--s-md);
  align-items: start;
}

:root[data-mode="oversimplified"] .hero-visual {
  justify-self: end;
  width: 320px;
  margin: 20px 40px 0 0;
}

:root[data-mode="oversimplified"] .hero-sub {
  margin-bottom: var(--s-xs);
}

:root[data-mode="oversimplified"] .hero-meta {
  margin-top: 16px;
  padding-top: 12px;
}

:root[data-mode="oversimplified"] .section-header {
  margin-bottom: var(--s-sm);
}

:root[data-mode="oversimplified"] .about-grid {
  gap: var(--s-md);
}

:root[data-mode="oversimplified"] .about-text p {
  margin-bottom: 8px;
}

:root[data-mode="oversimplified"] .project-desc {
  margin-bottom: var(--s-xs);
}

:root[data-mode="oversimplified"] .project-tech {
  margin-bottom: var(--s-xs);
}

:root[data-mode="oversimplified"] .hero-photo {
  border: none;
  box-shadow: none;
}

:root[data-mode="oversimplified"] .hero-photo:hover {
  transform: none;
  box-shadow: none;
}

/* flat cards: dividers, not boxes */
:root[data-mode="oversimplified"] .skill-card,
:root[data-mode="oversimplified"] .exp-card,
:root[data-mode="oversimplified"] .project-card,
:root[data-mode="oversimplified"] .collab-card {
  border: none;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

/* flat buttons: border box, no travel */
:root[data-mode="oversimplified"] .btn,
:root[data-mode="oversimplified"] .mode-toggle {
  border-width: 1px;
  box-shadow: none;
}

:root[data-mode="oversimplified"] .btn:hover,
:root[data-mode="oversimplified"] .btn:active,
:root[data-mode="oversimplified"] .btn.is-pressed,
:root[data-mode="oversimplified"] .mode-toggle:hover,
:root[data-mode="oversimplified"] .mode-toggle:active {
  transform: none;
  box-shadow: none;
}

/* blue links, never underlined */
:root[data-mode="oversimplified"] .project-link {
  border-bottom: none;
}

:root[data-mode="oversimplified"] a:hover {
  text-decoration: none;
}

/* plain-list treatment: content as default HTML, no card chrome */
:root[data-mode="oversimplified"] .section-line,
:root[data-mode="oversimplified"] .project-num,
:root[data-mode="oversimplified"] .cert-thumb {
  display: none;
}

:root[data-mode="oversimplified"] .hero-label {
  border: none;
  padding: 0;
}

:root[data-mode="oversimplified"] .skill-card-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 4px;
  font-size: 15px;
}

:root[data-mode="oversimplified"] .skill-card-title::after {
  content: ":";
}

:root[data-mode="oversimplified"] .skill-tag,
:root[data-mode="oversimplified"] .project-tech span {
  display: block;
  border: none;
  padding: 3px 0;
  font-size: 14px;
  font-weight: 400;
}

:root[data-mode="oversimplified"] .exp-row {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 4px;
}

:root[data-mode="oversimplified"] .exp-date,
:root[data-mode="oversimplified"] .edu-meta {
  border: none;
  padding: 0;
}

:root[data-mode="oversimplified"] .exp-list li {
  border-bottom: none;
  padding: 4px 0 4px var(--s-sm);
}

:root[data-mode="oversimplified"] .about-info {
  border-left: none;
  padding-left: 0;
}

:root[data-mode="oversimplified"] .info-row {
  border-bottom: none;
  padding: 4px 0;
}

:root[data-mode="oversimplified"] .hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 14px;
  font-weight: 400;
}

:root[data-mode="oversimplified"] .hero-detail-dot {
  display: none;
}

:root[data-mode="oversimplified"] .hero-detail {
  display: inline;
  padding: 3px 0;
}

:root[data-mode="oversimplified"] .hero-detail-label {
  font-size: 14px;
  font-weight: 400;
  margin-right: 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grid);
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  opacity: 0.25;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='3'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

.accordion-icon {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--canvas);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--canvas);
}

::selection {
  background: var(--primary);
  color: var(--canvas);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

section,
.hero,
footer {
  scroll-margin-top: var(--nav-h);
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
}

/* ============ FONT ROLES ============ */
.skill-card-title,
/* ============ INTRO OVERLAY ============ */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-intro);
  background: var(--canvas);
  display: none;
  align-items: center;
  justify-content: center;
}

.intro-overlay.show {
  display: flex;
}

.intro-overlay.hidden {
  display: none;
}

.intro-inner {
  text-align: center;
}

.intro-overlay.done {
  transform: translateY(-100%);
  transition: transform 0.65s cubic-bezier(0.77, 0, 0.18, 1);
}

.intro-monogram {
  font-size: 96px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -4px;
  color: var(--ink);
  opacity: 0;
  animation: introRise 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-dot {
  color: var(--primary);
}

.intro-rule {
  width: 96px;
  height: 1px;
  background: var(--primary);
  margin: 24px auto 0;
  opacity: 0;
  transform: scaleX(0);
  animation: introSweep 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.intro-tagline {
  margin-top: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted-soft);
  opacity: 0;
  animation: introFade 0.45s ease 0.9s forwards;
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introSweep {
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes introFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ HERO ENTRANCE ============ */
.hero-label,
.hero-title,
.hero-sub,
.hero-cta,
.hero-details,
.hero-visual,
.hero-meta {
  transition:
    opacity 0.65s ease,
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js body:not(.ready) .hero-label,
html.js body:not(.ready) .hero-title,
html.js body:not(.ready) .hero-sub,
html.js body:not(.ready) .hero-cta,
html.js body:not(.ready) .hero-details,
html.js body:not(.ready) .hero-visual,
html.js body:not(.ready) .hero-meta {
  opacity: 0;
  transform: translateY(24px);
}

html.js body.ready .hero-label {
  transition-delay: 0.05s;
}

html.js body.ready .hero-title {
  transition-delay: 0.18s;
}

html.js body.ready .hero-sub {
  transition-delay: 0.38s;
}

html.js body.ready .hero-cta {
  transition-delay: 0.58s;
}

html.js body.ready .hero-details {
  transition-delay: 0.66s;
}

html.js body.ready .hero-visual {
  transition-delay: 0.42s;
}

html.js body.ready .hero-meta {
  transition-delay: 0.72s;
}

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

  .intro-overlay {
    display: none !important;
  }

  html.js body .hero-label,
  html.js body .hero-title,
  html.js body .hero-sub,
  html.js body .hero-cta,
  html.js body .hero-details,
  html.js body .hero-visual,
  html.js body .hero-meta {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-details .press,
  .hero-meta .press {
    animation: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .btn,
  .hero-photo {
    transition: none !important;
  }

  .btn:hover,
  .btn:active {
    transform: none !important;
  }
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--hairline);
  z-index: var(--z-nav);
  transition: background 0.3s ease;
}

.nav.scrolled {
  background: var(--canvas);
}

.logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  line-height: 1;
}

.logo-mark {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.35rem 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.mode-toggle {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  padding: 10px 14px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.2s ease,
    color 0.2s ease;
}

@media (hover: hover) {
  .mode-toggle:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--shadow);
  }
}

.mode-toggle:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--shadow);
}

.mode-toggle:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.mode-toggle.is-on {
  background: var(--primary);
  color: var(--on-primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: auto;
  display: block;
  overflow: hidden;
  background: var(--canvas);
  padding: calc(var(--nav-h) + 48px) clamp(1.5rem, 5vw, 3rem) 64px;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero-visual {
  justify-self: end;
  width: min(100%, 400px);
  perspective: 900px;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
  border: 2px solid var(--border);
  box-shadow: 8px 8px 0 var(--primary);
  display: block;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.22s ease;
  will-change: transform;
}

.hero-photo:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--primary);
}

.hero-visual:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 0;
}

@media (hover: none) {
  .hero-photo {
    transition: none;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--hairline);
  padding: var(--s-xxxs) 12px;
  margin-bottom: var(--s-sm);
}

.hero-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--primary);
  margin-right: 8px;
}

.hero-title {
  font-size: clamp(2.5rem, 1.2rem + 6vw, 5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -1.6px;
  text-transform: uppercase;
  margin-bottom: var(--s-sm);
}

.hero-title .accent-dot {
  color: var(--primary);
}

.hero-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  max-width: 520px;
  margin-bottom: var(--s-md);
}

.hero-cta {
  display: flex;
  gap: var(--s-xs);
  flex-wrap: wrap;
}

.hero-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: var(--s-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.hero-detail-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.1px;
  margin-right: 4px;
}

.hero-detail-label::after {
  content: ":";
  margin-left: 1px;
}

.hero-detail-dot {
  color: var(--muted);
  opacity: 0.5;
}

.hero-details .press {
  color: var(--primary);
  animation: blink 1.5s step-end infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 0 32px;
  height: 48px;
  border-radius: 0;
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

@media (hover: hover) {
  .btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--shadow);
  }
}

.btn:active,
.btn.is-pressed {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--shadow);
}

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

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--primary-hover);
  }
}

.btn-primary:active,
.btn-primary.is-pressed {
  background: var(--primary-active);
}

.btn-outline {
  background: var(--card);
  color: var(--ink);
  border-color: var(--border);
}

@media (hover: hover) {
  .btn-outline:hover {
    background: var(--outline-hover-bg);
  }
}

.hero-meta {
  position: static;
  max-width: var(--container);
  margin: 40px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.hero-meta-item {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta-item:not(:last-child)::after {
  content: "\00B7";
  margin-left: 16px;
  color: var(--muted);
  opacity: 0.5;
}

.hero-meta-label {
  display: inline;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--muted);
  line-height: 1.2;
}

.hero-meta-label::after {
  content: ":";
  margin-left: 2px;
}

.hero-meta .press {
  color: var(--primary);
  animation: blink 1.5s step-end infinite;
}

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

/* ============ SECTIONS ============ */
section {
  padding: clamp(48px, 8vw, 96px) clamp(1.5rem, 5vw, 3rem);
  border-bottom: 1px solid var(--hairline);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  margin-bottom: var(--s-xl);
}

.section-title {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.36px;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xxl);
}

.about-text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--body);
  margin-bottom: var(--s-xs);
}

.about-text .hl {
  color: var(--ink);
  font-weight: 500;
}

.about-info {
  border-left: 1px solid var(--hairline);
  padding-left: var(--s-sm);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-xs);
  padding: var(--s-xs) 0;
  border-bottom: 1px solid var(--hairline);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.info-value {
  font-size: 14px;
  color: var(--ink);
  text-align: right;
}

/* ============ SKILLS ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-sm);
}

.skill-card {
  background: var(--canvas-elevated);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: var(--s-md);
}

.skill-card-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08px;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: var(--s-xs);
  margin-bottom: var(--s-xs);
  border-bottom: 1px solid var(--hairline);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xxs);
}

.skill-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  padding: var(--s-xxxs) 12px;
  border-radius: 0;
  border: 1px solid var(--hairline);
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.skill-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============ EXPERIENCE ============ */
.exp-card {
  background: var(--canvas-elevated);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: var(--s-md);
}

.exp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-sm);
  flex-wrap: wrap;
  padding-bottom: var(--s-xs);
  margin-bottom: var(--s-xs);
  border-bottom: 1px solid var(--hairline);
}

.exp-role {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.exp-company {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: var(--s-xxxs);
}

.exp-date {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--hairline);
  padding: var(--s-xxxs) 12px;
  white-space: nowrap;
}

.exp-list {
  list-style: none;
}

.exp-list li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  padding: 12px 0;
  padding-left: var(--s-sm);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}

.exp-list li:last-child {
  border-bottom: none;
}

.exp-list li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ============ PROJECTS ============ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-sm);
}

.project-card {
  background: var(--canvas-elevated);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: var(--s-md);
  display: flex;
  flex-direction: column;
}

.project-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-xs);
  margin-bottom: var(--s-xs);
}

.project-num {
  font-size: clamp(3rem, 2rem + 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.6px;
  color: var(--primary);
}

.project-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.project-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--body);
  margin-bottom: var(--s-sm);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xxs);
  margin-bottom: var(--s-md);
}

.project-tech span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  padding: var(--s-xxxs) 12px;
  border-radius: 0;
  border: 1px solid var(--hairline);
  color: var(--ink);
}

.project-links {
  display: flex;
  gap: var(--s-md);
  flex-wrap: wrap;
  margin-top: auto;
}

.project-link {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid rgba(218, 41, 28, 0.45);
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.project-link .arrow {
  transition: transform 0.2s ease;
}

.project-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.project-link:hover .arrow {
  transform: translateX(4px);
}

/* ============ EDUCATION ============ */
.edu-list {
  border-top: 1px solid var(--hairline);
}

.edu-row {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: var(--s-sm);
  align-items: baseline;
  padding: var(--s-sm) 0;
  border-bottom: 1px solid var(--hairline);
}

.edu-date {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
}

.edu-degree {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08px;
  color: var(--ink);
}

.edu-school {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: var(--s-xxxs);
}

.edu-meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--hairline);
  padding: var(--s-xxxs) 12px;
  white-space: nowrap;
}

/* ============ CERTIFICATIONS ============ */
.cert-list {
  border-top: 1px solid var(--hairline);
}

.cert-row {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-xs);
  align-items: center;
  padding: var(--s-xs) 0;
  border-bottom: 1px solid var(--hairline);
}

.cert-thumb {
  display: block;
  width: 96px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--hairline);
  background: var(--canvas-elevated);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0);
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
}

/* Hover color override for thumb only */
.cert-row:hover .cert-thumb img {
  transform: scale(1.03);
}

.cert-thumb:hover {
  border-color: var(--primary);
}

.cert-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08px;
  color: var(--ink);
  cursor: pointer;
}

.cert-issuer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: var(--s-xxxs);
}

.cert-view {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cert-view:hover {
  color: var(--primary);
}

.cert-view .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.cert-view:hover .arrow {
  transform: translateX(4px);
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-lg);
  background: rgba(24, 24, 24, 0.94);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-xs);
  max-width: min(100%, 1200px);
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border: 1px solid var(--hairline);
}

.lightbox-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.lightbox-link:hover {
  color: var(--primary);
}

.lightbox-close {
  position: absolute;
  top: var(--s-sm);
  right: var(--s-sm);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.lightbox-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============ FOOTER / COLLAB CARD ============ */
footer {
  border-top: 1px solid var(--hairline);
  padding: var(--s-md) clamp(1.5rem, 5vw, 3rem) var(--s-md);
}

/* Contact focus: nav Contact isolates the footer card, centered */
body.contact-focus section {
  display: none;
}

body.contact-focus footer {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: none;
}

.collab-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "main side";
  align-items: center;
  gap: var(--s-xs) var(--s-lg);
  background: var(--canvas-elevated);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: var(--s-sm) var(--s-lg);
}

.collab-main {
  grid-area: main;
}

.collab-side {
  grid-area: side;
}

.collab-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-xxxs);
}

.collab-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink);
  max-width: 680px;
}

.collab-quote {
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  margin-top: var(--s-xxs);
}

.collab-quote-by {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: var(--muted);
}

.collab-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
}

.collab-socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
  margin-top: var(--s-xxs);
  padding-top: var(--s-xxs);
  border-top: 1px solid var(--hairline);
}

.collab-social {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  color: var(--body);
  transition: color 0.2s ease;
}

.collab-social:hover {
  color: var(--primary);
}

.collab-name {
  font-size: clamp(2rem, 1.4rem + 4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.8px;
  color: var(--ink);
  margin-bottom: var(--s-xxs);
}

.collab-dot {
  color: var(--primary);
}

.collab-copy {
  max-width: var(--container);
  margin: var(--s-md) auto 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* ============ REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .nav-links {
    gap: 1.25rem;
  }
}

@media (max-width: 1024px) {
  .hero-visual {
    width: min(100%, 360px);
  }

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

@media (max-width: 768px) {
  

  .nav {
    padding: 0 1.5rem;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    width: 100%;
    background: var(--canvas);
    flex-direction: column;
    padding: var(--s-sm) 1.5rem;
    gap: var(--s-sm);
    border-bottom: 1px solid var(--hairline);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .section-header.accordion-header {
    cursor: pointer;
    flex-wrap: nowrap;
  }

  .accordion-header .section-line {
    display: none;
  }

  .accordion-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: auto;
  }

  .accordion-icon::before,
  .accordion-icon::after {
    content: "";
    position: absolute;
    background: var(--ink);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease;
  }

  .accordion-icon::before {
    left: 0;
    right: 0;
    top: 50%;
    height: 1.5px;
    transform: translateY(-50%);
  }

  .accordion-icon::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1.5px;
    transform: translateX(-50%);
  }

  .accordion-header[aria-expanded="true"] .accordion-icon::after {
    opacity: 0;
    transform: translateX(-50%) scaleY(0);
  }

  .collapsible-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      max-height 0.25s ease,
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s;
  }

  .accordion-header[aria-expanded="true"] + .collapsible-body {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  :root {
    --grid-size: 56px;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    padding: calc(var(--nav-h) + 24px) 1.5rem 48px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--s-lg);
  }

  .hero-visual {
    order: -1;
    justify-self: center;
    width: min(78vw, 340px);
    margin: 0 auto;
  }

  .hero-photo {
    border-radius: 0;
  }

  .hero-details {
    display: none;
  }

  .hero-meta {
    display: none;
  }

  .section-header {
    margin-bottom: var(--s-md);
  }

  .accordion-header[aria-expanded="false"] {
    margin-bottom: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--s-xl);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .edu-row {
    grid-template-columns: 1fr;
    gap: var(--s-xxs);
  }

.cert-row {
  cursor: pointer;
    grid-template-columns: auto 1fr;
    gap: var(--s-xs);
  }

  .cert-view {
    grid-column: 1 / -1;
  }

  .collab-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "side";
    text-align: center;
  }

  .collab-title {
    margin: 0 auto;
  }

  .collab-cta,
  .collab-socials {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .intro-monogram {
    font-size: 56px;
    letter-spacing: -2.24px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .section-header {
    flex-wrap: wrap;
  }

  .section-line {
    width: 100%;
  }

  .collab-title {
    font-size: 18px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .collab-card {
    padding: var(--s-sm) var(--s-md);
  }

  .collab-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .collab-cta .btn {
    width: 100%;
  }

  .collab-socials {
    gap: var(--s-xs);
  }
}

/* Oversimplified mobile: stack hero, neutralize desktop offsets */
@media (max-width: 768px) {
  :root[data-mode="oversimplified"] .hero-inner {
    grid-template-columns: 1fr;
  }

  :root[data-mode="oversimplified"] .hero-visual {
    order: -1;
    width: min(78vw, 300px);
    margin: 0 auto;
  }

  :root[data-mode="oversimplified"] section {
    padding: 24px 16px;
  }

  :root[data-mode="oversimplified"] .hero {
    padding: calc(var(--nav-h) + 16px) 16px 24px;
  }
}
