/* ============================================================================
   Novus website — page layer.

   The Novus UI kit (tokens.css) supplies every token and all 34 component
   families. This file adds ONLY what a marketing page needs on top and the kit
   does not define: the section rhythm, the hero, eyebrow/lede type roles, media
   figures, the mobile menu, and the footer.

   Rules this file obeys:
     - No ad-hoc hex or spacing. Every value is a var(--…) from the kit.
     - No decorative gradients (kit guardrail); flat token grounds only.
     - No italics for emphasis; weight does the work.
     - Inline SVG for → ← ✓, because Carlito's subset has no glyph for them.
   ========================================================================== */

/* --- hidden attribute -----------------------------------------------------
   The kit's components set `display` (e.g. `.alert{display:flex}`), and any
   author `display` beats the UA rule behind the `hidden` attribute — so a
   hidden alert would otherwise still paint. Restore the expected behaviour.  */
[hidden] { display: none !important; }

/* --- Screen-reader-only helper -------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* --- Skip link ------------------------------------------------------------ */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--text-on-accent);
  padding: var(--space-2) var(--space-4); border-radius: 0 0 var(--radius-md) 0;
}
.skip:focus { left: 0; }

/* --- Inline icons ---------------------------------------------------------
   Carlito's latin subset has no → ← ✓ glyph, so those are drawn, not typed.
   Sized in em so they track the surrounding type and inherit its colour.      */
.ico {
  width: 1em; height: 1em; flex: none;
  vertical-align: -0.125em;
}

/* --- Section rhythm (LOCKED in the kit) -----------------------------------
   Alternate plain <-> tinted band down the page so no two adjacent sections
   share a ground. Re-check the alternation whenever sections are reordered.   */
.section { padding-block: var(--space-8); }
.section.band { background: var(--bg-subtle); }
.section > .container > * + * { margin-top: var(--space-4); }

.eyebrow {
  margin: 0; font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow--rule { display: flex; align-items: center; gap: var(--space-3); }
.eyebrow--rule::before {
  content: ""; width: var(--space-5); height: 2px;
  background: var(--accent); flex: none;
}
.lede { font-size: var(--text-lg); color: var(--text-secondary); max-width: 62ch; }
.prose { max-width: 68ch; }
/* Vertical rhythm without a measure cap — for columns that are already
   constrained by .container--narrow. */
.flow > * + * { margin-top: var(--space-3); }
.prose > * + * { margin-top: var(--space-3); }

/* --- Hero ----------------------------------------------------------------- */
.hero { padding-block: var(--space-9) var(--space-8); }
.hero__grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
}
.hero h1 { margin: var(--space-3) 0 0; }
.hero__globe { display: block; }

/* Hero money-flow map. The artwork is an inline SVG (its fills reference
   var(--blue-*) and the gradient defs it carries), so it re-tunes with the
   theme. Markers are orange so Novus presence reads apart from the blue land. */
.hero-map { display: block; width: 100%; height: auto; color: var(--accent); }
.hero-map .globe-sphere { stroke: none; }
.hero-map .globe-ring { stroke: var(--accent); stroke-opacity: .30; stroke-width: 1.3; }
.hero-map .land { fill: url(#novaLand); }
.hero-map .grid { fill: none; stroke: var(--accent); opacity: .11; stroke-width: .8; }
.hero-map .rail { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .30; }
.hero-map .flow {
  fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 2 13; animation: novaflow 1.5s linear infinite;
}
.hero-map .node { fill: var(--orange-400); stroke: var(--surface); stroke-width: 1.1; }
.hero-map .hub { fill: var(--orange-400); }
.hero-map .hub-core { fill: var(--text-on-accent); }
.hero-map .ring {
  fill: none; stroke: var(--orange-400); stroke-width: 1.4; opacity: .5;
  transform-box: fill-box; transform-origin: center;
  animation: novapulse 2.8s ease-out infinite;
}
.hero-map .ring--hub { stroke-width: 1.8; animation-duration: 2.2s; }
.hero-map .lbl {
  fill: var(--text-secondary); font-family: var(--font-sans);
  font-size: 8.5px; font-weight: var(--weight-medium);
}
.hero-map .lbl--hub { fill: var(--accent-text); font-size: 9.5px; font-weight: var(--weight-bold); }

@keyframes novaflow { to { stroke-dashoffset: -60; } }
@keyframes novapulse {
  0% { transform: scale(1); opacity: .55; }
  70% { transform: scale(3); opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-map .flow { animation: none; stroke-dasharray: 4 7; opacity: .55; }
  .hero-map .ring { animation: none; opacity: .28; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- Media ---------------------------------------------------------------- */
.media { margin: 0; }
.media img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-md);
}
.media__cap {
  margin-top: var(--space-2);
  font-size: var(--text-sm); color: var(--text-muted); max-width: 62ch;
}

/* A full-bleed photo carries a bottom scrim so text on it stays legible.
   This is a legibility scrim, not decoration. */
.media--overlay { position: relative; border-radius: var(--radius-md); overflow: hidden; }
/* Crop to a band so the scrim covers a useful share of the frame rather than
   leaving the caption stranded in the middle of a tall photograph. */
.media--overlay img {
  border-radius: 0; aspect-ratio: 21 / 9; object-fit: cover; max-height: 30rem;
}
.media--overlay .media__body {
  position: absolute; inset: auto 0 0 0;
  padding: var(--space-5);
  /* The scrim must clear AA across the whole caption box, not just its foot —
     so it stays dense to the top edge and only then fades into the photo. */
  background: linear-gradient(to top,
    color-mix(in srgb, var(--neutral-950) 94%, transparent) 0%,
    color-mix(in srgb, var(--neutral-950) 88%, transparent) 72%,
    color-mix(in srgb, var(--neutral-950) 62%, transparent) 100%);
  color: var(--neutral-0);
}
@media (max-width: 760px) {
  .media--overlay img { aspect-ratio: 4 / 3; }
  .media--overlay .media__body { position: static; background: var(--neutral-950); }
}
.media--overlay .media__body .stat__value,
.media--overlay .media__body .stat__label { color: var(--neutral-0); }

/* --- Why-Novus icons ------------------------------------------------------
   Line icons drawn with currentColor so they re-tune with the accent and the
   theme; sized in rem so they track the type scale.                          */
.why-icon {
  width: 1.9rem; height: 1.9rem; display: block;
  color: var(--accent-text); fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: var(--space-2);
}

/* --- Product page head ---------------------------------------------------- */
.ppage__head { display: grid; gap: var(--space-3); }
.wm-h { display: flex; align-items: center; gap: var(--space-3); margin: 0; }

/* --- Grid helpers ---------------------------------------------------------
   The kit ships .grid (the token-gapped grid); these fix the column count.
   Explicit counts rather than auto-fit, so a 4-item grid never lands as 3 + 1. */
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  /* minmax(0,1fr), not 1fr: a bare 1fr track has an implicit `auto` minimum,
     so a wide child (a table) stretches the track past the viewport. */
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}
/* Asymmetric split: prose beside an aside, stacking on narrow screens. */
.grid--split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) {
  .grid--split, .grid--even { grid-template-columns: minmax(0, 1fr); }
}

/* --- Table scroll container ----------------------------------------------
   A data table is the one thing allowed to be wider than the viewport, inside
   its own scroller — the page body itself must never scroll sideways.        */
.table-wrap { overflow-x: auto; }

/* --- Select wrapper (used by the kit's dropdown, not defined by it) -------- */
.selectwrap { position: relative; display: block; }
.selectwrap::after {
  content: "›";
  position: absolute; right: var(--space-3); top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--text-muted); pointer-events: none;
}

/* --- Disclosure chevron ---------------------------------------------------
   The kit rotates the chevron from `.disclosure[aria-expanded="true"]`, but
   aria-expanded belongs on the button that owns the control, not the wrapper.
   This matches the same treatment to the accessible placement.               */
.disclosure button[aria-expanded="true"] .disclosure-ic { transform: rotate(90deg); }

/* --- Tabs -----------------------------------------------------------------
   The kit documents tabs as a radio-driven facet switcher but wires each
   instance to hard-coded ids. This is the same visual treatment generalised
   with nth-of-type so any number of instances can coexist on one page.
   Panels stay in the DOM, so the content is still indexed and still prints.  */
.xtabs .xradio { position: absolute; opacity: 0; pointer-events: none; }
.xtabs .xlist {
  display: flex; flex-wrap: wrap; gap: var(--space-1);
  border-bottom: 1px solid var(--border); margin-bottom: var(--space-4);
}
.xtabs .xlist label {
  position: relative; cursor: pointer;
  padding: var(--space-2) var(--space-3); min-height: 2.75rem;
  display: inline-flex; align-items: center;
  color: var(--text-secondary); font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: color .15s ease, background-color .15s ease;
}
.xtabs .xlist label:hover {
  color: var(--text); background: var(--bg-subtle);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.xtabs .xlist label::after {
  content: ""; position: absolute;
  left: var(--space-3); right: var(--space-3); bottom: -1px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform .18s ease;
}
.xtabs .xpanel { display: none; }
.xtabs .xradio:nth-of-type(1):checked ~ .xlist label:nth-of-type(1),
.xtabs .xradio:nth-of-type(2):checked ~ .xlist label:nth-of-type(2),
.xtabs .xradio:nth-of-type(3):checked ~ .xlist label:nth-of-type(3) { color: var(--accent-text); }
.xtabs .xradio:nth-of-type(1):checked ~ .xlist label:nth-of-type(1)::after,
.xtabs .xradio:nth-of-type(2):checked ~ .xlist label:nth-of-type(2)::after,
.xtabs .xradio:nth-of-type(3):checked ~ .xlist label:nth-of-type(3)::after { transform: scaleX(1); }
.xtabs .xradio:nth-of-type(1):checked ~ .xpanel:nth-of-type(1),
.xtabs .xradio:nth-of-type(2):checked ~ .xpanel:nth-of-type(2),
.xtabs .xradio:nth-of-type(3):checked ~ .xpanel:nth-of-type(3) {
  display: block; animation: xtabfade .18s ease;
}
.xtabs .xradio:focus-visible ~ .xlist label { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes xtabfade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .xtabs .xlist label, .xtabs .xlist label::after { transition: none; }
  .xtabs .xpanel { animation: none; }
}
@media print { .xtabs .xpanel { display: block !important; } .xtabs .xlist { display: none; } }

/* --- Mobile menu ---------------------------------------------------------- */
.menubtn { display: none; }
.menu { display: contents; }
@media (max-width: 860px) {
  .menubtn { display: inline-flex; }
  .menu {
    display: none; position: absolute; inset: 100% 0 auto 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: var(--space-3) var(--gutter);
  }
  .menu[data-open="true"] { display: block; }
  .menu .nav { flex-direction: column; align-items: stretch; border-bottom: 0; }
}

/* --- LinkedIn cards ------------------------------------------------------- */
.li-card { display: flex; flex-direction: column; gap: var(--space-2); }
.li-card__meta { display: flex; align-items: center; gap: var(--space-2); }
.li-card__when { margin-left: auto; font-size: var(--text-xs); color: var(--text-muted); }
.li-card__by { font-size: var(--text-xs); color: var(--text-muted); }

/* --- Footer --------------------------------------------------------------- */
.foot { background: var(--bg-muted); padding-block: var(--space-7); }
.foot__grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.foot a { color: var(--text-secondary); }
.foot a:hover { color: var(--accent-text); }
.foot__bar {
  margin-top: var(--space-6); padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  justify-content: space-between; font-size: var(--text-sm);
  color: var(--text-muted);
}

/* --- Print ---------------------------------------------------------------- */
@media print {
  .appbar, .menu, .menubtn, .skip, .theme-toggle { display: none !important; }
  details > * { display: revert !important; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: var(--text-xs); color: var(--neutral-500);
  }
  body { background: var(--neutral-0); }
  .card, .section { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
}
