:root {
  --bg: #fafafa;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft: rgba(244, 244, 245, 0.9);
  --text: #09090b;
  --text-soft: #3f3f46;
  --line: rgba(9, 9, 11, 0.1);
  --line-strong: rgba(9, 9, 11, 0.18);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 28px 70px rgba(15, 23, 42, 0.1);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f7f7f8 42%, #f4f4f5 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(9, 9, 11, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(9, 9, 11, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 84%);
}

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

button,
a {
  cursor: pointer;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding-bottom: 3rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
}

.brand-mark {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  flex-shrink: 0;
}

.brand-text {
  font-size: 0.96rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.site-nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
  transition: color 220ms ease;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1.25rem;
  padding: 4.2rem 0 1.4rem;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.proof-card,
.project-card,
.principle-card,
.contact-card,
.about-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(1.6rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Archivo", sans-serif;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3.4rem, 9vw, 7rem);
}

h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.hero-text,
.project-description,
.about-copy p,
.principle-card p,
.contact-lead,
.site-footer p,
.proof-card p,
.project-visual figcaption {
  color: var(--text-soft);
  line-height: 1.75;
}

.hero-text {
  max-width: 60ch;
  margin: 1.35rem 0 0;
  font-size: 1.06rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.85rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    transform 260ms ease,
    border-color 260ms ease,
    background-color 260ms ease,
    color 260ms ease,
    box-shadow 260ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--text);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(9, 9, 11, 0.15);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.hero-meta,
.chip-row,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-meta {
  margin-top: 2rem;
}

.hero-meta li,
.chip-row li,
.contact-links a,
.muted-link {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-soft);
  font-size: 0.92rem;
  transition:
    transform 240ms ease,
    border-color 240ms ease,
    color 240ms ease,
    background-color 240ms ease;
}

.contact-links a:hover,
.contact-links a:focus-visible,
.project-links a:hover,
.project-links a:focus-visible {
  transform: translateY(-2px);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 1.4rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 244, 245, 0.92)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 46%);
}

.panel-topline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.panel-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.3rem rgba(37, 99, 235, 0.16);
}

.code-block {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.96rem;
  line-height: 1.8;
  overflow: auto;
}

.code-block p {
  margin: 0;
}

.token {
  color: #93c5fd;
}

.string {
  color: #86efac;
}

.signal-grid {
  display: grid;
  gap: 0.9rem;
}

.signal-grid article {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.signal-label,
.project-index,
.project-proof-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 0.8rem 0 0.6rem;
}

.proof-card {
  padding: 1.2rem 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 248, 0.94));
}

.proof-value {
  display: inline-block;
  margin-bottom: 0.65rem;
  font-family: "Archivo", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.proof-card p {
  margin: 0;
  font-size: 0.95rem;
}

.section {
  padding: 3.1rem 0 0.8rem;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 1.1rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.4rem;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 320ms ease,
    border-color 320ms ease,
    box-shadow 320ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    420px circle at var(--spotlight-x, 16%) var(--spotlight-y, 12%),
    rgba(37, 99, 235, 0.14),
    transparent 38%
  );
  opacity: 0;
  transition: opacity 320ms ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--shadow-strong);
}

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

.project-card-featured {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.9)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.1), transparent 48%);
}

.project-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.project-tagline {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.project-visual {
  margin: 0;
  padding: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), transparent 55%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 40px rgba(15, 23, 42, 0.14);
}

.diagram-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.diagram-badge {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diagram-expand {
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #eff6ff;
  font-weight: 700;
  transition:
    transform 260ms ease,
    background-color 260ms ease,
    border-color 260ms ease;
}

.diagram-expand:hover,
.diagram-expand:focus-visible {
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(147, 197, 253, 0.42);
}

.project-visual img {
  width: 100%;
  min-height: 320px;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  padding: 0.65rem;
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
  background-size: 28px 28px, 28px 28px, auto;
  filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.16));
  transition:
    transform 340ms ease,
    filter 340ms ease;
}

.project-card:hover .project-visual img,
.project-card:focus-within .project-visual img {
  transform: scale(1.02);
  filter: drop-shadow(0 22px 38px rgba(15, 23, 42, 0.22));
}

.project-visual figcaption {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  color: rgba(226, 232, 240, 0.82);
}

.project-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.project-proof-grid article {
  min-height: 100%;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
}

.project-proof-grid strong {
  display: block;
  line-height: 1.4;
}

.project-description {
  margin: 0;
}

.project-highlights p {
  margin: 0 0 0.8rem;
  font-weight: 700;
}

.project-highlights ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-soft);
  line-height: 1.75;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: auto;
}

.project-links a {
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  transition:
    transform 260ms ease,
    background-color 260ms ease,
    color 260ms ease;
}

.project-links a:hover,
.project-links a:focus-visible {
  background: rgba(37, 99, 235, 0.18);
}

.section-split,
.contact-section {
  padding-top: 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 1rem;
  align-items: start;
}

.about-copy {
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.86);
}

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

.about-copy p:last-child {
  margin-bottom: 0;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.principle-card {
  padding: 1.4rem;
}

.principle-card span {
  color: var(--accent);
  font-weight: 700;
}

.principle-card h3 {
  margin-top: 1rem;
  font-size: 1.24rem;
  line-height: 1.05;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
}

.contact-lead {
  margin: 0;
}

.contact-links {
  margin-top: 1.2rem;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent);
  background: rgba(255, 255, 255, 1);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.8rem 0 0;
}

.site-footer p {
  margin: 0;
  font-size: 0.95rem;
}

.status-message {
  margin: 1rem 0 0;
}

.diagram-modal {
  width: min(1100px, calc(100% - 1.5rem));
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 24px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.42);
}

.diagram-modal::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.diagram-modal__inner {
  padding: 1.25rem;
}

.diagram-modal__topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.diagram-modal__eyebrow {
  margin: 0 0 0.4rem;
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.diagram-modal__title {
  max-width: none;
  color: #f8fafc;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.diagram-modal__close {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-weight: 700;
}

.diagram-modal__frame {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.97));
  background-size: 28px 28px, 28px 28px, auto;
}

.diagram-modal__frame img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.diagram-modal__caption {
  margin: 0.95rem 0 0;
  color: rgba(226, 232, 240, 0.86);
  line-height: 1.7;
}

.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;
}

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

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

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: 4px;
}

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

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

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

  h1,
  h2 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 1.2rem), var(--max-width));
  }

  .site-header,
  .contact-card,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }

  .hero {
    padding-top: 2.6rem;
  }

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

  .diagram-toolbar,
  .diagram-modal__topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-header {
    flex-direction: column;
  }
}

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

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

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