*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #0a0a0a;
  --gray: #6b7280;
  --light: #f5f5f5;
  --border: #e5e7eb;
  --white: #ffffff;
  --pad: clamp(24px, 6vw, 96px);
}

html,
body {
  width: 100%;
  min-height: 100vh;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: "Inter", sans-serif;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* PAGE LOADER */
@keyframes loader-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes loader-wordmark-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loader-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
  pointer-events: none;
}

.loader-wordmark {
  font-family: "DM Mono", monospace;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--black);
  animation: loader-wordmark-in 0.4s ease forwards;
}

/* VIEWPORT FRAME — nav + hero always fill exactly one screen */
.viewport-frame {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.nav-logo {
  font-family: "DM Mono", monospace;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: clamp(20px, 2.5vw, 36px);
  list-style: none;
}

.nav-links a {
  font-family: "DM Mono", monospace;
  font-size: clamp(13px, 1vw, 15px);
  color: var(--gray);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--black);
}

/* HERO */
.hero {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
  align-content: center;
  padding: clamp(40px, 5vh, 80px) var(--pad);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-tag {
  font-family: "DM Mono", monospace;
  font-size: clamp(12px, 0.9vw, 14px);
  color: var(--gray);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.hero-content p {
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--gray);
  max-width: 60ch;
  line-height: 1.7;
  margin-bottom: 40px;
}

/* HERO VISUAL */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  /* fill the column; only cap on unusually wide+short viewports */
  width: min(100%, calc(100dvh - 200px));
  min-width: 0;
}

.preview-cell {
  aspect-ratio: 1;
  background: var(--light);
  min-width: 0;
  overflow: hidden;
}

/* Subtle noise-like texture variation across cells */
.preview-cell:nth-child(1) {
  background: repeating-conic-gradient(#cdced0 0% 25%, #f2f3f4 0% 50%) 0 0 / 3px
    3px;
}
.preview-cell:nth-child(2) {
  background: repeating-conic-gradient(#d2d3d5 0% 25%, #f4f5f6 0% 50%) 0 0 / 4px
    4px;
}
.preview-cell:nth-child(3) {
  background: repeating-conic-gradient(#c9cacc 0% 25%, #f0f1f2 0% 50%) 0 0 / 3px
    3px;
}
.preview-cell:nth-child(4) {
  background: repeating-conic-gradient(#d5d6d8 0% 25%, #f6f7f8 0% 50%) 0 0 / 5px
    5px;
}
.preview-cell:nth-child(5) {
  background: repeating-conic-gradient(#d8d9db 0% 25%, #f7f8f9 0% 50%) 0 0 / 6px
    6px;
}
.preview-cell:nth-child(6) {
  background: repeating-conic-gradient(#d0d1d3 0% 25%, #f3f4f5 0% 50%) 0 0 / 4px
    4px;
}
.preview-cell:nth-child(7) {
  background: repeating-conic-gradient(#dadbe0 0% 25%, #f8f9fa 0% 50%) 0 0 / 7px
    7px;
}
.preview-cell:nth-child(8) {
  background: repeating-conic-gradient(#dcdde2 0% 25%, #f9fafb 0% 50%) 0 0 / 8px
    8px;
}
.preview-cell:nth-child(9) {
  background: repeating-conic-gradient(#e0e1e6 0% 25%, #fafbfc 0% 50%) 0 0 /
    10px 10px;
}

.hero-visual-label {
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 0.75vw, 12px);
  color: var(--gray);
  letter-spacing: 0.06em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: clamp(12px, 0.9vw, 14px);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: clamp(10px, 1vw, 14px) clamp(20px, 2vw, 28px);
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  transition:
    background 0.15s,
    color 0.15s;
  cursor: pointer;
}

.btn:hover {
  background: var(--white);
  color: var(--black);
}

.btn-outline {
  background: var(--white);
  color: var(--black);
  margin-left: 12px;
}

.btn-outline:hover {
  background: var(--black);
  color: var(--white);
}

/* SECTIONS */
.section {
  width: 100%;
  padding: clamp(60px, 8vw, 112px) var(--pad);
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: "DM Mono", monospace;
  font-size: clamp(11px, 0.8vw, 13px);
  color: var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

h2 {
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.section-sub {
  color: var(--gray);
  max-width: 60ch;
  margin-bottom: 48px;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.7;
}

/* ABOUT */
.about-body {
  max-width: 65ch;
  color: var(--gray);
  line-height: 1.85;
  font-size: clamp(15px, 1.1vw, 17px);
}

.about-body p + p {
  margin-top: 16px;
}

.about-body strong {
  color: var(--black);
  font-weight: 500;
}

/* FINDINGS */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.finding-card {
  background: var(--white);
  padding: clamp(28px, 3vw, 48px) clamp(24px, 2.5vw, 40px);
}

.finding-label {
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 0.75vw, 12px);
  color: var(--gray);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.finding-title {
  font-weight: 600;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.4;
  margin-bottom: 14px;
}

.finding-body {
  font-size: clamp(13px, 0.9vw, 15px);
  color: var(--gray);
  line-height: 1.7;
}

/* RESULTS */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.result-card {
  background: var(--light);
  height: clamp(160px, 18vw, 260px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Mono", monospace;
  font-size: clamp(11px, 0.85vw, 14px);
  color: var(--gray);
  letter-spacing: 0.06em;
}

/* TEAM */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 48px;
}

.team-card {
  background: var(--white);
  padding: clamp(24px, 2.5vw, 40px) clamp(20px, 2vw, 32px);
}

.team-name {
  font-weight: 600;
  font-size: clamp(15px, 1.1vw, 18px);
  margin-bottom: 8px;
}

.team-role {
  font-family: "DM Mono", monospace;
  font-size: clamp(11px, 0.8vw, 13px);
  color: var(--gray);
}

/* FOOTER */
footer {
  padding: clamp(24px, 3vw, 40px) var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.footer-left {
  font-family: "DM Mono", monospace;
  font-size: clamp(12px, 0.85vw, 14px);
  color: var(--gray);
}

.footer-right {
  display: flex;
  gap: 28px;
}

.footer-right a {
  font-family: "DM Mono", monospace;
  font-size: clamp(12px, 0.85vw, 14px);
  color: var(--gray);
  transition: color 0.15s;
}

.footer-right a:hover {
  color: var(--black);
}

/* LICENSE */
.license-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.license-page .section {
  flex: 1;
  display: flex;
  justify-content: center;
}

.license-container {
  max-width: 72ch;
}

.license-body {
  font-family: "DM Mono", monospace;
  font-size: clamp(13px, 0.95vw, 15px);
  color: var(--gray);
  line-height: 1.85;
}

.license-body p + p {
  margin-top: 20px;
}

/* RESEARCH PAGE */
.research-hero {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 5vh, 80px) var(--pad);
  border-bottom: 1px solid var(--border);
}

.research-hero h1 {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.research-hero p {
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--gray);
  max-width: 60ch;
  line-height: 1.7;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    display: none;
  }
}

@media (max-width: 700px) {
  .findings-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}