:root {
  --ink: #0e1014;
  --surface: #15171c;
  --surface-raised: #1a1c21;
  --line: #2a303a;
  --line-soft: #22262e;
  --text: #e6ebe7;
  --muted: #8b958d;
  --teal: #419272;
  --teal-bright: #5aad8c;
  --teal-dim: rgba(65, 146, 114, 0.16);
  --font-display: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  background:
    radial-gradient(ellipse 90% 55% at 75% 8%, rgba(65, 146, 114, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 10% 30%, rgba(65, 146, 114, 0.06), transparent 50%),
    linear-gradient(180deg, #12141a 0%, var(--ink) 42%, #0c0e12 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(42, 48, 58, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 48, 58, 0.35) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
  opacity: 0.45;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--teal-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #7dcdb0;
}

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

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--pad);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-mark img {
  border-radius: 7px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.nav-github {
  color: var(--teal-bright) !important;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) var(--pad) clamp(3rem, 8vh, 5.5rem);
  min-height: calc(100vh - 4.5rem);
}

.hero-brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--text);
}

.hero-title {
  margin: 0 0 1rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--teal-bright);
}

.hero-lede {
  margin: 0 0 1.75rem;
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal);
  color: #08110d;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: var(--teal-bright);
  color: #08110d;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--teal);
  color: var(--teal-bright);
}

.hero-visual {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}

.hero-svg {
  width: 100%;
  height: auto;
  display: block;
}

.hero-copy,
.hero-visual {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s var(--ease) forwards;
}

.hero-visual {
  animation-delay: 0.15s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.traces path {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: draw 2.4s var(--ease) forwards;
}

.trace-a { animation-delay: 0.35s; }
.trace-b { animation-delay: 0.55s; }
.trace-c { animation-delay: 0.75s; }
.trace-d { animation-delay: 0.95s; }

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.nodes circle {
  transform-origin: center;
  animation: pulse 2.8s ease-in-out infinite;
}

.nodes circle:nth-child(odd) {
  animation-delay: 0.4s;
}

.nodes circle:nth-child(3n) {
  animation-delay: 0.9s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.hero-glow {
  animation: breathe 5s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.18;
  }
}

.projects,
.approach {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6rem) var(--pad);
}

.section-head {
  max-width: 36rem;
  margin-bottom: 2.25rem;
}

.section-head h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.project-list {
  display: grid;
  gap: 1rem;
}

.project {
  display: block;
  padding: 1.45rem 1.4rem 1.3rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(26, 28, 33, 0.92), rgba(18, 20, 26, 0.75));
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.25s var(--ease);
}

.project:hover {
  border-color: var(--teal);
  background: linear-gradient(160deg, rgba(65, 146, 114, 0.1), rgba(18, 20, 26, 0.85));
  color: inherit;
  transform: translateY(-2px);
}

.project-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.project-name {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--teal-bright);
}

.project-lang {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.project-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 54rem;
}

.project-cta {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.project:hover .project-cta {
  color: var(--teal-bright);
}

.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.pillars h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pillars p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 3rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
}

.footer-brand img {
  border-radius: 6px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

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

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2rem;
  }

  .hero-visual {
    margin-inline: 0;
  }

  .project-list {
    grid-template-columns: 1fr 1fr;
  }

  .pillars {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .site-nav a:not(.nav-github) {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 2rem;
  }
}

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

  .hero-copy,
  .hero-visual,
  .traces path,
  .nodes circle,
  .hero-glow,
  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}
