/* Kukreja Desk — Market recap
   Terminal density, FT serif, warm brass. No gradients-as-personality. */

:root {
  --bg: #0b0b09;
  --bg-2: #12110e;
  --bg-3: #191713;
  --line: #2c291f;
  --line-2: #3d382c;
  --ink: #efe9dc;
  --ink-2: #b7b09f;
  --ink-3: #7e7868;
  --brass: #c4a574;
  --brass-2: #e4cc9f;
  --open: #a3bd90;
  --close: #d09372;
  --up: #a3bd90;
  --down: #d09372;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --topbar: 58px;
  --max: 1120px;
  --gutter: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(ellipse 90% 42% at 50% -8%, #1a1710 0%, transparent 58%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brass); color: var(--bg); }
:focus { outline: none; }
:focus-visible { outline: 1px solid var(--brass); outline-offset: 3px; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--brass);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 100;
  font-size: 13px;
}
.skip:focus { left: 8px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}

/* ——— progress ——— */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--brass);
  z-index: 80;
  pointer-events: none;
  transform-origin: left;
}

/* ——— topbar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar);
  background: rgba(11, 11, 9, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand-mark {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--brass);
  color: var(--brass);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: 0.01em;
}
.brand-text span {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  min-width: 0;
}
.session {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  padding: 4px 8px 3px;
  border: 1px solid color-mix(in srgb, var(--open) 45%, transparent);
  color: var(--open);
  background: color-mix(in srgb, var(--open) 10%, transparent);
}
.session.is-close {
  border-color: color-mix(in srgb, var(--close) 45%, transparent);
  color: var(--close);
  background: color-mix(in srgb, var(--close) 10%, transparent);
}
.top-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  white-space: nowrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 0 8px 0 10px;
  height: 34px;
  color: var(--ink-3);
  min-width: 0;
}
.search:focus-within {
  border-color: var(--line-2);
  color: var(--ink-2);
}
.search input {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 13px/1 var(--sans);
  width: 11.5rem;
  min-width: 0;
  padding: 0;
}
.search input::placeholder { color: var(--ink-3); }
.search kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 1px 5px 0;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand meta"
      "search search";
    gap: 8px 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .topbar { height: auto; }
  .brand { grid-area: brand; }
  .top-meta { grid-area: meta; justify-content: end; }
  .search { grid-area: search; }
  .search input { width: 100%; }
  .search kbd { display: none; }
  .brand-text span { display: none; }
  :root { --topbar: 86px; }
}

/* ——— page ——— */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

/* ——— hero ——— */
.hero {
  padding: 2.4rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
}
.kicker {
  margin: 0 0 0.85rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  align-items: center;
}
.kicker .sep {
  display: inline-block;
  width: 4px; height: 4px;
  margin: 0 10px;
  background: var(--brass);
  transform: rotate(45deg);
  opacity: 0.8;
}
.hero-title {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.85rem);
  line-height: 1.14;
  letter-spacing: -0.018em;
  max-width: 22ch;
  color: var(--ink);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 2.5rem;
  align-items: start;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .hero-title { max-width: 18ch; }
}
.hero-overview {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 38em;
}
.hero-overview.is-pending {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
}
.hero-byline {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-byline a {
  color: var(--brass-2);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 40%, transparent);
}
.hero-byline a:hover { color: var(--brass); }

.hero-media { min-width: 0; }
.yt-ph {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(180deg, transparent 40%, #0b0b09 100%),
    repeating-linear-gradient(-45deg, #16140f 0 8px, #12100c 8px 16px);
  border: 1px solid var(--line);
}
.yt {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #000;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  color: inherit;
}
.yt img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05);
  transform: scale(1.01);
  transition: filter 0.4s var(--ease), transform 0.5s var(--ease);
}
.yt:hover img { filter: saturate(1) contrast(1.08); transform: scale(1.03); }
.yt-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,11,9,0.05) 30%, rgba(11,11,9,0.78) 100%);
  pointer-events: none;
}
.yt-play {
  position: absolute;
  left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  width: 58px; height: 58px;
  border: 1px solid var(--brass);
  background: rgba(11,11,9,0.72);
  display: grid;
  place-items: center;
  transition: background 0.2s var(--ease), border-color 0.2s;
}
.yt:hover .yt-play {
  background: var(--brass);
  border-color: var(--brass);
}
.yt-play svg { display: block; margin-left: 2px; }
.yt:hover .yt-play svg { fill: var(--bg); }
.yt-cap {
  position: absolute;
  left: 14px; right: 14px; bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-2);
  pointer-events: none;
}
.yt iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ——— tape ——— */
.tape-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.tape-label {
  flex: none;
  display: flex;
  align-items: center;
  padding-right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  border-right: 1px solid var(--line);
  margin-right: 4px;
}
.tape {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 12px 0 12px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.tape::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  scroll-snap-align: start;
  min-width: 7.5rem;
  max-width: min(16rem, 72vw);
  padding: 8px 12px 9px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.chip-label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.chip-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--brass-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.chip-val.up { color: var(--up); }
.chip-val.down { color: var(--down); }

/* ——— desk layout ——— */
.desk {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding-top: 0.5rem;
}
@media (min-width: 900px) {
  .desk {
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
}

/* ——— toc ——— */
.toc {
  position: sticky;
  top: var(--topbar);
  z-index: 30;
  padding: 1.25rem 0 0.75rem;
}
.toc-title {
  display: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) var(--bg-2);
}
.toc-list::-webkit-scrollbar { height: 8px; display: block; }
.toc-list::-webkit-scrollbar-track { background: var(--bg-2); }
.toc-list::-webkit-scrollbar-thumb { background: var(--line-2); }
.toc a {
  display: block;
  text-decoration: none;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.3;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.toc a:hover { color: var(--ink); border-color: var(--line-2); }
.toc a.is-active {
  color: var(--brass-2);
  border-color: color-mix(in srgb, var(--brass) 50%, var(--line));
  background: color-mix(in srgb, var(--brass) 8%, var(--bg-2));
}

@media (max-width: 899px) {
  .toc {
    margin: 0;
    padding: 10px 0 4px;
    background: rgba(11,11,9,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
}
@media (min-width: 900px) {
  .toc {
    padding-top: 2.1rem;
    max-height: calc(100vh - var(--topbar) - 12px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
  .toc-title { display: block; }
  .toc-list {
    flex-direction: column;
    gap: 0;
    overflow: visible;
    padding-bottom: 0;
  }
  .toc a {
    border: 0;
    background: transparent;
    padding: 7px 0 7px 12px;
    border-left: 1px solid var(--line);
    white-space: normal;
  }
  .toc a.is-active {
    border-left-color: var(--brass);
    background: transparent;
    color: var(--ink);
  }
}

/* ——— generating / empty ——— */
.generating {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1.75rem 0 0.5rem;
  padding: 1.35rem 1.25rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.generating h2 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
}
.generating p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.generating code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--brass-2);
}
.pulse {
  flex: none;
  width: 8px; height: 8px;
  margin-top: 8px;
  background: var(--brass);
  animation: pulse 1.5s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.filter-empty {
  margin: 2rem 0;
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
}

/* ——— sections ——— */
.block { margin: 0; padding: 2.1rem 0 0.4rem; }
.block > .block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.block-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0;
}
.block-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: -0.015em;
}

.section {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1.7rem 0 1.55rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--topbar) + 18px);
}
.section:first-of-type { border-top: 0; }
.section-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--brass);
  line-height: 1.2;
  padding-top: 0.15rem;
}
.section h2 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.section .summary {
  margin: 0 0 0.85rem;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.62;
}
.section ul {
  margin: 0 0 0.9rem;
  padding: 0 0 0 1.05rem;
}
.section li {
  margin: 0 0 0.4rem;
  padding-left: 0.2rem;
  color: var(--ink);
}
.section li::marker { color: var(--brass); }

.pull {
  margin: 0.9rem 0 0.2rem;
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 2px solid var(--brass);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  background: transparent;
  display: block;
  width: 100%;
  text-align: left;
  font-weight: 400;
}
.pull:hover { color: var(--brass-2); }
.pull .hint {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ——— frameworks ——— */
.frames {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.frame {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 1.15rem 1.15rem 1.05rem;
  scroll-margin-top: calc(var(--topbar) + 18px);
}
.frame h3 {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 8px;
  align-items: start;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--brass);
  padding-top: 3px;
}

/* ——— quotes ——— */
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-card {
  border: 1px solid var(--line);
  background: transparent;
  padding: 1rem 1.15rem 0.95rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  width: 100%;
  font: inherit;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}
.q-card:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}
.q-card blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.4;
  color: var(--ink);
}
.q-card footer {
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-style: normal;
}

/* ——— takeaways ——— */
.take-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.take {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
  line-height: 1.5;
}
.check {
  width: 16px; height: 16px;
  margin-top: 3px;
  border: 1px solid var(--brass);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brass) 8%, transparent);
}
.check svg { display: block; }

/* ——— footer ——— */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12.5px;
}
.footer-src { margin: 0 0 0.5rem; }
.footer a { color: var(--brass-2); text-decoration: none; }
.footer a:hover { border-bottom: 1px solid var(--brass); }
.caveat {
  margin: 0;
  font-style: italic;
  max-width: 46em;
  color: var(--ink-3);
}

/* ——— toast ——— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 14px 7px;
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ——— skeletons ——— */
.skel {
  display: block;
  background: var(--bg-3);
  height: 0.85em;
  margin: 0.4em 0;
  position: relative;
  overflow: hidden;
}
.skel-line { width: 100%; }
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 6%, transparent), transparent);
  animation: shine 1.4s linear infinite;
}
@keyframes shine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ——— print ——— */
@media print {
  .topbar, .search, .toc, .progress, .toast, .yt, .hero-media { display: none !important; }
  body { background: #fff; color: #111; }
  .hero-title, .section h2 { color: #111; }
  a { color: #111; }
}


/* ——— lock page to viewport width ——— */
html, body { max-width: 100%; }
.hero, .hero-grid, .hero-copy, .hero-media, .hero-title, main, #content,
.block, .section, .frames, .q-list, .take-list, .kicker, .topbar-inner, .footer {
  min-width: 0;
  max-width: 100%;
}
[hidden] { display: none !important; }
.hero-title, .section h2, .summary, .pull, .q-card blockquote,
.take, .caveat, .hero-overview, .chip-label {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.yt img { max-width: 100%; }

.stream-pick {
  display: flex;
  align-items: center;
  min-width: 0;
}
.stream-pick[hidden] { display: none; }
.stream-pick select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 16rem;
  min-width: 0;
  background-color: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 26px 5px 8px;
  background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%),
    linear-gradient(135deg, var(--brass) 50%, transparent 50%);
  background-position: calc(100% - 12px) 11px, calc(100% - 7px) 11px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.stream-pick select:hover { border-color: var(--line-2); }
@media (max-width: 720px) {
  .stream-pick { grid-area: meta; justify-self: end; }
  .stream-pick select { max-width: 11rem; }
  .top-date { display: none; }
}
