:root {
  --bg: #0b0d10;
  --bg-raised: #111419;
  --panel: #15191f;
  --panel-hover: #191e25;
  --text: #f4f5f6;
  --muted: #9ba3ad;
  --subtle: #6f7781;
  --border: #282e36;
  --border-strong: #3a424d;
  --accent: #b8f43d;
  --accent-ink: #101408;
  --danger: #ff7b72;
  --success: #8ee87f;
  --shell: 1180px;
  --radius: 8px;
  --shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(255 255 255 / 2.2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2.2%) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.page-shell { width: min(calc(100% - 48px), var(--shell)); margin-inline: auto; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
.site-header.scrolled {
  background: rgb(11 13 16 / 88%);
  border-color: var(--border);
  backdrop-filter: blur(18px);
}
.nav-shell {
  width: min(calc(100% - 48px), var(--shell));
  min-height: 74px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 650; }
.wordmark-mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 6px;
  color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-weight: 700;
}
.desktop-nav { display: flex; align-items: center; gap: 34px; margin-left: auto; }
.desktop-nav a { color: var(--muted); font-size: 13px; font-weight: 550; transition: color .2s; }
.desktop-nav a:hover { color: var(--text); }
.button {
  min-height: 46px; padding: 0 18px; border: 1px solid var(--accent); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(184 244 61 / 16%); }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.button-small { min-height: 38px; padding-inline: 14px; font-size: 12px; }
.button-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); }
.button-secondary:hover { background: var(--panel); box-shadow: none; }
.icon-button {
  width: 40px; height: 40px; padding: 0; display: none; place-items: center;
  background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text);
}
.menu-close { display: none; }
.menu-button[aria-expanded="true"] .menu-open { display: none; }
.menu-button[aria-expanded="true"] .menu-close { display: block; }
.mobile-nav { display: none; }

.hero { position: relative; min-height: 760px; padding: 132px 0 80px; overflow: hidden; }
.hero::after {
  content: "SYSTEMS / DATA / CONTROL";
  position: absolute; left: max(24px, calc((100vw - var(--shell)) / 2)); bottom: 20px;
  color: var(--subtle); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hero-grid { min-height: 590px; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .58fr); align-items: center; gap: 9%; }
.hero-copy { position: relative; z-index: 2; }
.availability {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 38px;
  color: var(--muted); font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase;
}
.availability span, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(184 244 61 / 10%); }
.eyebrow {
  margin: 0 0 16px; color: var(--accent); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(64px, 8vw, 112px); line-height: .87; font-weight: 720; }
h1 span { color: transparent; -webkit-text-stroke: 1px #737b84; }
.hero-lede { max-width: 610px; margin: 34px 0 0; color: #c3c8ce; font-size: 19px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta {
  max-width: 560px; margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
}
.hero-meta div { display: flex; flex-direction: column; gap: 3px; }
.hero-meta span { color: var(--subtle); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.hero-meta strong { color: var(--muted); font-size: 12px; font-weight: 600; }
.portrait-wrap { position: relative; width: min(100%, 390px); justify-self: end; }
.portrait-wrap::before {
  content: ""; position: absolute; inset: -18px 18px 18px -18px;
  border: 1px solid var(--border); border-radius: var(--radius); z-index: -1;
}
.portrait-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.portrait-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(4 6 8 / 78%), transparent 45%); pointer-events: none; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: saturate(.72) contrast(1.03); }
.portrait-caption { position: absolute; z-index: 2; inset: auto 24px 22px; display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.portrait-caption div { display: flex; align-items: center; gap: 9px; }
.portrait-caption strong { font-size: 12px; }
.portrait-caption > span { max-width: 120px; color: #adb4bb; font-size: 10px; line-height: 1.4; text-align: right; }
.portrait-index { position: absolute; top: 12px; right: -32px; color: var(--subtle); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; writing-mode: vertical-rl; }
.scroll-cue { position: absolute; right: max(24px, calc((100vw - var(--shell)) / 2)); bottom: 20px; width: 28px; height: 44px; border: 1px solid var(--border-strong); border-radius: 16px; }
.scroll-cue span { position: absolute; width: 3px; height: 7px; border-radius: 2px; background: var(--accent); top: 8px; left: 12px; animation: scroll 1.7s ease-in-out infinite; }
@keyframes scroll { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(15px); opacity: 1; } }

.section { padding: 120px 0; border-top: 1px solid var(--border); }
.section-heading { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 70px; margin-bottom: 60px; }
h2 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1.02; font-weight: 680; }
.section-heading > p, .stack-intro > p, .contact-copy > p { max-width: 520px; margin: 0 0 8px; color: var(--muted); font-size: 17px; }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.service-card { position: relative; min-height: 400px; padding: 28px; border-right: 1px solid var(--border); background: rgb(17 20 25 / 82%); transition: background .25s ease, transform .25s ease; transform-style: preserve-3d; }
.service-card:last-child { border-right: 0; }
.service-card:hover { background: var(--panel-hover); }
.service-number { color: var(--subtle); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.service-icon { width: 34px; height: 34px; margin: 62px 0 26px; color: var(--accent); stroke-width: 1.35; }
.service-card h3 { margin: 0 0 12px; font-size: 19px; }
.service-card p { margin: 0; color: var(--muted); font-size: 14px; }
.service-card ul { list-style: none; padding: 22px 0 0; margin: 22px 0 0; border-top: 1px solid var(--border); }
.service-card li { position: relative; padding: 5px 0 5px 13px; color: #c2c7cc; font-size: 12px; }
.service-card li::before { content: ""; position: absolute; left: 0; top: 13px; width: 4px; height: 4px; background: var(--accent); }

.stack-section { background: #0e1115; }
.stack-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10%; }
.stack-intro { position: sticky; top: 120px; align-self: start; }
.stack-intro > p { margin-top: 28px; }
.text-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding-bottom: 5px; border-bottom: 1px solid var(--border-strong); font-size: 13px; font-weight: 650; }
.text-link .arrow { width: 14px; margin-left: 6px; color: var(--accent); }
.stack-groups { border-top: 1px solid var(--border); }
.stack-group { display: grid; grid-template-columns: 170px 1fr; gap: 30px; padding: 36px 0; border-bottom: 1px solid var(--border); }
.stack-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.stack-label .icon { color: var(--accent); }
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-list span { padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: #ccd0d5; font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; transition: border-color .2s, color .2s; }
.badge-list span:hover { border-color: var(--accent); color: var(--text); }

.contact-section { background: var(--bg-raised); }
.contact-layout { display: grid; grid-template-columns: .86fr 1.14fr; gap: 10%; }
.contact-copy > p { margin-top: 28px; }
.direct-contact { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 42px; }
.direct-contact span { color: var(--subtle); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.direct-contact a { display: inline-flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-strong); font-size: 14px; }
.direct-contact .icon { width: 14px; color: var(--accent); }
.contact-form { padding: 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field label { color: #d9dce0; font-size: 12px; font-weight: 650; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-raised); color: var(--text);
  padding: 12px 13px; outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field input { height: 46px; }
.field textarea { min-height: 150px; }
.field input:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(184 244 61 / 8%); }
.field input::placeholder, .field textarea::placeholder { color: #646c76; }
.field-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--subtle); font-size: 10px; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.form-footer { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 8px; }
.form-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.form-status.error { color: var(--danger); }
.form-status.success { color: var(--success); }
.privacy-note { margin: 7px 0 0; color: var(--subtle); font-size: 10px; }
.privacy-note a, .legal-content a { color: var(--text); border-bottom: 1px solid var(--border-strong); }
.privacy-note a:hover, .legal-content a:hover { border-color: var(--accent); }
.submit-button { min-width: 148px; }
.submit-button:disabled { opacity: .65; cursor: wait; transform: none; }
.success-icon { display: none; }
.submit-button.sent .send-icon { display: none; }
.submit-button.sent .success-icon { display: block; }

.legal-page { padding: 150px 0 110px; }
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 80px; justify-content: center; }
.legal-heading { grid-column: 1 / -1; max-width: 780px; padding-bottom: 50px; border-bottom: 1px solid var(--border); }
.legal-heading h1 { font-size: clamp(50px, 7vw, 88px); line-height: .95; }
.legal-heading > p:last-child { max-width: 680px; margin: 28px 0 0; color: var(--muted); font-size: 18px; }
.legal-updated { margin: 22px 0 0; color: var(--subtle); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.legal-toc { position: sticky; top: 110px; align-self: start; display: flex; flex-direction: column; gap: 10px; }
.legal-toc strong { margin-bottom: 8px; color: var(--subtle); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.legal-toc a { color: var(--muted); font-size: 12px; }
.legal-toc a:hover { color: var(--text); }
.legal-content section { scroll-margin-top: 100px; padding: 0 0 42px; margin: 0 0 42px; border-bottom: 1px solid var(--border); }
.legal-content section:last-child { margin-bottom: 0; }
.legal-content h2 { margin: 0 0 20px; font-size: 25px; line-height: 1.2; }
.legal-content p { margin: 0 0 16px; color: #b8bec5; font-size: 15px; line-height: 1.8; }
.legal-content p:last-child { margin-bottom: 0; }

footer { padding: 48px 0; border-top: 1px solid var(--border); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; }
.footer-inner > div > p { margin: 13px 0 0; color: var(--subtle); font-size: 11px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.footer-links .icon { width: 13px; height: 13px; }
.copyright { grid-column: 1 / -1; margin: 25px 0 0; padding-top: 20px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 10px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr 320px; gap: 42px; }
  h1 { font-size: 72px; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .service-card:nth-child(2) { border-right: 0; }
  .service-card:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .stack-layout, .contact-layout { gap: 7%; }
}

@media (max-width: 760px) {
  .page-shell, .nav-shell { width: min(calc(100% - 32px), var(--shell)); }
  .desktop-nav, .desktop-contact { display: none; }
  .icon-button { display: grid; cursor: pointer; }
  .mobile-nav {
    position: absolute; inset: 74px 0 auto; padding: 8px 16px 18px;
    flex-direction: column; background: rgb(11 13 16 / 96%); border-bottom: 1px solid var(--border);
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a { padding: 13px 4px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 14px; }
  .hero { min-height: auto; padding: 112px 0 80px; }
  .hero-grid { min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 58px; }
  .availability { margin-bottom: 28px; }
  h1 { font-size: clamp(58px, 19vw, 82px); }
  .hero-lede { font-size: 17px; }
  .hero-meta { margin-top: 40px; }
  .portrait-wrap { width: min(calc(100% - 42px), 360px); margin: 0 14px 0 auto; }
  .portrait-frame { min-height: 0; }
  .portrait-index { right: -22px; }
  .scroll-cue, .hero::after { display: none; }
  .section { padding: 84px 0; }
  .section-heading, .stack-layout, .contact-layout { grid-template-columns: 1fr; gap: 34px; }
  .section-heading { margin-bottom: 42px; }
  .service-card { min-height: 360px; }
  .stack-intro { position: static; }
  .stack-intro > p { margin-top: 22px; }
  .stack-group { grid-template-columns: 1fr; gap: 18px; }
  .contact-form { padding: 24px; }
  .legal-page { padding: 120px 0 80px; }
  .legal-layout { grid-template-columns: 1fr; gap: 42px; }
  .legal-heading { grid-column: 1; }
  .legal-toc { position: static; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
}

@media (max-width: 520px) {
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: 1fr; gap: 16px; }
  .portrait-caption { inset: auto 18px 18px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 340px; border-right: 0; border-bottom: 1px solid var(--border); }
  .service-card:nth-child(3) { border-bottom: 1px solid var(--border); }
  .service-card:last-child { border-bottom: 0; }
  .service-icon { margin-top: 44px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .submit-button { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; align-items: start; }
  .footer-links { grid-row: 2; flex-wrap: wrap; }
  .copyright { grid-column: 1; }
}

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