:root {
  --bg: #0a0a0a;
  --surface: #111;
  --surface-soft: #171717;
  --text: #f3f3f3;
  --muted: #929292;
  --line: #262626;
  --accent: #0066ff;
  --header: rgba(10, 10, 10, 0.78);
}

html.light {
  --bg: #f4f4f1;
  --surface: #fff;
  --surface-soft: #e9e9e5;
  --text: #0a0a0a;
  --muted: #656565;
  --line: #d7d7d2;
  --header: rgba(244, 244, 241, 0.82);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; }

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

.section-shell,
.nav-shell {
  width: min(100% - 40px, 1600px);
  margin-inline: auto;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  width: 100%;
  border-bottom: 1px solid transparent;
  background: var(--header);
  backdrop-filter: blur(18px);
  transition: border-color .25s ease;
}

.site-header.scrolled { border-color: var(--line); }

.nav-shell {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -.08em;
}

.logo span, .accent-dot { color: var(--accent); }
.nav-actions, .nav-links { display: flex; align-items: center; }
.nav-actions { gap: 28px; }
.nav-links { gap: clamp(22px, 3vw, 50px); }

.nav-links a {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  transition: color .2s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

.icon-button, .menu-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}

.icon-button:hover, .menu-button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: rotate(8deg);
}

.icon-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.moon-icon, html.light .sun-icon { display: none; }
html.light .moon-icon { display: block; }
.menu-button { display: none; }

.hero {
  min-height: max(720px, 100svh);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 150px;
  padding-bottom: 70px;
  overflow: hidden;
}

.hero-glow {
  width: min(60vw, 900px);
  aspect-ratio: 1;
  position: absolute;
  top: -42%;
  right: -15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,102,255,.14), transparent 68%);
  pointer-events: none;
}

.eyebrow, .section-label {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
}

.eyebrow::before {
  content: "";
  width: 27px;
  height: 1px;
  display: inline-block;
  margin: 0 12px 3px 0;
  background: var(--accent);
}

.hero-title {
  max-width: 1400px;
  margin: 40px 0 55px;
  font-size: clamp(4rem, 10.4vw, 11rem);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.085em;
}

.hero-title > span:not(.accent-dot) {
  color: var(--muted);
  font-weight: 400;
}

.hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.hero-footer p, .section-heading p, .contact-intro > p {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(.9rem, 1.2vw, 1.05rem);
  line-height: 1.75;
}

.primary-button {
  min-width: 170px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 15px 17px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  transition: background-color .25s, color .25s, transform .25s;
}

.primary-button:hover {
  background: transparent;
  color: var(--text);
  transform: translateY(-3px);
}

.scroll-note {
  position: absolute;
  bottom: 32px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.scroll-note span { width: 36px; height: 1px; background: var(--line); }

.about, .work, .contact {
  padding-top: clamp(100px, 12vw, 200px);
  padding-bottom: clamp(100px, 12vw, 200px);
  border-top: 1px solid var(--line);
}

.section-label { display: flex; align-items: center; gap: 14px; }
.section-label span { color: var(--accent); }

.about-grid, .contact-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(50px, 9vw, 150px);
  margin-top: clamp(55px, 8vw, 120px);
}

.section-title {
  margin: 0;
  font-size: clamp(3rem, 7vw, 7.5rem);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.075em;
}

.section-title span { color: var(--muted); font-weight: 500; }
.about-copy { max-width: 600px; }

.about-copy p {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.8;
}

.about-copy .lead {
  margin-top: 0;
  color: var(--text);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.5;
  letter-spacing: -.025em;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 45px;
}

.skill-list span {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  transition: border-color .2s, color .2s;
}

.skill-list span:hover { border-color: var(--accent); color: var(--text); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: clamp(55px, 8vw, 100px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(55px, 8vw, 120px) clamp(20px, 3vw, 48px);
}

.project-featured { grid-column: 1 / -1; }

.project-card { display: block; }

.project-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface);
}

.project-featured .project-visual { aspect-ratio: 16 / 8; }

.project-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.project-badge {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(10,10,10,.72);
  color: #fff;
  font-size: .56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  backdrop-filter: blur(10px);
}

.project-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.1), transparent 65%);
  transform: translateX(-100%);
  transition: transform .7s ease;
}

.project-card:hover .project-visual::after { transform: translateX(100%); }
.project-visual > * { transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.project-card:hover .project-visual > * { transform: scale(1.035); }

.project-meta {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 15px;
  padding-top: 22px;
}

.project-meta > div { display: flex; align-items: baseline; gap: 12px; }
.project-meta span, .project-meta p { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .11em; }
.project-meta h3 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -.04em; }
.project-meta p { margin: 0; }
.project-meta .project-arrow { display: none; color: var(--accent); font-size: 1.2rem; }

.contact { border-bottom: 1px solid var(--line); }
.contact-grid { grid-template-columns: 1fr .7fr; }
.contact-intro > p { margin-top: 40px; }
.email-link { display: inline-block; margin-top: 30px; border-bottom: 1px solid var(--accent); font-size: .83rem; font-weight: 600; }

.contact-form { display: flex; flex-direction: column; gap: 30px; }
.contact-form label span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }

.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 9px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  transition: border-color .2s;
}

.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); opacity: .65; }
.submit-button { width: 100%; margin-top: 6px; border: 0; cursor: pointer; }
.form-status { min-height: 20px; margin: -15px 0 0; color: var(--muted); font-size: .72rem; }

footer {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  color: var(--muted);
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.social-links { display: flex; gap: 25px; }
.social-links a { transition: color .2s; }
.social-links a:hover { color: var(--text); }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s ease, transform .75s cubic-bezier(.2,.7,.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 1800px) {
  .section-shell, .nav-shell { width: min(100% - 8vw, 2000px); }
  .hero-title { max-width: 1800px; font-size: 12rem; }
  body { font-size: 18px; }
}

@media (max-width: 900px) {
  .menu-button { display: grid; gap: 5px; }
  .menu-button span { width: 15px; height: 1px; display: block; background: currentColor; transition: transform .25s; }
  .menu-button.open span:first-child { transform: translateY(3px) rotate(45deg); }
  .menu-button.open span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .nav-actions { gap: 10px; }
  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0;
    padding: 15px 20px 25px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .25s, transform .25s;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-links a { width: 100%; padding: 15px 0; border-bottom: 1px solid var(--line); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-copy { margin-left: 15%; }
  .project-meta p { display: none; }
  .project-meta .project-arrow { display: block; }
}

@media (max-width: 640px) {
  .section-shell, .nav-shell { width: min(100% - 28px, 1600px); }
  .nav-shell { height: 68px; }
  .nav-links { top: 68px; padding-inline: 14px; }
  .hero { min-height: 740px; padding-top: 125px; }
  .hero-title { margin: 35px 0 45px; font-size: clamp(3.75rem, 19vw, 6.4rem); line-height: .91; }
  .hero-title > span:not(.accent-dot) { display: none; }
  .hero-footer, .section-heading { align-items: start; flex-direction: column; }
  .hero-footer p { max-width: 310px; }
  .primary-button { min-width: 100%; }
  .scroll-note { display: none; }
  .about-grid, .contact-grid { margin-top: 45px; }
  .about-copy { margin-left: 0; }
  .section-title { font-size: clamp(3rem, 14vw, 5rem); }
  .project-grid { grid-template-columns: 1fr; gap: 60px; }
  .project-featured { grid-column: auto; }
  .project-featured .project-visual, .project-visual { aspect-ratio: 4 / 3; }
  .project-meta { padding-top: 16px; }
  .social-links { width: 100%; justify-content: space-between; gap: 10px; }
  footer { padding-block: 40px; flex-wrap: wrap; }
  footer > p { width: 100%; }
}

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