/* ==========================================================================
   Arcois Gateway — site stylesheet
   Motif: the sealed volume. Every structural device on this site is a band —
   a header cap, a run of packed fragments, a manifest footer — because that
   is literally the file format the product writes.
   ========================================================================== */

:root {
  --ink:    #0E1F31;
  --navy:   #14304A;
  --steel:  #2E5A80;
  --mist:   #AEC1D6;
  --paper:  #F1F4F8;
  --white:  #FFFFFF;
  --gold:   #E9A521;
  --slate:  #4A6178;

  --hair-dark:  rgba(174, 193, 214, 0.22);
  --hair-light: rgba(20, 48, 74, 0.14);

  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --band-max: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* --- Type ---------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.display {
  font-weight: 300;
  font-size: clamp(2.5rem, 6.2vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.028em;
}

h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  line-height: 1.13;
}

h3 {
  font-size: 1.28rem;
  line-height: 1.3;
}

h4 {
  font-size: 1.02rem;
  line-height: 1.4;
}

p { margin: 0 0 1.05em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.14rem, 1.7vw, 1.33rem);
  line-height: 1.62;
  color: var(--steel);
  max-width: 56ch;
}

.note {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--slate);
  max-width: 78ch;
}

strong { font-weight: 500; color: var(--navy); }

a { color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--navy); }

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

/* --- Layout -------------------------------------------------------------- */

.wrap {
  max-width: var(--band-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.75rem, 5vw, 4rem); }

[data-ground="ink"]   { background: var(--ink);   color: var(--mist); }
[data-ground="navy"]  { background: var(--navy);  color: var(--mist); }
[data-ground="paper"] { background: var(--paper); }
[data-ground="white"] { background: var(--white); }

[data-ground="ink"] h1, [data-ground="ink"] h2,
[data-ground="ink"] h3, [data-ground="ink"] h4,
[data-ground="navy"] h1, [data-ground="navy"] h2,
[data-ground="navy"] h3, [data-ground="navy"] h4 { color: var(--white); }

[data-ground="ink"] .lead, [data-ground="navy"] .lead { color: var(--mist); }
[data-ground="ink"] .note, [data-ground="navy"] .note { color: rgba(174,193,214,0.72); }
[data-ground="ink"] strong, [data-ground="navy"] strong { color: var(--white); }
[data-ground="ink"] a, [data-ground="navy"] a { color: var(--gold); }
[data-ground="ink"] a:hover, [data-ground="navy"] a:hover { color: var(--white); }

/* --- Navigation ---------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  border-bottom: 1px solid var(--hair-dark);
}

.nav__inner {
  max-width: var(--band-max);
  margin: 0 auto;
  padding: 0.95rem var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.nav__logo { flex: none; }
.nav__logo img { width: 150px; height: auto; }

.nav__links {
  display: flex;
  gap: clamp(0.9rem, 2.2vw, 1.9rem);
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.nav__links a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--mist);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--white); border-bottom-color: var(--gold); }
.nav__links a[aria-current="page"] { color: var(--white); border-bottom-color: var(--gold); }

.nav__cta {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--ink) !important;
  background: var(--gold);
  padding: 0.5rem 0.95rem;
  border-radius: 3px;
  text-decoration: none;
  border-bottom: 0 !important;
}
.nav__cta:hover { background: var(--white); color: var(--ink) !important; }

/* --- Buttons ------------------------------------------------------------- */

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

.btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.72rem 1.35rem;
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid transparent;
  display: inline-block;
}

.btn--gold { background: var(--gold); color: var(--ink) !important; }
.btn--gold:hover { background: var(--white); }

.btn--line {
  border-color: var(--mist);
  color: var(--mist) !important;
}
.btn--line:hover { border-color: var(--white); color: var(--white) !important; }

.btn--line-dark { border-color: var(--hair-light); color: var(--navy) !important; }
.btn--line-dark:hover { border-color: var(--navy); }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  background: var(--ink);
  color: var(--mist);
  padding-block: clamp(3rem, 6vw, 5rem) clamp(3rem, 6vw, 4.5rem);
}

.hero__kicker {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--gold);
  margin: 0 0 1.4rem;
  max-width: 54ch;
}

.hero .display { color: var(--white); max-width: 21ch; }
.hero__lead { margin-top: 1.6rem; }
.hero .actions { margin-top: 2.2rem; }

/* --- The packing visualisation ------------------------------------------- */

.pack {
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  border-top: 1px solid var(--hair-dark);
  padding-top: 2.25rem;
}

.pack__stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 900px) {
  .pack__stage { grid-template-columns: 1fr 1.15fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
}

.pack__caption {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--mist);
  margin: 0 0 0.85rem;
  max-width: none;
}
.pack__caption b { font-weight: 500; color: var(--white); }

/* the field of small objects */
.pack__field {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6px, 1fr));
  gap: 3px;
  min-height: 132px;
  align-content: start;
}

.pack__obj {
  aspect-ratio: 1;
  background: var(--steel);
  border-radius: 1px;
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: calc(var(--i) * 0.5ms);
}

.pack.is-packed .pack__obj { opacity: 0.9; transform: scale(1); }

/* the sealed volume */
.pack__volume { position: relative; }

.pack__band {
  display: flex;
  height: 96px;
  align-items: stretch;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(174, 193, 214, 0.08);
  transform: scaleX(0.04);
  transform-origin: left center;
  opacity: 0.25;
  transition: transform 0.9s cubic-bezier(0.22, 0.7, 0.2, 1) 0.5s, opacity 0.5s ease 0.5s;
}
.pack.is-packed .pack__band { transform: scaleX(1); opacity: 1; }

.pack__cap { flex: none; }
.pack__cap--head { width: 7px; background: var(--gold); }
.pack__cap--foot { width: 5px; background: var(--gold); opacity: 0.55; }
.pack__cap--manifest { width: 34px; background: var(--steel); }

.pack__frag {
  background: var(--mist);
  border-right: 1px solid var(--ink);
  min-width: 1px;
}
.pack__frag:nth-child(even) { background: #C6D5E4; }

.pack__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin-top: 0.85rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  color: rgba(174,193,214,0.8);
}
.pack__legend span { display: flex; align-items: center; gap: 0.45rem; }
.pack__legend i {
  width: 10px; height: 10px; border-radius: 1px; flex: none;
  background: var(--mist);
}
.pack__legend .k-head { background: var(--gold); }
.pack__legend .k-manifest { background: var(--steel); }

.pack__foot { margin-top: 1.75rem; }

/* --- Ruled block grid (problems, audiences) ------------------------------ */

.grid-3 {
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.grid-2 {
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.ruled {
  border-top: 2px solid var(--navy);
  padding-top: 1.1rem;
}
.ruled h3 { margin-bottom: 0.55rem; }
.ruled p { font-size: 1rem; line-height: 1.7; max-width: 42ch; }

[data-ground="ink"] .ruled, [data-ground="navy"] .ruled { border-top-color: var(--gold); }

/* --- Split: prose column + spec rail ------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.75rem);
  align-items: start;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
}

.split__prose h2 { margin-bottom: 1.1rem; }

.rail {
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.5;
  border-top: 2px solid var(--gold);
  padding-top: 1rem;
}

.rail__title {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--slate);
  margin: 0 0 0.9rem;
  max-width: none;
}

.rail dl { margin: 0; }
.rail dt {
  font-weight: 500;
  color: var(--navy);
  padding-top: 0.7rem;
  border-top: 1px solid var(--hair-light);
}
.rail dt:first-of-type { border-top: 0; padding-top: 0; }
.rail dd {
  margin: 0.15rem 0 0.7rem;
  color: var(--slate);
  font-weight: 300;
}

[data-ground="ink"] .rail__title, [data-ground="navy"] .rail__title { color: rgba(174,193,214,0.75); }
[data-ground="ink"] .rail dt, [data-ground="navy"] .rail dt { color: var(--white); border-top-color: var(--hair-dark); }
[data-ground="ink"] .rail dd, [data-ground="navy"] .rail dd { color: rgba(174,193,214,0.85); }

/* --- Section heading block ----------------------------------------------- */

.head { max-width: 58ch; margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem); }
.head h2 { max-width: 30ch; }
.head p { margin-top: 1rem; max-width: 58ch; }

/* --- The rule (spine statement) ------------------------------------------ */

.spine {
  border-left: 3px solid var(--gold);
  padding-left: clamp(1.25rem, 3vw, 2.25rem);
  max-width: 62ch;
}
.spine__line {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  line-height: 1.35;
  color: var(--white);
  margin: 0 0 1.1rem;
  max-width: none;
}

/* --- Diagrams ------------------------------------------------------------ */

.figure { margin: 0; }
.figure figcaption {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--slate);
  margin-top: 1rem;
  max-width: 70ch;
}
[data-ground="ink"] .figure figcaption,
[data-ground="navy"] .figure figcaption { color: rgba(174,193,214,0.75); }

/* byte-layout diagram — monospace is right here, this is a byte layout */
.layout {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.layout__band { display: flex; align-items: stretch; height: 62px; border-radius: 2px; overflow: hidden; }
.layout__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.4rem 0.5rem;
  color: var(--ink);
  background: var(--mist);
  border-right: 2px solid var(--ink);
  line-height: 1.25;
}
.layout__cell:last-child { border-right: 0; }
.layout__cell--head { background: var(--gold); flex: 0 0 clamp(74px, 12%, 130px); }
.layout__cell--data { background: var(--mist); flex: 1 1 auto; }
.layout__cell--manifest { background: var(--steel); color: var(--white); flex: 0 0 clamp(94px, 16%, 160px); }
.layout__cell--trailer { background: rgba(233,165,33,0.6); flex: 0 0 clamp(84px, 13%, 138px); }

/* flow diagram — a stack of labelled tiers */
.tiers { display: grid; gap: 0.9rem; }
.tier {
  border: 1px solid var(--hair-dark);
  border-left: 3px solid var(--gold);
  padding: 1.05rem 1.25rem;
  border-radius: 2px;
}
.tier h4 { color: var(--white); margin-bottom: 0.3rem; }
.tier p { font-size: 0.94rem; line-height: 1.65; margin: 0; color: rgba(174,193,214,0.85); max-width: 62ch; }
.tier--muted { border-left-color: var(--steel); }

/* placement diagram */
.place {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .place { grid-template-columns: repeat(2, 1fr); } }

.place__group {
  border: 1px solid var(--hair-dark);
  border-radius: 2px;
  padding: 1.1rem;
}
.place__group h4 { color: var(--white); font-size: 0.92rem; margin-bottom: 0.75rem; }
.place__targets { display: grid; gap: 0.5rem; }
.place__target {
  font-family: var(--sans);
  font-size: 0.84rem;
  background: rgba(174,193,214,0.09);
  border-left: 2px solid var(--mist);
  padding: 0.5rem 0.7rem;
  border-radius: 2px;
  color: var(--mist);
}
.place__bucket {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--ink);
  background: var(--gold);
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}

/* --- Numbered sequence (only where content really is a sequence) --------- */

.steps { counter-reset: step; display: grid; gap: 1.5rem; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 1rem;
  align-items: start;
}
.step::before {
  content: counter(step);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--gold);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.step h4 { margin-bottom: 0.3rem; }
.step p { font-size: 0.98rem; margin: 0; }

/* --- Feature table ------------------------------------------------------- */

.table-scroll { overflow-x: auto; }

table.spec {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-family: var(--sans);
  font-size: 0.9rem;
}
table.spec th, table.spec td {
  text-align: left;
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--hair-light);
  vertical-align: top;
}
table.spec th {
  font-weight: 500;
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  font-size: 0.8rem;
}
table.spec td:first-child { font-weight: 500; width: 30%; }
table.spec td { color: var(--slate); font-weight: 300; line-height: 1.55; }

/* --- Capability list ----------------------------------------------------- */

.caps { display: grid; gap: clamp(2.25rem, 4vw, 3.25rem); }

.cap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem 2rem;
  border-top: 1px solid var(--hair-light);
  padding-top: 1.4rem;
}
@media (min-width: 820px) {
  .cap { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
}
.cap h3 { font-size: 1.12rem; }
.cap p { font-size: 1rem; line-height: 1.7; }
.cap ul {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.89rem;
  line-height: 1.65;
  color: var(--slate);
  max-width: var(--measure);
}
.cap li { margin-bottom: 0.32rem; }
.cap li::marker { color: var(--gold); }

/* --- Use-case blocks ----------------------------------------------------- */

.case { border-top: 2px solid var(--navy); padding-top: 1.4rem; }
.case + .case { margin-top: clamp(2.75rem, 5vw, 4.25rem); }
.case h2 { margin-bottom: 1.2rem; }

.case__facets { display: grid; gap: 1.6rem; margin-top: 1.6rem; }
@media (min-width: 860px) { .case__facets { grid-template-columns: repeat(2, 1fr); gap: 1.6rem 2.75rem; } }

.facet h4 {
  color: var(--steel);
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}
.facet p { font-size: 0.98rem; line-height: 1.7; max-width: 48ch; }
.facet--watch h4 { color: #A9761B; }

/* --- Callout ------------------------------------------------------------- */

.callout {
  border: 1px solid var(--hair-light);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 1.35rem 1.5rem;
  background: var(--white);
  max-width: 72ch;
}
.callout h4 { margin-bottom: 0.45rem; }
.callout p { font-size: 0.98rem; margin-bottom: 0.6rem; }
[data-ground="ink"] .callout, [data-ground="navy"] .callout {
  background: rgba(174,193,214,0.07);
  border-color: var(--hair-dark);
  border-left-color: var(--gold);
}

/* --- CTA band ------------------------------------------------------------ */

.cta { background: var(--navy); color: var(--mist); }
.cta__inner {
  display: grid;
  gap: 1.75rem;
  align-items: end;
}
@media (min-width: 820px) {
  .cta__inner { grid-template-columns: 1.5fr auto; gap: 3rem; }
}
.cta h2 { color: var(--white); max-width: 28ch; }
.cta p { margin-top: 0.9rem; color: var(--mist); }

/* --- Contact ------------------------------------------------------------- */

.contact-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: 1fr; }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 1.15fr 1fr; } }

form.enquiry { display: grid; gap: 1.05rem; max-width: 34rem; }
form.enquiry label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--navy);
  display: grid;
  gap: 0.35rem;
}
form.enquiry input, form.enquiry textarea, form.enquiry select {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--hair-light);
  border-radius: 3px;
  background: var(--white);
  color: var(--navy);
  width: 100%;
}
form.enquiry input:focus, form.enquiry textarea:focus, form.enquiry select:focus {
  border-color: var(--steel);
}
form.enquiry textarea { min-height: 7.5rem; resize: vertical; }
form.enquiry button {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.72rem 1.35rem;
  background: var(--gold);
  color: var(--ink);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  justify-self: start;
}
form.enquiry button:hover { background: var(--navy); color: var(--white); }

.detail-list { border-top: 2px solid var(--navy); padding-top: 1.1rem; }
.detail-list dl { margin: 0; font-family: var(--sans); font-size: 0.92rem; }
.detail-list dt { font-weight: 500; padding-top: 0.85rem; border-top: 1px solid var(--hair-light); }
.detail-list dt:first-of-type { border-top: 0; padding-top: 0; }
.detail-list dd { margin: 0.2rem 0 0.85rem; color: var(--slate); font-weight: 300; }

/* --- Footer -------------------------------------------------------------- */

.footer { background: var(--ink); color: rgba(174,193,214,0.8); padding-block: 3.25rem 2.25rem; }
.footer__inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 780px) { .footer__inner { grid-template-columns: 1.3fr 1fr 1fr; } }

.footer img { width: 152px; margin-bottom: 1.15rem; }
.footer p { font-family: var(--sans); font-weight: 300; font-size: 0.85rem; line-height: 1.65; max-width: 34ch; }
.footer h4 { font-size: 0.8rem; color: var(--white); margin-bottom: 0.75rem; }
.footer ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.88rem; }
.footer li { margin-bottom: 0.45rem; }
.footer a { color: rgba(174,193,214,0.85); text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }

.footer__base {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair-dark);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.78rem;
  color: rgba(174,193,214,0.6);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.footer__base p { max-width: none; margin: 0; font-size: 0.78rem; }

/* --- Skip link ----------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .pack__obj, .pack__band { transition: none !important; }
}

/* --- Narrow screens: the nav stacks instead of wrapping around the logo --- */

/* Below 900px the six items no longer fit beside the logo on one line, so the
   nav stacks: logo on its own row, links underneath with the call to action
   pushed to the right edge. Below 720px it also stops being sticky, because on
   a phone two stacked rows eat too much of the screen. */
@media (max-width: 900px) {
  .nav__inner {
    flex-wrap: wrap;
    row-gap: 0.85rem;
    padding-block: 0.85rem;
  }
  .nav__logo { width: 100%; }
  .nav__logo img { width: 132px; }
  .nav__links {
    margin-left: 0;
    width: 100%;
    gap: 0.6rem 1.05rem;
  }
  .nav__links a { font-size: 0.86rem; }
  .nav__cta { margin-left: auto; }
}

@media (max-width: 720px) {
  .nav { position: static; }
}

/* ==========================================================================
   Diagrams for the five problems on the home page.
   Each one is a picture first: readable with no motion, no library, no images.
   ========================================================================== */

.pic {
  border: 1px solid var(--hair-light);
  border-radius: 2px;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  background: var(--white);
}
[data-ground="ink"] .pic, [data-ground="navy"] .pic {
  background: rgba(174, 193, 214, 0.06);
  border-color: var(--hair-dark);
}
[data-ground="paper"] .pic { background: var(--white); }

.pic__cap {
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--slate);
  margin: 1rem 0 0;
  max-width: 62ch;
}
[data-ground="ink"] .pic__cap, [data-ground="navy"] .pic__cap { color: rgba(174,193,214,0.8); }

/* shared node styling ---------------------------------------------------- */

.node {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
  padding: 0.6rem 0.75rem;
  border-radius: 2px;
  background: var(--paper);
  border-left: 3px solid var(--steel);
  color: var(--navy);
}
[data-ground="ink"] .node, [data-ground="navy"] .node {
  background: rgba(174,193,214,0.1);
  color: var(--mist);
  border-left-color: var(--mist);
}
.node b { display: block; font-weight: 500; }
.node--gw { border-left-color: var(--gold); background: var(--navy); color: #fff; }
[data-ground="ink"] .node--gw, [data-ground="navy"] .node--gw { background: var(--gold); color: var(--ink); border-left-color: #fff; }
.node--gw b { color: inherit; }
.node--old { opacity: 0.62; }
.node--new { border-left-color: var(--gold); }

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  background: var(--gold);
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.tag--quiet { background: rgba(20,48,74,0.1); color: var(--slate); }
[data-ground="ink"] .tag--quiet, [data-ground="navy"] .tag--quiet { background: rgba(174,193,214,0.16); color: var(--mist); }

/* the arrow that carries the story ---------------------------------------- */

.arrow {
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--slate);
  text-align: center;
  line-height: 1.3;
  min-height: 1.5rem;
}
[data-ground="ink"] .arrow, [data-ground="navy"] .arrow { color: rgba(174,193,214,0.75); }
.arrow svg { display: block; overflow: visible; }
.arrow path, .arrow line { stroke: var(--steel); stroke-width: 1.4; fill: none; }
[data-ground="ink"] .arrow path, [data-ground="ink"] .arrow line,
[data-ground="navy"] .arrow path, [data-ground="navy"] .arrow line { stroke: var(--mist); }
.arrow .accent { stroke: var(--gold); stroke-width: 2; }

/* 1. swapping vendors ------------------------------------------------------ */

.swap { display: grid; gap: 0.9rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 760px) {
  .swap { grid-template-columns: minmax(0,1fr) 4.5rem minmax(0,1fr); }
}
.swap__clients { display: grid; gap: 0.5rem; }
.swap__stack { display: grid; gap: 0.6rem; }

/* 2. several vendors at once ---------------------------------------------- */

.fan { display: grid; gap: 1rem; }
.fan__groups { display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .fan__groups { grid-template-columns: repeat(2, 1fr); } }
.fan__group {
  border: 1px dashed var(--hair-light);
  border-radius: 2px;
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
[data-ground="ink"] .fan__group, [data-ground="navy"] .fan__group { border-color: var(--hair-dark); }
.fan__label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--slate);
  margin: 0;
  max-width: none;
}
[data-ground="ink"] .fan__label, [data-ground="navy"] .fan__label { color: rgba(174,193,214,0.8); }

/* 3. tape, and the shoe-shining problem ----------------------------------- */

.tape { display: grid; gap: 1.4rem; }
@media (min-width: 820px) { .tape { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; } }

.tape__lane { display: grid; gap: 0.6rem; align-content: start; }

.tape__reel {
  position: relative;
  border-radius: 2px;
  background: #0A1725;
  border: 1px solid var(--hair-dark);
  padding: 1.5rem 0.5rem 0.5rem;
  overflow: hidden;
}
.tape__track {
  display: flex;
  gap: 2px;
  align-items: stretch;
  height: 30px;
}
.tape__blk { background: var(--mist); border-radius: 1px; }
.tape__gap { background: rgba(174,193,214,0.12); border-radius: 1px; }
.tape__blk--vol { background: var(--gold); }

.tape__head {
  position: absolute;
  top: 0.35rem;
  left: 0.5rem;
  width: 3px;
  height: 1rem;
  background: #fff;
  border-radius: 1px;
}
.tape__head::after {
  content: "";
  position: absolute;
  left: -3px;
  bottom: -4px;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5px solid #fff;
}

.tape.is-running .tape__lane--bad .tape__head { animation: shoeshine 6s linear infinite; }
.tape.is-running .tape__lane--good .tape__head { animation: stream 6s linear infinite; }

/* The head sweeps the width of its own track, whatever that width is. Both
   keyframe sets position it as a fraction of the reel rather than at a fixed
   pixel offset: the reel is a grid column and measures anywhere from about
   100px to 650px across the breakpoints, so one fixed travel distance cannot
   fit them all -- it stopped a third of the way along the wide single-column
   layout and ran past the end into overflow: hidden on every desktop width.
   `left` rather than `transform` because a percentage translate resolves
   against the element's own 3px width, not against its container. */
@keyframes shoeshine {
  0%   { left: 0.5rem; }
  6%   { left: calc(0.5rem + (100% - 1rem - 3px) * 0.0603); }
  9%   { left: calc(0.5rem + (100% - 1rem - 3px) * 0.0172); }
  15%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.1466); }
  18%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.0948); }
  24%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.2414); }
  27%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.1897); }
  33%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.3362); }
  36%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.2845); }
  42%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.4310); }
  45%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.3793); }
  51%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.5259); }
  54%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.4741); }
  60%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.6207); }
  63%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.5690); }
  69%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.7155); }
  72%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.6638); }
  78%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.8103); }
  81%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.7586); }
  87%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.9052); }
  90%  { left: calc(0.5rem + (100% - 1rem - 3px) * 0.8534); }
  100% { left: calc(0.5rem + (100% - 1rem - 3px)); }
}
@keyframes stream {
  0%   { left: 0.5rem; }
  100% { left: calc(0.5rem + (100% - 1rem - 3px)); }
}

/* the static reading of the same picture, for reduced motion and for print */
.tape__marks { display: flex; gap: 2px; margin-top: 0.3rem; height: 10px; }
.tape__marks span { position: relative; }
.tape__lane--bad .tape__marks span::before {
  content: "";
  position: absolute;
  inset: 3px 1px auto 1px;
  height: 1px;
  background: var(--gold);
}
.tape__lane--bad .tape__marks span::after {
  content: "";
  position: absolute;
  left: 0; top: 1px;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-right: 4px solid var(--gold);
}

.tape__verdict {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  margin: 0;
  max-width: none;
}
.tape__lane--bad .tape__verdict { color: #B07714; }
.tape__lane--good .tape__verdict { color: var(--steel); }
[data-ground="ink"] .tape__lane--bad .tape__verdict { color: var(--gold); }
[data-ground="ink"] .tape__lane--good .tape__verdict { color: #fff; }

.tape__what {
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--slate);
  margin: 0;
  max-width: 40ch;
}
[data-ground="ink"] .tape__what, [data-ground="navy"] .tape__what { color: rgba(174,193,214,0.8); }

@media (prefers-reduced-motion: reduce) {
  .tape.is-running .tape__head { animation: none !important; }
}

/* the problem index at the top of the home page ---------------------------- */

.jump { display: grid; gap: 0; grid-template-columns: 1fr; margin-top: clamp(2rem, 4vw, 3rem); }
@media (min-width: 640px) { .jump { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .jump { grid-template-columns: repeat(6, 1fr); } }

.jump a {
  display: block;
  text-decoration: none;
  padding: 1.1rem 1rem 1.2rem;
  border-top: 2px solid var(--hair-dark);
  color: var(--mist);
}
.jump a:hover { border-top-color: var(--gold); color: #fff; }
.jump .n {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.jump .t {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.35;
}

/* arrows turn to point down when a diagram stacks on a narrow screen */
@media (max-width: 759px) {
  .swap > .arrow svg { transform: rotate(90deg); }
}
.arrow--v svg { transform: rotate(90deg); }

/* the orientation band: where the gateway goes */
.flow { display: grid; gap: 0.9rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 800px) {
  .flow { grid-template-columns: minmax(0,1fr) 3.5rem minmax(0,1.1fr) 3.5rem minmax(0,1fr); }
}
.flow .node { padding: 0.85rem 1rem; font-size: 0.86rem; }

/* ==========================================================================
   The worked example and the calculator.
   ========================================================================== */

.worked { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .worked { grid-template-columns: 1fr 1fr; gap: 2rem; } }

.dist { font-family: var(--sans); font-size: 0.82rem; }
.dist__row { display: grid; grid-template-columns: 6.5rem 1fr 3rem; gap: 0.6rem; align-items: center; margin-bottom: 0.3rem; }
.dist__row span:first-child { color: var(--slate); }
.dist__bar { background: rgba(20,48,74,0.08); border-radius: 1px; height: 12px; }
.dist__bar i { display: block; height: 100%; background: var(--steel); border-radius: 1px; }
.dist__row:first-child .dist__bar i { background: var(--gold); }
.dist__row span:last-child { text-align: right; font-weight: 500; color: var(--navy); font-variant-numeric: tabular-nums; }
[data-ground="ink"] .dist__row span:first-child { color: rgba(174,193,214,0.8); }
[data-ground="ink"] .dist__row span:last-child { color: #fff; }
[data-ground="ink"] .dist__bar { background: rgba(174,193,214,0.14); }

.versus { display: grid; gap: 0; }
.versus__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--hair-light);
  font-family: var(--sans);
  font-size: 0.88rem;
}
@media (min-width: 560px) { .versus__row { grid-template-columns: 9.5rem 1fr 1fr; } }
.versus__row:first-child { border-top: 2px solid var(--navy); }
.versus__k { font-weight: 500; color: var(--slate); font-size: 0.78rem; }
.versus__a { color: var(--slate); font-weight: 300; }
.versus__b { color: var(--navy); font-weight: 500; }
.versus__b em { font-style: normal; font-weight: 300; color: var(--slate); display: block; font-size: 0.8rem; }
[data-ground="ink"] .versus__row { border-top-color: var(--hair-dark); }
[data-ground="ink"] .versus__row:first-child { border-top-color: var(--gold); }
[data-ground="ink"] .versus__k, [data-ground="ink"] .versus__a { color: rgba(174,193,214,0.78); }
[data-ground="ink"] .versus__b { color: #fff; }
[data-ground="ink"] .versus__b em { color: rgba(174,193,214,0.7); }

/* calculator ------------------------------------------------------------- */

.calc {
  border: 1px solid var(--hair-dark);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(174,193,214,0.06);
}
.calc__grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .calc__grid { grid-template-columns: repeat(3, 1fr); } }

.calc label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--mist);
  display: grid;
  gap: 0.35rem;
}
.calc input, .calc select {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--hair-dark);
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  width: 100%;
}
.calc input:focus, .calc select:focus { border-color: var(--gold); outline: none; }

.calc__out {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair-dark);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .calc__out { grid-template-columns: 1fr 1fr 1fr; } }

.calc__fig { font-family: var(--sans); }
.calc__fig b {
  display: block;
  font-weight: 300;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  line-height: 1.05;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.calc__fig span { display: block; font-size: 0.78rem; color: rgba(174,193,214,0.8); margin-top: 0.3rem; }
.calc__fig--hero b { color: var(--gold); }
.calc__note { margin-top: 1.25rem; }

/* --- the deployment shape: pods in a tier, and what scales ---------------- */

.podrow { display: grid; gap: 0.85rem; }
.podrow__tier { display: grid; gap: 0.5rem; }
.podrow__label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--slate);
  margin: 0;
  max-width: none;
}
[data-ground="ink"] .podrow__label, [data-ground="navy"] .podrow__label { color: rgba(174,193,214,0.8); }
.podrow__pods { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: stretch; }
.pod {
  font-family: var(--sans);
  font-size: 0.74rem;
  padding: 0.45rem 0.55rem;
  border-radius: 2px;
  background: rgba(174,193,214,0.12);
  border-top: 2px solid var(--mist);
  color: var(--mist);
  min-width: 3.2rem;
  text-align: center;
}
.pod--gw { border-top-color: var(--gold); }
.pod--add {
  background: transparent;
  border: 1px dashed var(--hair-dark);
  border-top: 1px dashed var(--hair-dark);
  color: rgba(174,193,214,0.7);
  display: grid;
  place-items: center;
}
