:root {
  color-scheme: dark;
  --ink: #f6f7f1;
  --muted: #b9beb1;
  --dim: #858b80;
  --surface: #10120f;
  --surface-2: #171a16;
  --surface-3: #20251e;
  --line: rgba(246, 247, 241, 0.14);
  --lime: #c7ff4d;
  --teal: #4fd1c5;
  --coral: #ff7a59;
  --paper: #f7f8f3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(rgba(246, 247, 241, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 247, 241, 0.035) 1px, transparent 1px),
    var(--surface);
  background-size: 56px 56px;
}

a {
  color: inherit;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  transform: translateY(-150%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: #121410;
  padding: 0.75rem 1rem;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 4px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--lime), var(--teal), var(--coral));
}

.section-rail {
  position: fixed;
  top: 50%;
  right: 1.25rem;
  z-index: 15;
  display: grid;
  gap: 0.4rem;
  transform: translateY(-50%);
}

.rail-link {
  position: relative;
  display: flex;
  justify-content: flex-end;
  min-width: 8.25rem;
  padding: 0.45rem 1rem 0.45rem 0.45rem;
  color: var(--dim);
  text-decoration: none;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.rail-link::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.5rem;
  height: 0.5rem;
  content: "";
  border: 1px solid currentColor;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--surface);
}

.rail-link:hover,
.rail-link.is-active {
  color: var(--ink);
  transform: translateX(-0.15rem);
}

.rail-link.is-active::after {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 0 6px rgba(199, 255, 77, 0.12);
}

.section-panel {
  position: relative;
  min-height: 100vh;
  padding: 7.5rem 0;
}

.contained {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 7rem 0 6rem;
}

.hero-canvas,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-canvas {
  z-index: 0;
  width: 100%;
  height: 100%;
}

.hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(16, 18, 15, 0.95) 0%, rgba(16, 18, 15, 0.76) 58%, rgba(16, 18, 15, 0.92) 100%),
    radial-gradient(circle at 70% 25%, rgba(79, 209, 197, 0.14), transparent 34%),
    radial-gradient(circle at 42% 75%, rgba(199, 255, 77, 0.09), transparent 28%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 1.25rem;
  font-size: 5.15rem;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 1rem;
  font-size: 3rem;
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.85rem;
  font-size: 1.18rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions,
.project-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.8rem 1.05rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--lime);
  color: #151711;
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(246, 247, 241, 0.06);
}

.button.text-link {
  color: var(--muted);
  padding-inline: 0.25rem;
}

.hero-stats {
  display: grid;
  max-width: 860px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 4rem 0 0;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.hero-stats div {
  min-height: 9.25rem;
  padding: 1.25rem;
  background: rgba(16, 18, 15, 0.82);
}

.hero-stats dt {
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 3rem;
}

.section-heading h2 {
  color: var(--ink);
}

.section-heading p:last-child {
  color: var(--muted);
}

.reel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card,
.skill-card,
.project-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(246, 247, 241, 0.08), rgba(246, 247, 241, 0.03)),
    var(--surface-2);
  box-shadow: var(--shadow);
}

.feature-card {
  min-height: 23rem;
  padding: 1.35rem;
  transform:
    perspective(900px)
    rotateX(var(--tilt-y, 0deg))
    rotateY(var(--tilt-x, 0deg));
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.feature-card:hover,
.project-preview:hover {
  border-color: rgba(199, 255, 77, 0.45);
}

.card-index {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 900;
}

.feature-card p,
.skill-card p,
.timeline-body p,
.project-copy p,
.contact-content p,
.project-preview figcaption {
  color: var(--muted);
}

.project-band {
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(199, 255, 77, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(255, 122, 89, 0.11), transparent 40%),
    var(--surface-3);
}

.project-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 4rem;
  align-items: center;
}

.project-copy h2 {
  color: var(--paper);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.tag-row span {
  border: 1px solid rgba(246, 247, 241, 0.18);
  border-radius: 999px;
  background: rgba(246, 247, 241, 0.06);
  color: var(--paper);
  padding: 0.45rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 800;
}

.project-preview {
  overflow: hidden;
  margin: 0;
  transform:
    perspective(1000px)
    rotateX(var(--tilt-y, 0deg))
    rotateY(var(--tilt-x, 0deg));
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.project-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-preview figcaption {
  padding: 1rem 1.1rem 1.15rem;
  font-size: 0.92rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
}

.timeline::before {
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 13rem;
  width: 1px;
  content: "";
  background: var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}

.timeline-date {
  color: var(--lime);
  font-weight: 900;
}

.timeline-body {
  position: relative;
  padding-bottom: 2.3rem;
}

.timeline-body::before {
  position: absolute;
  top: 0.28rem;
  left: -2.25rem;
  width: 0.65rem;
  height: 0.65rem;
  content: "";
  border: 2px solid var(--lime);
  border-radius: 999px;
  background: var(--surface);
}

.timeline-body h3 {
  max-width: 760px;
}

.timeline-body p {
  max-width: 820px;
}

.skills-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.skill-card {
  min-height: 14rem;
  padding: 1.25rem;
}

.skill-card h3 {
  color: var(--lime);
}

.contact-band {
  display: grid;
  min-height: 78vh;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(16, 18, 15, 0.82), rgba(16, 18, 15, 0.98)),
    linear-gradient(135deg, rgba(79, 209, 197, 0.16), rgba(199, 255, 77, 0.08), rgba(255, 122, 89, 0.14));
}

.contact-content {
  max-width: 840px;
}

.contact-content h2 {
  font-size: 4rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--dim);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 620ms ease,
    transform 620ms ease;
}

.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  body {
    padding-bottom: 4.75rem;
  }

  .section-rail {
    top: auto;
    right: 50%;
    bottom: 1rem;
    grid-auto-flow: column;
    grid-template-columns: none;
    width: min(720px, calc(100% - 2rem));
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(16, 18, 15, 0.88);
    padding: 0.35rem;
    transform: translateX(50%);
    backdrop-filter: blur(18px);
    scrollbar-width: none;
  }

  .section-rail::-webkit-scrollbar {
    display: none;
  }

  .rail-link {
    min-width: auto;
    justify-content: center;
    padding: 0.55rem 0.65rem;
    font-size: 0.86rem;
  }

  .rail-link::after {
    display: none;
  }
}

@media (max-width: 980px) {
  h1 {
    font-size: 3.6rem;
  }

  h2 {
    font-size: 2.45rem;
  }

  .hero-stats,
  .reel-grid,
  .skills-layout,
  .project-shell {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    max-width: 560px;
  }

  .feature-card {
    min-height: auto;
  }

  .card-index {
    margin-bottom: 2rem;
  }

  .project-shell {
    gap: 2rem;
  }

  .timeline::before {
    left: 0.32rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-left: 2rem;
  }

  .timeline-body::before {
    left: -1.98rem;
  }

  .contact-content h2 {
    font-size: 2.75rem;
  }
}

@media (max-width: 640px) {
  .contained,
  .hero-content {
    width: min(100% - 2rem, 1120px);
  }

  .section-panel {
    padding: 5.5rem 0;
  }

  .hero {
    min-height: 100svh;
    padding-top: 5rem;
  }

  h1 {
    font-size: 2.7rem;
    line-height: 1;
  }

  h2 {
    font-size: 2rem;
  }

  .hero-copy {
    font-size: 1.03rem;
  }

  .hero-actions,
  .project-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section-rail {
    overflow-x: auto;
    justify-content: start;
  }

  .hero-stats div {
    min-height: auto;
  }

  .contact-content h2 {
    font-size: 2.2rem;
  }
}

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