:root {
  color-scheme: light;
  --ink: #121a22;
  --muted: #596773;
  --paper: #f5f7f4;
  --panel: #ffffff;
  --line: #dde5df;
  --rail: #be3438;
  --rail-dark: #8d242a;
  --teal: #0f6e69;
  --amber: #d38a2a;
  --night: #182936;
  --shadow: 0 18px 54px rgba(15, 26, 35, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

img {
  max-width: 100%;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 58px);
  color: #fff;
  background: linear-gradient(180deg, rgba(14, 24, 32, 0.84), rgba(14, 24, 32, 0));
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 13px;
  font-weight: 780;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.nav-links {
  gap: clamp(12px, 2vw, 24px);
}

.nav-links a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 700;
}

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

.hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 112px clamp(20px, 6vw, 78px) 74px;
  color: #fff;
}

.hero-video,
.hero-fallback,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video,
.hero-fallback {
  object-fit: cover;
  object-position: center;
}

.hero-video {
  z-index: 0;
}

.hero-fallback {
  z-index: -1;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(8, 14, 20, 0.9) 0%, rgba(8, 14, 20, 0.7) 34%, rgba(8, 14, 20, 0.35) 72%),
    linear-gradient(180deg, rgba(8, 14, 20, 0.18), rgba(8, 14, 20, 0.68));
}

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }

  .hero-fallback {
    z-index: 0;
  }
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  width: 100%;
}

.hero-visual {
  position: relative;
  min-height: clamp(360px, 52vw, 620px);
  overflow: hidden;
}

#rail-scene {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  touch-action: none;
}

.scene-readout {
  position: absolute;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  display: grid;
  gap: 2px;
  min-width: 112px;
  border-left: 3px solid var(--amber);
  padding: 10px 12px;
  background: rgba(6, 14, 20, 0.68);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
}

.scene-readout strong {
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.hero-content {
  width: min(680px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 780;
}

.button-primary {
  background: var(--rail);
  color: #fff;
  box-shadow: 0 12px 28px rgba(190, 52, 56, 0.27);
}

.button-primary:hover {
  background: var(--rail-dark);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.contact-band .button-secondary {
  border-color: rgba(255, 255, 255, 0.42);
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.signal-strip div {
  min-height: 126px;
  padding: 28px clamp(18px, 3vw, 42px);
  background: #fff;
}

.signal-strip strong,
.signal-strip span {
  display: block;
}

.signal-strip strong {
  color: var(--night);
  font-size: 18px;
}

.signal-strip span {
  margin-top: 8px;
  color: var(--muted);
}

.section {
  padding: 86px clamp(20px, 6vw, 78px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.section-heading h2,
.case-band h2,
.contact-band h2 {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 58px);
  line-height: 1.03;
  letter-spacing: 0;
}

.section-heading p,
.case-band p,
.contact-band p,
.profile-copy p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(280px, 1.18fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: start;
  background: #fff;
}

.profile-copy {
  border-left: 4px solid var(--teal);
  padding-left: clamp(18px, 3vw, 28px);
}

.profile-copy p:first-child {
  margin-top: 0;
}

.work-section {
  background: var(--paper);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.filter {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--night);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
}

.filter.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(15, 26, 35, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card.featured {
  border-top: 5px solid var(--rail);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 110, 105, 0.34);
  box-shadow: var(--shadow);
}

.project-card[hidden] {
  display: none;
}

.project-topline,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-topline span {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(15, 110, 105, 0.09);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.project-card h3 {
  margin: 28px 0 0;
  color: var(--night);
  font-size: 24px;
  line-height: 1.12;
}

.project-card p {
  margin: 14px 0 24px;
  color: var(--muted);
}

.project-links a {
  min-height: 38px;
  border-bottom: 2px solid rgba(190, 52, 56, 0.28);
  color: var(--rail-dark);
  font-size: 14px;
  font-weight: 800;
}

.case-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 5vw, 70px);
  padding: 86px clamp(20px, 6vw, 78px);
  background: var(--night);
  color: #fff;
}

.case-band p {
  color: rgba(255, 255, 255, 0.76);
}

.case-copy {
  max-width: 720px;
}

.case-metrics {
  display: grid;
  gap: 14px;
}

.case-metrics div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.case-metrics span {
  grid-row: span 2;
  color: var(--amber);
  font-size: 13px;
  font-weight: 820;
}

.case-metrics strong {
  display: block;
  font-size: 20px;
}

.case-metrics p {
  margin: 6px 0 0;
  font-size: 15px;
}

.stack-section {
  background: #e8efea;
}

.stack-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stack-list span {
  min-height: 54px;
  display: flex;
  align-items: center;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--night);
  font-weight: 760;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  background: var(--ink);
  color: #fff;
}

.contact-band p {
  color: rgba(255, 255, 255, 0.76);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(20px, 6vw, 78px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .signal-strip,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
    padding-top: 16px;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .hero {
    min-height: 76vh;
    padding-top: 108px;
  }

  h1 {
    font-size: clamp(48px, 18vw, 76px);
  }

  .signal-strip,
  .project-grid,
  .intro-section,
  .hero-layout,
  .case-band,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 340px;
    order: -1;
  }

  .section,
  .case-band {
    padding-block: 68px;
  }

  .project-card {
    min-height: 292px;
  }

  .contact-actions {
    margin-top: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .brand span:last-child {
    display: none;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 250px;
  }

  .hero-visual {
    min-height: 214px;
  }

  .hero {
    min-height: 0;
    padding: 82px 23px 32px;
  }

  h1 {
    font-size: clamp(44px, 16vw, 62px);
  }

  .hero-copy {
    margin-top: 16px;
    font-size: 16px;
  }

  .hero-actions {
    margin-top: 22px;
  }

  .button {
    min-height: 44px;
  }

  .scene-readout {
    min-width: 96px;
    right: 10px;
    bottom: 10px;
  }

  .button,
  .filter {
    width: 100%;
  }

  .hero-actions,
  .filter-bar,
  .contact-actions {
    flex-direction: column;
  }

  .stack-list {
    grid-template-columns: 1fr;
  }

  .case-metrics div {
    grid-template-columns: 1fr;
  }

  .case-metrics span {
    grid-row: auto;
  }
}
