/* ========================================
   PORTFOLIO — Design System
   ======================================== */

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

/* --- CSS Variables --- */
:root {
  /* White sections */
  --bg-white: #FFFFFF;
  --surface: #FFFFFF;
  --surface-soft: #F6F6F4;
  --text-primary: #000000;
  --text-secondary: #555555;
  --border: #E6E6E6;
  --divider-hairline: #E4E4E4;
  --hero-glow: rgba(0, 0, 0, 0.04);
  --hero-meta: rgba(0, 0, 0, 0.52);
  --project-number: #EAEAEA;
  --stack-muted: #777777;
  --hero-panel: rgba(255, 255, 255, 0.8);
  --hero-shadow: 0 28px 60px rgba(0, 0, 0, 0.08);
  --ambient-line: rgba(0, 0, 0, 0.08);
  --ambient-wash: rgba(0, 0, 0, 0.03);

  /* Black sections */
  --bg-black: #0A0A0A;
  --text-light-primary: #F5F5F5;
  --text-light-secondary: #A3A3A3;
  --border-dark: #222222;

  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', monospace;

  /* Layout */
  --container-max: 1080px;
  --container-px: 24px;
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light dark;
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-white);
  line-height: 1.6;
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--ambient-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ambient-line) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.16), transparent 72%);
  pointer-events: none;
  opacity: 0.35;
  z-index: -2;
  transition: opacity 180ms ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 14%, var(--ambient-wash), transparent 30%),
    radial-gradient(circle at 82% 10%, var(--ambient-wash), transparent 26%);
  pointer-events: none;
  z-index: -3;
  transition: background 180ms ease;
}

::selection {
  background: #000000;
  color: #ffffff;
}

::-moz-selection {
  background: #000000;
  color: #ffffff;
}

html[data-theme="dark"] {
  --bg-white: #0B0B0B;
  --surface: #0B0B0B;
  --surface-soft: #121212;
  --text-primary: #E5E5E5;
  --text-secondary: #888888;
  --border: #262626;
  --divider-hairline: #262626;
  --hero-glow: transparent;
  --hero-meta: rgba(255, 255, 255, 0.55);
  --project-number: #242424;
  --stack-muted: #888888;
  --hero-panel: rgba(18, 18, 18, 0.78);
  --hero-shadow: 0 30px 64px rgba(0, 0, 0, 0.34);
  --ambient-line: rgba(255, 255, 255, 0.08);
  --ambient-wash: rgba(255, 255, 255, 0.04);
  --bg-black: #0B0B0B;
  --text-light-primary: #E5E5E5;
  --text-light-secondary: #888888;
  --border-dark: #1C1C1C;
}

html[data-theme="dark"] ::selection {
  background: #ffffff;
  color: #000000;
}

html[data-theme="dark"] ::-moz-selection {
  background: #ffffff;
  color: #000000;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

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

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

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

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

.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--hero-meta);
  cursor: pointer;
  opacity: 0.5;
  box-shadow: inset 0 0 0 1px transparent;
}

.theme-toggle:hover {
  opacity: 1;
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 6px;
}

.theme-toggle__icon {
  width: 16px;
  height: 16px;
  transition: transform 180ms ease;
}

.theme-toggle__icon circle,
.theme-toggle__icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.theme-toggle__icon path {
  fill: currentColor;
  stroke: none;
}

html[data-theme="dark"] .theme-toggle__icon {
  transform: rotate(180deg);
}

/* ========================================
   SECTION 1 — HERO
   ======================================== */
.hero {
  position: relative;
  background-color: var(--bg-white);
  padding-top: 36px;
  padding-bottom: 132px;
  overflow: clip;
}

.hero::before {
  content: none;
}

html[data-theme="dark"] .hero::before {
  content: none;
}

.hero__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  opacity: 0.72;
}

.hero__meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 28px;
}

.hero__meta-item {
  color: var(--hero-meta);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 180ms ease;
}

.hero__clock {
  white-space: nowrap;
}

.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  column-gap: 20px;
  row-gap: 48px;
  margin-top: clamp(124px, 15vh, 210px);
}

.hero__text {
  grid-column: 1 / span 7;
  max-width: 610px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 1rem;
}

.hero__headline {
  font-family: var(--font-heading);
  font-size: clamp(44px, 5.8vw, 68px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

.hero__highlight {
  display: inline-block;
  padding-bottom: 0.06em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .hero__highlight {
  border-bottom-color: rgba(255, 255, 255, 0.22);
}

.hero__headline-nowrap {
  white-space: nowrap;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.55;
}

.hero__utility-divider {
  width: 160px;
  border-top: 0.5px solid var(--divider-hairline);
  margin-bottom: 0;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 18px 32px;
}

.hero__links a {
  position: relative;
  display: inline-flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  opacity: 0.65;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.hero__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0.5);
  transform-origin: left center;
  transition: transform 0.22s ease;
}

.hero__links a:hover {
  opacity: 1;
}

.hero__links a:hover::after,
.hero__links a:focus-visible::after {
  transform: scaleX(1);
}

.hero__links a:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: 2px;
  opacity: 1;
}

.hero__illustration {
  grid-column: 8 / -1;
  display: grid;
  place-items: center center;
  align-self: stretch;
  width: min(100%, 380px);
  margin-left: auto;
}

.hero__illustration-image {
  grid-area: 1 / 1;
  display: block;
  max-width: 380px;
  width: 100%;
  box-shadow: none;
  filter: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.hero__illustration-image--dark {
  opacity: 0;
  visibility: hidden;
}

html[data-theme="dark"] .hero__illustration-image--light {
  opacity: 0;
  visibility: hidden;
}

html[data-theme="dark"] .hero__illustration-image--dark {
  opacity: 1;
  visibility: visible;
}

.hero__index {
  width: fit-content;
  margin-top: 116px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hero-meta);
  opacity: 0.62;
}

.section__index {
  width: fit-content;
  margin-top: 72px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hero-meta);
  opacity: 0.62;
}

.section__index--dark {
  color: var(--text-light-secondary);
  opacity: 0.58;
}

/* ========================================
   SECTION 1.5 — CURRENT DIRECTION
   ======================================== */
.focus {
  background-color: var(--bg-white);
  padding-top: 24px;
  padding-bottom: 104px;
}

.focus__grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.focus__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.7;
}

.focus__lead {
  max-width: 62ch;
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-primary);
}

.focus__items {
  counter-reset: focus-items;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 36px;
}

.focus__items p {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.focus__items p::before {
  content: "0" counter(focus-items);
  counter-increment: focus-items;
  position: static;
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ========================================
   SECTION 2 — THINGS I'VE BUILT
   ======================================== */
.projects {
  background-color: var(--bg-white);
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 132px;
}

.projects__eyebrow {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.75;
}

.projects__title {
  max-width: 10ch;
  margin-bottom: 28px;
  font-family: var(--font-heading);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

.projects__intro {
  max-width: 62ch;
  margin-bottom: 56px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.project {
  display: grid;
  grid-template-columns: 60px 1fr 96px;
  column-gap: 28px;
  align-items: start;
  margin-bottom: 64px;
  padding: 30px 0 0;
  border-top: 1px solid var(--border);
}

.project:last-child {
  margin-bottom: 0;
}

.project__index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.2;
  white-space: nowrap;
  padding-top: 4px;
  width: 60px;
  color: var(--text-secondary);
  opacity: 0.72;
}

html[data-theme="dark"] .project__index {
  color: var(--text-light-secondary);
  opacity: 0.5;
}

.project__content {
  grid-column: 2;
  min-width: 0;
}

.project__name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.22;
  margin-bottom: 12px;
}

.project__description {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.68;
  margin-bottom: 16px;
}

.project__stack {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stack-muted);
  letter-spacing: 0.08em;
  line-height: 1.5;
  opacity: 0.72;
  margin-bottom: 14px;
  text-transform: none;
}

.project__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  opacity: 0.65;
  padding-bottom: 2px;
}

.project__link span {
  display: inline-block;
}

.project__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0.5);
  transform-origin: left center;
  transition: transform 0.22s ease;
}

.project__link:hover {
  opacity: 1;
}

.project__link:hover::after,
.project__link:focus-visible::after {
  transform: scaleX(1);
}

html[data-theme="dark"] .project__link:hover {
  color: var(--text-light-primary);
}

.project__link:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: 2px;
  opacity: 1;
}

.project__meta {
  grid-column: 3;
  justify-self: end;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.62;
  padding-top: 2px;
}

/* ========================================
   SECTION 3 — APPROACH
   ======================================== */
.approach {
  background-color: var(--bg-black);
  padding-top: 104px;
  padding-bottom: 40px;
}

.approach__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 28px 40px;
  align-items: start;
}

.approach__intro {
  max-width: 430px;
  padding-top: 8px;
}

.approach__title {
  margin-bottom: 18px;
  font-family: var(--font-heading);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--text-light-primary);
}

.approach__lead {
  max-width: 50ch;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-light-secondary);
}

.approach__cards {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border-dark);
}

.approach__card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-dark);
}

.approach__card-index {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light-secondary);
  opacity: 0.72;
}

.approach__card-title {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--text-light-primary);
}

.approach__card-copy {
  grid-column: 2;
  grid-row: 2;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-light-secondary);
}

/* ========================================
   SECTION 4 — FOOTER
   ======================================== */
.footer {
  background-color: var(--bg-black);
  padding-top: 24px;
  padding-bottom: 48px;
}

.footer__text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light-secondary);
  letter-spacing: 0.06em;
  line-height: 1.7;
  opacity: 0.6;
  padding-top: 18px;
  border-top: 1px solid var(--border-dark);
}

/* ========================================
   RESPONSIVE — Mobile
   ======================================== */
@media (max-width: 768px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    min-height: auto;
    padding-top: 18px;
    padding-bottom: 48px;
  }

  .hero__meta-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 18px;
  }

  .hero__meta {
    display: none;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0;
    margin-top: 18px;
  }

  .hero__text {
    grid-column: auto;
    max-width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .hero__illustration {
    display: none;
  }

  .hero__headline {
    font-size: clamp(34px, 10.6vw, 42px);
    line-height: 1.03;
    letter-spacing: -0.055em;
    max-width: none;
  }

  .hero__subtitle {
    max-width: 25ch;
    font-size: 14px;
    line-height: 1.6;
  }

  .hero__index {
    margin-top: 20px;
    margin-left: 0;
    font-size: 11px;
  }

  .section__index {
    margin-top: 22px;
    margin-left: 0;
    font-size: 11px;
  }

  .hero__links {
    gap: 10px 14px;
  }

  .hero__links a {
    gap: 5px;
    font-size: 11px;
  }

  .theme-toggle {
    width: 28px;
    height: 28px;
  }

  .projects {
    padding-top: 8px;
    padding-bottom: 64px;
  }

  .projects__eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .projects__title {
    font-size: clamp(32px, 11vw, 40px);
    margin-bottom: 18px;
  }

  .projects__intro {
    margin-bottom: 36px;
    font-size: 15px;
    line-height: 1.65;
  }

  .project {
    grid-template-columns: 1fr;
    margin-bottom: 36px;
    padding: 20px 0 0;
  }

  .project:last-child {
    margin-bottom: 0;
  }

  .project__index {
    display: none;
  }

  .project__content {
    grid-column: auto;
  }

  .project__name {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .project__description {
    font-size: 15px;
    line-height: 1.64;
    margin-bottom: 14px;
  }

  .project__stack {
    font-size: 10px;
    line-height: 1.55;
    margin-bottom: 12px;
  }

  .project__link {
    font-size: 12px;
  }

  .project__meta {
    display: none;
  }

  .focus {
    padding-top: 0;
    padding-bottom: 56px;
  }

  .focus__grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 20px;
  }

  .focus__lead {
    font-size: 17px;
    line-height: 1.65;
  }

  .focus__items {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
  }

  .focus__items p {
    gap: 8px;
    padding-top: 14px;
    font-size: 15px;
  }


  .approach {
    padding-top: 64px;
    padding-bottom: 24px;
  }

  .approach__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .approach__title {
    font-size: clamp(28px, 10vw, 34px);
    margin-bottom: 14px;
  }

  .approach__lead {
    font-size: 15px;
    line-height: 1.65;
  }

  .approach__cards {
    gap: 0;
  }

  .approach__card {
    grid-template-columns: 1fr;
    column-gap: 0;
    padding: 18px 0;
  }

  .approach__card-index,
  .approach__card-title,
  .approach__card-copy {
    grid-column: auto;
    grid-row: auto;
  }

  .approach__card-index {
    padding-top: 0;
    margin-bottom: 8px;
  }

  .approach__card-title {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .approach__card-copy {
    font-size: 15px;
    line-height: 1.68;
  }

  .footer {
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .footer__text {
    font-size: 10px;
    line-height: 1.65;
  }
}
