@font-face {
  font-family: "Roboto Mono";
  src: url("assets/fonts/roboto-mono-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("assets/fonts/roboto-mono-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("assets/fonts/roboto-mono-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("assets/fonts/roboto-mono-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f7f2;
  --fg: #0c0c0f;
  --muted: rgba(12, 12, 15, 0.72);
  --accent: #0c0c0f;
  --border: rgba(12, 12, 15, 0.18);
  --line: rgba(12, 12, 15, 0.12);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.7);
  --shadow: rgba(0, 0, 0, 0.16);
  --page-gutter: clamp(12px, 2.4vw, 24px);
  --ribbon-height: 84px;
  --ribbon-closed: var(--ribbon-height);
  --ribbon-open: calc(100vw - 48px);
  --ribbon-radius: 18px;
}

body[data-theme="dark"] {
  --bg: #050505;
  --fg: #f7f7f2;
  --muted: rgba(247, 247, 242, 0.72);
  --accent: #f7f7f2;
  --border: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.12);
  --surface: rgba(0, 0, 0, 0.85);
  --surface-soft: rgba(0, 0, 0, 0.7);
  --shadow: rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Roboto Mono", monospace;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}


html {
  overflow-x: hidden;
}

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

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

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

.bg-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 12, 15, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(12, 12, 15, 0.08) 1px, transparent 1px);
  background-size: 140px 140px;
  opacity: 0.14;
  z-index: 0;
}

body[data-theme="dark"] .bg-texture {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  opacity: 0.1;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
}

.lede {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--muted);
  max-width: 52ch;
}

.hero-bullet {
  min-height: calc(1.6em * 3);
  display: block;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-bullet-prefix {
  display: inline;
  margin-right: 0.35em;
  white-space: nowrap;
}

.hero-bullet-dynamic {
  display: inline;
}

.body {
  color: var(--muted);
  font-size: 17px;
  max-width: 60ch;
}

.section-shell {
  max-width: 820px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 2;
}

.section-shell.narrow {
  max-width: 900px;
}

.section-shell.full-bleed {
  max-width: none;
  width: 100%;
}

.section-shell.align-right {
  margin-left: auto;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(120px, 12vw, 200px) clamp(7vw, 12vw, 18vw);
  padding-right: clamp(26vw, 30vw, 38vw);
  position: relative;
  background: radial-gradient(120% 100% at 30% 40%, rgba(255, 255, 255, 0.8), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 40%);
}

body[data-theme="dark"] .hero {
  background: radial-gradient(120% 100% at 30% 40%, rgba(0, 0, 0, 0.8), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 40%);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(28px, 7vh, 64px) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  color: var(--muted);
  opacity: 0.5;
  animation: scroll-cue 6.8s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 600ms ease;
}

.scroll-cue svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes scroll-cue {
  0% {
    transform: translate(-50%, 0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, 12px);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 0;
  }
}

body.scrolled .scroll-cue {
  animation: none;
}


.hero h1 {
  font-size: clamp(64px, 9vw, 120px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.about {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: clamp(100px, 12vw, 180px) var(--page-gutter);
  padding-left: clamp(22vw, 30vw, 40vw);
  position: relative;
  background: radial-gradient(120% 100% at 70% 50%, rgba(255, 255, 255, 0.8), transparent 55%);
}

body[data-theme="dark"] .about {
  background: radial-gradient(120% 100% at 70% 50%, rgba(0, 0, 0, 0.8), transparent 55%);
}

.about.about-secondary {
  padding-left: clamp(7vw, 12vw, 18vw);
  padding-right: clamp(22vw, 30vw, 40vw);
  background: radial-gradient(120% 100% at 30% 50%, rgba(255, 255, 255, 0.8), transparent 55%);
}

body[data-theme="dark"] .about.about-secondary {
  background: radial-gradient(120% 100% at 30% 50%, rgba(0, 0, 0, 0.8), transparent 55%);
}

.about h2,
.projects-lock-title {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.about .section-shell {
  max-width: min(1280px, calc(100% - (var(--page-gutter) * 2)));
  width: 100%;
}

.about .section-shell.align-right {
  max-width: min(760px, 100%);
  margin-left: auto;
  margin-right: 0;
}

.projects-stack {
  position: relative;
  z-index: 2;
  padding: clamp(90px, 12vw, 150px) clamp(7vw, 12vw, 18vw) clamp(90px, 14vw, 160px);
  background: transparent;
}

body[data-theme="dark"] .projects-stack {
  background: transparent;
}

.projects-stack .section-shell {
  margin-bottom: clamp(8px, 1.8vw, 16px);
  position: relative;
  z-index: 4;
}

.projects-stack .section-shell .eyebrow.is-pinned {
  position: fixed;
  left: var(--projects-eyebrow-pin-left, 0px);
  top: var(--projects-eyebrow-pin-top, 120px);
  width: var(--projects-eyebrow-pin-width, auto);
  margin: 0;
  z-index: 12;
}

.projects-stack .projects-lock-title {
  position: relative;
  z-index: 3;
  margin: 0 0 clamp(20px, 3vw, 34px);
}

.projects-stack .projects-lock-title.is-pinned {
  position: fixed;
  left: var(--projects-pin-left, 0px);
  top: var(--projects-pin-top, clamp(160px, 23vh, 270px));
  width: var(--projects-pin-width, auto);
  margin: 0;
  z-index: 11;
}

.scroll-stack-wrap {
  width: min(980px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.scroll-stack-inner {
  position: relative;
  padding: clamp(8vh, 10vh, 13vh) 0 clamp(16vh, 22vh, 30vh);
  isolation: isolate;
}

.scroll-stack-card {
  position: relative;
  min-height: clamp(250px, 34vw, 360px);
  width: 100%;
  margin: 0;
  padding: clamp(20px, 3vw, 34px);
  border-radius: 26px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 22px 42px var(--shadow);
  transform-origin: top center;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  contain: layout paint;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  filter: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(14px, 2vw, 20px);
}

body[data-theme="dark"] .scroll-stack-card {
  background: #080808;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.55);
}

.scroll-stack-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

body[data-theme="dark"] .scroll-stack-card::before {
  border-color: rgba(255, 255, 255, 0.09);
}

.scroll-stack-card.is-link {
  cursor: pointer;
}

.scroll-stack-card.is-link:hover {
  border-color: rgba(12, 12, 15, 0.35);
}

body[data-theme="dark"] .scroll-stack-card.is-link:hover {
  border-color: rgba(255, 255, 255, 0.38);
}

.scroll-stack-card.is-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.stack-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stack-kicker {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
}

.stack-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
}

.stack-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 34%, 360px);
  gap: clamp(14px, 2vw, 24px);
  align-items: stretch;
}

body.hide-card-models .stack-card-layout {
  grid-template-columns: 1fr;
}

body.hide-card-models .stack-model-slot {
  display: none;
}

.stack-card-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.stack-card-copy h3 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.stack-card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 60ch;
}

.stack-model-slot {
  position: relative;
  border-radius: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  min-height: 220px;
}

body[data-theme="dark"] .stack-model-slot {
  background: transparent;
}

.stack-model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: transparent !important;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  --progress-mask: transparent;
  pointer-events: none;
  transform: scale(1.14);
  transform-origin: center center;
}

.experimental-wireframe .stack-model-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(10, 10, 10, 0.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 10, 10, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.stack-model-viewer.stack-model-viewer--wireframe {
  filter: grayscale(1) contrast(1.22) brightness(1.04);
}

.stack-model-viewer.stack-model-viewer--macbook {
  transform: scale(1.36);
}

.stack-model-viewer.stack-model-viewer--cube {
  filter: brightness(0.88);
}

.stack-model-viewer.stack-model-viewer--cube.stack-model-viewer--cube-index {
  filter: brightness(0.9) contrast(1.08);
}

.stack-model-viewer.stack-model-viewer--wireframe.stack-model-viewer--cube {
  filter: grayscale(1) contrast(1.18) brightness(1.16) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.stack-model-viewer::part(default-progress-bar),
.stack-model-viewer::part(default-progress-mask),
.stack-model-viewer::part(default-progress-track) {
  display: none !important;
}

.stack-model-fallback {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack-card-cta {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--surface);
}

.scroll-stack-end {
  width: 100%;
  height: 1px;
}

.cta {
  padding: clamp(80px, 10vw, 160px) clamp(6vw, 10vw, 16vw) clamp(120px, 12vw, 180px);
  background: linear-gradient(
    180deg,
    rgba(12, 12, 15, 0) 0%,
    rgba(12, 12, 15, 0.04) 55%,
    rgba(12, 12, 15, 0.06) 100%
  );
}

body[data-theme="dark"] .cta {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.06) 55%,
    rgba(255, 255, 255, 0.08) 100%
  );
}

.cta h2 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.01em;
}

.cta.preview-section {
  padding: clamp(140px, 16vw, 220px) 0 0;
  background: transparent;
}

body[data-theme="dark"] .cta.preview-section {
  background: transparent;
}

.mini-projects {
  margin-top: 0;
  display: grid;
  gap: 20px;
  width: 100%;
  --bg: #f7f7f2;
  --panel: #ffffff;
  --panel-glow: rgba(0, 0, 0, 0.05);
  --card-radius: 28px;
  --gap: clamp(24px, 8vw, 80px);
  --ink: #0c0c0f;
  --ink-soft: rgba(12, 12, 15, 0.72);
  --border: rgba(12, 12, 15, 0.18);
  --line: rgba(12, 12, 15, 0.12);
  --card-text: var(--ink-soft);
}

body[data-theme="dark"] .mini-projects {
  --bg: #000;
  --panel: #0a0a0c;
  --panel-glow: rgba(255, 255, 255, 0.08);
  --ink: #f5f6fb;
  --ink-soft: rgba(245, 246, 251, 0.7);
  --border: rgba(255, 255, 255, 0.4);
  --line: rgba(255, 255, 255, 0.08);
  --card-text: var(--ink-soft);
}

.mini-frame {
  position: relative;
  border-radius: 0;
  border: 0;
  background: var(--bg);
  overflow: hidden;
  box-shadow: none;
  opacity: calc(0.18 + 0.82 * var(--preview-reveal, 0));
  transition: opacity 220ms ease;
  width: 100%;
  height: 100vh;
}

.mini-workspace {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--columns, 5), 70vw);
  grid-template-rows: repeat(var(--rows, 4), 70vh);
  gap: var(--gap);
  padding: clamp(24px, 7vw, 96px);
  overflow: hidden;
  cursor: pointer;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-y;
}

.mini-workspace.is-grabbing {
  cursor: grabbing;
}

.mini-workspace::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.mini-projects .project-card {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line);
  isolation: isolate;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, filter 220ms ease;
  contain: layout paint;
  will-change: transform;
}

.mini-projects .project-card::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(60% 60% at 30% 30%, var(--panel-glow), transparent 60%);
  opacity: 0.35;
  z-index: 0;
}

.mini-projects .project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 40%, rgba(255, 255, 255, 0));
  mix-blend-mode: normal;
  opacity: 0.6;
  z-index: 1;
}

body[data-theme="dark"] .mini-projects .project-card::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%, rgba(0, 0, 0, 0.65));
}

.mini-projects .project-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(12, 12, 15, 0.32);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(12, 12, 15, 0.18);
  filter: none;
}

.mini-projects .card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e7e7df;
}

body[data-theme="dark"] .mini-projects .card-media {
  background: #050505;
}

.mini-projects .card-media img,
.mini-projects .card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-projects .card-index {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

body[data-theme="dark"] .mini-projects .card-index {
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.mini-projects .intro-card {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 0 0 2px var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  overflow: hidden;
}

.mini-projects .intro-card::before,
.mini-projects .intro-card::after {
  display: none;
}

.mini-projects .intro-card .card-index {
  position: absolute;
  top: 16px;
  left: 16px;
  border: 1px solid rgba(12, 12, 15, 0.5);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

body[data-theme="dark"] .mini-projects .intro-card {
  border: 3px solid #fff;
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 2px #fff;
  color: #fff;
}

body[data-theme="dark"] .mini-projects .intro-card .card-index {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.mini-projects .intro-content {
  text-align: center;
  color: #0c0c0f;
  display: grid;
  gap: 38px;
  padding: 40px 56px;
  max-width: 90%;
}

.mini-projects .intro-title {
  font-size: clamp(60px, 12vw, 128px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.1;
}

.mini-projects .intro-sub {
  font-size: 22px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  color: var(--ink-soft);
  line-height: 1.3;
}

.mini-projects .intro-surprise {
  justify-self: center;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 26px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mini-projects .intro-surprise:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 860px) {
  .mini-workspace {
    grid-template-columns: repeat(var(--columns, 5), 85vw);
    grid-template-rows: repeat(var(--rows, 4), 75vh);
  }
}

.actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(12, 12, 15, 0.24);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 12px;
  background: transparent;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.btn.primary {
  border-color: rgba(12, 12, 15, 0.32);
}

.btn.ghost {
  border-color: rgba(12, 12, 15, 0.22);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(12, 12, 15, 0.48);
}

body[data-theme="dark"] .btn {
  border-color: rgba(255, 255, 255, 0.24);
  color: #f7f7f2;
}

body[data-theme="dark"] .btn.primary {
  border-color: rgba(255, 255, 255, 0.32);
}

body[data-theme="dark"] .btn.ghost {
  border-color: rgba(255, 255, 255, 0.22);
}

body[data-theme="dark"] .btn:hover {
  border-color: rgba(255, 255, 255, 0.48);
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-top: 18px;
  border: 1px solid rgba(12, 12, 15, 0.14);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] .cta-grid {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.4);
}

.cta-card {
  padding: 18px 18px;
  border-bottom: 1px solid rgba(12, 12, 15, 0.08);
  background: transparent;
  display: grid;
  gap: 6px;
  transition: transform 160ms ease, color 160ms ease;
}

.cta-card:last-child {
  border-bottom: none;
}

.cta-card:hover {
  transform: translateX(4px);
  color: var(--accent);
}

.cta-title {
  font-weight: 700;
  font-size: 18px;
}

.cta-note {
  color: rgba(12, 12, 15, 0.7);
  font-size: 15px;
}

body[data-theme="dark"] .cta-note {
  color: var(--muted);
}

.contact-card {
  margin-top: 28px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(12, 12, 15, 0.12);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.contact-card h3 {
  font-size: 22px;
  margin: 4px 0;
}

.contact-copy {
  display: grid;
  gap: 6px;
  max-width: 620px;
}

/* --- Ribbon Header --- */
.ribbon-header {
  position: fixed;
  top: 24px;
  right: 24px;
  left: auto;
  z-index: 12;
  pointer-events: none;
}

.ribbon-shell {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  height: var(--ribbon-height);
  width: var(--ribbon-closed);
  min-width: var(--ribbon-height);
  max-width: var(--ribbon-open);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 12, 15, 0.35);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.12);
  border-radius: var(--ribbon-radius);
  overflow: hidden;
  transition: box-shadow 220ms ease, border-color 220ms ease;
  contain: layout paint;
  padding: 0;
}

.ribbon-shell.is-open {
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.18);
  border-color: rgba(12, 12, 15, 0.6);
  padding: 0 calc(var(--ribbon-height) + 10px) 0 18px;
}

body[data-theme="dark"] .ribbon-shell {
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .ribbon-shell.is-open {
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.75);
}

.ribbon-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  height: var(--ribbon-height);
  width: var(--ribbon-height);
  aspect-ratio: 1 / 1;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: none;
  --shake-mag: 0.4;
  --shake-period: 0.35s;
}

.ribbon-toggle.is-shaking {
  animation: ribbon-shake var(--shake-period, 0.35s) ease-in-out infinite;
}

.ribbon-label {
  display: none;
}

.ribbon-icon {
  width: var(--ribbon-height);
  height: var(--ribbon-height);
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: none;
  border: none;
  display: grid;
  place-items: center;
}

.ribbon-icon svg {
  width: 64%;
  height: 64%;
  overflow: visible;
  display: block;
}

.ribbon-lines line {
  stroke: #0c0c0f;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-theme="dark"] .ribbon-lines line {
  stroke: #ffffff;
}

.ribbon-nav {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
  padding: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 180ms ease, transform 180ms ease, max-width 220ms ease, padding 180ms ease, gap 180ms ease;
  white-space: nowrap;
}

.ribbon-shell.is-open .ribbon-nav {
  opacity: 1;
  pointer-events: auto;
  gap: 12px;
  padding: 0 18px;
  max-width: 1200px;
  transform: translateX(0);
}

.ribbon-nav a,
.ribbon-nav .nav-button {
  color: #0c0c0f;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  background: rgba(12, 12, 15, 0.04);
  border: 1px solid rgba(12, 12, 15, 0.12);
}

.ribbon-nav .nav-button {
  appearance: none;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-dark-only {
  display: none;
}

.ribbon-nav .nav-button.nav-dark-only {
  display: none;
}

body[data-theme="dark"] .nav-dark-only {
  display: inline-flex;
}

body[data-theme="dark"] .ribbon-nav .nav-button.nav-dark-only {
  display: inline-flex;
}

.ribbon-nav a:hover,
.ribbon-nav .nav-button:hover {
  background: rgba(12, 12, 15, 0.12);
  color: #000;
}

body[data-theme="dark"] .ribbon-nav a,
body[data-theme="dark"] .ribbon-nav .nav-button {
  color: #f5f6fb;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .ribbon-nav a:hover,
body[data-theme="dark"] .ribbon-nav .nav-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

@keyframes ribbon-shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(calc(-2px * var(--shake-mag)), calc(1px * var(--shake-mag)))
      rotate(calc(-2deg * var(--shake-mag)));
  }
  50% {
    transform: translate(calc(2px * var(--shake-mag)), calc(-1px * var(--shake-mag)))
      rotate(calc(2deg * var(--shake-mag)));
  }
  75% {
    transform: translate(calc(-1px * var(--shake-mag)), calc(-2px * var(--shake-mag)))
      rotate(calc(-1deg * var(--shake-mag)));
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

/* --- Globe --- */
.globe-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  will-change: transform;
}

.globe-stage.is-left {
  left: clamp(4vw, 12vw, 18vw);
  right: auto;
  transform: translateX(-6%);
}

.globe {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.globe canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
}

.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
}

body > .globe-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

body > canvas {
  position: fixed;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  z-index: 0;
}

.globe-halo {
  position: absolute;
  inset: -12%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(0, 0, 0, 0.05), transparent 70%),
    radial-gradient(40% 40% at 30% 30%, rgba(0, 0, 0, 0.04), transparent 65%),
    radial-gradient(40% 40% at 70% 70%, rgba(0, 0, 0, 0.04), transparent 65%);
  filter: blur(6px);
  opacity: 0.45;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .globe-halo {
  background: radial-gradient(60% 60% at 50% 50%, rgba(255, 255, 255, 0.04), transparent 70%),
    radial-gradient(40% 40% at 30% 30%, rgba(255, 255, 255, 0.03), transparent 65%),
    radial-gradient(40% 40% at 70% 70%, rgba(255, 255, 255, 0.03), transparent 65%);
  opacity: 0.35;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.6);
}

@media (max-width: 1200px) {
  .hero {
    padding-right: clamp(16vw, 20vw, 26vw);
  }

  .about {
    padding-left: clamp(14vw, 18vw, 26vw);
  }

  .about.about-secondary {
    padding-right: clamp(14vw, 18vw, 26vw);
  }
}

@media (max-width: 1440px) {
  .hero h1 {
    font-size: clamp(56px, 7.5vw, 96px);
  }

  .about h2,
  .projects-lock-title {
    font-size: clamp(28px, 3.4vw, 40px);
  }

  .cta h2 {
    font-size: clamp(26px, 3.2vw, 38px);
  }
}

@media (max-width: 960px) {
  body {
    overflow-x: hidden;
  }

  .ribbon-header {
    top: 12px;
    right: 12px;
    left: auto;
  }

  .ribbon-shell {
    width: calc(100vw - 24px);
    min-width: 0;
    max-width: calc(100vw - 24px);
    align-items: stretch;
  }

  .ribbon-shell.is-open {
    height: auto;
    padding: calc(var(--ribbon-height) + 6px) 12px 12px;
  }

  .ribbon-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    transform: translateY(-6px);
  }

  .ribbon-shell.is-open .ribbon-nav {
    padding: 0;
    gap: 10px;
    transform: translateY(0);
  }

  .ribbon-nav a,
  .ribbon-nav .nav-button {
    width: 100%;
  }

  .globe-stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
    opacity: 0.55;
  }

  .globe-stage.is-left {
    transform: none;
  }

  .hero {
    padding: clamp(110px, 14vw, 160px) clamp(7vw, 10vw, 14vw);
    padding-bottom: clamp(40px, 10vh, 120px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 56px);
    line-height: 1.08;
  }

  .lede {
    font-size: clamp(16px, 4.2vw, 18px);
  }

  .about {
    padding: clamp(80px, 14vw, 140px) var(--page-gutter);
  }

  .about.about-secondary {
    padding: clamp(80px, 14vw, 140px) var(--page-gutter);
  }

  .about h2,
  .projects-lock-title {
    font-size: clamp(22px, 6vw, 30px);
    line-height: 1.15;
  }

  .body {
    font-size: clamp(15px, 4vw, 17px);
  }

  .about .section-shell {
    margin-left: 0;
  }

  .projects-stack {
    padding: clamp(80px, 14vw, 120px) var(--page-gutter) clamp(80px, 16vw, 120px);
  }

  .scroll-stack-inner {
    padding: clamp(3vh, 5vh, 6vh) 0 clamp(12vh, 18vh, 24vh);
  }

  .scroll-stack-card {
    min-height: clamp(240px, 56vw, 320px);
    border-radius: 20px;
    padding: clamp(16px, 5vw, 24px);
  }

  .stack-card-copy h3 {
    font-size: clamp(24px, 7.2vw, 34px);
  }

  .stack-card-layout {
    grid-template-columns: 1fr;
  }

  .stack-model-slot,
  .stack-model-viewer,
  .stack-model-fallback {
    min-height: 240px;
  }

  .cta {
    padding: clamp(60px, 12vw, 120px) clamp(7vw, 10vw, 14vw);
  }

}

.hero::before,
.about::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(90% 80% at 30% 50%, rgba(255, 255, 255, 0.9), transparent 70%);
}

.about::before {
  background: radial-gradient(90% 80% at 70% 50%, rgba(255, 255, 255, 0.9), transparent 70%);
}

.about.about-secondary::before {
  background: radial-gradient(90% 80% at 30% 50%, rgba(255, 255, 255, 0.9), transparent 70%);
}

body[data-theme="dark"] .hero::before {
  background: radial-gradient(90% 80% at 30% 50%, rgba(0, 0, 0, 0.7), transparent 70%);
}

body[data-theme="dark"] .about::before {
  background: radial-gradient(90% 80% at 70% 50%, rgba(0, 0, 0, 0.7), transparent 70%);
}

body[data-theme="dark"] .about.about-secondary::before {
  background: radial-gradient(90% 80% at 30% 50%, rgba(0, 0, 0, 0.7), transparent 70%);
}

.theme-toggle {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(12, 12, 15, 0.18);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-toggle:hover {
  border-color: rgba(12, 12, 15, 0.35);
}

body[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  color: #f7f7f2;
}

body[data-theme="dark"] .theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.35);
}
