:root {
  color-scheme: light;
  --paper: #f6f8f7;
  --white: #fff;
  --alt: #eef3f1;
  --ink: #0f2a3a;
  --body: #34505e;
  --muted: #556d78;
  --line: #d8e1e0;
  --teal: #087f82;
  --teal-dark: #05676b;
  --navy: #0d1f2a;
  --term-text: #d5e3e8;
  --term-dim: #8fa9b4;
  --term-pass: #4fd1a1;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Code", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section: clamp(4rem, 9vw, 7rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  color: var(--body);
  background: var(--paper);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.03em;
  text-wrap: balance;
}

p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; }

a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(1160px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  z-index: 20;
  top: .75rem;
  left: .75rem;
  padding: .75rem 1rem;
  color: var(--white);
  background: var(--navy);
  font-weight: 700;
  transform: translateY(-200%);
}

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

/* Shared bits */

.label {
  color: var(--teal-dark);
  font: 600 .78rem/1.4 var(--mono);
  letter-spacing: .02em;
}

.label-on-dark { color: var(--term-pass); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .7rem 1.25rem;
  color: var(--white);
  background: var(--teal);
  border-radius: 6px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color .15s ease;
}

.button:hover { background: var(--teal-dark); }

.button-small { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }

.button-light { color: var(--navy); background: var(--white); }
.button-light:hover { background: #dff1ec; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

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

.text-link-light { color: var(--white); text-decoration-color: var(--term-pass); }
.text-link-light:hover { color: #c9efe2; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
}

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

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

.brand img, .brand-footer { display: block; height: auto; }

nav {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2.5vw, 2rem);
}

nav a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 550;
  text-decoration: none;
}

nav a:not(.button):hover { color: var(--teal-dark); }

/* Hero */

.hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3.5rem, 7vw, 5.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  margin-top: 1.1rem;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.lead {
  margin-top: 1.4rem;
  max-width: 36rem;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
}

.lead strong { color: var(--ink); font-weight: 650; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  margin-top: 2rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.facts li { max-width: 11rem; line-height: 1.4; }

.facts strong {
  display: block;
  color: var(--ink);
  font: 700 1.05rem/1.4 var(--mono);
}

/* Terminal */

.terminal {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--navy);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 24px 48px -24px rgba(13, 31, 42, .45);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2c4250;
}

.terminal-bar em {
  margin-left: auto;
  color: var(--term-dim);
  font: normal .72rem/1 var(--mono);
}

.terminal-body {
  margin: 0;
  padding: 1.2rem 1.25rem 1.4rem;
  overflow-x: auto;
  color: var(--term-text);
  font: .84rem/1.75 var(--mono);
}

.t-line { display: inline-block; }
.t-dim { color: var(--term-dim); }
.t-pass { color: var(--term-pass); font-weight: 700; }

.t-cursor {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--term-pass);
  animation: blink 1.1s steps(1) infinite;
}

.terminal-caption {
  padding: .85rem 1.25rem 1rem;
  color: var(--term-dim);
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .82rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .t-line { animation: reveal .35s ease both; }
  .t-line:nth-child(2) { animation-delay: .25s; }
  .t-line:nth-child(3) { animation-delay: .45s; }
  .t-line:nth-child(4) { animation-delay: .6s; }
  .t-line:nth-child(5) { animation-delay: .75s; }
  .t-line:nth-child(6) { animation-delay: .9s; }
  .t-line:nth-child(7) { animation-delay: 1.05s; }
  .t-line:nth-child(8) { animation-delay: 1.2s; }
  .t-line:nth-child(9) { animation-delay: 1.35s; }
  .t-line:nth-child(10) { animation-delay: 1.6s; }
  .t-line:nth-child(11) { animation-delay: 1.75s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .t-cursor { animation: none; }
}

@keyframes reveal { from { opacity: 0; transform: translateY(3px); } }
@keyframes blink { 50% { opacity: 0; } }

/* Track record */

.track {
  background: var(--white);
  border-block: 1px solid var(--line);
}

.track-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.5rem;
  padding-block: 1.6rem;
}

.track ul {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 2rem;
}

.track li {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -.01em;
}

.track li span {
  color: var(--muted);
  font: 400 .78rem var(--mono);
}

/* Sections */

.section { padding: var(--section) 0; }
.section-alt { background: var(--alt); }

.section-head { max-width: 46rem; }

.section-head h2 {
  margin-top: .8rem;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.12;
}

.section-head p:not(.label) { margin-top: 1rem; }

/* Services */

.groups { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }

.group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1.5rem 3rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
}

.group-num, .step-num {
  color: var(--teal-dark);
  font: 600 .78rem var(--mono);
}

.group-head h3 { margin-top: .35rem; font-size: 1.35rem; line-height: 1.25; }
.group-head p { margin-top: .5rem; max-width: 18rem; color: var(--muted); font-size: .95rem; }

.row { padding: 1rem 0; }
.row + .row { border-top: 1px solid var(--line); }
.row:first-child { padding-top: 0; }
.row:last-child { padding-bottom: 0; }

.row h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .75rem;
  font-size: 1.07rem;
  letter-spacing: -.015em;
}

.row p { margin-top: .3rem; font-size: 1rem; }

.row-featured {
  padding: 1.25rem 1.4rem !important;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
}

.tag {
  padding: .15rem .5rem;
  color: var(--teal-dark);
  background: #e1f1ee;
  border-radius: 4px;
  font: 600 .7rem/1.5 var(--mono);
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Stack */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 2.5rem clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.stack {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stack div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: .85rem 1.25rem;
  font-family: var(--mono);
  font-size: .88rem;
}

.stack div + div { border-top: 1px solid var(--line); }
.stack dt { color: var(--muted); }
.stack dd { color: var(--ink); }

/* How it works */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  counter-reset: none;
}

.steps li { padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.steps h3 { margin-top: .5rem; font-size: 1.2rem; }
.steps p { margin-top: .4rem; font-size: .98rem; }

.models {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 3rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.models div { padding: 1.4rem 1.5rem; }
.models div + div { border-left: 1px solid var(--line); }
.models h3 { font-size: 1.05rem; }
.models p { margin-top: .3rem; color: var(--muted); font-size: .95rem; }

/* About */

.about {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2.5rem clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.portrait {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  color: var(--term-pass);
  background: var(--navy);
  border-radius: 10px;
  font: 700 3rem/1 var(--mono);
  letter-spacing: -.04em;
}

.about-copy { max-width: 42rem; }
.about-copy h2 { margin: .8rem 0 1.25rem; font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.12; }
.about-copy p + p { margin-top: 1rem; }

.creds {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.5rem;
}

.creds li {
  padding: .3rem .7rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: .88rem;
}

.links { display: flex; gap: 1.5rem; margin-top: 1rem; }

/* Contact */

.contact {
  padding: var(--section) 0;
  color: var(--term-text);
  background: var(--navy);
}

.contact h2 { max-width: 40rem; margin-top: .8rem; color: var(--white); font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.1; }
.contact-copy p:not(.label) { margin-top: 1rem; max-width: 36rem; }
.contact-copy .text-link { margin-top: 1.25rem; }
.contact a:focus-visible { outline-color: var(--term-pass); }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contact-alt { color: var(--term-dim); font-size: .95rem; }
.contact-alt span { color: var(--white); font-family: var(--mono); overflow-wrap: anywhere; }

.contact-form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: #12293a;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
}

.field { display: grid; gap: .4rem; }

.field label { color: var(--white); font-size: .92rem; font-weight: 600; }
.field label span { color: var(--term-dim); font-weight: 400; }

.field input, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: .7rem .85rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
}

.field textarea { resize: vertical; min-height: 8rem; }

.field input:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--term-pass);
  outline-offset: 2px;
}

.contact-form .button { justify-self: start; border: 0; cursor: pointer; font: inherit; font-weight: 650; }
.contact-form .button:disabled { opacity: .7; cursor: progress; }
.contact-form .button:focus-visible { outline: 3px solid var(--term-pass); outline-offset: 3px; }

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

.form-status:empty { display: none; }
.form-status { padding: .75rem 1rem; border-radius: 6px; font-size: .95rem; }
.form-status.is-ok { color: #0d1f2a; background: var(--term-pass); }
.form-status.is-error { color: #fff; background: #9b2c2c; }

.form-note { color: var(--term-dim); font-size: .82rem; }

/* Footer */

.site-footer { padding: 1.75rem 0; background: var(--white); border-top: 1px solid var(--line); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 2rem;
  color: var(--muted);
  font-size: .88rem;
}


/* Responsive */

@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .group { grid-template-columns: minmax(0, 1fr); padding: 2rem 0; }
  .group-head p { max-width: none; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 12rem; }
}

@media (max-width: 680px) {
  nav a:not(.button) { display: none; }
  .models { grid-template-columns: minmax(0, 1fr); }
  .models div + div { border-left: 0; border-top: 1px solid var(--line); }
  .stack div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .terminal-body { font-size: .74rem; }
}

@media (max-width: 480px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .button { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
