:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: rgba(248, 250, 252, 0.72);
  --faint: rgba(248, 250, 252, 0.16);
  --line: rgba(248, 250, 252, 0.22);
  --panel: rgba(8, 12, 16, 0.54);
  --panel-strong: rgba(8, 12, 16, 0.76);
  --accent: #53d68a;
  --accent-ink: #06150d;
  --gold: #f2bd4b;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  margin: 0;
}

body {
  background: #070a0d;
  color: var(--ink);
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: #070a0d;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 12px clamp(14px, 3vw, 30px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.brand,
.top-left,
.view-tabs,
.top-actions,
.side-actions,
.index-rail {
  pointer-events: auto;
}

.top-left {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.58);
  box-shadow: var(--shadow);
  font-weight: 900;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.brand-copy strong {
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.view-tabs {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.46);
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
  backdrop-filter: blur(12px);
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.view-tab:hover {
  color: var(--ink);
  border-color: rgba(83, 214, 138, 0.52);
}

.view-tab.is-active {
  background: rgba(83, 214, 138, 0.92);
  border-color: rgba(83, 214, 138, 0.92);
  color: var(--accent-ink);
}

.top-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 0;
}

.counter {
  min-width: 70px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.5);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: var(--shadow);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.58);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.3;
}

.icon-button:hover {
  border-color: rgba(83, 214, 138, 0.7);
  background: rgba(8, 12, 16, 0.78);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button-strong {
  border-color: rgba(83, 214, 138, 0.76);
  background: rgba(83, 214, 138, 0.92);
  color: var(--accent-ink);
}

.icon-button-strong:hover {
  border-color: rgba(83, 214, 138, 0.9);
  background: rgba(83, 214, 138, 0.98);
  color: var(--accent-ink);
}

.feed {
  width: 100%;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}

.feed::-webkit-scrollbar {
  display: none;
}

.slide {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  display: grid;
  align-items: end;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #0b0f12;
  overflow: hidden;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.1) 24%, rgba(0, 0, 0, 0.08) 52%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.06) 55%, rgba(0, 0, 0, 0.4));
}

.slide img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  filter: saturate(1.08) contrast(1.02);
}

.slide-content {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 104px));
  margin: 0 0 clamp(24px, 7vh, 72px) clamp(16px, 6vw, 72px);
  padding-right: 8px;
}

.kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.tag,
.source-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.46);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.source-pill {
  color: var(--muted);
}

.source-pill svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.source-pill:hover {
  color: var(--ink);
  border-color: rgba(83, 214, 138, 0.64);
}

.audio-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(83, 214, 138, 0.58);
  border-radius: 8px;
  background: rgba(83, 214, 138, 0.18);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.audio-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.audio-button:hover,
.audio-button.is-playing {
  border-color: rgba(83, 214, 138, 0.92);
  background: rgba(83, 214, 138, 0.92);
  color: var(--accent-ink);
}

.audio-button.is-loading {
  border-color: rgba(242, 189, 75, 0.92);
  background: rgba(242, 189, 75, 0.24);
}

.audio-button:active {
  transform: translateY(1px);
}

.slide h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3.2rem, 10vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 7px 34px rgba(0, 0, 0, 0.72);
}

.latin {
  display: block;
  margin-top: 12px;
  color: rgba(248, 250, 252, 0.82);
  font-size: clamp(1.05rem, 2vw, 1.36rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(720px, 100%);
  margin-top: 22px;
}

.fact {
  min-width: 0;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.fact b,
.fact span {
  display: block;
  overflow-wrap: anywhere;
}

.fact b {
  margin-bottom: 5px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.72rem;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fact span {
  color: var(--ink);
  font-size: clamp(0.86rem, 1.5vw, 0.98rem);
  font-weight: 750;
  line-height: 1.25;
}

.note {
  width: min(640px, 100%);
  margin: 14px 0 0;
  color: rgba(248, 250, 252, 0.84);
  font-size: clamp(0.96rem, 1.8vw, 1.08rem);
  font-weight: 620;
  line-height: 1.42;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.78);
}

.side-actions {
  position: fixed;
  right: clamp(12px, 2.6vw, 28px);
  top: 50%;
  z-index: 21;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.index-rail {
  position: fixed;
  right: clamp(12px, 2.6vw, 28px);
  bottom: clamp(18px, 4vh, 38px);
  z-index: 21;
  display: grid;
  gap: 9px;
  max-height: min(48vh, 420px);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.5);
  box-shadow: var(--shadow);
  overflow: auto;
  scrollbar-width: none;
}

.index-rail::-webkit-scrollbar {
  display: none;
}

.index-dot {
  width: 44px;
  height: 44px;
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  overflow: hidden;
  opacity: 0.66;
  transition: opacity 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.index-dot:hover,
.index-dot.is-active {
  opacity: 1;
  border-color: var(--accent);
}

.index-dot.is-active {
  transform: translateX(-2px);
}

.index-dot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 760px) {
  .topbar {
    display: block;
    align-items: flex-start;
    min-height: 62px;
    padding: 10px 12px;
  }

  .top-left {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: none;
    gap: 7px;
  }

  .brand {
    max-width: calc(100% - 116px);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy small {
    display: none;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    padding: 3px;
    overflow: visible;
  }

  .view-tab {
    min-height: 29px;
    width: 100%;
    min-width: 0;
    padding: 0 6px;
    font-size: 0.68rem;
  }

  .top-actions {
    position: absolute;
    top: 10px;
    right: 12px;
  }

  .counter {
    min-width: 64px;
    padding-inline: 8px;
  }

  .slide::after {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.08) 32%, rgba(0, 0, 0, 0.88) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
  }

  .slide-content {
    width: calc(100% - 22px);
    margin: 0 11px 34px;
    padding-right: 0;
  }

  .slide h1 {
    max-width: 13ch;
    font-size: clamp(2.45rem, 13vw, 4.2rem);
  }

  .latin {
    margin-top: 8px;
  }

  .audio-button {
    width: 40px;
    height: 40px;
  }

  .facts {
    display: none;
  }

  .note {
    display: none;
  }

  .side-actions {
    display: none;
  }

  .index-rail {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand-copy strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions {
    gap: 7px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .counter {
    min-width: 58px;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed {
    scroll-behavior: auto;
  }

  .icon-button,
  .index-dot {
    transition: none;
  }
}
