:root {
  --bg: #121212;
  --panel: #1a1a1a;
  --text: #e5e5e5;
  --muted: #8f8f8f;
  --line: rgba(255,255,255,0.06);
  --line-strong: rgba(255,255,255,0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

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

.container {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
}

.three-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}


.three-bg canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 0.95;
}

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.02;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.6) 0 0.5px, transparent 0.7px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.35) 0 0.5px, transparent 0.7px),
    radial-gradient(circle at 35% 75%, rgba(255,255,255,.45) 0 0.5px, transparent 0.7px);
  background-size: 12px 12px, 16px 16px, 14px 14px;
}

.mouse-glow {
  position: fixed;
  width: 800px;
  height: 800px;
  left: 0;
  top: 0;
  border-radius: 9999px;
  background: rgba(255,255,255,0.05);
  filter: blur(150px);
  transform: translate(-9999px, -9999px);
  transition: transform 0.6s ease-out;
  z-index: 1;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 28px 0;
  transition: all 0.6s ease;
}

.site-header.scrolled {
  padding: 20px 0;
  background: rgba(18,18,18,0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: var(--text);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .3s ease;
}

.brand:hover .brand-mark {
  background: #ffffff;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  font-size: 20px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.header-nav a:hover {
  color: #fff;
}

.hero {
  position: relative;
  z-index: 10;
  padding: 240px 0 120px;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 64px;
}

.hero-line {
  display: inline-block;
  width: 96px;
  height: 1px;
  background: #4b4b4b;
}

.hero-label {
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  font-style: italic;
}

.hero-title {
  margin: 0 0 80px;
  line-height: 0.9;
  font-size: clamp(72px, 11vw, 172px);
  font-weight: 900;
  letter-spacing: -0.07em;
  text-transform: uppercase;
  color: #e7e2d8;
}

.hero-title span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.2);
}

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 520px) 1fr;
  align-items: end;
  gap: 56px;
}

.hero-copy {
  margin: 0;
  font-size: 22px;
  line-height: 1.9;
  color: var(--muted);
}

.hero-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #d1cdc2;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.24em;
  font-size: 12px;
  transition: gap 0.35s ease;
}

.hero-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s ease;
}

.hero-link:hover {
  gap: 24px;
}

.hero-link:hover svg {
  transform: translateY(3px);
}

.projects {
  position: relative;
  z-index: 10;
  padding-bottom: 240px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  grid-auto-rows: 500px;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 48px;
  background: var(--panel);
  border: 1px solid var(--line);
  transform: perspective(1200px) rotateX(0deg) rotateY(0deg);
  transition: transform .15s ease-out, border-color .4s ease;
}

.project-card.large {
  grid-column: span 2;
  grid-row: span 2;
}

.project-card.tall {
  grid-row: span 2;
}

.project-card.wide {
  grid-column: span 2;
}

.project-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  filter: grayscale(0.8);
  transition: transform 2s ease, opacity 0.8s ease, filter 1s ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18,18,18,0.96), rgba(18,18,18,0.08) 60%, rgba(18,18,18,0));
}

.project-content {
  position: absolute;
  inset: 0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.project-category {
  margin-bottom: 16px;
  color: #767676;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  transition: transform 0.5s ease;
}

.project-content h3 {
  margin: 0 0 16px;
  font-size: clamp(28px, 2vw, 48px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
  transition: transform 0.5s ease 0.08s;
}

.project-content p {
  margin: 0;
  max-width: 320px;
  color: #8a8a8a;
  font-size: 14px;
  line-height: 1.8;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease .16s, transform .5s ease .16s;
}

.project-arrow {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .7s ease;
}

.project-arrow svg {
  width: 18px;
  height: 18px;
}

.project-card:hover {
  border-color: rgba(255,255,255,0.1);
}

.project-card:hover > img {
  opacity: 0.6;
  filter: grayscale(0);
  transform: scale(1.05);
}

.project-card:hover .project-category,
.project-card:hover .project-content h3 {
  transform: translateY(-4px);
}

.project-card:hover .project-content p {
  opacity: 1;
  transform: translateY(0);
}

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

.cta {
  position: relative;
  z-index: 10;
  text-align: center;
  padding-bottom: 160px;
}

.cta-rule {
  height: 1px;
  width: 100%;
  margin-bottom: 128px;
  background: linear-gradient(to right, transparent, rgba(120,120,120,0.4), transparent);
}

.cta h2 {
  margin: 0 0 48px;
  font-size: clamp(48px, 7vw, 128px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-style: italic;
  color: #e7e2d8;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 52px;
  border-radius: 9999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  transition: transform .3s ease, background .3s ease;
}

.cta-button:hover {
  transform: scale(1.05);
  background: #fff;
}

.site-footer {
  position: relative;
  z-index: 10;
  padding: 0 0 64px;
  color: #6d6d6d;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.45em;
}

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

.footer-links {
  display: flex;
  gap: 48px;
}

.footer-links a {
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #cfcfcf;
}

.section-reveal {
  opacity: 0;
  transform: translateY(30px);
  animation: reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.projects.section-reveal { animation-delay: 0.12s; }
.cta.section-reveal { animation-delay: 0.18s; }

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .hero {
    padding-top: 190px;
  }

  .hero-bottom {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 420px;
  }

  .project-card.large,
  .project-card.wide {
    grid-column: span 2;
  }

  .project-card.tall {
    grid-row: span 1;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 32px, 1600px);
  }

  .mouse-glow {
    display: none;
  }

  .site-header {
    padding: 22px 0;
  }

  .header-nav {
    gap: 18px;
  }

  .header-nav a {
    letter-spacing: 0.2em;
    font-size: 11px;
  }

  .brand-text {
    font-size: 16px;
    letter-spacing: 0.12em;
  }

  .hero {
    padding: 160px 0 88px;
  }

  .hero-meta {
    margin-bottom: 40px;
  }

  .hero-title {
    margin-bottom: 48px;
    font-size: clamp(56px, 18vw, 100px);
  }

  .hero-copy {
    font-size: 16px;
    line-height: 1.9;
  }

  .projects {
    padding-bottom: 120px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 360px;
    gap: 28px;
  }

  .project-card.large,
  .project-card.wide,
  .project-card.tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  .project-content {
    padding: 32px;
  }

  .project-arrow {
    top: 28px;
    right: 28px;
  }

  .cta {
    padding-bottom: 120px;
  }

  .cta-rule {
    margin-bottom: 72px;
  }

  .cta h2 {
    margin-bottom: 36px;
  }

  .cta-button {
    width: 100%;
    padding: 20px 28px;
    letter-spacing: 0.24em;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    gap: 20px;
    flex-wrap: wrap;
  }

  .site-footer {
    letter-spacing: 0.25em;
  }
}

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