:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-deep: #010102;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.085);
  --border-soft: rgba(255, 255, 255, 0.055);
  --text: #f7f8f8;
  --muted: #d0d6e0;
  --subtle: #8a8f98;
  --dim: #62666d;
  --brand: #7170ff;
  --brand-strong: #5e6ad2;
  --max-width: 1180px;
  --radius: 22px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv01", "ss03";
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(113, 112, 255, .18), transparent 34rem),
    radial-gradient(circle at 84% 14%, rgba(103, 232, 249, .10), transparent 28rem),
    linear-gradient(180deg, #0b0c10 0%, #08090a 42%, #010102 100%);
  overflow-x: hidden;
}

body::selection {
  background: rgba(113, 112, 255, .35);
  color: white;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  z-index: -1;
}

.orb {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: .20;
  pointer-events: none;
  z-index: -2;
}

.orb-one {
  top: -12rem;
  left: -10rem;
  background: #7170ff;
}

.orb-two {
  right: -14rem;
  top: 28rem;
  background: #06b6d4;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-soft), transparent);
}

.brand,
.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: var(--muted);
  font-size: 14px;
  font-weight: 510;
  letter-spacing: -.13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.025));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.top-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 510;
  transition: color .22s var(--ease), background .22s var(--ease);
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--text);
  background: rgba(255,255,255,.045);
}

.hero,
.projects-section,
.site-footer {
  width: min(var(--max-width), calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  min-height: clamp(360px, 52vh, 560px);
  display: grid;
  align-content: center;
  padding: 86px 0 56px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--brand);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 940px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 8.2vw, 6.9rem);
  line-height: .92;
  letter-spacing: clamp(-.31rem, -.38vw, -.08rem);
  font-weight: 510;
}

.hero-statement {
  max-width: 920px;
  margin: 0;
  color: #f2efe8;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3.1vw, 2.35rem);
  font-weight: 400;
  line-height: 1.52;
  letter-spacing: -.025em;
  text-wrap: balance;
  text-shadow: 0 18px 58px rgba(0,0,0,.36);
}

.hero-statement::first-letter {
  float: left;
  margin: .08em .13em 0 0;
  color: #ffffff;
  font-size: 4.15em;
  line-height: .82;
  font-weight: 700;
  letter-spacing: -.09em;
  text-shadow: 0 0 32px rgba(113,112,255,.32);
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  line-height: 1.62;
  letter-spacing: -.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 510;
  transition: transform .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  background: linear-gradient(180deg, #828fff, var(--brand-strong));
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 12px 34px rgba(94,106,210,.28);
}

.button.ghost {
  color: var(--muted);
  background: rgba(255,255,255,.025);
}

.projects-section {
  padding: 18px 0 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 510;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.project-card {
  position: relative;
  grid-column: span 4;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 28% 0%, color-mix(in srgb, var(--accent), transparent 76%), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.024));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 1px 0 rgba(255,255,255,.04),
    0 24px 70px rgba(0,0,0,.22);
  overflow: hidden;
  isolation: isolate;
  transform: translateY(14px);
  opacity: 0;
  transition:
    opacity .7s var(--ease),
    transform .7s var(--ease),
    border-color .28s var(--ease),
    background .28s var(--ease);
}

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

.project-card.featured {
  grid-column: span 8;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), color-mix(in srgb, var(--accent), transparent 84%), transparent 44%);
  opacity: 0;
  transition: opacity .28s var(--ease);
  z-index: -1;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent), white 16%), transparent);
  opacity: .55;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--accent), rgba(255,255,255,.10) 55%);
  transform: translateY(-4px);
}

.project-card:hover::before {
  opacity: 1;
}

.card-index {
  margin-bottom: 18px;
  color: color-mix(in srgb, var(--accent), white 18%);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.project-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  margin-bottom: 34px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--accent), transparent 76%), transparent 70%),
    rgba(255,255,255,.045);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 18px 48px rgba(0,0,0,.24);
  overflow: hidden;
}

.project-visual img {
  display: block;
  max-width: 68%;
  max-height: 68%;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.28));
}

.project-visual-photo img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: none;
}

.project-card.featured .project-visual {
  width: 104px;
  height: 104px;
  border-radius: 30px;
}

.project-kicker {
  margin-bottom: 12px;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.5;
}

.project-card h3 {
  margin-bottom: 13px;
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.04;
  letter-spacing: -.055em;
  font-weight: 510;
}

.project-card p:not(.project-kicker) {
  max-width: 58ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -.011em;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
}

.project-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: 12px;
  font-weight: 510;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: 22px;
  color: color-mix(in srgb, var(--accent), white 24%);
  font-size: 14px;
  font-weight: 510;
}

.project-link span {
  transition: transform .2s var(--ease);
}

.project-link:hover span {
  transform: translate(2px, -2px);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 0 42px;
  border-top: 1px solid var(--border-soft);
  color: var(--dim);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

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

@media (max-width: 920px) {
  .project-card,
  .project-card.featured {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .site-header,
  .hero,
  .projects-section,
  .site-footer {
    width: min(100% - 24px, var(--max-width));
  }

  .top-nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 74px 0 52px;
  }

  .hero-actions,
  .site-footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section-heading {
    display: block;
  }

  .project-card,
  .project-card.featured {
    grid-column: 1 / -1;
    min-height: 360px;
    padding: 20px;
  }

  .card-index {
    margin-bottom: 16px;
  }

  .project-visual,
  .project-card.featured .project-visual {
    width: 76px;
    height: 76px;
    margin-bottom: 28px;
    border-radius: 22px;
  }
}

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

  .project-card {
    opacity: 1;
    transform: none;
  }
}
