:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #e9eeec;
  --text: #0a1715;
  --muted: #5d6b68;
  --line: rgba(10, 23, 21, 0.14);
  --line-strong: rgba(10, 23, 21, 0.28);
  --accent: #c8ff3d;
  --accent-ink: #101a0c;
  --secondary: #65e4c3;
  --header: rgba(244, 247, 246, 0.78);
  --shadow: 0 20px 60px rgba(15, 31, 27, 0.12);
  --radius: 1.5rem;
  --shell: min(100% - 3rem, 88rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="dark"] {
  --bg: #07110f;
  --surface: #0d1a17;
  --surface-soft: #13231f;
  --text: #f1f7f4;
  --muted: #9aacA6;
  --line: rgba(226, 243, 237, 0.13);
  --line-strong: rgba(226, 243, 237, 0.27);
  --header: rgba(7, 17, 15, 0.8);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  transition: color .35s ease, background-color .35s ease;
}

body.nav-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
::selection { color: var(--accent-ink); background: var(--accent); }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: .6rem;
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.section-shell { width: var(--shell); margin-inline: auto; }
.section-pad { padding-block: clamp(5.5rem, 10vw, 9.5rem); }

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  min-height: 5rem;
  padding: .8rem max(1.5rem, calc((100vw - 88rem) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.site-header.scrolled {
  background: var(--header);
  border-color: var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.site-header.header-hidden { transform: translateY(-110%); }
.brand { display: flex; align-items: center; gap: .75rem; position: relative; z-index: 102; }
.brand-mark {
  width: 2.8rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: .8rem;
  font-weight: 900;
  letter-spacing: -.08em;
}
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-size: .83rem; letter-spacing: .06em; }
.brand-copy small { margin-top: .3rem; color: var(--muted); font-size: .72rem; }
.desktop-nav { display: flex; align-items: center; gap: 2rem; }
.desktop-nav a { position: relative; color: var(--muted); font-size: .9rem; font-weight: 650; }
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.35rem;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s var(--ease);
}
.desktop-nav a:hover, .desktop-nav a:focus-visible { color: var(--text); }
.desktop-nav a:hover::after, .desktop-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.theme-toggle, .menu-toggle {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .3s ease;
}
.theme-toggle:hover, .menu-toggle:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.theme-toggle svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: none; }
html[data-theme="dark"] .moon-icon { display: block; }
.menu-toggle { display: none; position: relative; z-index: 102; }
.menu-toggle span { position: absolute; width: 1.1rem; height: 1.5px; background: currentColor; transition: transform .25s ease, top .25s ease; }
.menu-toggle span:first-child { top: 1.05rem; }
.menu-toggle span:last-child { top: 1.65rem; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 1.35rem; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 1.35rem; transform: rotate(-45deg); }
.mobile-nav { display: none; }

.hero {
  position: relative;
  min-height: 100svh;
  padding-top: 7.5rem;
  padding-bottom: 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(20rem, .8fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .62; }
.hero-glow { position: absolute; border-radius: 999px; filter: blur(8px); pointer-events: none; opacity: .48; }
.glow-one { width: 28rem; height: 28rem; right: -12rem; top: 14%; background: radial-gradient(circle, color-mix(in srgb, var(--secondary) 42%, transparent), transparent 70%); }
.glow-two { width: 22rem; height: 22rem; left: -13rem; bottom: 0; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 32%, transparent), transparent 70%); }
.hero-copy, .portrait-wrap { position: relative; z-index: 2; }
.status-pill {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.4rem;
  padding: .55rem .85rem;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(10px);
}
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #22b875; box-shadow: 0 0 0 .3rem rgba(34, 184, 117, .13); }
.eyebrow, .section-index, .card-kicker {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3.4rem, 7.5vw, 7.5rem);
  line-height: .84;
  letter-spacing: -.075em;
  text-wrap: balance;
}
.hero h1 span { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero-intro { max-width: 41rem; margin: 2rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.7vw, 1.3rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 2rem; }
.button {
  min-height: 3.5rem;
  padding: .8rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  transition: transform .25s var(--ease), background .25s ease, border-color .25s ease;
}
.button svg, .contact-email svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.button:hover { transform: translateY(-3px); }
.button:hover svg { transform: translateX(.25rem); }
.button-primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 20%, transparent); }
.button-quiet { background: color-mix(in srgb, var(--surface) 75%, transparent); backdrop-filter: blur(10px); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.8rem; margin: 2.6rem 0 0; }
.hero-meta div { padding-left: 1rem; border-left: 1px solid var(--line-strong); }
.hero-meta dt { color: var(--muted); font-size: .72rem; }
.hero-meta dd { margin: .1rem 0 0; font-size: .9rem; font-weight: 800; }

.portrait-wrap { width: min(100%, 28rem); justify-self: end; }
.portrait-frame {
  position: relative;
  z-index: 2;
  width: 78%;
  aspect-ratio: 1;
  margin: auto;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 46% 46% 1.6rem 1.6rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--secondary) 24%, var(--surface)), var(--surface));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.portrait-frame::before { content: ""; position: absolute; inset: .7rem; border: 1px solid color-mix(in srgb, var(--accent) 56%, transparent); border-radius: inherit; pointer-events: none; z-index: 2; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(46% - .3rem) calc(46% - .3rem) 1rem 1rem; filter: saturate(.9) contrast(1.03); }
.portrait-label { position: absolute; z-index: 4; right: -.7rem; top: 22%; writing-mode: vertical-rl; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.portrait-card { position: relative; z-index: 5; width: 75%; margin: -2.6rem 0 0 auto; padding: 1.1rem 1.3rem; display: grid; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.portrait-card-label, .portrait-card span:last-child { color: var(--muted); font-size: .72rem; }
.portrait-card strong { margin-block: .2rem; font-size: 1rem; }
.orbit { position: absolute; z-index: 1; border-radius: 50%; border: 1px solid var(--line); animation: orbitPulse 5s ease-in-out infinite; }
.orbit-one { inset: -6% 0 13% 0; }
.orbit-two { inset: 3% -9% 6% 9%; animation-delay: -2.5s; }
@keyframes orbitPulse { 50% { transform: scale(1.035) rotate(2deg); opacity: .5; } }
.scroll-cue { position: absolute; z-index: 4; left: 0; bottom: 1.4rem; display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.scroll-cue svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; animation: scrollBounce 1.6s ease-in-out infinite; }
@keyframes scrollBounce { 50% { transform: translateY(.3rem); } }

.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); }
.marquee-track { width: max-content; padding: 1.1rem 0; display: flex; align-items: center; gap: 1.7rem; animation: marquee 30s linear infinite; }
.marquee-track span { font-size: .83rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.marquee-track i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

.section-heading { margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.section-heading h2 { margin: 0; font-size: clamp(2.5rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.06em; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(21rem, .75fr); gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.about-copy { max-width: 45rem; }
.about-copy p { color: var(--muted); font-size: 1.05rem; line-height: 1.8; }
.about-copy .lead { margin-top: 0; color: var(--text); font-size: clamp(1.45rem, 2.5vw, 2.25rem); line-height: 1.35; letter-spacing: -.025em; }
.identity-card { padding: clamp(1.4rem, 3vw, 2.1rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.identity-card h3 { margin: 0 0 1.5rem; font-size: 1.5rem; letter-spacing: -.03em; }
.identity-card dl { margin: 0; }
.identity-card dl div { padding: .85rem 0; display: grid; grid-template-columns: 8.2rem minmax(0, 1fr); gap: 1rem; border-top: 1px solid var(--line); }
.identity-card dt { color: var(--muted); font-size: .78rem; }
.identity-card dd { margin: 0; font-size: .86rem; font-weight: 750; overflow-wrap: anywhere; }
.identity-card dd a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .25rem; }
.identity-note { margin: 1.2rem 0 0; padding: .9rem 1rem; color: var(--muted); background: var(--surface-soft); border-radius: .8rem; font-size: .78rem; }

.work { color: #f3f7f5; background: #07100e; }
.work .section-index { color: #8ea09a; }
.work-heading { display: flex; justify-content: space-between; align-items: end; gap: 3rem; }
.work-heading > p { max-width: 30rem; margin: 0 0 .5rem; color: #9fb0ab; font-size: 1.05rem; }
.project-list { display: grid; gap: 1.2rem; }
.project-card {
  position: relative;
  min-height: 32rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(20rem, .8fr);
  background: #0d1a17;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 1.5rem;
  overflow: hidden;
  transform-style: preserve-3d;
}
.project-media { position: relative; min-height: 25rem; overflow: hidden; }
.project-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 65%, rgba(7,16,14,.45)); pointer-events: none; }
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .75s var(--ease), filter .4s ease; }
.project-card:hover .project-media img { transform: scale(1.035); filter: saturate(1.08); }
.project-info { padding: clamp(1.8rem, 4vw, 3.2rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.project-number { margin: 0 0 .9rem; color: #8ea09a; font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
.project-info h3 { margin: 0; font-size: clamp(2rem, 3.5vw, 3.6rem); line-height: 1; letter-spacing: -.055em; }
.project-info > p { margin: 0; color: #a8b7b3; font-size: 1rem; line-height: 1.75; }
.project-footer { display: grid; gap: 1.2rem; }
.project-footer ul { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; }
.project-footer li { padding: .42rem .7rem; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #b8c5c1; font-size: .72rem; }
.project-footer > a { width: fit-content; color: var(--accent); font-size: .85rem; font-weight: 800; }
.project-footer > a span { display: inline-block; margin-left: .25rem; transition: transform .25s ease; }
.project-footer > a:hover span { transform: translate(.18rem, -.18rem); }
.project-disclaimer { margin: 1.6rem 0 0; color: #84948f; font-size: .78rem; text-align: center; }

.capability-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.capability-card { min-height: 21rem; padding: 1.6rem; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .3s ease, transform .3s ease; }
.capability-card:hover { background: var(--surface); transform: translateY(-.35rem); }
.capability-card > span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.capability-card h3 { margin: auto 0 1rem; font-size: clamp(1.3rem, 2vw, 1.8rem); letter-spacing: -.035em; }
.capability-card p { min-height: 5rem; margin: 0; color: var(--muted); font-size: .92rem; }
.stack-row { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.stack-row span { padding: .6rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .76rem; font-weight: 750; }

.contact { position: relative; color: #f3f7f5; background: #0b1714; overflow: hidden; }
#contact-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; pointer-events: none; }
.contact::before { content: ""; position: absolute; width: 45rem; height: 45rem; right: -20rem; top: -20rem; border-radius: 50%; background: radial-gradient(circle, rgba(101,228,195,.18), transparent 68%); }
.contact-inner { position: relative; z-index: 2; }
.contact .section-index { color: #8ea09a; }
.contact h2 { margin: 0; font-size: clamp(3.1rem, 8vw, 8.5rem); line-height: .9; letter-spacing: -.075em; }
.contact h2 span { color: var(--accent); }
.contact-copy { max-width: 43rem; margin: 2rem 0; color: #a6b7b2; font-size: clamp(1rem, 1.8vw, 1.25rem); }
.contact-email { width: fit-content; max-width: 100%; padding-bottom: .55rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid rgba(255,255,255,.28); font-size: clamp(1rem, 2.7vw, 2rem); font-weight: 750; overflow-wrap: anywhere; }
.contact-email svg { flex: 0 0 auto; width: 1.5rem; }
.contact-email:hover svg { transform: translateX(.35rem); }
.contact-bottom { margin-top: clamp(4rem, 9vw, 8rem); padding-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; border-top: 1px solid rgba(255,255,255,.15); }
.contact-bottom > div { display: grid; align-content: start; gap: .35rem; }
.contact-bottom span { color: #83938e; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.contact-bottom strong, .contact-bottom a { font-size: .86rem; }
.contact-bottom p { margin: 0; display: flex; gap: 1rem; }
.contact-bottom a:hover { color: var(--accent); }
.site-footer { color: #879791; background: #07100e; border-top: 1px solid rgba(255,255,255,.1); }
.site-footer .section-shell { min-height: 5rem; padding-block: 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-footer p, .site-footer a { margin: 0; font-size: .72rem; }
.site-footer a:hover { color: var(--accent); }
.noscript { position: fixed; z-index: 999; left: 1rem; right: 1rem; bottom: 1rem; padding: 1rem; color: #111; background: #fff3b8; border-radius: .8rem; text-align: center; }

.reveal { opacity: 0; transform: translateY(2rem); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--reveal-delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(17rem, .58fr); gap: 3rem; }
  .hero h1 { font-size: clamp(3.2rem, 7.5vw, 6rem); }
  .project-card { grid-template-columns: 1.1fr .9fr; }
  .capability-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  :root { --shell: min(100% - 2rem, 88rem); }
  .desktop-nav { display: none; }
  .menu-toggle { display: grid; }
  .mobile-nav {
    position: fixed;
    z-index: 101;
    inset: 0;
    padding: 7.5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: var(--bg);
    transform: translateY(-105%);
    visibility: hidden;
    transition: transform .45s var(--ease), visibility .45s;
  }
  .mobile-nav.open { transform: translateY(0); visibility: visible; }
  .mobile-nav a { padding: .35rem 0; font-size: clamp(2.4rem, 10vw, 4.5rem); font-weight: 850; letter-spacing: -.06em; line-height: 1.1; border-bottom: 1px solid var(--line); }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 9rem; padding-bottom: 6rem; }
  .portrait-wrap { width: min(100%, 24rem); justify-self: center; margin-top: 1rem; }
  .scroll-cue { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .work-heading { align-items: start; flex-direction: column; }
  .project-card { grid-template-columns: 1fr; }
  .project-media { min-height: auto; aspect-ratio: 16 / 9; }
  .project-media::after { background: linear-gradient(0deg, rgba(7,16,14,.28), transparent 45%); }
  .project-info { min-height: 24rem; }
  .contact-bottom { grid-template-columns: 1fr 1fr; }
  .site-footer .section-shell { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .site-header { padding-inline: 1rem; }
  .brand-copy strong { max-width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-copy small { display: none; }
  .hero h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .hero-actions .button { width: 100%; }
  .hero-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .portrait-label { right: .3rem; }
  .identity-card dl div { grid-template-columns: 1fr; gap: .2rem; }
  .project-info { min-height: 26rem; padding: 1.4rem; }
  .capability-grid { grid-template-columns: 1fr; }
  .capability-card { min-height: 17rem; }
  .contact-bottom { grid-template-columns: 1fr; }
  .contact-email { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  #hero-canvas, #contact-canvas { display: none; }
}
