/* ============================================================================
   Nauvis — shell
   ----------------------------------------------------------------------------
   A drafting sheet. The company mark is architectural (three strokes, squared
   terminals, mitered joins — an N built like a girder), so the site is built
   the same way: hairline rules, corner registration marks, monospace metadata
   in the margins, and products catalogued as numbered entries.

   Products theme themselves by overriding the --accent-* group only; see
   product-bridge-co.css. Adding app #2 is a palette, not a design pass.
   ========================================================================= */

:root {
  /* Shell — near-black with a cool cast, deliberately not warm. Gold belongs
     to Bridge Co; the company chrome must not compete with its own products. */
  --ink:          #0B0E10;
  --ink-raised:   #12171A;
  --rule:         #232B30;
  --rule-bright:  #38444B;
  --text:         #E8EDEF;
  --text-dim:     #8A979E;
  --text-faint:   #5A666C;

  /* Blueprint cyan. One accent, used sparingly — it marks the live thing on
     the page and nothing else. */
  --accent:       #5FD3E8;
  --accent-deep:  #2E9FB5;

  /* Products override these three. */
  --pa-bg:        var(--ink-raised);
  --pa-fg:        var(--accent);
  --pa-ink:       var(--ink);

  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* One 8px rhythm; every vertical value is a multiple. */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 68ch;
  --page: 1240px;
}

/* --- reset ---------------------------------------------------------------- */

*, *::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(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  /* The drafting-sheet ground: a faint grid, and a cool pool of light behind
     the top of the page so the sheet reads as lit rather than flat. */
  background-image:
    radial-gradient(120ch 60ch at 50% -10%, rgba(95, 211, 232, 0.07), transparent 70%),
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 100% 100%, 100% 96px, 96px 100%;
  background-position: 0 0, 0 0, 0 0;
}
/* The grid is a texture, not a feature — barely there, and gone on small
   screens where it competes with the content for a narrow viewport. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--ink);
  opacity: 0.86;
  z-index: -1;
}

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

a { color: inherit; }

/* --- layout --------------------------------------------------------------- */

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

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* Metadata label — the marginalia voice of the whole site. */
.label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

/* --- masthead ------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.75rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand__mark { width: 28px; height: 28px; display: block; color: var(--accent); }

.brand__word {
  font-family: var(--sans);
  font-weight: 700;
  font-stretch: 112%;
  font-size: 1.0625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.masthead nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.masthead nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.masthead nav a:hover,
.masthead nav a:focus-visible { color: var(--text); border-bottom-color: var(--accent); }

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

.hero { padding-block: clamp(3.5rem, 12vh, 8rem) clamp(3rem, 8vh, 5.5rem); }

.hero__mark {
  width: clamp(72px, 12vw, 116px);
  height: auto;
  color: var(--accent);
  margin-bottom: 2.5rem;
}

.hero__title {
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  font-weight: 700;
  font-stretch: 118%;
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.hero__lede {
  font-size: clamp(1.0625rem, 2vw, 1.375rem);
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 46ch;
  margin: 0;
  text-wrap: pretty;
}

/* --- product index -------------------------------------------------------- */

.index { padding-block: clamp(2rem, 6vh, 4rem) clamp(4rem, 12vh, 7rem); }

.index__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
}

.entry {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background-color 0.25s ease;
}
.entry:last-of-type { border-bottom: 1px solid var(--rule); }

/* The accent bleeds in from the left edge on hover — the row lights up like a
   selected line on a schematic, rather than lifting like a card. */
.entry::before {
  content: "";
  position: absolute;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  top: -1px;
  bottom: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--row-accent, var(--accent)) 12%, transparent), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.entry:hover::before,
.entry:focus-visible::before { opacity: 1; }

.entry__no {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.entry__body { min-width: 0; }

.entry__name {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  font-stretch: 108%;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  line-height: 1.1;
}
.entry:hover .entry__name { color: var(--row-accent, var(--accent)); }

.entry__desc { margin: 0; color: var(--text-dim); font-size: 0.9375rem; }

.entry__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--row-accent, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--row-accent, var(--accent)) 18%, transparent);
}

.entry__arrow {
  font-family: var(--mono);
  color: var(--text-faint);
  transition: transform 0.25s ease, color 0.25s ease;
}
.entry:hover .entry__arrow { transform: translateX(4px); color: var(--row-accent, var(--accent)); }

/* A dimmed placeholder row for the app that has no name yet. */
.entry--pending { opacity: 0.42; pointer-events: none; }
.entry--pending .status::before { background: var(--text-faint); box-shadow: none; }

/* --- prose (legal + support) ---------------------------------------------- */

.prose { max-width: var(--measure); padding-block: clamp(2.5rem, 7vh, 4.5rem) clamp(4rem, 10vh, 6rem); }

.prose h1 {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}

.prose__meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin: 0 0 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.prose section { margin-bottom: 2.75rem; }

.prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 0.75rem;
  display: flex;
  gap: 0.875rem;
  align-items: baseline;
}
/* Numbered sections, drafting-sheet style: the figure sits in the margin. */
.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  counter-increment: sec;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex: none;
}
.prose { counter-reset: sec; }

.prose p, .prose li { color: var(--text-dim); margin: 0 0 1rem; text-wrap: pretty; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.5rem; }

.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }

/* A boxed aside for the things a reader most needs to be able to find. */
.note {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  background: var(--ink-raised);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
}
.note p:last-child { margin-bottom: 0; }

/* --- footer --------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}
.foot nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.foot a { color: var(--text-dim); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* --- load choreography ---------------------------------------------------- */

/* The mark draws itself: it is three real strokes, so each has a length to
   animate along. 620 comfortably exceeds the longest of them. */
.draw path, .draw polyline, .draw line {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.draw polyline:nth-of-type(2) { animation-delay: 0.13s; }
.draw line { animation-delay: 0.26s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

.rise {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Staggered, but shallow — six steps, then it stops. A long stagger reads as
   a slow page rather than a considered one. */
.rise:nth-child(1) { animation-delay: 0.08s; }
.rise:nth-child(2) { animation-delay: 0.16s; }
.rise:nth-child(3) { animation-delay: 0.24s; }
.rise:nth-child(4) { animation-delay: 0.32s; }
.rise:nth-child(5) { animation-delay: 0.40s; }
.rise:nth-child(6) { animation-delay: 0.48s; }

/* One switch turns all of it off. Anything animated above must be legible in
   its final state without the animation ever running. */
@media (prefers-reduced-motion: reduce) {
  .draw path, .draw polyline, .draw line {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }
  .rise { opacity: 1; transform: none; animation: none; }
}

/* --- focus ---------------------------------------------------------------- */

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

/* --- narrow --------------------------------------------------------------- */

@media (max-width: 640px) {
  body { background-size: 100% 100%, 100% 72px, 72px 100%; font-size: 16px; }

  /* The three-column entry collapses: the figure moves above the name rather
     than stealing a quarter of a 390px viewport. */
  .entry {
    grid-template-columns: 1fr auto;
    row-gap: 0.5rem;
  }
  .entry__no { grid-column: 1 / -1; }
  .entry__meta { grid-column: 1 / -1; }
  .masthead { padding-block: 1.25rem; }
  .masthead nav { gap: 1.25rem; }
}
