:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #171717;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --muted-strong: #c6c6c6;
  --line: #252525;
  --line-light: #343434;
  --paper: #f3f3f0;
  --ink: #111111;
  --accent: #a9d9ff;
  --max-width: 1180px;
  --page-pad: 20px;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  font: inherit;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

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

::selection {
  background: var(--text);
  color: var(--bg);
}

.shell {
  width: min(100%, calc(var(--max-width) + (var(--page-pad) * 2)));
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: rgba(10, 10, 10, 0.9);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.site-header.scrolled {
  border-color: var(--line);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, calc(var(--max-width) + (var(--page-pad) * 2)));
  min-height: 68px;
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.96rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.menu-button {
  display: grid;
  place-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.menu-line {
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
  transition: transform 160ms ease;
}

.menu-button[aria-expanded="true"] .menu-line:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-button[aria-expanded="true"] .menu-line:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

.site-nav {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  display: none;
  padding: 12px var(--page-pad) 20px;
  border-bottom: 1px solid var(--line);
  background: #0a0a0a;
}

.site-nav.open {
  display: grid;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.96rem;
}

.site-nav a:last-child {
  border-bottom: 0;
}

.site-nav .nav-contact {
  color: var(--text);
  font-weight: 650;
}

/* Shared type */
.kicker {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 620;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 920px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 13vw, 5.75rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  line-height: 1.02;
}

h3 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 7vw, 2.65rem);
  line-height: 1.04;
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--line);
}

.hero-shell {
  display: flex;
  min-height: min(740px, calc(100svh - 68px));
  flex-direction: column;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: clamp(1.08rem, 4.5vw, 1.32rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 650;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--text);
  color: var(--bg);
}

.button-primary:hover {
  background: #dddddd;
}

.button-quiet {
  border-color: var(--line-light);
  color: var(--muted-strong);
}

.button-quiet:hover {
  border-color: #555;
  color: var(--text);
}

/* Proof strip */
.proof-strip {
  border-bottom: 1px solid var(--line);
}

.proof-grid {
  display: grid;
}

.proof-grid > div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.proof-grid > div:last-child {
  border-bottom: 0;
}

.proof-label {
  color: #707070;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.proof-grid strong {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 520;
}

/* Sections */
.section {
  padding-top: 92px;
  padding-bottom: 92px;
}

.section-intro {
  max-width: 820px;
  margin-bottom: 52px;
}

.section-intro > p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

/* Projects */
.project {
  min-width: 0;
  padding-block: 48px;
  border-top: 1px solid var(--line);
}

.project:last-child {
  border-bottom: 1px solid var(--line);
}

.project-image-link {
  display: block;
  min-width: 0;
  margin-bottom: 30px;
}

.project-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.project-figure img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 300ms ease;
}

.project-image-link:hover img {
  transform: scale(1.012);
}

.project-figure figcaption {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: #777;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.principia-figure img {
  object-position: center;
}

.project-body {
  min-width: 0;
}

.project-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.project-type {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.project-index {
  padding-top: 4px;
  color: #5d5d5d;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.project-summary {
  max-width: 700px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
}

.project-details {
  display: grid;
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-details > div {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.project-details > div:last-child {
  border-bottom: 0;
}

.project-details span {
  color: #707070;
  font-size: 0.72rem;
}

.project-details strong {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 0.83rem;
  font-weight: 520;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 620;
}

.text-link span {
  transition: transform 150ms ease;
}

.text-link:hover span {
  transform: translate(2px, -2px);
}

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

.compact-intro {
  margin-bottom: 44px;
}

.capability-list {
  border-top: 1px solid var(--line-light);
}

.capability-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line-light);
}

.capability-number {
  padding-top: 5px;
  color: #696969;
  font-size: 0.7rem;
}

.capability-list h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.capability-list p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.7;
}

/* About */
.about-grid {
  display: grid;
  gap: 40px;
}

.about-grid h2 {
  max-width: 620px;
}

.about-copy {
  max-width: 640px;
}

.about-copy p {
  margin-bottom: 20px;
  color: var(--muted-strong);
  font-size: 1.03rem;
  line-height: 1.8;
}

.about-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

/* Contact */
.contact-section {
  padding-top: 80px;
  padding-bottom: 80px;
  background: var(--paper);
  color: var(--ink);
}

.contact-section .kicker {
  color: #707070;
}

.contact-section h2 {
  margin-bottom: 0;
  color: var(--ink);
}

.contact-grid {
  display: grid;
  gap: 34px;
}

.contact-side p {
  max-width: 560px;
  margin-bottom: 24px;
  color: #555;
  line-height: 1.7;
}

.button-light {
  width: 100%;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.button-light:hover {
  background: #2a2a2a;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  gap: 22px;
  padding-top: 34px;
  padding-bottom: 34px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-links a,
.footer-grid > p {
  margin: 0;
  color: #777;
  font-size: 0.82rem;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

/* Small phones */
@media (max-width: 374px) {
  :root {
    --page-pad: 16px;
  }

  h1 {
    font-size: 2.65rem;
  }

  .hero-shell {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .project-details > div,
  .proof-grid > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Tablet and up */
@media (min-width: 700px) {
  :root {
    --page-pad: 32px;
  }

  .hero-shell {
    min-height: 680px;
    padding-top: 100px;
    padding-bottom: 100px;
  }

  .hero-actions {
    flex-direction: row;
    align-items: center;
  }

  .button {
    width: auto;
  }

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

  .proof-grid > div {
    display: block;
    padding: 22px 24px 22px 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .proof-grid > div + div {
    padding-left: 24px;
  }

  .proof-grid > div:last-child {
    border-right: 0;
  }

  .proof-label,
  .proof-grid strong {
    display: block;
  }

  .proof-grid strong {
    margin-top: 7px;
  }

  .section {
    padding-top: 120px;
    padding-bottom: 120px;
  }

  .project {
    padding-block: 64px;
  }

  .project-figure {
    border-radius: 18px;
  }

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

  .project-details > div {
    display: block;
    padding: 17px 18px 17px 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .project-details > div + div {
    padding-left: 18px;
  }

  .project-details > div:last-child {
    border-right: 0;
  }

  .project-details span,
  .project-details strong {
    display: block;
  }

  .project-details strong {
    margin-top: 6px;
  }

  .capability-list article {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 32px 0 36px;
  }

  .capability-list h3 {
    font-size: 1.55rem;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 80px;
    align-items: start;
  }

  .button-light {
    width: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 32px;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .menu-button {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .site-nav a {
    min-height: 44px;
    border: 0;
    color: #9b9b9b;
    font-size: 0.84rem;
    transition: color 140ms ease;
  }

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

  .site-nav .nav-contact {
    padding: 0 14px;
    border: 1px solid var(--line-light);
    border-radius: 8px;
    color: var(--text);
  }

  .hero-shell {
    min-height: 730px;
  }

  h1 {
    font-size: clamp(5rem, 8vw, 7.6rem);
  }

  .section-intro {
    margin-bottom: 74px;
  }

  .project {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
    gap: clamp(44px, 6vw, 88px);
    align-items: center;
    min-height: 610px;
  }

  .project-image-link {
    margin-bottom: 0;
  }

  .project-secondary {
    grid-template-columns: minmax(330px, 0.8fr) minmax(0, 1.2fr);
  }

  .project-secondary .project-image-link {
    order: 2;
  }

  .project-secondary .project-body {
    order: 1;
  }

  .project-figure img {
    min-height: 430px;
  }

  .project-secondary .project-figure img {
    min-height: 390px;
  }

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

  .project-details > div,
  .project-details > div + div {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 14px;
    padding: 13px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-details > div:last-child {
    border-bottom: 0;
  }

  .project-details strong {
    margin-top: 0;
  }

  .compact-intro {
    max-width: 760px;
    margin-bottom: 60px;
  }

  .capability-list article {
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: start;
    padding: 38px 0 42px;
  }

  .capability-list article > div {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    gap: 64px;
    align-items: baseline;
  }

  .capability-list h3 {
    margin: 0;
  }

  .contact-section {
    padding-top: 110px;
    padding-bottom: 110px;
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  :root {
    --page-pad: 40px;
  }

  .hero-copy {
    font-size: 1.28rem;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
