:root {
  --bg: #09090B;
  --card: #18181B;
  --border: #27272A;
  --border-hover: #3F3F46;
  --text: #FAFAFA;
  --muted: #A1A1AA;
  --subtle: #71717A;
  --danger: #F87171;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: 16px;
  --radius: 8px;

  color-scheme: dark;
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(250, 250, 250, 0.1);
  scroll-padding-top: 80px; /* keeps focused and linked-to content clear of the sticky header */
}

a,
button,
input,
select,
textarea {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans), sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dynamic viewport height avoids the jump from mobile browser toolbars */
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
}

main {
  flex: 1;
}

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

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link: hidden until it receives keyboard focus */
.skip-link {
  position: absolute;
  top: 8px;
  left: var(--gutter);
  z-index: 20;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Visibility by breakpoint */
@media (width < 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 640px) {
  .mobile-only { display: none !important; }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
}

.nav-center {
  justify-self: center;
}

.nav-end {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.brand {
  font-family: var(--font-mono), monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The home nav only just fits on the narrowest phones */
@media (width < 400px) {
  .brand { letter-spacing: 0.06em; }
  .nav-end { gap: 12px; }
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

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

.btn-primary:hover {
  background: #E4E4E7;
}

.btn-primary:disabled {
  background: var(--muted);
  cursor: default;
}

.btn-secondary {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: #1F1F23;
  border-color: var(--border-hover);
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}

/* Tags */
.tag {
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

/* Landing: hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(250, 250, 250, 0.06), transparent 70%);
}

@media (min-width: 1024px) {
  .hero { padding: 120px 0 80px; }
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.175rem);
  text-wrap: pretty;
}

/* Landing: capabilities */
.capabilities {
  padding-bottom: 64px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .projects .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.card:has(.card-link):hover {
  border-color: var(--border-hover);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-live {
  color: var(--text);
}

.badge-live::before {
  background: var(--text);
}

.card:has(.card-link) {
  position: relative;
}

.card-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card-link:focus-visible {
  outline: none;
}

.card-link:focus-visible::after {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.card:has(.card-link):hover .card-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

/* Landing: projects */
.projects {
  padding-bottom: 64px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Landing: CTA */
.cta {
  padding-bottom: 96px;
  text-align: center;
}

.cta .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .cta .btn { width: auto; }
}

/* Inquire page */
.inquire {
  padding: 40px 0 80px;
}

@media (min-width: 1024px) {
  .inquire { padding: 80px 0 120px; }
}

.split {
  display: grid;
  gap: 32px;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
    align-items: start;
  }

  .context {
    position: sticky;
    top: 112px;
  }
}

.context .tag {
  display: block;
  margin-bottom: 16px;
}

.context h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.context p {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.form-box {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

@media (min-width: 640px) {
  .form-box { padding: 32px; }
}

.form-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field-full { grid-column: 1 / -1; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field label {
  font-size: 13px;
  font-weight: 500;
}

.required-mark {
  color: var(--danger);
  margin-left: 2px;
}

/* 8px field gap + 10px margin = 18px above, matching .form-actions margin-top below */
.required-note {
  margin: 10px 0 0;
  align-self: flex-end;
  color: var(--subtle);
  font-size: 13px;
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  transition: border-color 0.15s, box-shadow 0.15s;
}

@media (min-width: 640px) {
  .input { font-size: 14px; }
}

.input::placeholder {
  color: var(--subtle);
}

.input:hover {
  border-color: var(--border-hover);
}

.input:focus {
  outline: none;
  border-color: var(--muted);
  box-shadow: 0 0 0 1px var(--muted);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 1px var(--danger);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.field-error:empty {
  display: none;
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.department {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

textarea.input {
  height: auto;
  min-height: 140px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

select.input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23A1A1AA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

select.input:invalid {
  color: var(--subtle);
}

select.input option {
  background: var(--card);
  color: var(--text);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.form-actions .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .form-actions {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
  }

  .form-actions .btn { width: auto; }
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status[data-state="error"] {
  color: var(--danger);
}

.form-status[data-state="success"] {
  color: var(--text);
}

.form-note {
  margin: 16px 0 0;
  color: var(--subtle);
  font-size: 13px;
}

.form-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-note a:hover {
  color: var(--text);
}

/* Privacy page */
.legal {
  padding: 40px 0 80px;
}

@media (min-width: 1024px) {
  .legal { padding: 80px 0 120px; }
}

.prose {
  max-width: 720px;
}

.prose .tag {
  display: block;
  margin-bottom: 16px;
}

.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.prose .updated {
  margin: 0 0 40px;
  color: var(--subtle);
  font-family: var(--font-mono), monospace;
  font-size: 13px;
}

.prose h2 {
  margin: 32px 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose p {
  margin: 0;
  color: var(--muted);
}

.prose a,
.text-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--subtle);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}

.prose a:hover,
.text-link:hover {
  text-decoration-color: var(--text);
}

/* 404 page */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 96px 0;
  text-align: center;
}

.not-found h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* Project pages */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --subtle is below 4.5:1 for small text, so project pages use --muted */
.project .tag {
  color: var(--muted);
}

.project .hero .tag {
  display: block;
  margin-bottom: 16px;
}

.project code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-family: var(--font-mono), monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.badge-plain::before {
  display: none;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 640px) {
  .btn-row {
    flex-direction: row;
    justify-content: center;
  }
}

.section {
  padding-bottom: 64px;
}

@media (min-width: 1024px) {
  .section { padding-bottom: 96px; }
}

.section-head {
  margin-bottom: 24px;
}

.section-head .tag {
  display: block;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose-block {
  max-width: 720px;
}

/* Center the narrow column, and its heading, inside the wide container */
.project .prose-block,
.project .flow-figure {
  margin-inline: auto;
}

.project .container:has(> .prose-block, > .flow-figure) > .section-head {
  max-width: 720px;
  margin-inline: auto;
}

.example-quote {
  max-width: 720px;
  margin: 32px auto 0;
}

.example-quote blockquote {
  margin: 0;
  padding: 20px 24px;
  border-left: 2px solid var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--card);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
}

.example-quote blockquote p {
  margin: 0;
}

.example-quote figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.list li + li {
  margin-top: 8px;
}

.list li::marker {
  color: var(--text);
}

.note,
.flow-figure figcaption,
.text-link-row {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.note strong {
  color: var(--text);
  font-weight: 500;
}

/* Flow diagram */
.flow-figure {
  max-width: 720px;
  margin: 0;
}

.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flow-node {
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.flow-sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.flow-end {
  font-family: var(--font-mono), monospace;
  font-size: 13px;
}

.flow-decision {
  border-style: dashed;
  border-color: var(--muted);
}

.flow-arrow,
.flow-line {
  position: relative;
  width: 1px;
  height: 24px;
  margin: 0 auto;
  background: var(--subtle);
}

.flow-arrow::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -4px;
  border: 4px solid transparent;
  border-top: 5px solid var(--subtle);
  border-bottom: 0;
}

.flow-line {
  flex: 1;
  min-height: 24px;
}

.flow-branches {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--subtle);
}

.flow-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flow-label {
  color: var(--muted);
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow-branches + .flow-arrow {
  margin-top: 0;
}

/* Quick start steps */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 44px;
  counter-increment: step;
}

.steps > li + li {
  margin-top: 24px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  background: var(--card);
  font-family: var(--font-mono), monospace;
  font-size: 13px;
}

.steps p {
  margin: 0 0 10px;
  color: var(--muted);
}

/* Code blocks */
.code-block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.code-block pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  overflow-x: auto;
  font-family: var(--font-mono), monospace;
  font-size: 13px;
  line-height: 1.6;
}

.project .code-block code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.code-block .btn {
  flex: none;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14px;
}

.table caption {
  padding: 12px 16px;
  caption-side: bottom;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.table th,
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table thead th {
  color: var(--muted);
  font-weight: 500;
}

.table tbody th {
  font-family: var(--font-mono), monospace;
  font-size: 13px;
  font-weight: 400;
}

.table td {
  color: var(--muted);
}

/* Project CTA */
.project-cta p {
  margin: 0;
  color: var(--muted);
}

.project-cta .btn-row {
  margin-top: 20px;
}

.project-cta .cta-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 14px;
}

/* Footer */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-inner a {
  transition: color 0.15s;
}

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