:root {
  --bg: #080a0d;
  --bg-soft: #10141a;
  --text: #f2f5f0;
  --muted: #a0a8a0;
  --line: rgba(242, 245, 240, 0.14);
  --accent: #7cf7c8;
  --accent-strong: #32d99d;
  --amber: #f5c26b;
  --rust: #c26b48;
  --max: 1180px;
  --header-height: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 0%, #000, transparent 78%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 54px);
  background: rgba(8, 10, 13, 0.68);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 240ms ease, background 240ms ease;
}

.site-header.is-scrolled {
  background: rgba(8, 10, 13, 0.9);
  border-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(124, 247, 200, 0.45);
  color: var(--accent);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 30px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.site-nav a {
  transition: color 180ms ease;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 6px auto;
  background: currentColor;
  transition: transform 220ms ease;
}

.nav-open .nav-toggle span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-open .nav-toggle span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-height) + 44px) clamp(20px, 7vw, 96px) 92px;
  isolation: isolate;
  overflow: hidden;
}

#hero-canvas,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hero-canvas {
  z-index: -3;
  background:
    radial-gradient(circle at 80% 22%, rgba(124, 247, 200, 0.2), transparent 30%),
    radial-gradient(circle at 10% 70%, rgba(245, 194, 107, 0.14), transparent 26%),
    linear-gradient(145deg, #080a0d 0%, #111821 42%, #080a0d 100%);
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(8, 10, 13, 0.96), rgba(8, 10, 13, 0.64) 46%, rgba(8, 10, 13, 0.15)),
    linear-gradient(0deg, var(--bg) 0%, transparent 24%);
}

.hero-inner {
  width: min(760px, 100%);
}

.eyebrow,
.section-label,
.stack,
.time {
  color: var(--accent);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(12px, 1.5vw, 14px);
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 22px;
  font-size: clamp(56px, 11vw, 132px);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 26px;
  font-size: clamp(34px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.12;
}

p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-copy {
  max-width: 660px;
  font-size: clamp(18px, 2vw, 23px);
  color: #dce3d9;
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.contact-links a,
.contact-links span {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover,
.contact-links a:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 247, 200, 0.58);
}

.button.primary {
  background: var(--accent);
  color: #06100d;
  border-color: var(--accent);
}

.button.ghost {
  background: rgba(255,255,255,0.04);
}

.hero-meta {
  position: absolute;
  left: clamp(20px, 7vw, 96px);
  right: clamp(20px, 7vw, 96px);
  bottom: 26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.hero-meta span {
  padding: 18px 18px 0 0;
  color: #dce3d9;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(82px, 12vw, 150px) 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(30px, 6vw, 86px);
  border-top: 1px solid var(--line);
}

.section-label {
  position: sticky;
  top: 106px;
  align-self: start;
}

.lead {
  max-width: 860px;
  color: #dce3d9;
  font-size: clamp(20px, 2.5vw, 30px);
  line-height: 1.45;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 70px);
  margin-top: 48px;
}

.timeline {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.time {
  color: var(--amber);
}

.role p {
  max-width: 830px;
}

.stack {
  margin-top: 18px;
  color: #b9f5df;
  text-transform: none;
}

.skills-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skill-column {
  background: var(--bg);
  padding: clamp(22px, 3vw, 34px);
}

.skill-column h3 {
  color: var(--accent);
  font-size: 18px;
}

.skill-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  color: #dce3d9;
}

.feature-section {
  position: relative;
  width: min(var(--max), calc(100% - 40px));
  min-height: 640px;
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) 0;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(28px, 6vw, 86px);
  align-items: center;
  border-top: 1px solid var(--line);
}

.feature-copy p:not(.eyebrow) {
  max-width: 560px;
  font-size: 18px;
}

.alpaca-panel {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid rgba(124, 247, 200, 0.34);
  background:
    linear-gradient(180deg, rgba(22, 38, 48, 0.98), rgba(9, 15, 17, 0.96)),
    radial-gradient(circle at 70% 18%, rgba(245, 194, 107, 0.28), transparent 26%);
}

.pixel-scene {
  position: absolute;
  inset: 0;
}

.pixel-scene span {
  position: absolute;
  display: block;
}

.sun {
  width: 86px;
  height: 86px;
  right: 18%;
  top: 16%;
  background: var(--amber);
  box-shadow: 0 0 90px rgba(245, 194, 107, 0.46);
}

.mountain {
  bottom: 90px;
  width: 260px;
  height: 260px;
  transform: rotate(45deg);
  background: #264657;
}

.mountain.one {
  left: 8%;
}

.mountain.two {
  right: 6%;
  width: 220px;
  height: 220px;
  background: #345043;
}

.ground {
  left: 0;
  right: 0;
  bottom: 0;
  height: 106px;
  background: linear-gradient(90deg, #315542, #263f34);
}

.alpaca-body,
.alpaca-neck,
.alpaca-head,
.alpaca-ear,
.alpaca-leg {
  background: #f3ead8;
  box-shadow: inset -12px -12px 0 rgba(194, 107, 72, 0.24);
}

.alpaca-body {
  width: 188px;
  height: 86px;
  left: 42%;
  bottom: 96px;
}

.alpaca-neck {
  width: 48px;
  height: 132px;
  left: 62%;
  bottom: 142px;
}

.alpaca-head {
  width: 78px;
  height: 58px;
  left: 63%;
  bottom: 252px;
}

.alpaca-ear {
  width: 22px;
  height: 38px;
  left: 68%;
  bottom: 306px;
  transform: skewX(-12deg);
}

.alpaca-leg {
  width: 28px;
  height: 70px;
  bottom: 50px;
}

.alpaca-leg.a {
  left: 46%;
}

.alpaca-leg.b {
  left: 55%;
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 180ms ease, border-color 180ms ease;
}

.project-item:hover {
  padding-left: 14px;
  border-color: rgba(124, 247, 200, 0.38);
}

.project-item span {
  color: var(--rust);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.project-item p {
  max-width: 760px;
  margin-bottom: 0;
}

.contact-section {
  padding: clamp(90px, 14vw, 180px) 20px;
  background:
    linear-gradient(rgba(8, 10, 13, 0.72), rgba(8, 10, 13, 0.92)),
    radial-gradient(circle at 18% 30%, rgba(124, 247, 200, 0.16), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(245, 194, 107, 0.13), transparent 28%);
  border-top: 1px solid var(--line);
}

.contact-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.contact-inner h2 {
  max-width: 880px;
}

.contact-links a,
.contact-links span {
  background: rgba(255,255,255,0.04);
  color: #dce3d9;
}

.site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    min-height: calc(100svh - var(--header-height));
    display: grid;
    align-content: start;
    gap: 0;
    padding: 12px 20px 24px;
    background: #080a0d;
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    pointer-events: none;
    transition: transform 240ms ease;
  }

  .nav-open .site-nav {
    transform: translateY(0);
    pointer-events: auto;
  }

  .site-nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    color: #dce3d9;
  }

  .section,
  .timeline-item,
  .feature-section {
    grid-template-columns: 1fr;
  }

  .section-label {
    position: static;
  }

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

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

@media (max-width: 680px) {
  :root {
    --header-height: 66px;
  }

  .site-header {
    padding: 0 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero {
    padding: calc(var(--header-height) + 38px) 20px 126px;
    min-height: 720px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(8, 10, 13, 0.98), rgba(8, 10, 13, 0.72)),
      linear-gradient(0deg, var(--bg) 0%, transparent 28%);
  }

  .hero-meta {
    bottom: 20px;
    left: 20px;
    right: 20px;
  }

  .hero-meta span {
    font-size: 12px;
    padding-top: 12px;
  }

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

  .feature-section,
  .section {
    width: min(100% - 32px, var(--max));
  }

  .alpaca-panel {
    min-height: 360px;
  }

  .project-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
  }

  .button,
  .contact-links a,
  .contact-links span {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }
}
