/* assets/deep-dive.css
   Deep Dive one-pager styling. A scoped port of the CVS reader breakdown sheet
   (Public/Drafts/cvs-breakdown/index.html), the brass-gold editorial look that
   is the agreed visual target. Every selector is prefixed dd- and scoped under
   .dd-root so the brass palette and serif type live inside the result surface
   without fighting the site dark theme or yb.css.

   Fonts are loaded by deep-dive.html. The palette variables are local to
   .dd-root so nothing leaks into the rest of the page.

   Voice contract: no em-dashes, no en-dashes, no ellipsis glyph in any comment
   or content. */

.dd-root {
  --dd-ink: #0c0c0e;
  --dd-panel: #151418;
  --dd-panel-2: #1b1a1f;
  --dd-line: #2c2a2f;
  --dd-paper: #ece5d6;
  --dd-paper-dim: #b9b2a4;
  --dd-paper-mute: #857f74;
  --dd-brass: #c8a24c;
  --dd-brass-bright: #e3c075;
  --dd-brass-deep: #9a7526;
  --dd-green: #7fa86a;
  --dd-red: #c96a55;

  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(200, 162, 76, 0.10), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, rgba(200, 162, 76, 0.06), transparent 60%),
    var(--dd-ink);
  color: var(--dd-paper);
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  line-height: 1.62;
  border: 1px solid var(--dd-line);
  border-radius: 14px;
  padding: 44px 30px 40px;
  margin: 30px auto 0;
  max-width: 1120px;
  position: relative;
  overflow: hidden;
}

/* grain */
.dd-root::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.dd-sheet { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; }

/* masthead */
.dd-mast {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 1px solid var(--dd-line); padding-bottom: 14px; margin-bottom: 6px;
}
.dd-wordmark { display: flex; align-items: center; gap: 11px; }
.dd-bull {
  font-family: "Fraunces"; font-weight: 900; font-size: 13px; letter-spacing: 0.42em;
  text-transform: uppercase; color: var(--dd-brass-bright);
}
.dd-bull .div { color: var(--dd-paper-mute); margin: 0 2px; }
.dd-seal {
  width: 30px; height: 30px; border: 1.5px solid var(--dd-brass); border-radius: 50%;
  display: grid; place-items: center; font-family: "Fraunces"; font-weight: 900; font-size: 14px;
  color: var(--dd-brass-bright); box-shadow: inset 0 0 0 3px rgba(200, 162, 76, 0.12);
}
.dd-meta {
  font-family: "IBM Plex Mono"; font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dd-paper-mute); text-align: right; line-height: 1.8;
}

/* headline block */
.dd-headline {
  display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end;
  border-bottom: 2px solid var(--dd-brass-deep); padding-bottom: 26px; margin-top: 26px;
}
.dd-headline h1 {
  font-family: "Fraunces"; font-weight: 900; font-size: 58px; line-height: 0.95;
  letter-spacing: -0.015em; color: var(--dd-paper); margin: 0;
}
.dd-headline h1 em { font-style: italic; font-weight: 500; color: var(--dd-brass-bright); }
.dd-tickerchip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-family: "IBM Plex Mono"; font-size: 12px; letter-spacing: 0.05em;
}
.dd-tickerchip .tk {
  background: var(--dd-brass-deep); color: #fff; font-weight: 600;
  padding: 3px 9px; border-radius: 3px; letter-spacing: 0.08em;
  box-shadow: 0 2px 14px rgba(154, 117, 38, 0.35);
}
.dd-tickerchip .sub { color: var(--dd-paper-mute); letter-spacing: 0.14em; text-transform: uppercase; }

.dd-verdict { text-align: right; min-width: 230px; }
.dd-verdict .label {
  font-family: "IBM Plex Mono"; font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--dd-paper-mute); margin-bottom: 7px;
}
.dd-verdict .call {
  font-family: "Fraunces"; font-weight: 900; font-size: 30px; line-height: 1;
  color: var(--dd-brass-bright);
}
.dd-verdict .dd-call-buy { color: var(--dd-green); }
.dd-verdict .dd-call-avoid { color: var(--dd-red); }
.dd-verdict .trim {
  display: block; font-family: "Newsreader"; font-style: italic; font-weight: 400;
  font-size: 16px; color: var(--dd-paper-dim); margin-top: 8px;
}

/* delta lead card: standing committee verdict vs the dive read. Flat panel
   colors only, verdict-card adjacent, brass rail on the left. */
.dd-delta {
  margin: 26px 0 0; background: var(--dd-panel); border: 1px solid var(--dd-line);
  border-radius: 10px; padding: 20px 26px 18px; position: relative; overflow: hidden;
}
.dd-delta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dd-brass); }
.dd-delta-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 22px; align-items: start;
}
.dd-delta-side .lbl {
  font-family: "IBM Plex Mono"; font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--dd-paper-mute); margin-bottom: 8px;
}
.dd-delta-side .val { font-family: "Fraunces"; font-weight: 900; font-size: 24px; color: var(--dd-paper); line-height: 1.1; }
.dd-delta-side .val .num { color: var(--dd-brass-bright); }
.dd-delta-side .val .of { font-size: 14px; font-weight: 500; color: var(--dd-paper-mute); margin-left: 2px; }
.dd-delta-side .val .stance {
  font-family: "IBM Plex Mono"; font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dd-paper-dim); margin-left: 6px;
}
.dd-delta-side .val .call { color: var(--dd-brass-bright); }
.dd-delta-side .line {
  font-family: "IBM Plex Mono"; font-size: 11px; letter-spacing: 0.06em;
  color: var(--dd-paper-mute); margin-top: 5px;
}
.dd-delta-side .line.dir-up { color: var(--dd-green); }
.dd-delta-side .line.dir-down { color: var(--dd-red); }
.dd-delta-side .line.dir-hold { color: var(--dd-paper-dim); }
.dd-delta-side.dive { text-align: right; }
.dd-delta-mid { align-self: center; }
.dd-delta-chip {
  display: inline-block; font-family: "IBM Plex Mono"; font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--dd-line); white-space: nowrap;
}
.dd-delta-chip.agree { color: var(--dd-green); border-color: var(--dd-green); }
.dd-delta-chip.disagree { color: var(--dd-red); border-color: var(--dd-red); }
.dd-delta-reason {
  margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--dd-line);
  font-size: 15px; color: var(--dd-paper-dim); line-height: 1.5;
}
.dd-delta-reason + .dd-delta-reason { margin-top: 8px; padding-top: 8px; border-top: none; }

/* variant perception extension: the dive's addition under the curated read */
.dd-variant-ext { margin-top: 12px; }
.dd-variant-ext .ext-lbl {
  display: inline-block; font-family: "IBM Plex Mono"; font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--dd-brass);
  margin-right: 6px;
}

/* price ribbon */
.dd-ribbon {
  margin: 30px 0 6px; background: var(--dd-panel); border: 1px solid var(--dd-line);
  border-radius: 10px; padding: 22px 26px 26px; position: relative; overflow: hidden;
}
.dd-ribbon::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dd-brass); }
.dd-ribbon .rh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.dd-ribbon .rh .t {
  font-family: "IBM Plex Mono"; font-size: 10.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dd-paper-mute);
}
.dd-ribbon .rh .now { font-family: "Fraunces"; font-weight: 900; font-size: 34px; color: var(--dd-paper); }
.dd-ribbon .rh .now span { font-size: 15px; color: var(--dd-paper-mute); font-weight: 400; letter-spacing: 0.04em; }
.dd-ribbon .track {
  position: relative; height: 8px; background: linear-gradient(90deg, #2a2a30, #3a3326);
  border-radius: 99px; margin: 34px 4px 6px;
}
.dd-ribbon .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--dd-brass-deep), var(--dd-brass), var(--dd-brass-bright));
  border-radius: 99px; box-shadow: 0 0 18px rgba(200, 162, 76, 0.4);
}
.dd-ribbon .dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%); width: 15px; height: 15px;
  border-radius: 50%; background: var(--dd-brass-bright); border: 3px solid var(--dd-ink);
  box-shadow: 0 0 0 2px var(--dd-brass), 0 0 16px rgba(227, 192, 117, 0.7);
}
.dd-ribbon .mk { position: absolute; transform: translateX(-50%); text-align: center; top: 20px; }
.dd-ribbon .mk .v { font-family: "IBM Plex Mono"; font-size: 13px; color: var(--dd-paper); font-weight: 600; }
.dd-ribbon .mk .l {
  font-family: "IBM Plex Mono"; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dd-paper-mute); margin-top: 3px;
}
.dd-ribbon .mk.lo { left: 0; transform: translateX(0); text-align: left; }
.dd-ribbon .mk.hi { right: 0; left: auto; transform: translateX(0); text-align: right; }

/* lead */
.dd-lead {
  font-size: 21px; line-height: 1.5; color: var(--dd-paper); font-family: "Newsreader";
  font-weight: 400; border-left: 2px solid var(--dd-brass); padding-left: 18px; margin: 30px 0 4px;
}
.dd-lead em { font-style: italic; color: var(--dd-brass-bright); }

/* columns */
.dd-cols { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 34px; margin-top: 36px; align-items: start; }

.dd-sheet h2 {
  font-family: "Fraunces"; font-weight: 600; font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dd-brass); margin: 0 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.dd-sheet h2::before { content: ""; width: 18px; height: 1px; background: var(--dd-brass-deep); }
.dd-block { margin-bottom: 30px; }
.dd-block p { color: var(--dd-paper-dim); font-size: 16.5px; }
.dd-block p strong { color: var(--dd-paper); font-weight: 500; }

/* metric ledger */
.dd-ledger { background: var(--dd-panel); border: 1px solid var(--dd-line); border-radius: 10px; overflow: hidden; }
.dd-lh {
  font-family: "IBM Plex Mono"; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dd-paper-mute); padding: 14px 18px 10px; border-bottom: 1px solid var(--dd-line);
}
.dd-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 18px; border-bottom: 1px solid rgba(44, 42, 47, 0.55);
  font-family: "IBM Plex Mono"; font-size: 13px;
}
.dd-row:last-child { border-bottom: none; }
.dd-row .k { color: var(--dd-paper-mute); letter-spacing: 0.02em; }
.dd-row .v { color: var(--dd-paper); font-weight: 500; text-align: right; }
.dd-row .v .pos { color: var(--dd-green); }
.dd-row .v .neg { color: var(--dd-red); }
.dd-row .v .flag { color: var(--dd-brass-bright); }

/* income view */
.dd-income { background: var(--dd-panel); border: 1px solid var(--dd-line); border-radius: 10px; overflow: hidden; margin-top: 16px; }
.dd-income .dd-row:last-child { border-bottom: none; }
.dd-safety { padding: 13px 18px 15px; border-top: 1px solid var(--dd-line); }
.dd-safety-label {
  font-family: "IBM Plex Mono"; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dd-paper-mute); display: block; margin-bottom: 5px;
}
.dd-safety p { color: var(--dd-paper-dim); font-size: 14px; margin: 0; }
.dd-safety-strong { border-left: 3px solid var(--dd-green); }
.dd-safety-adequate { border-left: 3px solid var(--dd-brass); }
.dd-safety-thin { border-left: 3px solid var(--dd-brass-bright); }
.dd-safety-stretched { border-left: 3px solid var(--dd-red); }
.dd-safety-uncovered { border-left: 3px solid var(--dd-red); }

/* risks */
.dd-risk { counter-reset: r; margin-top: 4px; }
.dd-risk-item { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--dd-line); }
.dd-risk-item:last-child { border-bottom: none; }
.dd-risk-item .n {
  counter-increment: r; font-family: "Fraunces"; font-weight: 900; font-size: 18px;
  color: var(--dd-brass-deep); min-width: 22px;
}
.dd-risk-item .n::before { content: counter(r, decimal-leading-zero); }
.dd-risk-item p { font-size: 15px; color: var(--dd-paper-dim); margin: 0; }
.dd-risk-item p b { color: var(--dd-paper); font-weight: 500; }

/* verdict panel */
.dd-vpanel {
  background: linear-gradient(160deg, var(--dd-panel-2), #141318);
  border: 1px solid var(--dd-brass-deep); border-radius: 12px; padding: 26px 28px; margin-top: 6px;
  position: relative; overflow: hidden;
}
.dd-vpanel::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(200, 162, 76, 0.16), transparent 70%);
}
.dd-vpanel h2 { color: var(--dd-brass-bright); }
.dd-vpanel p { font-size: 17px; color: var(--dd-paper); line-height: 1.56; }
.dd-vpanel p + p { margin-top: 13px; color: var(--dd-paper-dim); }

/* footer */
.dd-foot {
  margin-top: 38px; padding-top: 16px; border-top: 1px solid var(--dd-line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: "IBM Plex Mono"; font-size: 10px; letter-spacing: 0.12em; color: var(--dd-paper-mute);
  text-transform: uppercase;
}
.dd-foot .dd-disc { max-width: 560px; text-transform: none; letter-spacing: 0.02em; font-size: 11px; color: #6c675e; }
.dd-permalink { color: var(--dd-brass); text-decoration: none; }
.dd-permalink:hover { color: var(--dd-brass-bright); }

/* error card (malformed model) */
.dd-error {
  position: relative; z-index: 2; text-align: center; padding: 40px 20px;
  font-family: "Newsreader", Georgia, serif; color: var(--dd-paper-dim);
}
.dd-error-title { font-family: "Fraunces"; font-weight: 600; font-size: 22px; color: var(--dd-paper); margin-bottom: 8px; }
.dd-error-sub { font-size: 15px; }

/* entrance */
.dd-fade { opacity: 0; transform: translateY(14px); animation: dd-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes dd-rise { to { opacity: 1; transform: none; } }
.dd-d1 { animation-delay: 0.05s; }
.dd-d2 { animation-delay: 0.16s; }
.dd-d3 { animation-delay: 0.28s; }
.dd-d4 { animation-delay: 0.40s; }
.dd-d5 { animation-delay: 0.52s; }
.dd-d6 { animation-delay: 0.64s; }
@media (prefers-reduced-motion: reduce) {
  .dd-fade { opacity: 1; transform: none; animation: none; }
}

@media (max-width: 820px) {
  .dd-root { padding: 30px 18px 30px; }
  .dd-cols { grid-template-columns: 1fr; }
  .dd-headline { grid-template-columns: 1fr; }
  .dd-headline h1 { font-size: 44px; }
  .dd-verdict { text-align: left; min-width: 0; margin-top: 18px; }
  .dd-delta-grid { grid-template-columns: 1fr; gap: 14px; }
  .dd-delta-side.dive { text-align: left; }
  .dd-delta-mid { align-self: start; }
}

/* ──────────────────────────────────────────────────────────────────
   Page chrome: the search hero and the loading / error states. Kept in
   the brass family so the whole surface reads as one editorial desk.
   ────────────────────────────────────────────────────────────────── */
.dd-hero {
  max-width: 1080px; margin: 0 auto; padding: clamp(48px, 8vw, 84px) 4px clamp(8px, 2vw, 20px);
}
.dd-hero .kicker {
  font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 11px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold, #c8a24c); font-weight: 600;
}
.dd-hero h1 {
  font-family: var(--serif, "Fraunces", Georgia, serif); font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02; letter-spacing: -0.02em; margin: 18px 0 0; max-width: 18ch; text-wrap: balance;
}
.dd-hero p.sub {
  font-size: clamp(15px, 1.7vw, 17px); color: var(--ink-body, #b9b2a4); max-width: 56ch;
  margin: 18px 0 0; line-height: 1.6;
}
.dd-searchrow { display: flex; gap: 10px; max-width: 540px; margin-top: 30px; }
.dd-input {
  flex: 1; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line, #2c2a2f);
  border-radius: 9px; padding: 14px 16px; color: var(--ink, #ece5d6);
  font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 15px; letter-spacing: 0.04em;
  text-transform: uppercase; transition: border-color 140ms ease;
}
.dd-input:focus { outline: none; border-color: var(--gold, #c8a24c); }
.dd-input::placeholder { color: var(--ink-mute, #857f74); text-transform: none; letter-spacing: normal; }
.dd-run {
  background: var(--gold, #c8a24c); color: #15130d; border: none; border-radius: 9px;
  padding: 0 26px; font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 12px;
  font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
  transition: background 140ms ease, opacity 140ms ease;
}
.dd-run:hover { background: var(--gold-bright, #e3c075); }
.dd-run:disabled { opacity: 0.55; cursor: default; }
.dd-hint { margin-top: 12px; font-size: 12.5px; color: var(--ink-mute, #857f74); }
.dd-hint b { color: var(--gold, #c8a24c); font-weight: 600; }
.dd-inline-error { margin-top: 12px; font-size: 13px; color: var(--dd-red, #c96a55); }

.dd-state { max-width: 1120px; margin: 0 auto; }
.dd-loading {
  max-width: 1080px; margin: 30px auto 0; padding: 60px 24px; text-align: center;
  border: 1px solid var(--line, #2c2a2f); border-radius: 14px;
  font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-dim, #b9b2a4);
}
.dd-loading .pulse {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 10px;
  background: var(--gold, #c8a24c); box-shadow: 0 0 0 0 rgba(200, 162, 76, 0.5);
  animation: dd-pulse 1.6s ease infinite; vertical-align: middle;
}
@keyframes dd-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 162, 76, 0.5); opacity: 0.7; }
  70% { box-shadow: 0 0 0 9px rgba(200, 162, 76, 0); opacity: 1; }
  100% { box-shadow: 0 0 0 0 rgba(200, 162, 76, 0); opacity: 0.7; }
}
.dd-statemsg {
  max-width: 720px; margin: 30px auto 0; padding: 36px 28px; text-align: center;
  border: 1px solid var(--line, #2c2a2f); border-left: 3px solid var(--gold, #c8a24c);
  border-radius: 12px; background: rgba(255, 255, 255, 0.02);
}
.dd-statemsg .t {
  font-family: var(--serif, "Fraunces", Georgia, serif); font-size: 22px; font-weight: 600;
  color: var(--ink, #ece5d6); margin-bottom: 8px; letter-spacing: -0.01em;
}
.dd-statemsg .s { font-size: 15px; color: var(--ink-dim, #b9b2a4); line-height: 1.55; }
.dd-statemsg .dd-retry {
  margin-top: 18px; display: inline-block; background: var(--gold, #c8a24c); color: #15130d;
  border: none; border-radius: 8px; padding: 10px 20px; cursor: pointer;
  font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  .dd-loading .pulse { animation: none; }
}
