/* ============================================================
   TRIDENT TOOLS — site layer for tools.tridentsocial.net.
   Loaded after trident-glass.css on every Glass page.

   trident-glass.css is a verbatim copy of the fleet framework
   (canonical in trident-social); edits there drift the fleet.
   Rules that only this site needs live here instead. The film
   budget page has its own paper theme and does not load either.
   Added 2026-10-11 (quality pass, gaps G3/G5/G7/G8/G10/G12/G13/
   G23/G26/G27). test/pages-structure pins the load order.
   ============================================================ */

/* ---------- Brand system: Trident Tools (2026-10-20) ----------
   Trident Studio brand system, product "tools". Reference copy of the
   source files: design/brand/tools/ (DESIGN.md, tokens.css, tokens.json);
   how it is applied: docs/BRAND.md. The framework file stays a verbatim
   copy, so the brand is applied by re-pointing its variables here and
   restating the few framework rules that hard-code an old colour.
   test/brand-system.test.mjs pins every value below to tokens.json.
   Pages must not set their own --tg-a1 / --tg-a2: one accent pair per
   product, and this file is the only place it is written. */
:root {
  /* dark theme (the hub is dark-only): bg / surface / line / text / muted */
  --tg-bg: #0C182B;
  --tg-bg2: #0E2035;
  --tg-line: #13314A;
  --tg-ink: #FFFFFF;
  --tg-muted: #9AA7BD;

  /* the accent pair: links, buttons, focus rings, gradients, tile */
  --tg-a1: #36B3F4;
  --tg-a2: #5B6CFF;
  --tg-on-accent: #0B0B0D;
  /* accent-2 scale step 400: --tg-a2 itself is 4.3:1 on --tg-bg, so small
     text in the second accent uses this step (5.8:1) */
  --tg-a2-text: #7C89FF;

  /* signal: the one status colour this site uses (pending / not verified) */
  --tg-warn: #F5B83D;

  /* glass surfaces follow the brand surface colour */
  --tg-glass: color-mix(in srgb, var(--tg-bg2) 62%, transparent);
  --tg-glass-strong: color-mix(in srgb, var(--tg-bg2) 82%, transparent);

  /* radius and motion: brand scale (radius lg 16 / xl 24, 160 / 320 ms, ease-out) */
  --tg-r: 16px;
  --tg-r-lg: 24px;
  --tg-fast: 160ms;
  --tg-med: 320ms;
  --tg-ease: cubic-bezier(.2, .8, .2, 1);
}

/* Primary buttons and the skip link: accent fill, on-accent text (brand rule). */
.tg-btn-primary, .tg-skip { color: var(--tg-on-accent); }

/* Focus rings use the link colour at 2px (brand rule); the framework used --tg-a2. */
:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible,
[tabindex]:focus-visible, [contenteditable]:focus-visible { outline-color: var(--tg-a1); }

/* Framework rules that hard-code the old surface colour (a navy hex in trident-glass.css). */
.tg-btn-ghost, .tg-menu > summary { background: color-mix(in srgb, var(--tg-bg2) 55%, transparent); }
.tg-input, .tg-select, .tg-textarea { background: color-mix(in srgb, var(--tg-bg2) 70%, transparent); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tg-glass, .tg-nav { background: var(--tg-bg2); }
}

/* Entrance motion is 160 to 320 ms in the brand system; the framework used 600 ms.
   The stagger delays stay; transform and opacity only, reduced motion still wins. */
.tg-rise { animation: tg-rise var(--tg-med) var(--tg-ease) both; }
.tg-rise-1 { animation: tg-rise var(--tg-med) var(--tg-ease) .06s both; }
.tg-rise-2 { animation: tg-rise var(--tg-med) var(--tg-ease) .12s both; }
.tg-rise-3 { animation: tg-rise var(--tg-med) var(--tg-ease) .18s both; }

/* A product's own tile on its status page (Social Cut Commander, Poseidon). The page
   sets background-image; decorative, the product name is the heading right below it. */
.ptile {
  display: block; width: 64px; height: 64px; margin: 0 0 18px; border-radius: 22%;
  background: center / contain no-repeat;
  box-shadow: 0 0 0 1px var(--tg-glass-edge), 0 10px 28px rgba(0, 0, 0, .35);
}

/* ---------- G3: no iOS focus zoom ----------
   iOS Safari zooms the page when a focused field's text is under
   16px. The framework sets 15px, so every calculator field zoomed. */
@media (max-width: 720px) {
  .tg-input, .tg-select, .tg-textarea { font-size: 16px; }
}

/* ---------- breadcrumb (G8) ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 14px; font-size: 13px; color: var(--tg-muted); }
.crumbs a { color: var(--tg-muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.crumbs a:hover { color: var(--tg-ink); }
.crumbs [aria-current] { color: var(--tg-ink); }

/* ---------- card grids without orphan cells (G13) ----------
   .tg-grid's auto-fit gives three columns at 1080px, so two cards
   left an empty third and four cards orphaned the fourth. */
.tg-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tg-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tg-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tg-grid > .wide { grid-column: 1 / -1; }
@media (max-width: 999px) { .tg-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .tg-grid.g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .tg-grid.g2, .tg-grid.g4 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- status pill (G10, G12) ----------
   Pending status is a label, not a button: no href, no hover, no
   pointer. A "Coming soon" .tg-btn with no href read as broken. */
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 0 0 8px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--tg-display); font-weight: 600; font-size: 14px; letter-spacing: .01em;
  padding: 9px 16px; border-radius: var(--tg-r-pill); cursor: default; user-select: none;
  color: var(--tg-warn); border: 1px dashed color-mix(in srgb, var(--tg-warn) 55%, transparent);
  background: color-mix(in srgb, var(--tg-warn) 7%, transparent);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status-row .note { color: var(--tg-muted); font-size: 13.5px; max-width: 520px; line-height: 1.5; }
.status-row .note a { color: var(--tg-a1); }

/* ---------- product visual (G11) ---------- */
.shot { margin: 30px 0 40px; padding: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: var(--tg-r); border: 1px solid var(--tg-glass-edge); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); background: var(--tg-bg2); }
.shot figcaption { margin-top: 10px; font-size: 13px; color: var(--tg-muted); line-height: 1.5; }

/* ---------- release evidence (G10) ----------
   Engineering proof stays on the page, collapsed, so the buyer
   reads the benefit first and the evidence is one click away. */
details.evidence { margin: 0 0 44px; padding: 0; overflow: hidden; }
details.evidence > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; min-height: 28px;
}
details.evidence > summary::-webkit-details-marker { display: none; }
details.evidence > summary .t { font-family: var(--tg-display); font-weight: 700; font-size: 19px; color: var(--tg-ink); }
details.evidence > summary .d { display: block; font-family: var(--tg-body); font-weight: 400; font-size: 13.5px; color: var(--tg-muted); margin-top: 3px; }
details.evidence > summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--tg-muted); border-bottom: 2px solid var(--tg-muted);
  transform: rotate(45deg) translateY(-3px); transition: transform var(--tg-fast) var(--tg-ease);
}
details.evidence[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.evidence > summary:hover .t { color: var(--tg-a1); }
details.evidence .evidence-body { padding: 4px 22px 24px; border-top: 1px solid var(--tg-line); }
details.evidence .evidence-body > h2 { margin: 26px 0 6px; font-size: 21px; }
details.evidence .evidence-body > p { color: var(--tg-muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 12px; }

/* ---------- related tools (G7) ---------- */
.more-tools { margin: 8px 0 28px; }
.more-tools > h2 { margin: 0 0 14px; }
.more-tools .tg-card { display: flex; flex-direction: column; gap: 8px; }
.more-tools .tg-card .eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--tg-a1); }
.more-tools .tg-card h3 { font-family: var(--tg-display); font-size: 18px; margin: 0; }
.more-tools .tg-card p { color: var(--tg-muted); font-size: 14px; line-height: 1.55; margin: 0; }

/* ---------- FAQ (G8) ---------- */
.faq { margin: 0 0 28px; }
.faq > h2 { margin: 0 0 4px; }
.faq .faq-item { padding: 16px 0 0; margin-top: 16px; border-top: 1px solid var(--tg-line); }
.faq .faq-item:first-of-type { border-top: 0; margin-top: 6px; }
.faq .faq-item h3 { font-family: var(--tg-display); font-weight: 600; font-size: 17px; line-height: 1.3; margin: 0 0 6px; }
.faq .faq-item p { color: var(--tg-muted); font-size: 14.5px; line-height: 1.65; margin: 0; }
.faq .faq-item p strong { color: var(--tg-ink); }

/* ---------- studio CTA, two links (G14) ---------- */
.studio-cta .cta-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.studio-cta .cta-links a, .studio-cta > a { display: inline-flex; align-items: center; min-height: 28px; }

/* ---------- compact result bar on phones (G5) ----------
   On a phone the answer sat ~900-1100px down, after the whole form.
   The bar shows it in the first screen and stays pinned under the
   nav while the visitor edits. JS sets --nav-h from the real nav. */
.result-bar { display: none; }
@media (max-width: 900px) {
  .result-bar {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
    position: sticky; top: var(--nav-h, 58px); z-index: 40;
    margin: 0 0 14px; padding: 10px 14px;
    background: color-mix(in srgb, var(--tg-bg2) 92%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--tg-glass-edge); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    font-variant-numeric: tabular-nums;
  }
  .result-bar .rb-main { font-family: var(--tg-display); font-weight: 700; font-size: 20px; color: var(--tg-a1); line-height: 1.2; }
  .result-bar .rb-lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--tg-muted); }
  .result-bar .rb-sub { font-size: 13px; color: var(--tg-ink); }
  .result-bar a { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--tg-a1); text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
}

/* ---------- units inside fields (G26) ---------- */
.unit { position: relative; display: block; }
.unit > .tg-input { padding-right: 54px; }
.unit > .u { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 13px; font-weight: 600; color: var(--tg-muted); letter-spacing: .02em; }

/* ---------- share link (G6) ---------- */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.share-row .share-note { font-size: 12.5px; color: var(--tg-muted); line-height: 1.5; flex: 1 1 220px; }

/* ---------- footer (G23, G27) ----------
   Links were 16px tall (under the 24px WCAG 2.5.8 minimum), and on a
   390px phone the inline row left "Contact" alone on a second line. */
.foot-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 28px; }
@media (max-width: 480px) {
  /* `max-content` tracks cannot shrink, so a single long label — "AE Plugin Fleet"
     at 320px — pushed the row 6px past the viewport and scrolled the whole page
     sideways. minmax(0, …) lets the tracks give way instead, and the link text is
     allowed to wrap. Found by sweeping 320px, which the G1 gate did not cover. */
  .foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); column-gap: 22px; }
  .foot-links a { min-width: 0; overflow-wrap: anywhere; }
}

/* product visual beside its caption (G11) */
.shot.split { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: start; padding: 22px; border-radius: var(--tg-r-lg); }
.shot.split img { box-shadow: 0 12px 36px rgba(0, 0, 0, .45); }
.shot.split figcaption { margin: 0; padding-top: 6px; font-size: 14.5px; line-height: 1.65; max-width: 460px; }
@media (min-width: 761px) { .shot.split.portrait { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } }
.shot.split figcaption strong { display: block; color: var(--tg-ink); font-family: var(--tg-display); font-size: 19px; margin-bottom: 8px; }
@media (max-width: 760px) {
  .shot.split { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; }
  .shot.split img { max-width: 420px; margin: 0 auto; }
}

/* ---------- hub proof strip (AE plugin fleet demos) ----------
   One line under the editor products pointing at the fleet's computed-output page.
   The link carries the "running" claim, so it is a real anchor rather than card
   prose: the demos page is where the evidence lives. */
.hub-proof { color: var(--tg-muted); font-size: 14.5px; line-height: 1.6; margin: 18px 0 0; max-width: 760px; }
.hub-proof a { color: var(--tg-a1); font-weight: 600; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--tg-a1) 35%, transparent); }
