:root {
  --color-page: #fafafa;
  --color-text: #141414;
  --color-muted: #5e5e5e;
  --color-subtle: #999;
  --color-line: #e8e8e8;
  --color-accent: #141414;
  --color-accent-hover: #333;
  --color-focus: #0055cc;
  --font-base: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --container: 1120px;
  --space-section: 160px;
  --transition: 120ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss03", "ss04";
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Header ────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 250, 0.7);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

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

.nav {
  width: min(100% - 48px, var(--container));
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text);
  place-items: center;
}

/* ── Sections ──────────────────────────── */

.section {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
  padding-top: var(--space-section);
}

.section-narrow {
  max-width: 700px;
}

/* ── Eyebrow ───────────────────────────── */

.eyebrow {
  margin-bottom: 14px;
  color: var(--color-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading {
  margin-bottom: 44px;
}

/* ── Typography ────────────────────────── */

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
}

h1 {
  margin-bottom: 26px;
  font-size: clamp(4.5rem, 10vw, 8.5rem);
  line-height: 0.86;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.hero-copy {
  max-width: 580px;
  color: var(--color-muted);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.5;
}

.hero-stack {
  margin-top: 18px;
  color: var(--color-subtle);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lead {
  max-width: 600px;
  color: var(--color-text);
  font-size: clamp(1.02rem, 1.8vw, 1.16rem);
  line-height: 1.68;
}

.lead-sub {
  max-width: 540px;
  margin-top: 16px;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.62;
}

/* ── Hero ──────────────────────────────── */

.hero {
  min-height: calc(100svh - 60px);
  display: flex;
  align-items: center;
  padding-top: 0;
}

.hero-content {
  max-width: 860px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

/* ── Buttons ───────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 19px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: background var(--transition), color var(--transition);
}

.button-primary {
  background: var(--color-accent);
  color: var(--color-page);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--color-accent-hover);
}

.button-ghost {
  background: none;
  color: var(--color-muted);
}

.button-ghost:hover,
.button-ghost:focus-visible {
  color: var(--color-text);
}

.material-symbols-rounded {
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Skill Grid ────────────────────────── */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.skill-card {
  padding: 22px 0;
  border-bottom: 1px solid var(--color-line);
}

.skill-card span {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* ── Project Grid ──────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-line);
}

.project-card {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-line);
}

.project-card:nth-child(3n+1) {
  border-right: 1px solid var(--color-line);
  padding-right: 28px;
}

.project-card:nth-child(3n+2) {
  border-right: 1px solid var(--color-line);
  padding-left: 28px;
  padding-right: 28px;
}

.project-card:nth-child(3n+3) {
  padding-left: 28px;
}

.project-card p {
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 4px;
  margin-top: 16px;
}

.tags span {
  color: var(--color-subtle);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Contact ───────────────────────────── */

.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  padding-bottom: var(--space-section);
}

.mail-link {
  color: var(--color-text);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  transition: color var(--transition);
}

.mail-link:hover,
.mail-link:focus-visible {
  color: var(--color-focus);
}

.contact-form {
  display: grid;
  gap: 20px;
}

.field input,
.field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--color-line);
  background: none;
  outline: none;
  padding: 10px 0;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color var(--transition);
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--color-text);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-subtle);
}

.contact-form .button {
  justify-self: start;
  margin-top: 2px;
}

/* ── Footer ────────────────────────────── */

.site-footer {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
  padding: 26px 0 44px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--color-line);
  color: var(--color-subtle);
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--color-muted);
  font-weight: 500;
  transition: color var(--transition);
}

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

/* ── Reveal ────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 450ms ease, transform 450ms ease;
}

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

/* ── Reduced Motion ────────────────────── */

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Tablet ────────────────────────────── */

@media (max-width: 1024px) {
  :root {
    --space-section: 120px;
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
  }

  .skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    border-top: none;
  }

  .project-card:nth-child(3n+1),
  .project-card:nth-child(3n+2),
  .project-card:nth-child(3n+3) {
    border-right: none;
    padding: 24px 0;
  }

  .project-card:nth-child(odd) {
    border-right: 1px solid var(--color-line);
    padding-right: 24px;
  }

  .project-card:nth-child(even) {
    padding-left: 24px;
  }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ── Mobile ────────────────────────────── */

@media (max-width: 640px) {
  :root {
    --space-section: 88px;
  }

  .nav,
  .section,
  .site-footer {
    width: min(100% - 32px, var(--container));
  }

  .nav {
    min-height: 54px;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: 58px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    background: rgba(250, 250, 250, 0.94);
    backdrop-filter: blur(18px);
    border: 1px solid var(--color-line);
    border-radius: 14px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  h1 {
    font-size: clamp(3.2rem, 14vw, 4.5rem);
  }

  .hero {
    padding-top: 64px;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
    border-top: none;
  }

  .project-card:nth-child(odd) {
    border-right: none;
    padding: 22px 0;
  }

  .project-card:nth-child(even) {
    padding: 22px 0;
  }

  .skill-card {
    padding: 20px 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
  }
}
