/* ==========================================================================
   CENTNORD v2 — HOMEPAGE
   --------------------------------------------------------------------------
   Loaded after tokens.css and main.css, on the homepage only (for now).
   When the client approves this direction, the nav (H1), footer (H10)
   and section patterns (H3) move into main.css for every page.

   The idea: "The star is the instrument." The page is drawn like an
   engineer's chart: a faint blueprint grid, monospace labels, dashed
   construction lines. The Centnord star sits on it as a working
   instrument. It turns its north tip towards whatever you point at,
   and always returns to true north when you let go.

   Colour roles (hybrid palette, see tokens.css):
     navy  = ink and the dark "chapters"
     blue  = the blueprint layer (grids, lines, diagrams)
     green = the north tip and the one primary call to action

     H1  (moved to main.css §3b)  H6  Outcomes
     H2  Hero: the instrument      H7  Navy chapter: selected work
     H3  Shared section patterns   H8  Navy chapter: process
     H4  Trust strip               H9  FAQ + contact
     H5  Services                  H10 (moved to main.css §12b)
   ========================================================================== */


/* H1 Navigation now lives in main.css §3b (shared by every page). */


/* H2 ──────────────────────────── HERO: THE INSTRUMENT ───────────────────────
   Left: a numbered index (like a drawing's legend), the headline, one CTA.
   Right: the star on a chart. Range rings, degree ticks and crosshairs
   are construction lines, not decoration: they make the bearing readable.
   No compass letters (client decision); bearings are shown in degrees.   */

.hero2 {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid; align-items: center;
  padding-block: clamp(2.5rem, 5vh, 4.5rem);
  /* the blueprint grid */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: center top;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero2-grid {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
}

/* Legend / index — each line previews a destination */
.hero2-index { margin: 0 0 var(--s-7); display: grid; gap: 2px; }
.hero2-index a {
  display: inline-flex; align-items: baseline; gap: var(--s-3);
  width: fit-content;
  padding: 0.2rem 0.5rem 0.2rem 0;
  font-family: var(--mono); font-size: var(--text-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); text-decoration: none;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              padding var(--t-fast) var(--ease);
}
.hero2-index a .n { color: var(--blue-ink); }
.hero2-index a:hover, .hero2-index a:focus-visible, .hero2-index a.is-target {
  color: var(--navy); background: var(--blue-soft); padding-left: 0.5rem;
}

.hero2 h1 {
  font-size: var(--text-4xl);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 13ch;
  margin-bottom: var(--s-5);
}
.hero2 h1 .accent { color: var(--blue); }

.hero2 .lede {
  font-size: var(--text-lg); color: var(--ink-2);
  max-width: 42ch; margin-bottom: var(--s-6);
}
.hero2 .hero-cta { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.hero2 .hero-note {
  font-family: var(--mono); font-size: var(--text-mono);
  letter-spacing: 0.04em; color: var(--ink-3);
}

/* The instrument panel */
.instrument {
  position: relative;
  width: min(100%, 30rem);
  aspect-ratio: 1;
  justify-self: center;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
}
/* registration marks at the four corners */
.instrument::before, .instrument::after,
.instrument .reg::before, .instrument .reg::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-color: var(--blue); border-style: solid; border-width: 0;
}
.instrument::before          { top: -7px;    left: -7px;  border-top-width: 1.5px; border-left-width: 1.5px; }
.instrument::after           { top: -7px;    right: -7px; border-top-width: 1.5px; border-right-width: 1.5px; }
.instrument .reg::before     { bottom: -7px; left: -7px;  border-bottom-width: 1.5px; border-left-width: 1.5px; }
.instrument .reg::after      { bottom: -7px; right: -7px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.instrument .chart { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .ring  { fill: none; stroke: var(--blue); stroke-opacity: 0.28; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ring.dash { stroke-dasharray: 3 5; }
.chart .cross { stroke: var(--blue); stroke-opacity: 0.22; stroke-width: 1; stroke-dasharray: 2 6; vector-effect: non-scaling-stroke; }
.chart .tick  { stroke: var(--blue); stroke-opacity: 0.45; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .tick.major { stroke-opacity: 0.8; }
.chart .vector { stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke;
                 opacity: 0; transition: opacity var(--t-med) var(--ease); }
.chart .target { fill: none; stroke: var(--blue); stroke-width: 1.5; vector-effect: non-scaling-stroke;
                 opacity: 0; transition: opacity var(--t-med) var(--ease); }
.instrument.is-tracking .chart .vector,
.instrument.is-tracking .chart .target { opacity: 1; }

/* The star itself: the exact logo, rotated by home.js */
.instrument .needle {
  position: absolute; left: 50%; top: 50%;
  width: 46%; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--bearing, 0deg));
  will-change: transform;
}
.instrument .needle svg { width: 100%; height: 100%; display: block; overflow: visible; }
.instrument .needle .tip-glow {
  filter: blur(36px); opacity: 0.35;
  transition: opacity var(--t-med) var(--ease);
}
.instrument.at-north .needle .tip-glow { opacity: 0.75; }

/* Read-out: corner labels in mono */
.readout {
  position: absolute; left: var(--s-4); right: var(--s-4); bottom: var(--s-3);
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4);
  font-family: var(--mono); font-size: var(--text-mono); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
  pointer-events: none;
}
.readout b { font-weight: 500; color: var(--navy); }
.readout .brg b { font-size: 1.125rem; letter-spacing: 0.02em; }
.readout .sts b { transition: color var(--t-fast) var(--ease); }
.instrument.at-north .readout .sts b { color: var(--green-ink); }
.readout-top {
  position: absolute; left: var(--s-4); right: var(--s-4); top: var(--s-3);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  pointer-events: none;
}

@media (max-width: 52em) {
  .hero2 { min-height: 0; }
  .hero2-grid { grid-template-columns: 1fr; }
  .instrument { width: min(78vw, 22rem); order: -1; }
  .hero2-index { display: none; }        /* the menu carries these on phones */
}


/* H3 Shared patterns (.label, .head2, .mono) now live in main.css §18. */


/* H4 ────────────────────────────── TRUST STRIP ─────────────────────────────
   Verified facts only (no invented client logos or numbers), set like
   the data line under a drawing's title block.                          */

.trust {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.trust-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.trust-item {
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  border-right: 1px solid var(--line-soft);
}
.trust-item + .trust-item { padding-left: var(--s-5); }
.trust-item:last-child { border-right: 0; }
.trust-item dt {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-1);
}
.trust-item dd { margin: 0; font-weight: 700; color: var(--ink); font-size: var(--text-sm); }
.trust-item.is-north dd { display: inline-flex; align-items: center; gap: 0.5rem; }
.trust-item.is-north dd::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}
@media (max-width: 52em) {
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-item:nth-child(2) { border-right: 0; }
  .trust-item:nth-child(3) { padding-left: 0; }
  .trust-item:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}


/* H5 ──────────────────────────────── SERVICES ──────────────────────────────
   Three cards, each a "sheet". On hover: registration marks snap into the
   corners, the border turns blueprint blue, the line icon redraws.      */

.svc-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 52em) { .svc-grid { grid-template-columns: 1fr; } }

.svc {
  position: relative;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.svc:hover, .svc:focus-visible { border-color: var(--blue); transform: translateY(-3px); }

.svc .marks::before, .svc .marks::after,
.svc::before, .svc::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 0 solid var(--blue);
  opacity: 0; transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.svc::before        { top: -6px; left: -6px; border-top-width: 1.5px; border-left-width: 1.5px; transform: translate(6px, 6px); }
.svc::after         { top: -6px; right: -6px; border-top-width: 1.5px; border-right-width: 1.5px; transform: translate(-6px, 6px); }
.svc .marks::before { bottom: -6px; left: -6px; border-bottom-width: 1.5px; border-left-width: 1.5px; transform: translate(6px, -6px); }
.svc .marks::after  { bottom: -6px; right: -6px; border-bottom-width: 1.5px; border-right-width: 1.5px; transform: translate(-6px, -6px); }
.svc:hover::before, .svc:hover::after, .svc:hover .marks::before, .svc:hover .marks::after,
.svc:focus-visible::before, .svc:focus-visible::after,
.svc:focus-visible .marks::before, .svc:focus-visible .marks::after { opacity: 1; transform: none; }

.svc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--s-3); }
.svc .icon { width: 44px; height: 44px; }
.svc:hover .icon .draw { animation: icon-draw var(--t-slow) var(--ease); }
.svc:hover .icon .node { animation: node-pulse 0.6s var(--ease); }
.svc .n { font-family: var(--mono); font-size: var(--text-mono); color: var(--blue-ink); }
.svc .label { margin: 0; }
.svc .label::after { display: none; }
.svc h3 { font-size: var(--text-xl); margin: 0; }
.svc p:not(.label) { font-size: var(--text-sm); color: var(--ink-2); flex: 1; margin: 0; }
.svc .link-quiet { margin-top: var(--s-3); }


/* H6 ──────────────────────────────── OUTCOMES ──────────────────────────────
   What changes for the client, in four short lines. No invented numbers. */

.outcomes { display: grid; gap: var(--s-6); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 64em) { .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40em) { .outcomes { grid-template-columns: 1fr; } }
.outcome { border-top: 1px solid var(--navy); padding-top: var(--s-4); }
.outcome .mono { display: block; font-size: var(--text-mono); color: var(--blue-ink); margin-bottom: var(--s-3); }
.outcome h3 { font-size: var(--text-base); margin-bottom: var(--s-2); }
.outcome p { font-size: var(--text-sm); margin: 0; }


/* H7 ──────────────────────── NAVY CHAPTER: SELECTED WORK ────────────────────
   The page changes colour for the two "proof" sections, like turning to a
   new chapter. The work shown is clearly labelled as concept
   demonstrations until real, approved case studies replace it.          */

.chapter {
  background-color: var(--navy);
  background-image:
    linear-gradient(var(--grid-line-navy) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-navy) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  color: var(--on-navy);
  padding-block: var(--section-y);
}
.chapter h2, .chapter h3 { color: #fff; }
.chapter .label { color: var(--blue-on-navy); }
.chapter .head2 p:not(.label) { color: var(--on-navy); }
.chapter + .chapter { padding-top: 0; }

.concept-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px dashed var(--blue-on-navy); border-radius: 4px;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue-on-navy);
}

.work-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 64em) { .work-grid { grid-template-columns: 1fr; } }

.case {
  display: flex; flex-direction: column;
  border: 1px solid rgba(141, 189, 235, 0.22);
  background: rgba(255, 255, 255, 0.025);
}
.case .flow {
  display: block; width: 100%; height: auto;
  border-bottom: 1px dashed rgba(141, 189, 235, 0.22);
  background: rgba(13, 38, 69, 0.6);
}
.flow .node rect { fill: var(--navy); stroke: rgba(141, 189, 235, 0.55); stroke-width: 1; }
.flow .node.human rect { stroke: var(--green); }
.flow .node text {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  fill: var(--on-navy); text-anchor: middle; dominant-baseline: middle;
}
.flow .node.human text { fill: var(--green); }
.flow .wire { fill: none; stroke: rgba(141, 189, 235, 0.45); stroke-width: 1; stroke-dasharray: 3 4; }
.flow .pulse { fill: var(--green); }
.flow .cap { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; fill: var(--on-navy-dim); }

.case-body { padding: var(--s-5); display: grid; gap: var(--s-3); }
.case-body .mono { font-size: 0.6875rem; color: var(--blue-on-navy); text-transform: uppercase; }
.case-body h3 { font-size: var(--text-lg); margin: 0; }
.case-body dl { margin: 0; display: grid; gap: var(--s-3); }
.case-body dt {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--on-navy-dim);
}
.case-body dd { margin: 0.125rem 0 0; font-size: var(--text-sm); color: var(--on-navy); }
.case-body dd.target { color: #fff; }

.work-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  flex-wrap: wrap; margin-top: var(--s-6);
}
.work-foot p { margin: 0; font-size: var(--text-sm); color: var(--on-navy-dim); max-width: 52ch; }


/* H8 ──────────────────────── NAVY CHAPTER: PROCESS ─────────────────────────
   Five steps on one bearing line. As you scroll, the line draws itself
   and each step lights up. The last point is the star's tip: delivery is
   "true north". home.js sets --p (0 → 1) on .process.                   */

.process { --p: 0; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-5); padding-top: 2.75rem; }
.process::before, .process::after {
  content: ""; position: absolute; top: 0.75rem; left: 0.75rem; right: 0.75rem; height: 2px;
}
.process::before { background: rgba(141, 189, 235, 0.2); }
.process::after {
  background: linear-gradient(90deg, var(--blue), var(--blue) 80%, var(--green));
  transform-origin: left center; transform: scaleX(var(--p));
}
.pstep { position: relative; }
.pstep .node {
  position: absolute; top: -2.75rem; left: 0;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--navy); border: 2px solid rgba(141, 189, 235, 0.35);
  transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.pstep.is-lit .node { border-color: var(--blue); background: var(--blue); }
.pstep.north .node { border: 0; background: none; border-radius: 0; width: 1.75rem; height: 1.75rem; top: -2.85rem; }
.pstep.north .node svg { width: 100%; height: 100%; }
.pstep.north .node .b { fill: rgba(255,255,255,0.35); transition: fill var(--t-med) var(--ease); }
.pstep.north .node .t { fill: rgba(57,183,143,0.35); transition: fill var(--t-med) var(--ease); }
.pstep.north.is-lit .node .b { fill: #fff; }
.pstep.north.is-lit .node .t { fill: var(--green); }

.pstep .mono { display: block; font-size: var(--text-mono); color: var(--on-navy-dim); margin-bottom: var(--s-2); transition: color var(--t-med) var(--ease); }
.pstep h3 { font-size: var(--text-base); margin-bottom: var(--s-2); color: var(--on-navy-dim); transition: color var(--t-med) var(--ease); }
.pstep p { font-size: var(--text-sm); margin: 0; color: var(--on-navy-dim); transition: color var(--t-med) var(--ease); }
.pstep.is-lit .mono { color: var(--blue-on-navy); }
.pstep.is-lit h3 { color: #fff; }
.pstep.is-lit p { color: var(--on-navy); }
.pstep.north.is-lit .mono { color: var(--green); }

/* Phones and tablets: the bearing line runs down the left edge */
@media (max-width: 52em) {
  .process { grid-template-columns: 1fr; padding-top: 0; padding-left: 2.75rem; gap: var(--s-6); }
  .process::before, .process::after { top: 0.75rem; bottom: 0.75rem; left: 0.6875rem; right: auto; width: 2px; height: auto; }
  .process::after {
    background: linear-gradient(180deg, var(--blue), var(--blue) 80%, var(--green));
    transform-origin: center top; transform: scaleY(var(--p));
  }
  .pstep .node { top: 0; left: -2.75rem; }
  .pstep.north .node { top: -0.125rem; left: -2.875rem; }
}

/* Without JS (or with reduced motion) every step simply shows lit */
html:not(.js) .process { --p: 1; }
html:not(.js) .pstep .node { border-color: var(--blue); background: var(--blue); }
html:not(.js) .pstep h3, html:not(.js) .pstep p { color: var(--on-navy); }


/* H9 ───────────────────────────── FAQ + CONTACT ──────────────────────────── */

.faq-grid { display: grid; gap: clamp(2rem, 5vw, 5rem); grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; }
.faq-grid .head2 { position: sticky; top: calc(var(--header-offset, 0px) + var(--s-6)); transition: top 320ms var(--ease); }
@media (max-width: 52em) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-grid .head2 { position: static; margin-bottom: 0; }
}

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-5);
  padding: var(--s-5) 0;
  font-weight: 700; color: var(--ink); cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--blue-ink); }
/* the star glyph turns 45° when open — a small instrument detail */
.faq summary .glyph { width: 14px; height: 14px; flex: none; color: var(--blue); transition: transform var(--t-med) var(--ease), color var(--t-med) var(--ease); }
.faq details[open] summary .glyph { transform: rotate(45deg); color: var(--green); }
.faq details p { margin: 0 0 var(--s-5); color: var(--ink-2); max-width: 58ch; }

.contact2 { display: grid; gap: clamp(2rem, 5vw, 5rem); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
@media (max-width: 52em) { .contact2 { grid-template-columns: 1fr; } }
.contact2 .panel {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface); border: 1px solid var(--line);
}
.next-steps { margin: var(--s-6) 0; display: grid; gap: var(--s-4); counter-reset: nx; }
.next-steps li { display: grid; grid-template-columns: 2.25rem 1fr; gap: var(--s-3); align-items: baseline; }
.next-steps li::before {
  counter-increment: nx; content: "0" counter(nx);
  font-family: var(--mono); font-size: var(--text-mono); color: var(--blue-ink);
}
.next-steps strong { display: block; color: var(--ink); }
.next-steps span { font-size: var(--text-sm); color: var(--ink-2); }
.contact-person {
  display: flex; align-items: center; gap: var(--s-4);
  padding-top: var(--s-5); border-top: 1px solid var(--line);
}
.contact-person .avatar {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border: 1px dashed var(--blue); border-radius: 50%;
  font-family: var(--mono); font-size: 0.625rem; color: var(--blue-ink);
}
.contact-person p { margin: 0; font-size: var(--text-sm); }
.placeholder { color: var(--blue-ink); font-family: var(--mono); font-size: 0.8125rem; }


/* H10 Footer now lives in main.css §12b (shared by every page). */
