/* ==========================================================================
   Direction B — The Chart Room
   The page is typeset like the AIM chart library: Lato Black titles with a
   parenthetical subtitle, charts as the hero, and a slide-footer rule that
   closes every section.
   ========================================================================== */

/* Chart-title typography (mirrors the slide titles in the chart library) */
.ct {
  font-family: var(--font-text);
  font-weight: 900;
  font-size: clamp(1.875rem, 1.2rem + 2.7vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
}
.ct--sm { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem); }
.ct-sub {
  margin-top: var(--space-2xs);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 62ch;
  text-wrap: pretty;
}

/* Slide footer: closes each section like a page of the chart library */
.slide-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2xs) var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--rule-strong);
  font-size: var(--label); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.slide-foot__brand { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--ink); }
.slide-foot__brand img { width: 22px; height: auto; }
.slide-foot__brand span { color: var(--amber-ink); }
.slide-foot__meta { display: inline-flex; gap: var(--space-lg); font-variant-numeric: tabular-nums; }
.slide-foot__meta em { font-style: normal; color: var(--amber-ink); }

/* ---------- Hero / chart room ---------- */
.b-hero { padding-block: clamp(40px, 2rem + 3vw, 88px) var(--section); }
.b-hero__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-lg) var(--space-xl); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.b-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

.room { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 9fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
.room__tabs { display: grid; gap: 0; border-top: 1px solid var(--rule-strong); }
.tab {
  display: grid; gap: 6px;
  width: 100%; text-align: left;
  padding: var(--space-md) var(--space-sm) var(--space-md) var(--space-md);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  font: inherit; color: var(--ink-2); cursor: pointer;
  position: relative;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.tab::before {
  content: ''; position: absolute; left: 0; top: calc(var(--space-md) + 5px);
  width: 10px; height: 10px; background: var(--rule-strong);
  transition: background-color 200ms var(--ease-out);
}
.tab:hover { color: var(--ink); background: var(--paper-2); }
.tab[aria-selected='true'] { color: var(--ink); background: var(--slide); }
.tab[aria-selected='true']::before { background: var(--amber); }
.tab__meta { font-size: var(--label); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding-left: var(--space-2xs); }
.tab__title { font-weight: 700; font-size: var(--step-0); line-height: 1.3; padding-left: var(--space-2xs); }

.panel { display: grid; gap: var(--space-md); }
.no-js .panel + .panel { margin-top: var(--space-2xl); }
.panel .slide { box-shadow: 0 1px 0 var(--rule), 0 30px 60px -40px oklch(0.25 0.03 235 / 0.35); }
.panel__read { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs) var(--space-lg); align-items: baseline; }
.panel__read p { color: var(--ink-2); max-width: 70ch; }
.panel__links { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); }
@media (prefers-reduced-motion: no-preference) {
  .js .panel:not([hidden]) { animation: panel-in 420ms var(--ease-out); }
  @keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
}

@media (max-width: 1024px) {
  .b-hero__top { grid-template-columns: minmax(0, 1fr); }
  .room { grid-template-columns: minmax(0, 1fr); }
  .room__tabs {
    grid-auto-flow: column; grid-auto-columns: minmax(220px, 68%);
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    border-top: 0; border-bottom: 1px solid var(--rule-strong);
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .room__tabs::-webkit-scrollbar { display: none; }
  .tab { scroll-snap-align: start; border-bottom: 0; border-right: 1px solid var(--rule); padding-block: var(--space-sm); }
  .tab::before { top: calc(var(--space-sm) + 5px); }
}
@media (max-width: 640px) {
  .panel__read { grid-template-columns: minmax(0, 1fr); }
  .panel__links { grid-column: 1; }
}

/* ---------- Products ---------- */
.prod-list { display: grid; gap: clamp(64px, 8vw, 128px); margin-top: var(--space-2xl); }
.prod { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.prod--flip .prod__art { order: 2; }
.prod__text { display: grid; gap: var(--space-md); align-content: start; }
.prod__num { font-size: var(--label); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-ink); }
.prod__text ul { list-style: none; padding: 0; display: grid; gap: var(--space-2xs); border-top: 1px solid var(--rule); padding-top: var(--space-md); }
.prod__text li { position: relative; padding-left: 1.25rem; color: var(--ink); }
.prod__text li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; background: var(--amber); }
.prod__text li span { color: var(--ink-3); }
@media (max-width: 960px) {
  .prod { grid-template-columns: minmax(0, 1fr); }
  .prod--flip .prod__art { order: 0; }
}

/* Deck stack — advisory deliverables */
.deck { position: relative; aspect-ratio: 16 / 11.2; }
.deck .slide {
  position: absolute; width: 84%;
  box-shadow: 0 1px 2px oklch(0.25 0.03 235 / 0.08), 0 24px 48px -28px oklch(0.25 0.03 235 / 0.4);
  transition: transform 500ms var(--ease-out);
}
.deck .slide:nth-child(1) { left: 0; top: 0; }
.deck .slide:nth-child(2) { left: 8%; top: 10%; }
.deck .slide:nth-child(3) { left: 16%; top: 20%; }
.deck:hover .slide:nth-child(1) { transform: translate(-3%, -3%); }
.deck:hover .slide:nth-child(3) { transform: translate(3%, 3%); }
.deck__tag {
  position: absolute; right: 0; bottom: 0; z-index: 2;
  font-size: var(--label); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--navy); color: #fff; padding: 6px 10px; border-radius: var(--radius);
}

/* AIM cover — research */
.cover-wrap { position: relative; padding: 0 6% 5% 0; max-width: 520px; }
.cover-wrap::before {
  content: ''; position: absolute; inset: 5% 0 0 6%;
  background: var(--navy); opacity: 0.16; border-radius: var(--radius);
}
.cover {
  position: relative;
  display: grid; gap: var(--space-md);
  padding: clamp(24px, 4vw, 44px);
  background: var(--navy-deep); color: oklch(0.9 0.012 235);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -36px oklch(0.2 0.03 235 / 0.6);
}
.cover__series { font-size: var(--label); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.cover__issue { font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); line-height: 1; color: #fff; }
.cover ol { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-sm); align-content: start; counter-reset: c; }
.cover li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: var(--space-2xs); font-size: var(--step--1); line-height: 1.45; counter-increment: c; }
.cover li::before { content: counter(c); font-family: var(--font-display); color: var(--amber); font-size: 1.125rem; line-height: 1.2; }
.cover__inside { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--space-sm); padding-top: var(--space-md); border-top: 1px solid oklch(1 0 0 / 0.16); font-size: var(--step--2); line-height: 1.4; }
.cover__inside b { display: block; color: #fff; font-size: var(--step--1); margin-bottom: 2px; }
.cover__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid oklch(1 0 0 / 0.16); font-size: var(--label); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.cover__foot span:last-child { color: var(--amber); }

/* ---------- Free research table ---------- */
.b-free__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-md); margin-bottom: var(--space-xl); }

/* ---------- Annotation-callout testimonials ---------- */
.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-2xl) var(--space-lg); margin-top: var(--space-2xl); padding-top: var(--space-2xl); }
.callout {
  position: relative;
  border: 1px solid var(--c, var(--navy));
  background: var(--slide);
  padding: var(--space-md) var(--space-md) var(--space-md);
  text-align: center;
  color: var(--c, var(--navy));
}
.callout::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 44px; background: var(--c, var(--navy)); }
.callout::after { content: ''; position: absolute; left: 50%; bottom: calc(100% + 40px); width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: var(--c, var(--navy)); }
.callout p { font-size: var(--step-0); line-height: 1.5; }
.callout footer { margin-top: var(--space-sm); font-size: var(--step--2); color: var(--ink-2); }
.callout footer b { display: block; color: var(--ink); }
.callout--rust { --c: var(--rust); }
.callout--steel { --c: oklch(0.45 0.07 245); }
.callout--grey { --c: oklch(0.45 0.01 235); }

/* ---------- Team + closer ---------- */
.b-close { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.b-close .people { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
.ask {
  background: var(--slide); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(24px, 3vw, 40px);
  display: grid; gap: var(--space-md);
}
.ask .btn { justify-self: start; }
@media (max-width: 960px) { .b-close { grid-template-columns: minmax(0, 1fr); } }
