:root {
  --bg: #05080d;
  --bg-elevated: #0a1018;
  --surface: #111827;
  --text: #eef4fc;
  --text-muted: rgba(238, 244, 252, 0.52);
  --accent: #2ec4cf;
  --accent-soft: #6ee7ef;
  --accent-deep: #14919b;
  --accent-glow: rgba(46, 196, 207, 0.28);
  --line: rgba(238, 244, 252, 0.1);
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "DM Mono", "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

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

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.045;
  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='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: linear-gradient(to bottom, rgba(5, 8, 13, 0.85), transparent);
  backdrop-filter: blur(8px);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.nav-logo-mark {
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s var(--ease);
}

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

.nav-cta {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  color: var(--text) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent-soft) !important;
}

.rail {
  position: fixed;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  display: flex;
  gap: 2rem;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 50;
  pointer-events: none;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 6rem 2rem 3rem 4.5rem;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, transparent 0%, var(--bg) 85%),
    linear-gradient(to bottom, rgba(5, 8, 13, 0.3) 0%, rgba(5, 8, 13, 0.75) 55%, var(--bg) 100%),
    linear-gradient(to right, rgba(5, 8, 13, 0.6) 0%, transparent 40%);
}

.hero-glow {
  position: absolute;
  bottom: 10%;
  left: 20%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(60px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-soft);
}

.hero-lede {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.35s var(--ease);
}

.btn-primary {
  background: var(--accent-deep);
  color: var(--text);
  border-color: var(--accent-deep);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 12px;
}

.hero-spec {
  position: absolute;
  right: 2rem;
  bottom: 3rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: right;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.spec-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.spec-value {
  font-size: 12px;
}

.scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent-soft), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Sections */
.section {
  padding: 8rem 2rem 8rem 4.5rem;
  position: relative;
}

.section-marker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-num {
  font-size: 11px;
  color: var(--accent-soft);
  letter-spacing: 0.15em;
}

.section-tag {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-header h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.section-sub {
  margin-top: 0.75rem;
  color: var(--text-muted);
  max-width: 420px;
}

/* Thesis */
.thesis {
  border-top: 1px solid var(--line);
}

.thesis-quote {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 2rem;
}

.thesis-quote em {
  font-style: italic;
  color: var(--accent-soft);
}

.thesis-body {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

/* Capabilities */
.capabilities {
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.capabilities-intro {
  max-width: 640px;
  margin-bottom: 3rem;
}

.capabilities-intro p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.85;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.cap-card {
  background: var(--bg);
  padding: 2rem 1.75rem;
  min-height: 168px;
  transition: background 0.4s var(--ease);
}

.cap-card:hover {
  background: var(--surface);
}

.cap-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 1.1rem;
  opacity: 0.92;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.cap-card:hover .cap-icon {
  opacity: 1;
  transform: translateY(-2px);
}

.cap-card h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.65rem;
}

.cap-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.capabilities-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.signal-chip {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  color: var(--text-muted);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.signal-chip:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

/* Process */
.process {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 3rem;
  background: var(--line);
  border: 1px solid var(--line);
}

.process-card {
  background: var(--bg-elevated);
  padding: 2rem 1.75rem;
  min-height: 220px;
  transition: background 0.4s var(--ease);
}

.process-card:hover {
  background: var(--surface);
}

.process-index {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent-soft);
  margin-bottom: 1.5rem;
}

.process-card h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.process-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

/* Showcase */
.showcase {
  border-top: 1px solid var(--line);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

.clip-card {
  grid-column: span 4;
}

.clip-featured {
  grid-column: span 8;
  grid-row: span 2;
}

.clip-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.clip-featured .clip-frame {
  aspect-ratio: 16 / 11;
  min-height: 360px;
}

.clip-frame-square {
  aspect-ratio: 4 / 3;
}

.clip-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.clip-card:hover .clip-frame video {
  transform: scale(1.04);
}

.clip-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 8, 13, 0.7) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.clip-card:hover .clip-overlay,
.clip-card.is-playing .clip-overlay {
  opacity: 1;
}

.clip-badge {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--accent-soft);
  color: var(--accent-soft);
}

.clip-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--text);
  background: rgba(5, 8, 13, 0.5);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.3s var(--ease);
}

.clip-play:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.clip-card figcaption {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 0 0;
}

.clip-id {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
}

.clip-task {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.clip-meta {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Assurance */
.assurance {
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.assurance-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.assurance h2 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.assurance-lede {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.grade-strip {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.grade {
  flex: 1;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.grade-letter {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.grade-a .grade-letter { color: #6ee7a0; }
.grade-b .grade-letter { color: var(--accent-soft); }
.grade-r .grade-letter { color: var(--text-muted); }

.grade-desc {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.assurance-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.assurance-list li {
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-muted);
  font-size: 12px;
}

.assurance-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent-soft);
}

.assurance-glow {
  position: absolute;
  top: 20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(80px);
  pointer-events: none;
}

/* Contact */
.contact {
  border-top: 1px solid var(--line);
  padding-bottom: 0;
}

.contact-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 4rem;
}

.contact-inner h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  margin-bottom: 1rem;
}

.contact-inner p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-domain,
.contact-note {
  margin-top: 1.5rem !important;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

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

/* Responsive */
@media (max-width: 1024px) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .clip-card,
  .clip-featured {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .rail {
    display: none;
  }

  .hero,
  .section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hero-spec {
    display: none;
  }

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

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

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

  .clip-card,
  .clip-featured {
    grid-column: span 1;
  }

  .grade-strip {
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
