:root {
  --bg: #ffffff;
  --ink: #050505;
  --muted: #686868;
  --line: #e9e9e9;
  --soft: #f7f7f7;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  scroll-behavior: smooth;
}

html:has(.story-reader),
body:has(.story-reader) {
  height: 100%;
  overflow: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 16px 18px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: clamp(1.45rem, 7vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.page-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 14px 42px;
}

.feed-heading {
  padding: 6px 2px 16px;
}

.feed-heading p,
.video-copy p,
.article-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feed-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 11vw, 4.2rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.video-feed {
  display: grid;
  gap: 18px;
}

.video-card {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.video-frame {
  position: relative;
  display: grid;
  min-height: 520px;
  overflow: hidden;
  place-items: center;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.image-frame {
  min-height: 0;
  aspect-ratio: 4 / 5;
  background: #f1f1f1;
}

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

.video-copy {
  padding: 14px;
}

.video-copy h2 {
  margin: 0;
  font-size: clamp(1.35rem, 6vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.video-copy span {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.article-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 14px 52px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  min-height: 42px;
  padding: 0 14px 0 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.back-link::before {
  content: "<-";
  font-size: 1rem;
  line-height: 1;
}

.story-reader {
  width: min(100%, 900px);
  height: calc(100svh - 73px);
  margin: 0 auto;
  padding: 10px 0 0;
  overflow: hidden;
}

.story-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.story-back {
  margin: 0;
}

.story-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.story-progress span {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
}

.story-progress span.active {
  background: var(--ink);
}

.story-deck {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  height: calc(100% - 65px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.story-deck::-webkit-scrollbar {
  display: none;
}

.story-panel {
  display: grid;
  grid-template-rows: 50% 50%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  border: 0;
  border-radius: 0;
  scroll-snap-align: start;
}

.story-image {
  position: relative;
  min-height: 0;
  height: 100%;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #eef1f1;
  border: 0;
  border-radius: 0;
}

.story-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--story-image);
  background-position: center;
  background-size: cover;
  filter: blur(18px);
  opacity: 0.16;
  transform: scale(1.08);
  transform-origin: center;
}

.story-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 80%;
  padding: 0;
  object-fit: contain !important;
  border-radius: 0;
  box-shadow: none;
}

.story-text {
  display: grid;
  min-height: 0;
  height: 100%;
  align-content: center;
  overflow: hidden;
  padding: clamp(16px, 5vw, 28px);
}

.story-text h1,
.story-text h2 {
  margin: 0;
  font-size: clamp(1.9rem, 8.8vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.story-text h2 {
  font-size: clamp(1.65rem, 7.3vw, 3.2rem);
  text-wrap: balance;
}

.story-text p:not(.article-kicker) {
  margin: clamp(8px, 2.4vw, 14px) 0 0;
  color: #1a1a1a;
  font-size: clamp(1.06rem, 4.55vw, 1.34rem);
  line-height: 1.34;
}

.story-text .article-kicker {
  margin-bottom: clamp(6px, 1.8vw, 10px);
  font-size: clamp(0.68rem, 2.8vw, 0.78rem);
}

.story-controls {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9;
  display: flex;
  gap: 8px;
}

.story-controls button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 900;
}

.story-controls button:disabled {
  opacity: 0.28;
}

@media (min-width: 720px) {
  .site-header {
    padding-top: 22px;
  }

  .page-shell {
    padding-top: 34px;
  }

  .video-feed {
    gap: 24px;
  }

  .story-deck {
    height: calc(100% - 65px);
  }
}

@media (max-width: 430px) {
  .site-header {
    padding: 12px 12px 10px;
  }

  .page-shell,
  .article-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .video-card,
  .article-video {
    border-radius: 6px;
  }

  .video-frame {
    min-height: 0;
  }
}
