/* ==========================================================================
   AI VISIBILITY — landing page styles (ai-visibility.html only)
   Loaded AFTER /css/styles.css, which still supplies the nav and footer.

   Direction: "deep water and a signal flare".
     - One dominant colour: near-black ocean navy, layered with chart
       contours, a measurement grid and fine grain.
     - One accent: signal coral, used only where something is missing or
       demands action. Cyan from the main site marks competitors and data.
     - Fraunces (editorial serif) for display, Geist for text, Geist Mono for
       data. The @font-face rules live in styles.css (shared by every page).
   ========================================================================== */


.vis {
  --abyss:   #050d1a;   /* dominant: page background */
  --deep:    #0a1a2f;   /* raised surfaces */
  --trench:  #0f2440;   /* panels, table rows */
  --line:    rgba(141, 169, 196, 0.16);   /* hairlines */
  --line-2:  rgba(141, 169, 196, 0.28);
  --ink:     #e9f0f7;   /* primary text */
  --ink-2:   #9fb4ca;   /* secondary text */
  --ink-3:   #6f86a0;   /* tertiary / captions */
  --flare:   #ff6a3d;   /* accent: missing, action */
  --flare-2: #ff8659;
  --tide:    #33c4e0;   /* competitors, data */
  --tide-dim: rgba(51, 196, 224, 0.14);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 48px);

  background-color: var(--abyss);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  position: relative;
  overflow-x: clip;
}

/* Layered background: chart contours + measurement grid + grain.
   Fixed to the viewport so content glides over it. */
.vis::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(29, 78, 137, 0.45), transparent 60%),
    radial-gradient(900px 600px at -10% 40%, rgba(19, 49, 92, 0.55), transparent 65%),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'><g fill='none' stroke='%238da9c4' stroke-opacity='0.07' stroke-width='1'><path d='M-50 620 C 200 560, 380 700, 620 610 S 1000 520, 1260 600'/><path d='M-50 660 C 210 600, 390 740, 630 650 S 1010 560, 1260 640'/><path d='M-50 700 C 220 640, 400 780, 640 690 S 1020 600, 1260 680'/><path d='M-50 180 C 180 120, 420 240, 660 160 S 1040 90, 1260 170'/><path d='M-50 220 C 190 160, 430 280, 670 200 S 1050 130, 1260 210'/><path d='M-50 260 C 200 200, 440 320, 680 240 S 1060 170, 1260 250'/><path d='M180 420 C 260 360, 380 380, 420 430 S 360 520, 260 500 S 120 470, 180 420Z'/><path d='M150 425 C 240 330, 410 350, 455 430 S 380 560, 255 535 S 90 480, 150 425Z'/><path d='M880 380 C 960 330, 1060 360, 1080 410 S 1010 490, 930 470 S 830 420, 880 380Z'/></g></svg>") center / cover no-repeat,
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 96px 96px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0,0,0,0.55) 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0,0,0,0.55) 100%);
}
.vis::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.vis > * { position: relative; z-index: 1; }

/* The shared nav sits on the dark page without a seam. */
.vis nav { background: rgba(5, 13, 26, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }

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

.vis a { color: inherit; }
.vis ::selection { background: var(--flare); color: var(--abyss); }

/* --- Shared type ------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tag::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--flare);
}
.display {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  font-weight: 360;
  letter-spacing: -0.025em;
  line-height: 0.98;
  color: var(--ink);
}
.display em { font-style: italic; font-weight: 300; color: var(--flare); }

/* --- Buttons ----------------------------------------------------------- */
.v-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: var(--abyss);
  background: var(--flare);
  border-radius: 2px;
  box-shadow: 0 0 0 0 rgba(255, 106, 61, 0.5);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
}
.v-btn:hover { background: var(--flare-2); transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(255, 106, 61, 0.7); }
.v-btn .arrow { transition: transform 0.25s var(--ease); }
.v-btn:hover .arrow { transform: translateX(4px); }
.v-link {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.v-link:hover { color: var(--ink); border-color: var(--tide); }
.v-btn:focus-visible, .v-link:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 3px;
}

/* ==========================================================================
   HERO — off-centre headline, answer console bleeding into the next section
   ========================================================================== */
.v-hero { padding: clamp(56px, 9vw, 120px) 0 0; }
.v-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.v-hero h1 {
  font-size: clamp(2.7rem, 6.4vw, 5.9rem);
  margin: 26px 0 28px;
}
.v-hero .lede-v {
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 34ch;
  margin-bottom: 36px;
}
.v-hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 30px; }

/* The answer console */
.console {
  margin-top: clamp(0px, 4vw, 56px);
  margin-bottom: -120px;              /* overlaps the statement band */
  background: linear-gradient(180deg, rgba(15, 36, 64, 0.92), rgba(10, 26, 47, 0.96));
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.86rem;
  transform: rotate(-0.6deg);
}
.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.console-bar .live { display: inline-flex; align-items: center; gap: 8px; color: var(--tide); }
.console-bar .live i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--tide);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.console-q {
  padding: 18px 18px 6px;
  color: var(--ink);
  font-size: 0.95rem;
}
.console-q span { color: var(--ink-3); margin-right: 10px; }
.console-a {
  padding: 8px 18px 20px;
  min-height: 230px;
  color: var(--ink-2);
  line-height: 1.7;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.console-a .who {
  color: var(--tide);
  background: var(--tide-dim);
  padding: 0 4px;
  border-radius: 2px;
}
.console-a .caret {
  display: inline-block;
  width: 8px; height: 1.05em;
  vertical-align: -2px;
  background: var(--ink-2);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.console-readout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 14px 18px;
  border-top: 1px dashed var(--line-2);
  background: rgba(5, 13, 26, 0.55);
  font-size: 0.78rem;
}
.console-readout dt { color: var(--ink-3); }
.console-readout dd { text-align: right; color: var(--ink); }
.console-readout .miss { color: var(--flare); }

/* ==========================================================================
   STATEMENT BAND — full-bleed, oversized type
   ========================================================================== */
.statement {
  padding: 200px 0 110px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(10, 26, 47, 0.6));
}
.statement p.display {
  font-size: clamp(2rem, 4.6vw, 4.1rem);
  max-width: 19ch;
}
.statement .aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  margin-top: 56px;
  max-width: 760px;
  margin-left: auto;
}
.statement .aside p { color: var(--ink-2); line-height: 1.65; font-size: 1.02rem; }
.statement .aside strong { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   SCOREBOARD — narrow copy column, wide table that breaks the column edge
   ========================================================================== */
.board { padding: clamp(80px, 10vw, 140px) 0 clamp(60px, 8vw, 110px); }
.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.board h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); margin: 20px 0 18px; }
.board .copy p { color: var(--ink-2); line-height: 1.65; margin-bottom: 16px; }
.board .copy .note { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); line-height: 1.6; }

.panel {
  background: rgba(10, 26, 47, 0.88);
  border: 1px solid var(--line-2);
  margin-right: calc(-1 * var(--gutter));   /* bleeds past the column edge */
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head .meta { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.04em; }

/* Segmented toggle */
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border: 1px solid var(--line-2);
  background: rgba(5, 13, 26, 0.7);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.seg button {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s;
}
.seg button[aria-pressed="true"] { color: var(--abyss); }
.seg .thumb {
  position: absolute;
  z-index: 0;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: var(--ink);
  transition: transform 0.4s var(--ease), background 0.3s;
}
.seg[data-side="comp"] .thumb { transform: translateX(100%); background: var(--tide); }
.seg .sm { display: none; }
@media (max-width: 640px) {
  .seg .lg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .seg .sm { display: inline; }
}

/* The table */
.score { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.score th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.score td { padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.score tr:last-child td { border-bottom: 0; }
.score tbody tr { transition: background 0.2s; }
.score tbody tr:hover { background: rgba(51, 196, 224, 0.04); }
.score .q { color: var(--ink); line-height: 1.4; }
.score .q small { display: block; margin-top: 4px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
.score .num { font-family: var(--mono); color: var(--ink-3); width: 1%; white-space: nowrap; }

.dots { display: inline-flex; gap: 6px; }
.dot {
  width: 12px; height: 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  transition: background 0.35s var(--ease), border-color 0.35s, transform 0.35s var(--ease);
  transition-delay: var(--d, 0ms);
}
.dot.on { background: var(--ink); border-color: var(--ink); transform: scale(1.05); }
.side-comp .dot.on { background: var(--tide); border-color: var(--tide); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.miss { color: var(--flare); border-color: rgba(255, 106, 61, 0.45); background: rgba(255, 106, 61, 0.07); }
.badge.hit { color: var(--tide); border-color: rgba(51, 196, 224, 0.45); background: var(--tide-dim); }

.named { font-size: 0.85rem; color: var(--ink-2); }
.panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
}
.panel-foot .legend { display: inline-flex; align-items: center; gap: 8px; }
.panel-foot .legend .dot { width: 9px; height: 9px; }

/* ==========================================================================
   SOURCES — ranked bars against one oversized figure
   ========================================================================== */
.sources { padding: clamp(60px, 8vw, 110px) 0; border-top: 1px solid var(--line); }
.sources-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.sources h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); margin: 18px 0 14px; max-width: 18ch; }
.sources .copy p { color: var(--ink-2); line-height: 1.65; max-width: 52ch; margin-bottom: 30px; }
.bars { list-style: none; display: grid; gap: 12px; }
.bars li {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr auto;
  gap: 16px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.bars .d { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 8px; background: rgba(141, 169, 196, 0.1); position: relative; overflow: hidden; }
.bars .fill {
  position: absolute; inset: 0 auto 0 0;
  width: var(--w);
  background: linear-gradient(90deg, rgba(51, 196, 224, 0.5), var(--tide));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.bars .n { color: var(--ink-3); min-width: 2ch; text-align: right; }
.in .bars .fill { transform: scaleX(1); }
.bars li.you .d { color: var(--flare); }
.bars li.you .n { color: var(--flare); }

.figure { text-align: right; }
.figure .big {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "WONK" 1;
  font-weight: 300;
  font-size: clamp(7rem, 17vw, 15rem);
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--flare);
}
.figure p { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-2); max-width: 26ch; margin-left: auto; line-height: 1.6; margin-top: 18px; }

/* ==========================================================================
   METHOD — giant numeral rail
   ========================================================================== */
.method { padding: clamp(80px, 10vw, 140px) 0; border-top: 1px solid var(--line); }
.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 90px);
}
.method h2 { font-size: clamp(2.2rem, 4.4vw, 3.9rem); position: sticky; top: 110px; margin-top: 18px; }
.steps-v { list-style: none; counter-reset: s; border-left: 1px solid var(--line-2); }
.steps-v li {
  counter-increment: s;
  position: relative;
  padding: 0 0 56px 40px;
}
.steps-v li:last-child { padding-bottom: 0; }
.steps-v li::before {
  content: "0" counter(s);
  position: absolute;
  left: 40px;
  top: -0.18em;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 4.2rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
}
.steps-v li::after {
  content: "";
  position: absolute;
  left: -5px; top: 10px;
  width: 9px; height: 9px;
  background: var(--abyss);
  border: 1.5px solid var(--tide);
  border-radius: 50%;
}
.steps-v h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0 0 10px 96px;
  color: var(--ink);
}
.steps-v p { color: var(--ink-2); line-height: 1.65; margin-left: 96px; max-width: 46ch; }
.steps-v .spec { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0 96px; }

/* ==========================================================================
   LEDGER — what we do / what we won't promise
   ========================================================================== */
.ledger { padding: clamp(60px, 8vw, 110px) 0; border-top: 1px solid var(--line); }
.ledger-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line-2);
}
.ledger-col { padding: clamp(24px, 3vw, 40px); }
.ledger-col + .ledger-col { border-left: 1px solid var(--line-2); background: rgba(255, 106, 61, 0.035); }
.ledger h3 { font-family: var(--mono); font-weight: 500; font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 22px; }
.ledger ul { list-style: none; }
.ledger li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.55;
}
.ledger li span { font-family: var(--mono); color: var(--tide); }
.ledger-col + .ledger-col li span { color: var(--flare); }
.ledger li small { display: block; color: var(--ink-2); font-size: 0.9rem; margin-top: 2px; }

/* ==========================================================================
   CLOSE
   ========================================================================== */
.close { padding: clamp(90px, 12vw, 170px) 0 clamp(90px, 10vw, 140px); border-top: 1px solid var(--line); }
.close-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 48px; align-items: end; }
.close h2 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
.close p { color: var(--ink-2); line-height: 1.65; margin-bottom: 28px; }
.close .alt { margin-top: 18px; font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); }
.close .alt a { color: var(--ink); }

/* Footer on the dark page */
.vis footer { background: transparent; border-top: 1px solid var(--line); }
.vis .foot-wave { opacity: 0.25; }

/* ==========================================================================
   MOTION — staggered reveal. Content is visible without JS; the hidden
   starting state applies only once JS has marked the page ready.
   ========================================================================== */
.js .rv { opacity: 0; transform: translateY(22px); filter: blur(4px); }
.js .rv.in {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .console.rv { transform: translateY(28px) rotate(-0.6deg); }
.js .console.rv.in { transform: rotate(-0.6deg); }

@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .rv.in, .js .console.rv { opacity: 1; transform: none; filter: none; transition: none; }
  .js .console.rv, .js .console.rv.in { transform: rotate(-0.6deg); }
  .bars .fill { transform: scaleX(1); transition: none; }
  .dot, .seg .thumb { transition: none; }
  .console-bar .live i, .console-a .caret { animation: none; }
}

/* ==========================================================================
   SMALL SCREENS
   ========================================================================== */
@media (max-width: 960px) {
  .v-hero-grid, .board-grid, .sources-grid, .method-grid, .close-grid { grid-template-columns: 1fr; }
  .console { margin-bottom: -80px; transform: none; }
  .js .console.rv, .js .console.rv.in { transform: none; }
  .statement { padding-top: 150px; }
  .statement .aside { grid-template-columns: 1fr; gap: 18px; margin-left: 0; }
  .panel { margin-right: 0; }
  .method h2 { position: static; }
  .figure { text-align: left; }
  .figure p { margin-left: 0; }
}
@media (max-width: 640px) {
  .ledger-grid { grid-template-columns: 1fr; }
  .ledger-col + .ledger-col { border-left: 0; border-top: 1px solid var(--line-2); }
  .score .named-col { display: none; }
  .score td, .score th { padding: 14px 12px; }
  .score .num { display: none; }
  .bars li { grid-template-columns: minmax(0, 1fr) 70px auto; gap: 10px; }
  .steps-v li { padding-left: 26px; }
  .steps-v li::before { left: 26px; font-size: 3rem; }
  .steps-v h3, .steps-v p, .steps-v .spec { margin-left: 70px; }
  .panel-head { padding: 14px 12px; }
  .seg button { padding: 8px 10px; }
}
