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

:root {
  --bg:        #f5f4ef;
  --bg-2:      #ffffff;
  --text:      #18181a;
  --text-2:    #5b5b5e;
  --text-3:    #9a9a9d;
  --border:    #e3e1d8;
  --border-2:  #d6d3c8;
  --nav-bg:    rgba(245, 244, 239, 0.78);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Menlo', monospace;

  --transition: 0.22s ease;

  --container-max: 1080px;
  --section-pad: 120px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:        #111111;
  --bg-2:      #1a1a1a;
  --text:      #f0efea;
  --text-2:    #a4a4a4;
  --text-3:    #6e6e6e;
  --border:    #262626;
  --border-2:  #363636;
  --nav-bg:    rgba(17, 17, 17, 0.78);

  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }

::selection { background: var(--text); color: var(--bg); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border: 2px solid var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo-dot { color: var(--text-3); }

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-2);
  transition: color var(--transition);
  position: relative;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
  flex: none;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* hero */
.hero {
  padding: 120px 0 100px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 36px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ea043;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(46, 160, 67, 0.15);
}
.hero-title {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 30px;
  max-width: 18ch;
}
.hero-lede {
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  color: var(--text-2);
  max-width: 56ch;
  line-height: 1.6;
  margin-bottom: 44px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover {
  background: transparent;
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  border-color: var(--text);
}
.btn .arrow {
  transition: transform var(--transition);
  display: inline-block;
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* sections */
.section {
  padding: var(--section-pad) 0;
}
.section-bordered {
  border-top: 1px solid var(--border);
}
.section-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 80px;
}
.section-meta {
  position: sticky;
  top: 100px;
  align-self: start;
}
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.section-meta-note {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-top: 14px;
  max-width: 200px;
  line-height: 1.5;
}
.section-body {
  max-width: 640px;
}

.section-body p {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 20px;
}
.section-body p:last-child { margin-bottom: 0; }
.section-body .lead {
  font-size: 1.22rem;
  color: var(--text);
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 28px;
  letter-spacing: -0.012em;
}

/* projects */
.project-list {
  display: flex;
  flex-direction: column;
}
.project-link {
  display: grid;
  grid-template-columns: 160px 1fr 24px;
  gap: 28px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  transition: padding var(--transition);
}
.project:last-child .project-link {
  border-bottom: 1px solid var(--border);
}
.project-link:hover {
  padding-left: 6px;
}
.project-thumb {
  width: 160px;
  height: 90px;
  border-radius: 6px;
  background-color: var(--border-2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  transition: opacity 0.4s ease;
}
.thumb-1 { background-image: url('images/dig-or-die.png'); }
.thumb-2 { background-image: url('images/hunt-the-brainrot.png'); }
.thumb-3 { background-image: url('images/dont-stop.png'); }
.thumb-4 { background-image: url('images/gravity-runner.png'); }

.project-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.project-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-3);
}
.dot-sep { opacity: 0.6; }
.project-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.012em;
}
.project-desc {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.5;
}
.project-arrow {
  font-size: 1.1rem;
  color: var(--text-3);
  transition: var(--transition);
  text-align: right;
}
.project-link:hover .project-arrow {
  color: var(--text);
  transform: translateX(4px);
}

/* stack */
.stack-list {
  display: flex;
  flex-direction: column;
}
.stack-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.stack-row:last-child {
  border-bottom: 1px solid var(--border);
}
.stack-key {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.stack-val {
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* contact */
.contact-title {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}
.contact-lede {
  font-size: 1.05rem;
  color: var(--text-2);
  margin-bottom: 36px;
  max-width: 50ch;
  line-height: 1.6;
}
.contact-primary {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 40px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.contact-primary-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contact-primary-value {
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 4px;
  letter-spacing: -0.018em;
  transition: var(--transition);
}
.contact-primary:hover .contact-primary-value {
  color: var(--text-2);
  border-bottom-color: var(--text-2);
}
.contact-primary-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-top: 2px;
  transition: color var(--transition);
}
.contact-primary.copied .contact-primary-hint {
  color: #2ea043;
}
.contact-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.contact-socials a {
  font-size: 0.92rem;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}
.contact-socials a:hover {
  color: var(--text);
}
.contact-socials .ext {
  font-size: 0.85em;
  color: var(--text-3);
  transition: transform var(--transition);
  display: inline-block;
}
.contact-socials a:hover .ext {
  transform: translate(2px, -2px);
  color: var(--text);
}

/* footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
}

/* fade-in */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* responsive */
@media (max-width: 880px) {
  :root { --section-pad: 80px; }
  .section-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .section-meta {
    position: static;
  }
  .section-meta-note { max-width: none; }
  .hero { padding: 80px 0 60px; }
  .container { padding: 0 24px; }
  .nav-inner { padding: 16px 24px; gap: 16px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; z-index: 110; }
  .theme-toggle { z-index: 110; position: relative; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 0 24px;
  }
  .nav-links.open {
    transform: translateX(0);
  }
  .nav-link {
    font-size: 1.4rem;
    color: var(--text);
  }
  .nav-link.active::after { display: none; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .btn {
    justify-content: center;
  }

  .project-link {
    grid-template-columns: 1fr 24px;
    gap: 16px;
    padding: 20px 0;
  }
  .project-thumb {
    grid-column: 1 / -1;
    width: 100%;
    height: 160px;
    margin-bottom: 4px;
  }

  .stack-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
  }
}
