/* ==========================================================================
   grahamjohnston.ca — network automation for ISPs
   Palette keyed to instrument/console vernacular:
     amber  = primary accent, drift
     teal   = intended state, compliant, PON
     crimson = removed lines in a diff
     claude = the AI-polish toggle only
   ========================================================================== */

:root {
  --ground:    #0D1218;
  --surface:   #151E29;
  --surface-2: #1C2733;
  --line:      #263442;
  --line-soft: #1E2A36;
  --text:      #E8EEF3;
  --muted:     #8195A6;
  --amber:     #F0A63C;
  --amber-dim: #8A6224;
  --teal:      #3FA3B3;
  --teal-dim:  #245A63;
  --crimson:   #C05561;
  --claude:    #D97757;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 62ch;
  --rule: 1px solid var(--line);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 115;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --- shared -------------------------------------------------------------- */

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

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--amber);
  flex: none;
  align-self: flex-start;
  margin-top: 0.62em;
}

section { border-top: var(--rule); }
.band { padding-block: clamp(3.5rem, 9vw, 7rem); }

.section-head { display: grid; gap: 1.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); max-width: 20ch; }
.section-head p { color: var(--muted); }
@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: end; }
}

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

.btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--amber);
  display: inline-block;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn--solid { background: var(--amber); color: var(--ground); font-weight: 500; }
.btn--solid:hover { background: #FFC066; border-color: #FFC066; }
.btn--ghost { color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text); }

/* --- navigation ---------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--rule);
}
.nav__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.nav__mark {
  font-family: var(--display);
  font-variation-settings: "wdth" 125;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.nav__mark span { color: var(--muted); font-weight: 400; }
.nav__links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.nav__links a { color: var(--muted); text-decoration: none; padding-block: 0.35rem; transition: color 0.18s; }
.nav__links a:hover { color: var(--text); }
/* Three pages means navigation has to survive every width, so the links drop
   to their own row rather than disappearing. */
@media (max-width: 900px) {
  .nav__inner { flex-wrap: wrap; gap: 0 1rem; }
  .nav__mark { order: 1; }
  .voice-toggle { order: 2; margin-left: auto; }
  .nav__links {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 1.1rem;
    padding-bottom: 0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav__links::-webkit-scrollbar { display: none; }
}
@media (max-width: 620px) { .nav__mark span { display: none; } }

/* --- the Claude toggle ---------------------------------------------------
   On: the copy is polished by Claude. Off: plain speak.
   ------------------------------------------------------------------------- */

.voice-toggle {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav__links + .voice-toggle { margin-left: 1.25rem; }
.voice-toggle svg { width: 1.15rem; height: 1.15rem; display: block; transition: transform 0.3s ease; }
.voice-toggle:hover { border-color: var(--muted); }

.voice-toggle[aria-checked="true"] {
  color: var(--claude);
  border-color: color-mix(in srgb, var(--claude) 50%, transparent);
  background: color-mix(in srgb, var(--claude) 12%, transparent);
}
.voice-toggle[aria-checked="true"]:hover { border-color: var(--claude); }
.voice-toggle[aria-checked="true"] svg { transform: rotate(45deg); }

/* Voice visibility. Polished is the default; plain is opt-in. */
.v-plain { display: none; }
html[data-voice="plain"] .v-plain { display: revert; }
html[data-voice="plain"] .v-polished { display: none; }

/* --- hero ---------------------------------------------------------------- */

.hero { border-top: 0; padding-top: clamp(3rem, 8vw, 5.5rem); }
.hero h1 {
  font-size: clamp(2.3rem, 5.8vw, 4.5rem);
  font-variation-settings: "wdth" 118;
  max-width: 15ch;
  margin-bottom: 1.5rem;
}
.hero__lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: #C3D0DB;
  max-width: 56ch;
  margin-bottom: 2rem;
}

/* --- signature: Golden Config compliance run ------------------------------ */

.compliance {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  border: var(--rule);
  background: linear-gradient(180deg, #101822 0%, #0B1017 100%);
}
.compliance__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.compliance__head b { color: var(--text); font-weight: 500; }
.compliance__meta { margin-left: auto; }
@media (max-width: 640px) { .compliance__meta { display: none; } }

.compliance__body { display: grid; }
@media (min-width: 820px) {
  .compliance__body { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); }
  .compliance__list { border-right: 1px solid var(--line-soft); border-bottom: 0 !important; }
}

.compliance__list { display: flex; flex-direction: column; border-bottom: 1px solid var(--line-soft); }
.compliance__list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 0.75rem;
  align-items: center;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.compliance__list button:last-child { border-bottom: 0; }
.compliance__list button:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.compliance__list button[aria-selected="true"] {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-left-color: var(--amber);
  color: var(--text);
}
.compliance__list .dev { font-family: var(--mono); font-size: 0.85rem; color: inherit; }
.compliance__list .plat {
  grid-column: 1;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.compliance__list .state {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.state--ok { color: var(--teal); }
.state--drift { color: var(--amber); }

.compliance__pane { padding: 1.1rem 1rem 1.3rem; min-width: 0; min-height: 12.5rem; }
.diff {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.75;
  overflow-x: auto;
}
.diff .l { display: block; white-space: pre; padding-inline: 0.4rem; }
.diff .ctx { color: var(--muted); }
.diff .add { color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, transparent); }
.diff .del { color: var(--crimson); background: color-mix(in srgb, var(--crimson) 10%, transparent); }
.diff__none { font-family: var(--body); color: var(--teal); font-size: 0.9rem; margin: 0; }

/* --- cards --------------------------------------------------------------- */

.grid-3 {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: var(--rule);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  margin-top: 2.5rem;
}
.card { background: var(--ground); padding: 1.75rem 1.6rem 2rem; }
.card__no {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--amber);
  display: block;
  margin-bottom: 1rem;
}
.card h3 { font-size: 1.2rem; margin-bottom: 0.6rem; font-variation-settings: "wdth" 100; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* --- definition rows (platforms, engagement) ----------------------------- */

.rows { border-top: var(--rule); margin-top: 2.5rem; }
.rows > div {
  display: grid;
  gap: 0.4rem 2.5rem;
  padding: 1.5rem 0;
  border-bottom: var(--rule);
}
@media (min-width: 780px) {
  .rows > div { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
}
.rows h3 { font-size: 1.05rem; font-variation-settings: "wdth" 100; }
.rows p { color: var(--muted); font-size: 0.95rem; }

/* --- ProvOSS: a self-contained unit sitting on the section ---------------- */

#provoss { background: var(--surface); }

.pv { border: var(--rule); background: var(--ground); }

.pv__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem clamp(1.1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line-soft);
}
.pv__mark {
  font-family: var(--display);
  font-variation-settings: "wdth" 125;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  padding: 0.3rem 0.65rem;
}
.chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.pv__strip { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line-soft); }

.pv__body {
  display: grid;
  gap: 3rem;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.1rem, 3vw, 2rem) clamp(2rem, 4vw, 3rem);
}
@media (min-width: 960px) {
  .pv__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; }
}
.pv__body p { color: #C3D0DB; }
.pv__h { font-size: 1.35rem; font-variation-settings: "wdth" 100; margin-bottom: 0.9rem; }

/* Components, not a sequence — so no step numbers. */
.stack { list-style: none; margin: 1.75rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.stack li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.stack .name { font-size: 0.98rem; color: var(--text); }
.stack .name small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-top: 0.15rem;
}
.stack .scale {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teal);
  white-space: nowrap;
  border: 1px solid var(--teal-dim);
  padding: 0.2rem 0.5rem;
}
.stack li[data-cmts] .name small::after {
  content: "CMTS";
  display: inline-block;
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  padding: 0.05rem 0.35rem;
  vertical-align: 1px;
}
@media (max-width: 560px) {
  .stack li { grid-template-columns: minmax(0, 1fr); }
  .stack .scale { justify-self: start; }
}

.roadmap {
  margin-top: 2rem;
  border: 1px solid var(--teal-dim);
  padding: 1.25rem 1.4rem;
  background: color-mix(in srgb, var(--teal) 6%, transparent);
}
.roadmap h3 {
  font-size: 0.7rem;
  font-family: var(--mono);
  font-variation-settings: normal;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.6rem;
}
.roadmap p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* --- contact ------------------------------------------------------------- */

#contact { background: var(--surface); }
.contact__mail {
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  font-weight: 600;
  font-size: clamp(1.4rem, 4.6vw, 3rem);
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-block;
  margin: 1.5rem 0 1rem;
  border-bottom: 2px solid var(--amber-dim);
  padding-bottom: 0.1em;
  overflow-wrap: anywhere;
  transition: border-color 0.18s, color 0.18s;
}
.contact__mail:hover { border-color: var(--amber); color: var(--amber); }

footer {
  border-top: var(--rule);
  padding-block: 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* --- current page in nav -------------------------------------------------- */

.nav__links a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--amber);
}

/* --- ProvOSS teaser card (automation page) -------------------------------- */

.pv--teaser {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.pv--teaser:hover { border-color: var(--muted); }
.pv--teaser .pv__body { grid-template-columns: minmax(0, 1fr); padding-block: 2rem; }
.pv--teaser p { max-width: 68ch; }
.pv__more {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.pv__more::after { content: " →"; }
.pv--teaser:hover .pv__more { color: #FFC066; }

/* --- ProvOSS page hero ---------------------------------------------------- */

.pv-hero { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pv-hero__mark {
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-variation-settings: "wdth" 125;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}
.pv__strip--hero { margin-top: clamp(2.5rem, 6vw, 4rem); border: var(--rule); }

.chip--teal { border-color: var(--teal-dim); color: var(--teal); }
.chip--teal::before { background: var(--teal); animation: none; }

/* --- signature: SR-MPLS segment list -------------------------------------
   The stack shrinks as each node SID is popped along the path. That pop is
   the whole idea, so the stack is drawn per hop rather than once.
   ------------------------------------------------------------------------- */

.srpath {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  border: var(--rule);
  background: linear-gradient(180deg, #101822 0%, #0B1017 100%);
}
.srpath__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.srpath__head b { color: var(--text); font-weight: 500; }
.srpath__head span:last-child { margin-left: auto; }
@media (max-width: 640px) { .srpath__head span:last-child { display: none; } }

.srpath__hops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
}
.hop {
  background: #0D1520;
  padding: 1.25rem 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background 0.3s;
}
.hop[data-active="true"] { background: #14202D; }

.hop__node { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.hop__name {
  font-family: var(--display);
  font-variation-settings: "wdth" 110;
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.3s;
}
.hop[data-active="true"] .hop__name { color: var(--text); }
.hop__sid { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); letter-spacing: 0.05em; }

.hop__stack { display: flex; flex-direction: column; gap: 3px; min-height: 5.6rem; }
.lbl {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  transition: opacity 0.3s, border-color 0.3s, color 0.3s;
}
.lbl--top { border-color: var(--amber-dim); color: var(--amber); }
.lbl--svc { border-color: var(--teal-dim); color: var(--teal); }
.lbl--none { border-style: dashed; opacity: 0.45; }

.hop__act {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
}
.hop[data-active="true"] .hop__act { color: var(--amber); }

@media (max-width: 700px) {
  .srpath__hops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hop__stack { min-height: 5rem; }
}

/* --- cross-links between pages -------------------------------------------- */

.teasers {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: stretch;
}
.teasers .pv--teaser { display: flex; flex-direction: column; }
.teasers .pv__body { flex: 1; }
.pv__mark--sm { font-size: clamp(1.25rem, 3vw, 1.65rem); font-variation-settings: "wdth" 115; }
