:root {
  --bg: #0a0c10;
  --bg-surface: #0e1116;
  --text-primary: #f0f2f5;
  --text-secondary: #6b7280;
  --text-dim: #374151;
  --accent: #004aad;
  --accent-dim: rgba(0, 74, 173, 0.08);
  --border: #1a2030;
  --border-hover: #2d3f5c;
  --shadow-soft: 0 1.5rem 3rem rgba(0, 0, 0, 0.28);
  --header-height: clamp(4.5rem, 6vw, 5.5rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 0.125rem solid var(--accent);
  outline-offset: 0.25rem;
}

.container {
  width: min(100%, 75rem);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 5rem);
}

.section-pad {
  padding-block: clamp(5rem, 8vw, 7.5rem);
}

.section-label,
.eyebrow,
.site-nav a,
.project-index,
.status-tag,
.footer-nav a,
.site-footer p {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.section-label,
.eyebrow,
.project-index,
.status-tag,
.site-footer p,
.footer-nav a {
  font-size: clamp(0.625rem, 0.6rem + 0.12vw, 0.6875rem);
}

.section-label,
.eyebrow,
.project-index,
.site-footer p,
.footer-nav a {
  color: var(--text-dim);
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  background: rgba(10, 12, 16, 0.85);
  border-bottom: 0.0625rem solid var(--border);
  backdrop-filter: blur(0.75rem);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--accent);
}

.header-shell {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.24vw, 1.1875rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-logo {
  display: block;
  height: clamp(1.5rem, 2.5vw, 2rem);
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}

.site-nav a {
  position: relative;
  font-size: clamp(0.6875rem, 0.67rem + 0.08vw, 0.75rem);
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.375rem;
  width: 100%;
  height: 0.0625rem;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text-primary);
}

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

/* Hero */
.hero {
  position: relative;
  min-height: 50svh;
  overflow: clip;
  border-bottom: 0.0625rem solid var(--border);
}

.hero-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(10, 12, 16, 0) 0%, rgba(10, 12, 16, 0.24) 54%, rgba(10, 12, 16, 0.78) 100%);
}

.circuit-grid {
  width: 100%;
  height: 100%;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.025);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.grid-node {
  fill: var(--border);
}

.signal-pulse {
  fill: var(--accent);
  opacity: 0.74;
  filter: drop-shadow(0 0 0.625rem rgba(79, 127, 255, 0.5));
}

.hero-shell {
  position: relative;
  z-index: 1;
  min-height: 50svh;
  padding-top: calc(var(--header-height) + clamp(2rem, 6vw, 4rem));
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: left;
  justify-content: space-between;
  text-align: left;
}

.hero-content {
  max-width: 52rem;
}

.eyebrow {
  margin: 0 0 clamp(1rem, 2vw, 1.5rem);
}

.hero-title {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hero-copy {
  margin: clamp(1.5rem, 3vw, 2rem) 0 0;
  max-width: 40rem;
  color: var(--text-secondary);
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.0625rem);
}

.hero-actions {
  margin-top: clamp(2rem, 3vw, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.button-primary {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.75rem, 0.73rem + 0.08vw, 0.8125rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(3rem, 4vw, 3.25rem);
  padding-inline: clamp(1.25rem, 2vw, 1.75rem);
  border: 0.0625rem solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 0.5rem var(--accent-dim);
}

.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-content > .reveal:nth-child(1) {
  animation-delay: 0.08s;
}

.hero-content > .reveal:nth-child(2) {
  animation-delay: 0.22s;
}

.hero-content > .reveal:nth-child(3) {
  animation-delay: 0.38s;
}

.hero-content > .reveal:nth-child(4) {
  animation-delay: 0.52s;
}

/* Projects */
.section-shell {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.5rem);
}

.section-heading h2,
.philosophy-copy h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.project-card {
  position: relative;
  min-height: clamp(18rem, 28vw, 20rem);
  padding: clamp(1.5rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-surface);
  border: 0.0625rem solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  left: -0.0625rem;
  top: -0.0625rem;
  bottom: -0.0625rem;
  width: 0.25rem;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-0.125rem);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-soft);
}

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

.project-card h3 {
  margin: 0;
  max-width: 14ch;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.project-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(0.98rem, 0.94rem + 0.16vw, 1.05rem);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 0.0625rem solid var(--border);
}

.status-tag {
  color: var(--text-secondary);
}

.case-category {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.5625rem, 0.55rem + 0.06vw, 0.625rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.case-outcome {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(0.9375rem, 0.92rem + 0.1vw, 1rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

/* Carousel */
.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.carousel-track-wrap {
  overflow: hidden;
  flex: 1;
}

.carousel-track {
  display: grid;
  grid-template-columns: repeat(4, calc((100% - clamp(2rem, 4vw, 3rem)) / 3));
  gap: clamp(1rem, 2vw, 1.5rem);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 0.0625rem solid var(--border);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  padding: 0;
}

.carousel-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.carousel-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.project-card--placeholder {
  border-style: dashed;
  opacity: 0.6;
}

.case-brief-cta {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.625rem, 0.6rem + 0.1vw, 0.6875rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  transition: color 0.2s ease;
}

.case-brief-cta:hover {
  color: var(--text-primary);
}

/* Accordion */
.case-brief {
  margin-top: auto;
  border-top: 0.0625rem solid var(--border);
  padding-top: 0.75rem;
}

.case-brief summary {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.625rem, 0.6rem + 0.1vw, 0.6875rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.case-brief summary::-webkit-details-marker {
  display: none;
}

.case-brief summary::after {
  content: "+";
  font-size: 0.875rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.case-brief[open] summary::after {
  transform: rotate(45deg);
}

.case-brief summary:hover {
  color: var(--text-primary);
}

.case-brief-body {
  padding-top: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-brief-body p {
  margin: 0;
  font-size: clamp(0.8125rem, 0.8rem + 0.1vw, 0.875rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

.case-brief-result {
  color: var(--text-primary) !important;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(0.875rem, 0.86rem + 0.1vw, 0.9375rem) !important;
}

/* Philosophy */
.philosophy {
  border-top: 0.0625rem solid var(--border);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.philosophy-copy {
  max-width: 42rem;
}

.philosophy-copy p {
  margin: clamp(1rem, 2vw, 1.25rem) 0 0;
  color: var(--text-secondary);
}

.philosophy-accent {
  display: grid;
  place-items: center;
  min-height: clamp(16rem, 28vw, 20rem);
  padding: clamp(1rem, 3vw, 2rem);
}

.philosophy-logo {
  width: 100%;
  height: auto;
  max-width: 22rem;
}

/* Footer */
.site-footer {
  border-top: 0.0625rem solid var(--border);
  padding-block: clamp(1.5rem, 3vw, 2rem);
}

.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.footer-nav a {
  transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--text-secondary);
}

/* Motion */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tablet */
@media (max-width: 63.9375rem) {
  .carousel-track {
    grid-template-columns: repeat(4, calc((100% - clamp(1rem, 2vw, 1.5rem)) / 2));
  }

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

  .philosophy-accent {
    justify-items: start;
  }
}

/* Mobile */
@media (max-width: 47.9375rem) {
  .carousel-track {
    grid-template-columns: repeat(4, 100%);
  }

  .carousel-btn {
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
  }

  .header-shell,
  .footer-shell,
  .site-nav,
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-shell {
    justify-content: center;
    padding-block: 0.75rem;
  }

  .site-nav {
    gap: 0.75rem;
  }

  .hero {
    min-height: auto;
  }

  .hero-shell {
    min-height: 100svh;
  }

  .hero-background .signal-pulse {
    display: none;
  }

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .signal-pulse {
    display: none;
  }
}
