:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-deep: #f3f3f2;
  --ink: #161616;
  --muted: #666666;
  --line: rgba(0, 0, 0, .14);
  --accent: #191919;
  --accent-hover: #000000;
  --night: #111111;
  --white: #ffffff;
  --max: 76rem;
  --gutter: clamp(1.25rem, 5.4vw, 5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { color: var(--white); background: var(--ink); }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section-pad { padding-block: clamp(5rem, 9vw, 8rem); }

/* Header */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled { border-color: var(--line); background: rgba(255, 255, 255, .96); }
.header-inner { min-height: 5.25rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font: 400 1.35rem/1 Georgia, "Times New Roman", serif;
  letter-spacing: .19em;
  text-decoration: none;
}
.brand-symbol {
  display: inline-block;
  width: 2.15rem;
  height: 2.15rem;
  background: currentColor;
  -webkit-mask: url("./logo.svg") center / contain no-repeat;
  mask: url("./logo.svg") center / contain no-repeat;
  transition: transform .6s var(--ease);
}
.brand:hover .brand-symbol { transform: rotate(90deg); }
.main-nav { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.8rem); }
.main-nav a { font-size: .91rem; text-decoration: none; color: #514c46; transition: color .2s ease; }
.main-nav a:hover { color: var(--accent); }
.main-nav .nav-contact { color: var(--ink); }
.menu-toggle { display: none; }

/* Hero */
.hero {
  position: relative;
  min-height: min(52rem, calc(100svh - 5.25rem));
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 76% 43%, rgba(0, 0, 0, .035), transparent 42%);
  content: "";
}
.hero-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(25rem, 1.08fr); align-items: center; gap: clamp(1rem, 3vw, 3rem); padding-block: 4rem 5rem; }
.hero-copy { position: relative; z-index: 2; padding-block: 1rem; }
.hero h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(3.2rem, 6.25vw, 6rem);
  font-weight: 620;
  line-height: .98;
  letter-spacing: -.07em;
  text-wrap: balance;
}
.hero h1 span { color: var(--accent); }
.hero-subtitle { max-width: 29rem; margin: 1.8rem 0 0; font-size: clamp(1.1rem, 1.8vw, 1.45rem); letter-spacing: -.025em; }
.hero-description { max-width: 28rem; margin: .55rem 0 0; color: var(--muted); font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; margin-top: 2rem; }
.button {
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s var(--ease), background .2s ease, border-color .2s ease, color .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--white); background: var(--accent); }
.button-primary:hover { background: var(--accent-hover); }
.button-quiet { padding-inline: .2rem; color: var(--ink); border-bottom-color: var(--line); border-radius: 0; }
.button-quiet:hover { border-color: var(--accent); color: var(--accent); }
.hero-visual { position: relative; min-width: 0; width: 100%; aspect-ratio: 1.12 / 1; transform-style: preserve-3d; }
.hero-visual::before {
  position: absolute;
  z-index: -1;
  top: 14%;
  right: 6%;
  width: 76%;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 50%;
  content: "";
}
.hero-visual::after {
  position: absolute;
  z-index: -1;
  right: 1%;
  bottom: 11%;
  left: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .16), transparent);
  content: "";
}
.hero-fallback, #hero-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.hero-fallback { object-fit: contain; }
#hero-scene { opacity: 0; }
.hero-visual.webgl-ready #hero-scene { opacity: 1; }
.hero-visual.webgl-ready .hero-fallback { opacity: 0; }
.scene-caption {
  position: absolute;
  right: 1%;
  top: 13%;
  max-width: 8.5rem;
  color: #756f68;
  font: 500 .62rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
  pointer-events: none;
}
.scroll-cue {
  position: absolute;
  bottom: 1.7rem;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--muted);
  font-size: .74rem;
  text-decoration: none;
  transform: translateX(-50%);
}
.scroll-cue span { width: 1.4rem; height: 1px; background: var(--accent); }

/* Intro */
.intro-band { padding-block: clamp(4.5rem, 8vw, 7rem); color: var(--white); background: var(--night); }
.intro-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(3rem, 9vw, 9rem); align-items: center; }
.section-index { margin: 0 0 1.1rem; color: var(--accent); font: 600 .7rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .11em; }
.section-index span { color: currentColor; opacity: .6; }
.intro-heading h2, .section-heading h2, .stack-heading h2, .sectors h2, .contact h2 {
  margin: 0;
  font-size: clamp(2.45rem, 4.2vw, 4.35rem);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -.06em;
  text-wrap: balance;
}
.intro-heading h2 em, .method h2 em { color: #aaa; font-style: normal; }
.intro-copy { max-width: 34rem; }
.intro-lead { margin: 0; font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.45; }
.intro-copy > p + p { margin-top: .85rem; color: #aaa; }
.intro-signals { display: flex; flex-wrap: wrap; gap: .65rem 1.6rem; margin-top: 2rem; color: #d0d0d0; font-size: .83rem; }
.intro-signals span + span { padding-left: 1.6rem; border-left: 1px solid rgba(255,255,255,.2); }

/* Services */
.section-heading { margin-bottom: clamp(2.5rem, 5vw, 4.4rem); }
.section-heading > p:not(.section-index) { margin: 1rem 0 0; color: var(--muted); }
.service-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(1.5rem, 3.5vw, 3.5rem); }
.service-row {
  min-height: 9.5rem;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  gap: .5rem;
  padding: 1.25rem 0 1rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.service-row:hover { border-color: var(--accent); color: var(--accent-hover); }
.service-icon, .sector-icon, .method-icon { display: block; width: 1.55rem; height: 1.55rem; object-fit: contain; }
.service-icon { margin-bottom: .35rem; }
.service-row h3 { margin: 0; font-size: clamp(1.08rem, 1.5vw, 1.35rem); font-weight: 560; letter-spacing: -.035em; }
.service-row p { max-width: 18ch; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }

/* Sectors */
.sectors { background: var(--paper-deep); }
.sectors-top { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; }
.sectors-top > p { max-width: 22rem; margin: 0 0 .35rem; color: var(--muted); }
.sectors h2 { font-size: clamp(2.4rem, 4vw, 4rem); }
.sector-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.sector-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.12 / 1;
  overflow: hidden;
  color: #fff;
  background: #171717;
}
.sector-card::after {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  content: "";
  pointer-events: none;
}
.sector-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.sector-card:hover .sector-image { transform: scale(1.045); }
.sector-copy { position: absolute; z-index: 1; right: 1.35rem; bottom: 1.35rem; left: 1.35rem; }
.sector-copy h3 { margin: 0; font-size: clamp(1.15rem, 1.65vw, 1.5rem); font-weight: 560; letter-spacing: -.035em; }
.sector-copy p { margin: .35rem 0 0; color: rgba(255,255,255,.78); font-size: .85rem; }

/* Technology stack */
.stack { color: var(--white); background: var(--night); }
.stack-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; }
.stack-heading .section-index { color: #a6a6a6; }
.stack-heading > p { max-width: 18rem; margin: 0 0 .35rem; color: #b9b9b9; }
.stack-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.2rem, 2.8vw, 2.8rem); }
.stack-group { min-width: 0; min-height: 9rem; padding-top: 1.15rem; border-top: 1px solid rgba(255,255,255,.24); }
.stack-group h3 { margin: 0 0 1.35rem; color: #b8b8b8; font-size: .73rem; font-weight: 550; letter-spacing: .1em; text-transform: uppercase; }
.stack-brands { display: flex; flex-wrap: wrap; align-items: start; gap: 1rem 1.15rem; }
.stack-brands figure { min-width: 2.5rem; display: grid; justify-items: center; gap: .55rem; margin: 0; }
.stack-brands img { display: block; width: 1.5rem; height: 1.5rem; object-fit: contain; filter: grayscale(1) brightness(0) invert(1); opacity: .9; }
.stack-brands figcaption { color: #f2f2f2; font-size: .72rem; line-height: 1.2; text-align: center; white-space: nowrap; }

/* Method */
.method { background: #f4f4f3; }
.method .section-heading { margin-bottom: 3.5rem; }
.method-track { display: grid; grid-template-columns: repeat(3, 1fr); }
.method-step { position: relative; padding: 1.3rem clamp(1rem, 3vw, 3rem) 0 0; border-top: 1px solid var(--line); }
.method-step + .method-step { padding-left: clamp(1rem, 3vw, 3rem); }
.method-step + .method-step::before { position: absolute; top: -2px; left: 0; width: 3.8rem; height: 3px; background: var(--accent); content: ""; }
.method-icon { margin-bottom: 1.15rem; }
.method-step h3 { margin: .1rem 0 .45rem; font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 560; letter-spacing: -.04em; }
.method-step p { max-width: 19rem; margin: 0; color: var(--muted); font-size: .92rem; }

/* Contact */
.contact { position: relative; overflow: hidden; color: var(--white); background: var(--night); }
.contact::before {
  position: absolute;
  right: -7%;
  bottom: -82%;
  width: min(66vw, 58rem);
  aspect-ratio: 1.7;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  box-shadow: 0 -18px 90px -54px rgba(255, 255, 255, .12), inset 0 1px rgba(255,255,255,.06);
  content: "";
  transform: rotate(-15deg);
  pointer-events: none;
}
.contact-inner { position: relative; display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.contact h2 { font-size: clamp(3.3rem, 7vw, 7rem); }
.contact-inner > div > p:last-child { max-width: 28rem; margin: 1rem 0 0; color: #b8b8b8; }
.button-light { flex: 0 0 auto; color: var(--ink); background: var(--white); }
.button-light:hover { color: var(--white); background: var(--accent); }

/* Footer */
.site-footer { padding-block: 2rem 2.5rem; color: #707070; background: var(--night); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.1rem 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); }
.footer-brand { color: var(--white); font-size: 1.1rem; }
.footer-brand .brand-symbol { width: 1.8rem; height: 1.8rem; }
.footer-inner p, .footer-location, .copyright, .footer-inner > a:not(.brand) { margin: 0; font-size: .78rem; }
.footer-inner > a:not(.brand) { color: #eeeeee; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; }
.back-to-top {
  position: fixed;
  z-index: 15;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: var(--white);
  background: rgba(23,22,20,.88);
  font-size: 1.2rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0;
  transform: translateY(.5rem);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top img { display: block; width: 1.2rem; height: 1.2rem; filter: invert(1); }

/* Motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s var(--ease), transform .65s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.service-row.reveal:nth-child(2), .sector-item.reveal:nth-child(2), .method-step.reveal:nth-child(2) { transition-delay: .08s; }
.service-row.reveal:nth-child(3), .sector-item.reveal:nth-child(3), .method-step.reveal:nth-child(3) { transition-delay: .16s; }
.service-row.reveal:nth-child(4) { transition-delay: .06s; }
.service-row.reveal:nth-child(5) { transition-delay: .12s; }
.service-row.reveal:nth-child(6) { transition-delay: .18s; }

@media (max-width: 65rem) {
  .hero-grid { grid-template-columns: minmax(0, .9fr) minmax(20rem, 1.1fr); gap: 0; }
  .hero h1 { font-size: clamp(3.1rem, 6.4vw, 4.8rem); }
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sector-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 52rem) {
  .header-inner { min-height: 4.5rem; }
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: .65rem;
    border: 0;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
  }
  .menu-icon { display: block; width: 1.35rem; height: 1.35rem; }
  .menu-icon-close { display: none; }
  .menu-toggle[aria-expanded="true"] .menu-icon-open { display: none; }
  .menu-toggle[aria-expanded="true"] .menu-icon-close { display: block; }
  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    padding: 1rem var(--gutter) 1.4rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .main-nav.open { display: grid; }
  .main-nav a { padding: .55rem 0; font-size: 1rem; }
  .sector-list { grid-template-columns: 1fr; }
  .sector-card { aspect-ratio: 1.35 / 1; }
  .back-to-top { display: none; }
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 4rem 3.8rem; }
  .hero-copy { max-width: 39rem; }
  .hero h1 { max-width: 11ch; font-size: clamp(3.3rem, 11vw, 5.2rem); }
  .hero-visual { width: min(100%, 37rem); margin: -.2rem auto -1.5rem; aspect-ratio: 1.25 / 1; }
  .scene-caption { top: 8%; }
  .scroll-cue { display: none; }
  .intro-grid { grid-template-columns: 1fr; gap: 2.3rem; }
  .intro-heading h2 { font-size: clamp(2.6rem, 9vw, 4rem); }
  .stack-heading { align-items: start; }
}
@media (max-width: 40rem) {
  :root { --gutter: 1.25rem; }
  .brand { font-size: 1.2rem; }
  .brand-symbol { width: 1.95rem; height: 1.95rem; }
  .hero-grid { padding-top: 3.2rem; }
  .hero h1 { max-width: 9.5ch; font-size: clamp(3.1rem, 13vw, 4.6rem); }
  .hero-subtitle { margin-top: 1.35rem; }
  .hero-visual { margin-top: .4rem; margin-bottom: -.4rem; width: calc(100% + .6rem); margin-left: -.3rem; }
  .hero-visual::before { right: 9%; width: 73%; }
  .scene-caption { display: none; }
  .hero-actions { gap: .65rem 1rem; margin-top: 1.5rem; }
  .button { min-height: 2.9rem; padding: .72rem 1rem; font-size: .86rem; }
  .button-quiet { padding-inline: .2rem; }
  .section-pad { padding-block: 4.5rem; }
  .intro-band { padding-block: 4.3rem; }
  .intro-grid { gap: 1.7rem; }
  .intro-heading h2, .section-heading h2, .sectors h2 { font-size: clamp(2.35rem, 10vw, 3.5rem); }
  .intro-signals { gap: .55rem 1rem; font-size: .75rem; }
  .intro-signals span + span { padding-left: 1rem; }
  .stack-heading { display: block; margin-bottom: 2rem; }
  .stack-heading > p { margin-top: .9rem; }
  .stack-heading h2 { font-size: clamp(2.35rem, 10vw, 3.5rem); }
  .stack-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem 1rem; }
  .stack-group { min-height: 8.7rem; }
  .stack-brands { gap: .8rem .9rem; }
  .stack-brands figure { min-width: 2.4rem; }
  .stack-brands img { width: 1.3rem; height: 1.3rem; }
  .stack-brands figcaption { font-size: .66rem; }
  .service-list { grid-template-columns: 1fr; }
  .service-row { min-height: 8.2rem; gap: .45rem; }
  .service-row p { max-width: 19rem; }
  .sectors-top { display: block; margin-bottom: 2rem; }
  .sectors-top > p { margin-top: 1rem; }
  .method .section-heading { margin-bottom: 2.4rem; }
  .method-track { grid-template-columns: 1fr; gap: 0; }
  .method-step, .method-step + .method-step { min-height: 7.6rem; display: grid; grid-template-columns: 2rem 1fr; align-content: center; gap: .35rem 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
  .method-step + .method-step::before { top: -2px; left: 0; }
  .method-icon { grid-row: span 2; margin: 0; }
  .method-step h3 { margin: 0; }
  .method-step p { grid-column: 2; max-width: 25rem; font-size: .88rem; }
  .contact-inner { display: block; }
  .contact h2 { font-size: clamp(3.2rem, 13vw, 5rem); }
  .contact-inner > .button { margin-top: 1.8rem; }
  .contact::before { right: -50%; bottom: -57%; width: 125vw; }
  .footer-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .footer-inner p { grid-column: 1 / -1; grid-row: 2; }
  .footer-brand { grid-column: 1; grid-row: 1; }
  .footer-inner > a:not(.brand) { grid-column: 1 / -1; }
  .footer-location { grid-column: 1; }
  .copyright { grid-column: 2; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
