:root {
  --surface-darkest: #08090a;
  --surface-dark: #0f1011;
  --surface-base: #141516;
  --surface-mid: #23252a;
  --surface-gray: #383b3f;
  --text: #f7f8f8;
  --text-strong: #ffffff;
  --text-muted: #8a8f98;
  --text-soft: #b4bcd0;
  --accent: #5e6ad2;
  --accent-light: #828fff;
  --cta-bg: #e5e5e6;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-faint: rgba(255, 255, 255, 0.05);
  --max-width: 1180px;
  --header-height: 72px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-darkest);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 24px;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, #08090a 0%, #0f1011 62%, #11131b 100%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, black 14%, black 72%, transparent);
}

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

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

button {
  font: inherit;
}

ul {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 100;
  transform: translate(-50%, calc(-100% - 24px));
  border-radius: 6px;
  background: var(--cta-bg);
  color: var(--surface-darkest);
  opacity: 0;
  padding: 8px 12px;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

@supports selector(:focus-visible) {
  .skip-link:focus {
    transform: translate(-50%, calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
  }

  .skip-link:focus-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header,
.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  width: 100%;
  max-width: 100vw;
  padding: 0 24px;
  background: rgba(8, 9, 10, 0.76);
  box-shadow: rgba(0, 0, 0, 0.4) 0 1px 0 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 510;
  line-height: 21px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #0f1011;
  color: var(--text);
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 16px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a,
.button,
.text-link {
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 14px;
  line-height: 21px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  outline: none;
}

.site-nav .nav-cta {
  margin-left: 8px;
  border: 1px solid var(--cta-bg);
  border-radius: 9999px;
  background: var(--cta-bg);
  color: var(--surface-darkest);
  padding: 4px 14px;
  font-weight: 510;
  white-space: nowrap;
  box-shadow:
    rgba(0, 0, 0, 0) 0 8px 2px 0,
    rgba(0, 0, 0, 0.01) 0 5px 2px 0,
    rgba(0, 0, 0, 0.04) 0 3px 2px 0,
    rgba(0, 0, 0, 0.07) 0 1px 1px 0,
    rgba(0, 0, 0, 0.08) 0 0 1px 0;
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible {
  background: #f0f0f1;
  color: var(--surface-darkest);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
  content: "";
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 0;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

.menu-toggle[aria-expanded="true"] .menu-icon {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(88svh - var(--header-height));
  overflow: hidden;
  isolation: isolate;
  padding: 72px 24px 80px;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% center;
  opacity: 0.72;
  animation: mediaDrift 18s ease-in-out infinite alternate;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 9, 10, 0.94) 0%, rgba(8, 9, 10, 0.78) 42%, rgba(8, 9, 10, 0.35) 72%, rgba(8, 9, 10, 0.72) 100%),
    linear-gradient(0deg, rgba(8, 9, 10, 0.98) 0%, transparent 26%);
}

.hero-content {
  width: 100%;
  max-width: 720px;
  min-width: 0;
  align-self: center;
  margin-left: max(0px, calc((100vw - var(--max-width)) / 2));
  animation: riseIn 700ms ease both;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--accent-light);
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  color: var(--text-strong);
  font-size: 64px;
  font-weight: 510;
  line-height: 64px;
}

h2 {
  margin-bottom: 0;
  color: var(--text-strong);
  font-size: 48px;
  font-weight: 510;
  line-height: 48px;
}

h3 {
  margin-bottom: 12px;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 590;
  line-height: 27px;
}

.hero-lead {
  max-width: 620px;
  margin-bottom: 32px;
  color: var(--text-soft);
  font-size: 20px;
  line-height: 30px;
  overflow-wrap: break-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 510;
  line-height: 20px;
}

.button-primary {
  border: 1px solid var(--cta-bg);
  background: var(--cta-bg);
  color: var(--surface-darkest);
  box-shadow:
    rgba(0, 0, 0, 0) 0 8px 2px 0,
    rgba(0, 0, 0, 0.01) 0 5px 2px 0,
    rgba(0, 0, 0, 0.04) 0 3px 2px 0,
    rgba(0, 0, 0, 0.07) 0 1px 1px 0,
    rgba(0, 0, 0, 0.08) 0 0 1px 0;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #f0f0f1;
  color: var(--surface-darkest);
  transform: translateY(-1px);
  outline: none;
}

.button-secondary {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: rgba(180, 188, 208, 0.35);
  color: var(--text-soft);
  outline: none;
}

.section {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 104px 0;
}

.intro {
  padding-top: 48px;
}

.intro-grid,
.section-heading,
.case-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 48px;
  align-items: start;
}

.intro-grid p,
.section-heading p,
.case-copy p,
.contact-section p,
.timeline-item p,
.service-card p,
.legal-main p {
  color: var(--text-muted);
}

.intro-grid p,
.section-heading p,
.case-copy p,
.contact-section p {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 24px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.service-card,
.metric,
.timeline-item {
  border: 1px solid var(--border-faint);
  border-radius: 8px;
  background: rgba(15, 16, 17, 0.86);
}

.service-card {
  display: flex;
  min-height: 432px;
  flex-direction: column;
  padding: 24px;
}

.service-index {
  width: fit-content;
  margin-bottom: 52px;
  color: var(--accent-light);
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 16px;
}

.service-card p {
  margin-bottom: 28px;
}

.service-card ul {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.service-card li {
  position: relative;
  color: var(--text-soft);
  padding-left: 16px;
  font-size: 14px;
  line-height: 21px;
}

.service-card li::before {
  position: absolute;
  top: 10px;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.case-section {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 104px 0;
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
}

.case-copy h2 {
  margin-bottom: 24px;
}

.case-copy p {
  margin-bottom: 28px;
}

.text-link {
  display: inline-flex;
  color: var(--text);
  font-size: 14px;
  font-weight: 510;
  line-height: 21px;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent-light);
  outline: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.metric {
  min-height: 180px;
  padding: 24px;
}

.metric strong {
  display: block;
  margin-bottom: 48px;
  color: var(--text-strong);
  font-size: 40px;
  font-weight: 510;
  line-height: 44px;
}

.metric span {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 21px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.timeline-item {
  padding: 24px;
}

.timeline-item span {
  display: block;
  margin-bottom: 36px;
  color: var(--accent-light);
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 16px;
}

.timeline-item p {
  margin-bottom: 0;
}

.stack-section h2 {
  max-width: 760px;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.stack-list span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  padding: 4px 12px;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 16px;
}

.contact-section {
  width: min(calc(100% - 48px), 860px);
  margin: 0 auto;
  padding: 104px 0 120px;
  text-align: center;
}

.contact-section h2 {
  margin-bottom: 24px;
}

.contact-section p {
  max-width: 620px;
  margin: 0 auto 32px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 24px;
  border-top: 1px solid var(--border-faint);
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  gap: 16px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text-soft);
  outline: none;
}

.reveal {
  transform: translateY(20px);
  opacity: 0;
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

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

.legal-page {
  background: var(--surface-darkest);
}

.legal-header {
  position: static;
}

.legal-main {
  width: min(calc(100% - 48px), 800px);
  margin: 0 auto;
  padding: 80px 0 120px;
}

.legal-main h1 {
  margin-bottom: 24px;
}

.legal-main h2 {
  margin: 48px 0 16px;
  font-size: 24px;
  line-height: 32px;
}

.legal-note {
  border: 1px solid rgba(130, 143, 255, 0.32);
  border-radius: 8px;
  background: rgba(94, 106, 210, 0.08);
  padding: 16px;
  overflow-wrap: anywhere;
}

.legal-list {
  display: grid;
  gap: 16px;
}

.legal-list div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border-faint);
  padding-top: 16px;
}

.legal-list dt {
  color: var(--text-soft);
}

.legal-list dd {
  margin: 0;
  color: var(--text-muted);
}

.legal-main a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(130, 143, 255, 0.52);
  text-underline-offset: 4px;
}

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

@keyframes mediaDrift {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.035) translate3d(-10px, 0, 0);
  }
}

@media (max-width: 1100px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card {
    min-height: 360px;
  }

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

@media (max-width: 1240px) {
  .site-header,
  .legal-header {
    padding: 0 16px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    left: 16px;
    display: grid;
    gap: 4px;
    visibility: hidden;
    transform: translateY(-8px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(15, 16, 17, 0.98);
    padding: 8px;
    opacity: 0;
    transition:
      opacity 180ms ease,
      transform 180ms ease,
      visibility 180ms ease;
  }

  .site-nav.is-open {
    visibility: visible;
    transform: translateY(0);
    opacity: 1;
  }

  .site-nav a {
    min-height: 48px;
    padding: 12px;
  }

  .site-nav .nav-cta {
    margin-left: 0;
    justify-content: center;
  }

  .hero {
    min-height: calc(88svh - var(--header-height));
    padding: 64px 16px 72px;
  }

  .hero-media img {
    object-position: 70% center;
    opacity: 0.46;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(8, 9, 10, 0.96), rgba(8, 9, 10, 0.76)),
      linear-gradient(0deg, rgba(8, 9, 10, 1) 0%, transparent 32%);
  }

  h1 {
    font-size: 48px;
    line-height: 48px;
  }

  h2 {
    font-size: 32px;
    line-height: 36px;
  }

  .hero-lead {
    font-size: 18px;
    line-height: 28px;
  }

  .section,
  .case-section,
  .contact-section,
  .legal-main {
    width: min(calc(100% - 32px), var(--max-width));
    padding: 72px 0;
  }

  .intro-grid,
  .section-heading,
  .case-section {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

@media (max-width: 640px) {
  body::after {
    background-size: 36px 36px;
  }

  .brand {
    gap: 8px;
  }

  .brand span:last-child {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    padding-top: 52px;
  }

  .hero-content {
    width: auto;
    max-width: 100%;
    margin-left: 0;
  }

  h1 {
    font-size: 40px;
    line-height: 44px;
  }

  h2 {
    font-size: 28px;
    line-height: 32px;
  }

  .hero-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .section,
  .case-section,
  .contact-section,
  .legal-main {
    width: auto;
    margin-right: 16px;
    margin-left: 16px;
  }

  .hero-actions .button,
  .contact-section .button {
    width: 100%;
  }

  .service-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: auto;
  }

  .service-index,
  .metric strong,
  .timeline-item span {
    margin-bottom: 28px;
  }

  .metric {
    min-height: auto;
  }

  .legal-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .hero-content,
  .section,
  .case-section,
  .contact-section,
  .legal-main {
    max-width: 358px;
  }
}

@media (max-width: 420px) {
  .site-header,
  .legal-header {
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    max-width: 142px;
  }

  .legal-header .button {
    flex: 0 0 auto;
    padding-right: 12px;
    padding-left: 12px;
  }

  h1 {
    font-size: 34px;
    line-height: 38px;
  }

  .hero-lead {
    font-size: 17px;
    line-height: 27px;
  }
}

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

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