/* Axesec — main stylesheet
   Tokens first, then base, layout, components, pages. No build step. */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Fog, ink and one blue. Greys lean toward the blue on purpose. */
  --ground: #eceef1;
  --surface: #f6f7f9;
  --ink: #10131a;
  --muted: #566072;
  --line: #c8cdd6;
  --accent: #1a2fe0;
  --on-accent: #ffffff;
  /* Terminal panel: the same dark surface in both themes. */
  --term-bg: #0c0f15;
  --term-line: #222936;
  --term-ink: #cfd6e2;
  --term-muted: #6d7789;
  --term-green: #5fd68f;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.75rem;
  --step-0: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
  --step-1: clamp(1.3rem, 1.15rem + 0.7vw, 1.75rem);
  --step-2: clamp(1.7rem, 1.35rem + 1.6vw, 2.75rem);
  --step-3: clamp(2.2rem, 1.5rem + 3.4vw, 4.5rem);
  --step-4: clamp(2.6rem, 1rem + 7.6vw, 7.75rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4rem, 9vw, 8.5rem);
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b0d13;
    --surface: #131720;
    --ink: #e7eaf0;
    --muted: #98a1b2;
    --line: #2a303d;
    --accent: #8896ff;
    --on-accent: #0b0d13;
    --term-bg: #12161f;
    --term-line: #2a303d;
  }
}
:root[data-theme="dark"] {
  --ground: #0b0d13;
  --surface: #131720;
  --ink: #e7eaf0;
  --muted: #98a1b2;
  --line: #2a303d;
  --accent: #8896ff;
  --on-accent: #0b0d13;
  --term-bg: #12161f;
  --term-line: #2a303d;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 600; font-stretch: 125%; line-height: 0.96; letter-spacing: -0.04em; }
h2 { font-size: var(--step-3); font-weight: 500; font-stretch: 118%; line-height: 1.02; letter-spacing: -0.035em; }
h3 { font-size: var(--step-1); font-weight: 600; font-stretch: 112%; line-height: 1.15; letter-spacing: -0.02em; }
em { font-style: italic; }

.mono {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
.lede { font-size: var(--step-1); line-height: 1.4; max-width: 34em; }
.prose { display: grid; gap: 1.1em; max-width: var(--measure); }
.prose a { color: var(--ink); }
.accent { color: var(--accent); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--ground);
  padding: 0.6rem 1rem; font-family: var(--mono); font-size: var(--step--1);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; color: var(--ground); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 84rem; margin-inline: auto; padding-inline: var(--gutter); }

/* A section is a narrow rail of metadata and a wide column of content. */
.band { padding-block: var(--section); border-top: 1px solid var(--line); }
.band > .wrap { display: grid; gap: 2rem var(--gutter); grid-template-columns: minmax(0, 1fr); }
.band-body { display: grid; gap: clamp(2rem, 4vw, 3.5rem); min-width: 0; }
@media (min-width: 60rem) {
  .band > .wrap { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
  .rail { position: sticky; top: 2rem; align-self: start; }
}

/* ---------- Header ---------- */
.site-head { padding-block: 1.5rem; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-weight: 700; font-stretch: 125%;
  font-size: 1.05rem; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark svg { width: 1.35rem; height: 1.35rem; }
.mark-block { fill: var(--ink); }
.nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.nav a {
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; padding-block: 0.4rem; display: inline-block;
}
.nav a[aria-current="page"] { color: var(--accent); }

/* ---------- Hero and the cut ---------- */
.hero { padding-block: clamp(3rem, 8vw, 7rem) var(--section); overflow-x: clip; }
.hero .wrap { display: grid; gap: clamp(2rem, 4vw, 3.25rem); }
.hero-foot { display: grid; gap: 2rem var(--gutter); align-items: end; }
@media (min-width: 60rem) {
  .hero-foot { grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); }
  .hero-foot .actions { justify-self: end; }
}

/* One headline, struck once. The upper piece is the real text; the lower
   piece is a clipped copy that has slipped away from the cut. */
.cut { position: relative; max-width: 11em; }
.cut-top, .cut-bottom { display: block; }
.cut-top { clip-path: polygon(0 -10%, 100% -10%, 100% 22%, 0 78%); }
.cut-bottom {
  position: absolute; inset: 0;
  clip-path: polygon(0 78%, 100% 22%, 100% 115%, 0 115%);
  transform: translate(-0.06em, 0.085em);
  user-select: none; -webkit-user-select: none;
}
.cut-line {
  position: absolute; inset: 0 -6%; width: 112%; height: 100%;
  overflow: visible; pointer-events: none;
  transform: translate(-0.03em, 0.042em);
}
.cut-line line { stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

@media (prefers-reduced-motion: no-preference) {
  .cut-bottom { animation: slip 1100ms cubic-bezier(0.7, 0, 0.15, 1) 500ms backwards; }
  .cut-line { animation: strike 520ms cubic-bezier(0.8, 0, 0.2, 1) 120ms backwards; transform-origin: 0 50%; }
}
@keyframes slip { from { transform: translate(0, 0); } }
@keyframes strike { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(-20% 0 -20% 0); } }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--mono); font-size: var(--step--1); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; padding: 1rem 1.4rem; border: 1px solid var(--ink);
  background: var(--ink); color: var(--ground); cursor: pointer;
  transition: background-color 160ms, border-color 160ms, color 160ms;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn .arrow { transition: transform 160ms; }
.btn:hover .arrow { transform: translateX(4px); }
.link-quiet { font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Practice index (home) ---------- */
.index { border-top: 1px solid var(--ink); }
.index li { border-bottom: 1px solid var(--line); }
.index a {
  display: grid; gap: 0.4rem 2rem; padding-block: 1.5rem; text-decoration: none;
  grid-template-columns: minmax(0, 1fr);
}
.index h3 { transition: transform 200ms; }
.index a:hover h3 { transform: translateX(0.5rem); }
.index p { color: var(--muted); max-width: 40em; }
.index a:hover p { color: var(--ink); }
.index .mono { align-self: center; }
@media (min-width: 48rem) {
  .index a { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 3fr); align-items: baseline; }
  .index .mono { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { .index h3, .btn .arrow { transition: none; } }

/* ---------- Commitments ---------- */
.tenets { display: grid; gap: 2.5rem var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.tenets li { display: grid; gap: 0.75rem; align-content: start; padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.tenets p { color: var(--muted); }

/* ---------- Closing call ---------- */
.closing h2 { max-width: 14em; }

/* ---------- Inner page heads ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem); }
.page-head .wrap { display: grid; gap: 1.75rem; }
.page-head h1 { font-size: var(--step-3); max-width: 15em; letter-spacing: -0.035em; line-height: 1; }

/* ---------- Services ---------- */
.service { display: grid; gap: 1.5rem; }
.service-facts { display: grid; gap: 1.5rem var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.service-facts div { display: grid; gap: 0.5rem; align-content: start; }
.service-facts dd { font-size: 1.0625rem; line-height: 1.5; }
.service-facts li + li { margin-top: 0.3rem; }

/* ---------- Approach steps (a real sequence, so it is numbered) ---------- */
.steps { counter-reset: step; border-top: 1px solid var(--ink); }
.steps > li {
  counter-increment: step; display: grid; gap: 0.75rem 2rem; padding-block: 2rem; border-bottom: 1px solid var(--line);
  grid-template-columns: 3.5rem minmax(0, 1fr);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; color: var(--accent); padding-top: 0.5em;
}
.steps .step-body { display: grid; gap: 0.75rem; max-width: var(--measure); }
.steps p { color: var(--muted); }

.plain-list { display: grid; gap: 0.9rem; max-width: var(--measure); }
.plain-list li { padding-left: 1.5rem; position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.75rem; height: 1px; background: var(--accent); }

/* ---------- Placeholders: visible on purpose until replaced ---------- */
[data-placeholder] {
  display: block;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; color: var(--muted);
  border: 1px dashed var(--muted); padding: 1rem 1.25rem; max-width: var(--measure);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 3rem var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.form { display: grid; gap: 1.5rem; }
.field { display: grid; gap: 0.5rem; }
.field label { font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1.0625rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 0; padding: 0.85rem 1rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.form-note { color: var(--muted); font-size: 1rem; max-width: 46ch; }
.form-status { font-family: var(--mono); font-size: 0.8125rem; color: var(--accent); }
.form-status:empty { display: none; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--ink); padding-block: 3rem 2.5rem; }
.site-foot .wrap { display: grid; gap: 2.5rem var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.site-foot ul { display: grid; gap: 0.5rem; }
.site-foot a { text-decoration: none; }
.site-foot .col { display: grid; gap: 1rem; align-content: start; }
.site-foot .fine { grid-column: 1 / -1; padding-top: 2rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }

/* ---------- 404 ---------- */
.lost { padding-block: clamp(4rem, 12vw, 10rem); }
.lost .wrap { display: grid; gap: 2rem; }

@media print {
  .site-head .nav, .actions, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- Term and description lists (specialized, standards, team) ---------- */
.spec-list { border-top: 1px solid var(--ink); }
.spec-list > div { display: grid; gap: 0.25rem 2rem; padding-block: 1.1rem; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1fr); }
.spec-list dt { font-family: var(--display); font-weight: 600; font-stretch: 112%; letter-spacing: -0.015em; font-size: 1.125rem; line-height: 1.3; }
.spec-list dd { color: var(--muted); font-size: 1.0625rem; line-height: 1.5; }
@media (min-width: 48rem) { .spec-list > div { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: baseline; } }

/* ---------- Finishing touches ---------- */
.nowrap { white-space: nowrap; }
[id] { scroll-margin-top: 2rem; }

/* The mark repeats the headline's gesture: the lower piece slips on hover. */
.mark-lower { transition: transform 260ms cubic-bezier(0.7, 0, 0.15, 1); }
.wordmark:hover .mark-lower, .wordmark:focus-visible .mark-lower { transform: translate(-1px, 1.6px); }

/* Navigation underline draws in from the left. */
.nav a, .jump a {
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat;
  transition: background-size 220ms ease, color 160ms;
}
.nav a:hover, .nav a[aria-current="page"], .jump a:hover { background-size: 100% 1px; }

/* In-page index on the services page. */
.jump ul { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.jump a {
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; display: inline-block; padding-block: 0.4rem;
}

.btn:active { transform: translateY(1px); }

/* Native select, redrawn to match the other fields. */
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 2.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237a8394' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 0.75rem;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .mark-lower, .nav a, .jump a { transition: none; }
}

/* ---------- Color and terminal details ---------- */
.dot { color: var(--accent); }

/* Rail labels read like code comments. */
.rail.mono::before, .rail > .mono::before { content: "// "; color: var(--accent); }

/* The name as a hex dump line, with a cursor. */
.hexdump { letter-spacing: 0.04em; white-space: nowrap; text-transform: none; }
.hex-off, .hex-ascii { color: var(--accent); }
.hex-off { margin-right: 0.75em; }
.hex-ascii { margin-left: 0.75em; }
.cursor {
  display: inline-block; width: 0.6em; height: 1.15em; margin-left: 0.4em;
  background: var(--accent); vertical-align: text-bottom;
}
@media (prefers-reduced-motion: no-preference) { .cursor { animation: blink 1.1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }

.creds-line { color: var(--ink); font-size: 0.8125rem; font-weight: 500; }

/* Service rows pick up the accent on hover. */
.index a:hover h3 { color: var(--accent); }

/* ---------- Terminal: a small working shell ---------- */
.term {
  background: var(--term-bg); color: var(--term-ink); border: 1px solid var(--term-line);
  font-family: var(--mono); font-size: 0.875rem; line-height: 1.7;
  width: 100%; max-width: 44rem; box-shadow: 0.5rem 0.5rem 0 var(--line); cursor: text;
}
.term-bar {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--term-line); color: var(--term-muted); font-size: 0.75rem; letter-spacing: 0.04em;
}
.term-body { display: grid; gap: 0.5rem; padding: 1.1rem 1.1rem 1.2rem; }
.term-out { display: grid; gap: 0.05rem; max-height: 19rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--term-line) transparent; }
.term-out:empty { display: none; }
.term-row { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.7em; }
.term .prompt { color: var(--term-green); }
.term-dim { color: var(--term-muted); }
.term-ask, .term-ok { color: var(--term-green); }
.term-warn { color: #e3b56a; }
.term-echo { color: #ffffff; }
.term a { color: var(--term-ink); text-decoration-color: var(--term-green); }
.term a:hover { color: var(--term-green); }
.term :focus-visible { outline-color: var(--term-green); }
.term ::selection { background: var(--term-green); color: var(--term-bg); }

.term-line { display: flex; align-items: baseline; gap: 1ch; }
.term-input {
  flex: 1; min-width: 0; font: inherit; color: #ffffff; background: transparent; border: 0; padding: 0;
  caret-color: var(--term-green); caret-shape: block;
}
.term-input:focus, .term-input:focus-visible { outline: none; }
.term-input::placeholder { color: var(--term-muted); opacity: 1; }
.term.is-live:focus-within { border-color: var(--term-green); }

.term-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.75rem; margin-top: 0.35rem; border-top: 1px solid var(--term-line); }
.term-chip {
  font: inherit; font-size: 0.8125rem; color: var(--term-green); background: transparent; cursor: pointer;
  border: 1px solid var(--term-line); padding: 0.3rem 0.75rem; transition: border-color 140ms, background-color 140ms, color 140ms;
}
.term-chip:hover { border-color: var(--term-green); background: var(--term-green); color: var(--term-bg); }

.term.in-flow .term-chip:not(.chip-cancel), .term:not(.in-flow) .chip-cancel { display: none; }
.chip-cancel { color: #e3b56a; }
@media (max-width: 48rem) { .term-input { font-size: 1rem; } }

.closing .band-body { gap: 2.25rem; }
.closing code { font-family: var(--mono); font-size: 0.85em; color: var(--accent); }
.channels { display: grid; gap: 2rem; align-content: start; }
.channels div { display: grid; gap: 0.35rem; }
.channels dd { font-size: var(--step-1); line-height: 1.3; overflow-wrap: anywhere; }
main > .band:last-child { border-bottom: 1px solid var(--ink); }
.site-foot { border-top: 0; }
