:root {
  --bg: #000000;
  --surface: #060606;
  --surface-soft: #0b0b0b;
  --text: #ededed;
  --muted: #8b8b8b;
  --accent: #3d8068;
  --accent-soft: #86aea0;
  --accent-ink: #000000;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

::-moz-selection {
  background: var(--accent);
  color: var(--accent-ink);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  font-weight: 700;
}

h1 {
  margin-top: 0.75rem;
  max-width: 13ch;
  font-size: clamp(2.25rem, 6.5vw, 4.9rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.8rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

code {
  color: var(--accent-soft);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.scroll-track {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 30;
  background: #111111;
}

#scroll-progress {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.14s linear;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(4px);
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.9rem;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
  line-height: 1;
  transition: color 0.2s ease;
}

.top-nav a:hover {
  color: var(--accent-soft);
}

main {
  width: min(1100px, 91vw);
  margin: 0 auto;
}

.section {
  padding: clamp(2.6rem, 6vw, 5.5rem) 0;
}

.site-footer {
  width: min(1100px, 91vw);
  margin: 0 auto;
  padding: 1rem 0 2rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer p,
.site-footer small {
  margin: 0;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
}

.chapter-kicker {
  margin: 0;
  color: var(--accent);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.hero {
  padding-top: clamp(0.8rem, 2.4vw, 2rem);
  padding-bottom: clamp(1.8rem, 4vw, 3.2rem);
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise-in 0.6s ease both;
}

.hero-intro {
  margin-top: 1rem;
  max-width: 64ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.13rem);
}

.hero-panels {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.hero-panel {
  background: var(--surface);
  padding: 0.95rem;
}

.hero-panel h2 {
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
}

.hero-panel p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.stack-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.stack-list li {
  padding-left: 0.85rem;
  color: var(--muted);
  position: relative;
}

.stack-list li::before {
  content: ">";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-tagline {
  margin-top: 0.95rem;
  max-width: 60ch;
  color: #b7b7b7;
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0.56rem 0.85rem;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  color: var(--accent-soft);
}

.btn-primary {
  background: #f0f0f0;
  color: #000000;
}

.btn-primary:hover {
  color: #000000;
  background: #ffffff;
}

.section-head {
  max-width: 72ch;
}

.section-head h2 {
  margin-top: 0.55rem;
}

.section-head p:not(.chapter-kicker) {
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.project-showcase {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.project-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.project-index-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface);
  color: inherit;
  padding: 0.78rem;
  cursor: pointer;
  display: grid;
  gap: 0.28rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.project-index-item:hover {
  transform: translateY(-2px);
  background: #0d0d0d;
}

.project-index-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-index-item.is-active {
  background: #111111;
}

.project-index-item.is-active .project-index-title {
  color: var(--accent-soft);
}

.project-index-chapter {
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  color: var(--accent);
}

.project-index-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #e8e8e8;
  line-height: 1.2;
}

.project-index-hook {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.project-detail {
  background: var(--surface);
  padding: 0.95rem;
  min-height: 100%;
}

.project-detail-head {
  display: grid;
  gap: 0.44rem;
}

.project-detail-chapter {
  margin: 0;
  color: var(--accent-soft);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.project-detail-hook {
  margin: 0;
  color: #d9d9d9;
  font-weight: 500;
}

.project-detail-body {
  margin: 0.66rem 0 0;
  color: var(--muted);
}

.project-detail-media {
  margin: 0.84rem 0 0;
  background: #030303;
  overflow: hidden;
  aspect-ratio: 5 / 3;
}

.project-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) contrast(1.08);
}

.project-detail-footer {
  margin-top: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.project-tech-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tech-list li {
  background: var(--surface-soft);
  padding: 0.2rem 0.45rem;
}

.project-tech-list code {
  color: var(--accent-soft);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.project-detail-link {
  text-decoration: none;
  color: var(--text);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.79rem;
}

.project-detail-link:hover {
  color: var(--accent-soft);
}

.project-detail-link:focus-visible,
.contact-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact h2 {
  margin-top: 0.55rem;
  max-width: 19ch;
}

.contact p:not(.chapter-kicker) {
  margin-top: 0.85rem;
  color: var(--muted);
  max-width: 66ch;
}

.contact-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.contact-links a {
  text-decoration: none;
  color: var(--text);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.79rem;
}

.contact-links a:hover {
  color: var(--accent-soft);
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 900px) {
  .hero-panels {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .site-header {
    padding-inline: 0.85rem;
    gap: 0.5rem;
  }

  .top-nav {
    margin-left: auto;
    gap: 0.45rem;
  }

  .top-nav a {
    font-size: 0.73rem;
  }

  h1 {
    max-width: 11ch;
  }

  .hero {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
  }
}

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