:root {
  --bg: #0b0b0d;
  --bg-surface: #111114;
  --bg-elevated: #16161b;
  --border: #232329;
  --border-hover: #383842;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --red: #e11d48;
  --red-hover: #be123c;
  --red-tint: rgba(225, 29, 72, 0.1);
  --green: #22c55e;
  --radius: 8px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1140px, calc(100% - 2.5rem));
  margin-inline: auto;
}

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

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}

.brand-square {
  width: 12px;
  height: 12px;
  background: var(--red);
  border-radius: 2px;
  display: inline-block;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand-wordmark strong {
  color: var(--text);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.3rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.45rem;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.mobile-drawer a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.mobile-drawer.is-open {
  display: flex;
}

/* Typography & Shared */
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  line-height: 1.16;
  margin: 0;
  color: var(--text);
}

.kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

/* Hero */
.hero {
  padding: 4.75rem 0 5rem;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 3.5rem;
  align-items: start;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.accent-underline {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.hero-lead {
  margin: 0 0 1.9rem;
  color: var(--text-muted);
  font-size: 1.03rem;
  max-width: 54ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.75rem;
}

.hero-stats {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.hero-stats dt {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.hero-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

/* Blueprint Card */
.blueprint-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.blueprint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.blueprint-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.blueprint-file {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.flow-steps {
  display: flex;
  flex-direction: column;
}

.flow-step {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-left-color 0.15s ease;
}

.flow-step:hover {
  background: rgba(255, 255, 255, 0.02);
}

.flow-step.is-active {
  background: rgba(225, 29, 72, 0.055);
  border-left-color: var(--red);
}

.step-idx {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  padding-top: 0.12rem;
}

.flow-step.is-active .step-idx {
  color: var(--red);
}

.step-content {
  flex: 1;
}

.step-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.step-title-row strong {
  font-size: 0.93rem;
  font-weight: 600;
}

.step-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.step-content p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.blueprint-log {
  padding: 0.8rem 1.15rem;
  background: #09090b;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.log-tag {
  color: var(--green);
  font-weight: 500;
  flex-shrink: 0;
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-surface {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.75rem;
}

.section-head.head-split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.section-head h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  margin-bottom: 0.75rem;
}

.section-head.head-split h2 {
  margin-bottom: 0;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

/* Hairline Service Matrix */
.service-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-cell {
  background: var(--bg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: background 0.16s ease;
}

.service-cell:hover {
  background: var(--bg-surface);
}

.service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.service-icon {
  width: 22px;
  height: 22px;
  color: var(--red);
  display: inline-flex;
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.service-cell h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.service-cell p {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.cell-tags {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Filter Tabs & Projects */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.filter-btn.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

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

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease;
}

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

.project-card.is-hidden {
  display: none;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.project-sector {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.project-state {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.project-card p {
  margin: 0 0 1.4rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  flex: 1;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.project-stack {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-dim);
}

.text-action {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.text-action:hover {
  color: var(--red);
}

/* Spec Table */
.spec-table {
  border-top: 1px solid var(--border);
}

.spec-row {
  display: grid;
  grid-template-columns: 180px 1.2fr 1.3fr;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.spec-cat {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--red);
}

.spec-tools {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}

.spec-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Timeline */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.timeline-item {
  border-top: 2px solid var(--border-hover);
  padding-top: 1.25rem;
}

.timeline-step {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--red);
  margin-bottom: 0.65rem;
}

.timeline-item h3 {
  font-size: 1.12rem;
  margin-bottom: 0.55rem;
}

.timeline-item p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.contact-copy h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  margin-bottom: 0.85rem;
}

.contact-copy > p {
  margin: 0 0 2rem;
  color: var(--text-muted);
}

.contact-details {
  margin: 0;
  border-top: 1px solid var(--border);
}

.contact-details div {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.contact-details dt {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.contact-details dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text);
  text-align: right;
}

.contact-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.form-row {
  margin-bottom: 1.05rem;
}

.form-row label {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.72rem 0.85rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--red);
}

.form-feedback {
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  min-height: 1.2em;
}

.form-feedback.is-ok {
  color: var(--green);
}

.form-feedback.is-err {
  color: #f87171;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}

.footer-brand span {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.4rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
}

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

.footer-copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.76);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 1.8rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.modal-card h3 {
  font-size: 1.38rem;
  margin-bottom: 0.6rem;
}

.modal-desc {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.modal-section {
  margin-bottom: 1.2rem;
}

.modal-section h4 {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.modal-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: #d4d4d8;
  font-size: 0.91rem;
}

.modal-steps li {
  margin-bottom: 0.4rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.24rem 0.55rem;
  border-radius: 4px;
}

.modal-actions {
  margin-top: 1.35rem;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

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

  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

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

@media (max-width: 680px) {
  .nav-links,
  .header-actions .btn {
    display: none;
  }

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

  .service-matrix,
  .projects-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 0 3.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }
}
