/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--navy);
  --btn-bd: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-xs);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 1rem/1 var(--font-sans);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn--quote { --btn-bg: var(--red); --btn-fg: var(--on-navy); --btn-bd: var(--red); }
.btn--quote:hover { --btn-bg: var(--red-press); --btn-bd: var(--red-press); color: var(--on-navy); }
.btn--portal:hover { --btn-bg: var(--navy); --btn-fg: var(--on-navy); color: var(--on-navy); }
.btn--on-navy { --btn-bg: var(--on-navy); --btn-fg: var(--navy); --btn-bd: var(--on-navy); }
.btn--on-navy:hover { --btn-bg: transparent; --btn-fg: var(--on-navy); color: var(--on-navy); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: var(--fs-small); }
.btn:active { transform: translateY(1px); transition-duration: 60ms; }

/* arrow nudges right on hover of its link */
/* quiet text link for every secondary action; buttons stay for quote and login */
.more { display: inline-flex; align-items: baseline; gap: 0.4em; font-weight: 600; font-size: var(--fs-small); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* arrow nudges right on hover of its link */
.btn .arrow, .more .arrow { display: inline-block; transition: transform 200ms var(--ease-out); }
.btn:hover .arrow, .more:hover .arrow { transform: translateX(3px); }

/* ---------- steprule: the logo's rising bars as section marker ---------- */
.steprule {
  display: inline-flex; align-items: flex-end; gap: 3px;
  width: 22px; height: 14px;
  flex: none;
}
.steprule i { display: block; width: 5px; background: var(--red); }
.steprule i:nth-child(1) { height: 40%; }
.steprule i:nth-child(2) { height: 70%; }
.steprule i:nth-child(3) { height: 100%; }

.kicker {
  display: flex; align-items: center; gap: var(--s3);
  margin-bottom: var(--s5);
  color: var(--ink-2);
  font: 600 0.9375rem/1 var(--font-sans);
}
.field-navy .kicker { color: var(--on-navy-2); }

/* the 12-column page grid (.gallery narrows the gap in pages.css) */
.section-head, .hero__grid, .control__grid, .page-head__grid, .proc-head__grid, .split,
.spec-grid, .gallery, .report, .sector, .quote {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s5);
}

/* wide plant-wall code type */
.cycle__code, .register__code, .trust__iso-word, .codes__code, .proc-head__code,
.prevnext .code, .equip__codes, .lost__code {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
}

.section-head {
  align-items: end;
  margin-bottom: var(--s7);
}
.section-head > :first-child { grid-column: 1 / span 7; }
.section-head > :last-child:not(:first-child) { grid-column: 8 / span 5; color: var(--ink-2); }
.field-navy .section-head > :last-child:not(:first-child) { color: var(--on-navy-2); }
@media (max-width: 900px) {
  .section-head > :first-child, .section-head > :last-child:not(:first-child) { grid-column: 1 / -1; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ground);
  transition: box-shadow 200ms var(--ease-out);
}
.site-header.is-scrolled { box-shadow: var(--shadow-header); }
.site-header__bar {
  display: flex; align-items: center; gap: var(--s5);
  min-height: 76px;
}
.site-header__logo {
  display: flex; align-items: center; gap: var(--s3); flex: none;
  text-decoration: none;
}
.site-header__logo img { width: 112px; height: auto; flex: none; }
.site-header__name {
  display: grid; gap: 2px;
  font-size: var(--fs-xs); line-height: 1.3;
  white-space: nowrap;
}
.site-header__co { color: var(--navy); font-weight: 650; }
.site-header__tag { color: var(--ink-2); font-weight: 450; }

.site-nav { flex: 1; }
.site-nav ul { display: flex; gap: var(--s1); list-style: none; justify-content: center; }
.site-nav a {
  display: block; padding: 10px 12px;
  color: var(--ink);
  font-size: var(--fs-small); font-weight: 550;
  text-decoration: none;
  border-radius: var(--r-xs);
}
.site-nav a:hover { color: var(--navy); background: var(--ground-2); }
.site-nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--navy); border-radius: 0; }

.site-header__actions { display: flex; gap: var(--s2); flex: none; }
.menu-toggle {
  display: none;
  align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: var(--r-xs);
  background: var(--surface); color: var(--navy);
  font: 600 0.9375rem/1 var(--font-sans);
  cursor: pointer;
}
.menu-toggle__bars { display: grid; gap: 4px; width: 16px; }
.menu-toggle__bars i { display: block; height: 2px; background: currentColor; }

@media (max-width: 1240px) {
  .site-header__bar { gap: var(--s4); }
  .site-nav a { padding: 10px 8px; }
}
@media (max-width: 1100px) {
  .site-nav a { padding: 10px 6px; font-size: var(--fs-sm); }
  .site-header__logo img { width: 96px; }
}
@media (min-width: 1001px) and (max-width: 1080px) {
  .site-header__bar { gap: var(--s3); }
  .site-nav a { padding: 10px 4px; }
}
/* narrow desktop: the name takes two lines so the nav keeps one row */
@media (min-width: 1001px) and (max-width: 1240px) {
  .site-header__co span, .site-header__tag span { display: block; }
  .site-header__name { gap: 0; font-size: var(--fs-data); line-height: 1.25; }
}
@media (max-width: 1000px) {
  .site-header__bar { gap: var(--s3); min-height: 64px; }
  .site-header__logo img { width: 92px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .site-header__actions .btn--quote { display: none; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ground);
    border-top: 1px solid var(--rule);
    box-shadow: var(--shadow-header);
    padding: var(--s3) var(--gutter) var(--s5);
  }
  .site-nav[hidden] { display: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li + li { border-top: 1px solid var(--rule-soft); }
  .site-nav a { padding: 14px 0; font-size: var(--fs-body); }
  .site-nav a[aria-current="page"] { box-shadow: none; }
  .site-nav .site-nav__quote { display: flex; margin-top: var(--s4); border: 0; }
  .site-nav .site-nav__quote a { padding: 0 22px; color: var(--on-navy); }
}
@media (min-width: 1001px) {
  .site-nav[hidden] { display: block; }
  .site-nav__quote { display: none; }
}
@media (max-width: 720px) {
  .site-header__co span { display: block; }
  .site-header__tag { display: none; }
}
@media (max-width: 560px) {
  .site-header__name { display: none; }
}
@media (max-width: 420px) {
  .site-header__actions .btn--portal { padding: 0 10px; }
}
@media (max-width: 360px) {
  /* smallest phones: the menu button keeps its bars; the word stays for screen readers */
  .menu-toggle { padding: 0 10px; }
  .menu-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header__logo img { width: 80px; }
}

/* ---------- cycle chart ---------- */
.cycle {
  position: relative;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
}
.cycle__top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: var(--s4) var(--s5) 0;
}
/* title takes the leftover width and wraps inside it, so the switcher never changes row */
.cycle__title { display: flex; align-items: baseline; gap: var(--s3); flex: 1 1 0; min-width: 0; }
.cycle__title .cycle__name { min-width: 0; text-wrap: balance; }
.cycle__top .switcher { flex: none; }
@container (max-width: 680px) {
  .cycle__top .switcher { flex: 1 0 100%; }
  .cycle__top .switcher button { flex: 1; min-width: 0; padding: 0 6px; }
}
.cycle__code {
  color: var(--navy);
  font-size: 1.75rem; line-height: 1;
  letter-spacing: -0.01em;
}
.cycle__name { color: var(--ink-2); font-size: var(--fs-small); font-weight: 550; }

.switcher {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 2px;
  background: var(--ground-2);
  border-radius: var(--r-sm);
}
.switcher__ink {
  position: absolute; top: 0; left: 0;
  background: var(--navy);
  border-radius: var(--r-xs);
  transition: transform 340ms var(--ease-out), width 340ms var(--ease-out);
  pointer-events: none;
}
.switcher__ink.is-still { transition: none; }
.switcher button {
  position: relative;
  min-width: 44px; min-height: 36px;
  padding: 0 10px;
  border: 0; border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-2);
  font: 700 0.8125rem/1 var(--font-sans);
  font-variation-settings: "wdth" 118;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.switcher button:hover { color: var(--navy); background: var(--surface); }
.switcher button[aria-selected="true"] { background: var(--navy); color: var(--on-navy); }
.switcher.has-ink button[aria-selected="true"] { background: transparent; }
.switcher.has-ink button[aria-selected="true"]:hover { color: var(--on-navy); }

.cycle__plot { position: relative; height: clamp(300px, 34vw, 420px); margin-top: var(--s3); }
.cycle__plot svg { width: 100%; height: 100%; overflow: visible; }
.cycle__plot text { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500; fill: var(--ink-3); }
.cycle__plot .grid line { stroke: var(--rule-soft); shape-rendering: crispEdges; }
.cycle__plot .axis-line { stroke: var(--rule); shape-rendering: crispEdges; }
.cycle__plot .trace { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.cycle__plot .trace.is-drawing { transition: stroke-dashoffset 1.8s var(--ease-out); }
.cycle__plot .ann { transition: opacity 260ms var(--ease-out); }
.cycle__plot .ann.is-hidden { opacity: 0; }
.cycle__plot .ann-tick { stroke: var(--ink-3); }
.cycle__plot .ann-label { fill: var(--ink); font-size: 11.5px; font-weight: 500; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.cycle__plot .ann-sub { fill: var(--ink-2); }
.cycle__plot .readout-line { stroke: var(--navy-2); stroke-dasharray: 2 3; shape-rendering: crispEdges; }
.cycle__plot .readout-dot { fill: var(--surface); stroke: var(--navy); stroke-width: 2; }
.cycle__plot .readout-bg { fill: var(--navy); }
.cycle__plot .readout-text { fill: var(--on-navy); font-size: var(--fs-2xs); }
.cycle__plot .playhead-line { stroke: var(--navy-2); stroke-dasharray: 1 3; opacity: 0.55; }
.cycle__plot .playhead-dot { fill: var(--navy); stroke: var(--surface); stroke-width: 1.5; }
.cycle__plot .playhead-halo { fill: var(--navy); opacity: 0.14; transform-box: fill-box; transform-origin: center; animation: playhead-pulse 1.6s var(--ease-out) infinite; }
.cycle__plot .playhead-text { fill: var(--navy); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
@keyframes playhead-pulse { 0% { transform: scale(0.5); opacity: 0.3; } 100% { transform: scale(1.35); opacity: 0; } }

.cycle__foot {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s4); align-items: end;
  padding: var(--s3) var(--s5) var(--s4);
  border-top: 1px solid var(--rule-soft);
}
.cycle__params { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); list-style: none; }
.cycle__params li { display: grid; gap: 2px; }
.cycle__params .k { color: var(--ink-3); font-family: var(--font-sans); font-size: var(--fs-data); letter-spacing: 0.01em; }
.cycle__params .v { color: var(--ink); font-size: var(--fs-xs); font-weight: 500; }
.cycle__note { color: var(--ink-3); font-family: var(--font-sans); font-size: var(--fs-data); line-height: 1.45; text-align: right; max-width: 34ch; justify-self: end; }
.cycle__foot .more { grid-column: 2; justify-self: end; margin-top: calc(var(--s2) * -1); }
.cycle__code, .cycle__name, .cycle__params, .cycle__note {
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.cycle.is-swapping .cycle__code, .cycle.is-swapping .cycle__name,
.cycle.is-swapping .cycle__params, .cycle.is-swapping .cycle__note {
  opacity: 0; transform: translateY(3px); transition-duration: 120ms;
}
@media (prefers-reduced-motion: reduce) {
  .cycle__code, .cycle__name, .cycle__params, .cycle__note { transition: none; }
}
@media (max-width: 560px) {
  .cycle__top { padding: var(--s3) var(--s3) 0; }
  .cycle__foot { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: var(--s3); }
  .cycle__note { text-align: left; max-width: none; }
  .cycle__foot .more { grid-column: 1; justify-self: start; }
}

/* ---------- process register (ruled rows, not cards) ---------- */
.register { list-style: none; border-top: 1px solid var(--rule); }
.register__row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 3fr) 5fr 3fr auto;
  gap: var(--s5);
  align-items: center;
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.register__code {
  color: var(--navy);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  transition: color 200ms var(--ease-out), font-variation-settings 480ms var(--ease-out), letter-spacing 480ms var(--ease-out);
}
.register__row:hover .register__code { color: var(--navy-deep); font-variation-settings: "wdth" 112; letter-spacing: 0.01em; }
.register__name { font-size: var(--fs-h3); font-weight: 600; color: var(--ink); }
.register__desc { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-small); max-width: 48ch; }
.register__params { color: var(--ink-2); }
.register__params span { display: block; }
.register__params span + span { margin-top: 3px; }
.register__go {
  color: var(--navy); font-weight: 600; font-size: var(--fs-small); text-decoration: none; white-space: nowrap;
}
.register__go .arrow { display: inline-block; transition: transform 240ms var(--ease-out); }
.register__row:hover .register__go .arrow { transform: translateX(4px); }
.register__go::after { content: ""; position: absolute; inset: 0; }
.register__row:hover { background: var(--surface); box-shadow: -16px 0 0 var(--surface), 16px 0 0 var(--surface); }
.register__row:hover .register__go { text-decoration: underline; }
@media (max-width: 900px) {
  .register__row { grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); padding: var(--s4) 0; }
  .register__code { grid-row: 1; font-size: 2.75rem; }
  .register__go { grid-row: 1; grid-column: 2; }
  .register__body, .register__params { grid-column: 1 / -1; }
}

/* ---------- photo band ---------- */
.photo-band { position: relative; margin: 0; background: var(--ink); }
.photo-band img { width: 100%; height: clamp(260px, 42vw, 560px); object-fit: cover; }
.photo-band figcaption {
  position: absolute; left: var(--gutter); bottom: var(--s4);
  padding: 6px 10px;
  background: var(--navy); color: var(--on-navy);
  border-radius: var(--r-xs);
}

/* ---------- ruled data table ---------- */
.ledger { font-size: var(--fs-small); }
.ledger th, .ledger td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.ledger thead th { color: var(--ink-3); font-family: var(--font-mono); font-size: var(--fs-data); font-weight: 400; border-bottom-color: var(--ink-3); }
.ledger td.mono { font-size: var(--fs-xs); }
.ledger tbody th { font-weight: 600; color: var(--ink); }

/* ---------- release checks: result column + counter ---------- */
.ledger .ledger__result { color: var(--navy); font-weight: 500; white-space: nowrap; }
.ledger .ledger__result::before {
  content: ""; display: inline-block; width: 7px; height: 4px; margin: 0 7px 3px 0;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.release {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  margin-bottom: var(--s4); padding: 10px 12px;
  background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r-sm);
}
.release__lot { color: var(--ink-3); margin-right: auto; }
.release__count { color: var(--ink); font-variant-numeric: tabular-nums; }
.release__count b { font-weight: 500; }
/* navy status pill (.sector__status--next outlines it in pages.css) */
.release__state, .sector__status { padding: 3px 8px; border-radius: var(--r-xs); background: var(--navy); color: var(--on-navy); }
.release__state {
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out);
}
.release.is-holding .release__state { background: var(--ground-2); color: var(--ink-2); }

/* ---------- stage strip ---------- */
.stages {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  list-style: none;
  counter-reset: stage;
}
.stages li {
  position: relative;
  padding: var(--s4) var(--s3) 0 0;
  border-top: 3px solid var(--on-navy-rule);
  color: var(--on-navy-2);
  transition: color 300ms var(--ease-out);
}
.stages li::after {
  content: ""; position: absolute; left: 0; right: 0; top: -3px; height: 3px;
  background: var(--on-navy-2);
  transform: scaleX(0); transform-origin: left;
  transition: transform 700ms var(--ease-out), background-color 300ms var(--ease-out);
}
.stages li.is-done::after { transform: none; }
.stages li.is-now::after { transform: scaleX(0.5); background: var(--on-navy); }
.stages li.is-now { color: var(--on-navy); }
.stages li.is-now::before {
  content: ""; position: absolute; top: -8px; left: 0; z-index: 1;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--on-navy); box-shadow: 0 0 0 4px var(--navy-deep);
  animation: stage-now 520ms var(--ease-out);
}
@keyframes stage-now { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.stages .stage-name { display: block; font-size: var(--fs-xs); }
.stages .stage-time { display: block; margin-top: 4px; color: var(--on-navy-2); font-size: var(--fs-2xs); transition: opacity 300ms var(--ease-out); }
@media (max-width: 700px) {
  .stages { grid-template-columns: 1fr; }
  .stages li {
    display: flex; justify-content: space-between; gap: var(--s3);
    padding: 10px 0 10px var(--s4);
    border-top: 0; border-left: 3px solid var(--on-navy-rule);
  }
  .stages li::after { left: -3px; right: auto; top: 0; bottom: 0; width: 3px; height: auto; transform: scaleY(0); transform-origin: top; }
  .stages li.is-now::after { transform: scaleY(0.5); }
  .stages li.is-now::before { top: 50%; left: -8px; margin-top: -6.5px; }
  .stages .stage-time { margin-top: 0; }
}

/* ---------- footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--on-navy-2); font-size: var(--fs-small); }
.site-footer a { color: var(--on-navy); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__grid {
  display: grid; grid-template-columns: 3fr 4fr 2fr 2fr; gap: var(--s6);
  padding-block: var(--s8) var(--s7);
}
.site-footer__logo img { width: 128px; }
.site-footer h2 { color: var(--on-navy); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; margin-bottom: var(--s3); }
.site-footer ul { list-style: none; display: grid; gap: var(--s2); }
.site-footer address { font-style: normal; line-height: 1.6; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3);
  position: relative;
  padding-block: var(--s4) var(--s5);
  font-size: var(--fs-xs);
}
.site-footer__legal::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--on-navy-rule);
}
@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .site-footer__grid { gap: var(--s6) var(--s5); }
  .site-footer__grid > :nth-child(-n+2) { grid-column: 1 / -1; }
}
