/* The Opn Canvas — mobile-first, calm Apple-adjacent UI */

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-faint: #aeaeb2;
  --overlay-dark: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.45) 100%
  );
  --overlay-card: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.55) 100%
  );
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.25rem;
  --space-5: 3.5rem;
  --space-6: 5rem;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1240px;
  --carousel-gap: 16px;
  --card-width: min(78vw, 280px);
  --editorial-card-ratio: 4 / 5;
  --dock-h: 64px;
  --dock-pad: max(var(--space-3), env(safe-area-inset-bottom, 0px));
  --page-pad-bottom: calc(var(--dock-h) + var(--dock-pad) + var(--space-5));
  --strip-after: 1.375rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (max-width: 899px) {
  html {
    scroll-padding-bottom: var(--page-pad-bottom);
  }
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* ——— Shell ——— */

.site {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  padding-bottom: var(--page-pad-bottom);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

/* ——— Header ——— */

.site-header {
  padding: max(var(--space-2), env(safe-area-inset-top, 0px)) 0 var(--space-2);
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.site-header--home {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) 0;
  color: var(--text);
}

.brand__logo {
  display: block;
  height: 1.625rem;
  width: auto;
  max-width: min(200px, 48vw);
}

.brand:hover .brand__logo,
.brand:focus-visible .brand__logo {
  opacity: 0.72;
}

.brand:hover,
.brand:focus-visible {
  color: var(--text-soft);
}

/* ——— Home hero ——— */

.home-hero {
  text-align: center;
  padding: var(--space-3) 0 var(--space-4);
}

.home-hero__title {
  font-size: clamp(1.875rem, 6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 var(--space-2);
  color: var(--text);
}

.home-hero__line {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

/* ——— Home navigation cards ——— */

.home-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
}

.home-nav-card {
  position: relative;
  display: block;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 13.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.45s ease;
}

.home-nav-card:hover,
.home-nav-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.home-nav-card:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 3px;
}

.home-nav-card__media {
  position: absolute;
  inset: 0;
}

.home-nav-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.home-nav-card:hover .home-nav-card__media img,
.home-nav-card:focus-visible .home-nav-card__media img {
  transform: scale(1.06);
}

.home-nav-card__gradient {
  position: absolute;
  inset: 0;
  background: var(--overlay-card);
  pointer-events: none;
}

.home-nav-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 13.5rem;
  padding: var(--space-3) var(--space-3) var(--space-3);
  color: #fff;
}

.home-nav-card__title {
  font-size: clamp(1.5rem, 4.5vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-1);
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.25);
}

.home-nav-card__desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  opacity: 0.92;
  max-width: 26rem;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.2);
}

.home-nav-card__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.home-nav-card__arrow {
  transition: transform 0.3s ease;
}

.home-nav-card:hover .home-nav-card__arrow,
.home-nav-card:focus-visible .home-nav-card__arrow {
  transform: translateX(4px);
}

@media (min-width: 640px) {
  .home-nav-card,
  .home-nav-card__content {
    min-height: 15rem;
  }
}

/* Mobile / narrow: home nav cards stay visible (reveal + IntersectionObserver + iOS quirks) */
@media (max-width: 899px) {
  #home-nav-cards .home-nav-card.home-nav-card--ready.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  #home-nav-cards .home-nav-card.home-nav-card--ready.reveal.reveal--visible {
    opacity: 1;
    transform: none;
  }

  .home-nav {
    padding-bottom: calc(var(--space-4) + var(--space-2) + env(safe-area-inset-bottom, 0px));
  }

  .home-nav-card,
  .home-nav-card__content {
    min-height: 14.25rem;
  }

  .home-nav-card__media img {
    transform: scale(1.01);
  }
}

/* ——— Editorial landing (Canvas, Finds, Compass, Spaces, Stories) ——— */

.editorial-strip-mount,
.category-hero {
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  margin-bottom: var(--strip-after);
}

.page-editorial-landing .site-header {
  padding-bottom: var(--space-1);
}

.editorial-strip {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 9.25rem;
  max-height: 10rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.editorial-strip__backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.editorial-strip__texture {
  position: absolute;
  inset: 0;
  opacity: 1;
}

.editorial-strip__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: grayscale(1) contrast(0.92) brightness(1.08);
  opacity: 0.22;
  transform: scale(1.06);
}

.editorial-strip__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--space-2) var(--space-3);
}

.editorial-strip__copy {
  max-width: 36rem;
}

.editorial-strip__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 3.8vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.18;
  color: var(--text);
}

.editorial-strip__tagline {
  margin: 0;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.42;
  font-weight: 400;
  color: var(--text-soft);
}

/* Per-category mood: muted tint + abstract texture (monochrome-first) */

.editorial-strip[data-opn-strip="canvas"] .editorial-strip__texture {
  background:
    linear-gradient(118deg, rgba(245, 243, 238, 0.97) 0%, rgba(232, 228, 220, 0.88) 55%, rgba(220, 216, 208, 0.75) 100%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.018) 3px,
      rgba(0, 0, 0, 0.018) 4px
    );
}

.editorial-strip[data-opn-strip="finds"] .editorial-strip__texture {
  background:
    linear-gradient(105deg, rgba(242, 241, 239, 0.96) 0%, rgba(228, 226, 224, 0.9) 100%),
    radial-gradient(ellipse 55% 80% at 88% 50%, rgba(0, 0, 0, 0.07) 0%, transparent 68%);
}

.editorial-strip[data-opn-strip="compass"] .editorial-strip__texture {
  background-color: #ebeae6;
  background-image:
    linear-gradient(128deg, rgba(235, 233, 228, 0.95), rgba(218, 216, 210, 0.85)),
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(0, 0, 0, 0.04) 23px, rgba(0, 0, 0, 0.04) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(0, 0, 0, 0.035) 23px, rgba(0, 0, 0, 0.035) 24px);
}

.editorial-strip[data-opn-strip="spaces"] .editorial-strip__texture {
  background:
    linear-gradient(160deg, rgba(246, 244, 240, 0.98) 0%, rgba(210, 208, 204, 0.55) 100%),
    linear-gradient(25deg, transparent 40%, rgba(0, 0, 0, 0.06) 72%, transparent 100%);
}

.editorial-strip[data-opn-strip="circle"] .editorial-strip__texture {
  background:
    radial-gradient(circle at 78% 42%, rgba(0, 0, 0, 0.08) 0%, transparent 52%),
    linear-gradient(100deg, rgba(241, 240, 238, 0.97), rgba(228, 226, 224, 0.88));
  filter: blur(0.3px);
}

.editorial-strip[data-opn-strip="stories"] .editorial-strip__texture {
  background:
    linear-gradient(115deg, rgba(244, 242, 238, 0.98) 0%, rgba(234, 230, 224, 0.9) 100%),
    radial-gradient(ellipse 40% 90% at 12% 80%, rgba(0, 0, 0, 0.04) 0%, transparent 70%);
}

.editorial-strip--loading .editorial-strip__copy {
  display: flex;
  align-items: center;
  min-height: 4rem;
}

@media (min-width: 900px) {
  .editorial-strip {
    min-height: 9.5rem;
    max-height: 11rem;
    border-radius: var(--radius-xl);
  }

  .editorial-strip__inner {
    padding: var(--space-2) var(--space-3);
  }

  .editorial-strip__title {
    font-size: 1.5rem;
  }

  .editorial-strip__tagline {
    font-size: 0.9375rem;
  }
}

@media (max-width: 899px) {
  :root {
    --strip-after: 1.5rem;
  }

  .editorial-strip {
    min-height: 7.5rem;
    max-height: 8.75rem;
  }

  .editorial-strip__inner {
    padding: 0.625rem var(--space-3);
  }

  .editorial-strip__title {
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
  }

  .editorial-strip__tagline {
    font-size: 0.8125rem;
    line-height: 1.38;
  }

  .editorial-strip__photo {
    opacity: 0.14;
  }
}

/* ——— Rails ——— */

.rail-section {
  margin-bottom: var(--space-4);
}

.page-editorial-landing .rail-section:last-child,
.page-editorial-landing .editorial-landing-section:last-child {
  margin-bottom: var(--space-3);
}

.rail-section__head {
  margin-bottom: var(--space-2);
}

.rail-section__title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

/* ——— Carousel ——— */

.carousel {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  padding-bottom: var(--space-2);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--space-3);
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y pinch-zoom;
  scrollbar-width: none;
}

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

.feed-track {
  display: flex;
  gap: var(--carousel-gap);
  padding-bottom: var(--space-1);
}

.feed-track > * {
  scroll-snap-align: start;
  flex: 0 0 var(--card-width);
}

.feed-track--full {
  padding-bottom: var(--space-2);
}

/* ——— Editorial cards (image-first grids) ——— */

.editorial-card,
.feed-card.editorial-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 100%;
  background: #1a1a1c;
  transition: box-shadow 0.35s ease;
}

@media (hover: hover) {
  .editorial-card:hover,
  .feed-card.editorial-card:hover {
    box-shadow: var(--shadow-md);
  }
}

.editorial-card__link {
  display: block;
  position: relative;
  color: #fff;
  text-decoration: none;
  aspect-ratio: var(--editorial-card-ratio);
  min-height: 17.5rem;
  -webkit-tap-highlight-color: transparent;
}

.editorial-card__link--static {
  cursor: default;
}

.editorial-card__link:focus-visible {
  outline: none;
}

.editorial-card:has(.editorial-card__link:focus-visible) {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

.editorial-card__link:focus-visible .editorial-card__content {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 0.2em;
}

.editorial-card__media {
  position: absolute;
  inset: 0;
  background: #2c2c2e;
}

.editorial-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.editorial-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.2) 42%,
    rgba(0, 0, 0, 0.58) 72%,
    rgba(0, 0, 0, 0.76) 100%
  );
  transition: background 0.4s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .editorial-card:hover .editorial-card__media img {
    transform: scale(1.045);
  }

  .editorial-card:hover .editorial-card__overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0.28) 42%,
      rgba(0, 0, 0, 0.66) 72%,
      rgba(0, 0, 0, 0.84) 100%
    );
  }

  .editorial-card:hover .editorial-card__title {
    transform: translateY(-2px);
  }
}

.editorial-card__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
}

.editorial-card__label {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.editorial-card__label--sponsored,
.editorial-card__label--partner {
  background: rgba(255, 255, 255, 0.16);
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

.editorial-card__label--find,
.editorial-card__label--read-next {
  letter-spacing: 0.12em;
}

.editorial-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s ease;
}

.editorial-card__desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.editorial-card__hint {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.editorial-card__hint::after {
  content: " ↗";
}

.editorial-card__note {
  margin: 0;
  font-size: 0.625rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
}

.editorial-card__share {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  box-sizing: border-box;
  font-family: inherit;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.editorial-card__share:hover,
.editorial-card__share:focus-visible {
  background: rgba(0, 0, 0, 0.52);
  border-color: rgba(255, 255, 255, 0.38);
  outline: none;
}

.editorial-card__share:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.feed-card__share--standalone {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.editorial-card__share svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.editorial-card--sponsored .editorial-card__overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.24) 40%,
    rgba(0, 0, 0, 0.62) 72%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

.page-editorial-landing .feed-track--full > .editorial-card:first-child .editorial-card__link {
  aspect-ratio: 5 / 6;
  min-height: 19rem;
}

@media (min-width: 900px) {
  .editorial-card__title {
    font-size: 1.25rem;
  }

  .page-editorial-landing .feed-track--full > .editorial-card:first-child .editorial-card__link {
    aspect-ratio: 4 / 5;
    min-height: 22rem;
  }
}

/* Card detail CTA (legacy; card.php / story footer) */

.feed-card__cta {
  align-self: flex-start;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  box-sizing: border-box;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  color: var(--bg-elevated);
  background: var(--text);
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.feed-card__cta-text {
  line-height: 1;
}

.feed-card__cta-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.feed-card__cta-icon--external {
  opacity: 0.92;
}

.feed-card__cta:hover,
.feed-card__cta:focus-visible {
  background: #424245;
  transform: translateY(-1px);
  outline: none;
}

.feed-card__cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.card-detail__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.card-detail__label--sponsored {
  display: inline-block;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.card-detail__sponsor {
  margin-bottom: var(--space-2);
}

.card-detail__sponsor-logo {
  max-height: 1.75rem;
  max-width: 6.5rem;
  width: auto;
  object-fit: contain;
  opacity: 0.88;
}

.card-detail__disclosure {
  margin: 0 0 var(--space-2);
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.feed-card__share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.feed-card__share:hover,
.feed-card__share:focus-visible {
  color: var(--text);
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.1);
  outline: none;
}

.feed-card__share:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.feed-card__share-svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.feed-card__share-label {
  line-height: 1;
}

.home-sponsored-mount {
  margin-bottom: var(--space-3);
}

.home-sponsored-mount__inner .editorial-card__link {
  aspect-ratio: 16 / 10;
  min-height: 12rem;
}

.card-detail__hero {
  margin: 0 0 var(--space-3);
  border-radius: 1.125rem;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #e8e8ed;
  box-shadow: var(--shadow-sm);
}

.card-detail__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.card-detail__actions .feed-card__cta {
  margin-top: 0;
}

/* ——— Story detail: back + related cards ——— */

.story-back-mount {
  margin-bottom: var(--space-2);
}

.story-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
}

.story-back:hover,
.story-back:focus-visible {
  color: var(--text);
  text-decoration: none;
}

.story-back__icon {
  font-size: 1rem;
  line-height: 1;
}

/* Story detail — outer shell + inner readable column (mobile unchanged) */
.page-story-detail .story-doc.legal-doc {
  max-width: none;
  width: 100%;
  padding-top: var(--space-2);
  padding-bottom: var(--space-5);
}

.page-story-detail .site-main > .story-doc.wrap {
  max-width: min(1280px, 100%);
}

.page-story-detail .legal-doc__title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 var(--space-2);
}

.story-doc__byline {
  margin: 0 0 var(--space-3);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.story-doc__byline a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.story-doc__byline a:hover {
  color: var(--text);
  border-bottom-color: rgba(0, 0, 0, 0.2);
}

.story-doc__byline-sep {
  margin: 0 0.15em;
  color: var(--text-faint);
  opacity: 0.65;
}

.story-doc__read-time {
  color: var(--text-faint);
}

.story-doc__excerpt {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0 0 var(--space-3);
  font-weight: 400;
}

.page-story-detail .card-detail__hero {
  margin: var(--space-3) 0 var(--space-4);
  border-radius: 1.25rem;
  aspect-ratio: 16 / 10;
  min-height: 12.5rem;
  max-height: none;
}

.page-story-detail .card-detail__hero img {
  object-fit: cover;
  object-position: center center;
}

.page-story-detail .story-doc__body {
  font-size: 1.0625rem;
  line-height: 1.62;
}

.story-doc__post-body {
  margin-top: var(--space-4);
}

.story-doc__cta {
  margin-bottom: var(--space-3);
}

.story-doc__share {
  margin: 0 0 var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.story-doc__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
  border: none;
  background: none;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.story-doc__share-btn:hover,
.story-doc__share-btn:focus-visible {
  color: var(--text);
  outline: none;
}

.story-doc__share-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.75;
}

.story-subscribe {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.story-subscribe__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.story-subscribe__text {
  margin: 0 0 var(--space-2);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 28rem;
}

.story-subscribe__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  max-width: 26rem;
}

.story-subscribe__form input[type="email"] {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.875rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

.story-subscribe__form input[type="email"]:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.28);
}

.story-subscribe__submit {
  padding: 0.55rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.story-subscribe__submit:hover,
.story-subscribe__submit:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.22);
  outline: none;
}

.story-subscribe__note {
  margin: var(--space-2) 0 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.story-continue {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.story-continue__title {
  margin: 0 0 var(--space-3);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.story-continue__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.story-continue__card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.story-continue__card:hover,
.story-continue__card:focus-visible {
  border-color: rgba(0, 0, 0, 0.18);
  background: #fafafa;
  outline: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.story-continue__glyph {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-soft);
}

.story-continue__glyph svg {
  width: 1.25rem;
  height: 1.25rem;
}

.story-continue__card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.story-continue__card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.25;
}

.story-continue__card-desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-soft);
  font-weight: 400;
}

@media (min-width: 600px) {
  .story-continue__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .story-continue__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 900px) {
  .page-story-detail .story-doc.legal-doc {
    --story-read: min(48rem, 100%);
    --story-hero: min(72rem, 100%);
    padding-top: var(--space-3);
  }

  .page-story-detail .story-back-mount,
  .page-story-detail .legal-doc__title,
  .page-story-detail .story-doc__excerpt,
  .page-story-detail .story-doc__byline,
  .page-story-detail .story-doc__body,
  .page-story-detail .story-doc__post-body {
    max-width: var(--story-read);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .page-story-detail .story-continue {
    max-width: var(--story-hero);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .page-story-detail .legal-doc__title {
    margin-bottom: var(--space-2);
  }

  .page-story-detail .story-doc__excerpt {
    margin-bottom: var(--space-3);
    font-size: 1.1875rem;
  }

  .page-story-detail .card-detail__hero {
    max-width: var(--story-hero);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--space-2);
    margin-bottom: var(--space-4);
    aspect-ratio: 16 / 9;
    min-height: clamp(18rem, 36vw, 28rem);
    max-height: min(68vh, 32rem);
    border-radius: 1.375rem;
    box-shadow: var(--shadow-md);
  }

  .page-story-detail .story-related {
    max-width: var(--story-hero);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .page-story-detail .story-doc.legal-doc {
    --story-read: min(50rem, 100%);
    --story-hero: min(76rem, 100%);
  }

  .page-story-detail .card-detail__hero {
    aspect-ratio: 2 / 1;
    max-height: min(70vh, 34rem);
  }
}

.story-related {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.story-related__intro {
  margin: 0 0 var(--space-3);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-soft);
  font-style: italic;
}

.story-related__group {
  margin-bottom: var(--space-4);
}

.story-related__group-title {
  margin: 0 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.story-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 600px) {
  .page-story-detail .story-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }
}

@media (min-width: 1024px) {
  .page-story-detail .story-related__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Story recommendations — compact editorial tiles (not hero-scale cards) */
.page-story-detail .story-related .editorial-card__link {
  aspect-ratio: 3 / 2;
  min-height: 0;
}

.page-story-detail .story-related .editorial-card__content {
  padding: 0.75rem 0.85rem;
  gap: 0.28rem;
}

.page-story-detail .story-related .editorial-card__label {
  font-size: 0.5625rem;
  letter-spacing: 0.13em;
  color: rgba(255, 255, 255, 0.82);
}

.page-story-detail .story-related .editorial-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.page-story-detail .story-related .editorial-card__desc {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 400;
  -webkit-line-clamp: 2;
}

.page-story-detail .story-related .editorial-card__hint--outbound {
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.1rem;
}

.page-story-detail .story-related .editorial-card__hint--outbound::after {
  content: " ↗";
  opacity: 0.85;
}

.page-story-detail .story-related .editorial-card__note {
  font-size: 0.5625rem;
  color: rgba(255, 255, 255, 0.55);
}

.page-story-detail .story-related .editorial-card__label--sponsored,
.page-story-detail .story-related .editorial-card__label--partner {
  background: rgba(255, 255, 255, 0.1);
  letter-spacing: 0.11em;
}

@media (min-width: 900px) {
  .page-story-detail .story-related .editorial-card__title {
    font-size: 1rem;
  }
}

/* Story page — quieter category dock until hover (desktop rail) */
@media (min-width: 900px) {
  .page-story-detail .site-dock {
    opacity: 0.42;
    transition: opacity 0.28s ease;
  }

  .page-story-detail .site-dock:hover,
  .page-story-detail .site-dock:focus-within {
    opacity: 1;
  }
}

@media (max-width: 899px) {
  .page-story-detail .site-dock {
    opacity: 0.92;
  }

  .page-story-detail .site-dock:hover,
  .page-story-detail .site-dock:focus-within {
    opacity: 1;
  }
}

.story-doc__body h2,
.story-doc__body h3,
.story-doc__body h4 {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.story-doc__body h2 {
  font-size: 1.375rem;
}

.story-doc__body h3 {
  font-size: 1.125rem;
}

.story-doc__body h4 {
  font-size: 1rem;
}

.story-doc__body p {
  margin: 0 0 1.1em;
}

.story-doc__body ul,
.story-doc__body ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.story-doc__body li {
  margin-bottom: 0.35em;
}

.story-doc__body a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.story-doc__body blockquote {
  margin: var(--space-2) 0;
  padding-left: var(--space-2);
  border-left: 2px solid rgba(0, 0, 0, 0.12);
  color: var(--text-soft);
}

/* ——— Dock ——— */

.site-dock {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 var(--space-2) var(--dock-pad);
}

.site-dock .dock__inner {
  pointer-events: auto;
}

.dock__inner {
  width: 100%;
  max-width: min(100% - var(--space-3), 520px);
}

.dock__nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2px;
  padding: 6px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.dock__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 8px;
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  min-width: 2.75rem;
  min-height: 2.75rem;
  transition: color 0.25s ease, background 0.25s ease;
}

.dock__item:hover,
.dock__item:focus-visible {
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.dock__item--active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.dock__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.dock__svg {
  width: 22px;
  height: 22px;
}

.dock__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ——— Footer ——— */

.site-footer {
  padding: var(--space-3) 0 calc(var(--space-3) + var(--page-pad-bottom));
  text-align: center;
}

.page-editorial-landing .site-footer {
  padding-top: var(--space-2);
}

.site-footer p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: -0.01em;
}

.site-footer__copy {
  margin: 0 0 var(--space-2);
}

.site-footer__legal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: -0.01em;
  line-height: 1.55;
}

.site-footer__legal a {
  color: var(--text-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__legal a:hover,
.site-footer__legal a:focus-visible {
  color: var(--text);
}

.site-footer__sep {
  margin: 0 0.35rem;
  color: var(--text-faint);
  user-select: none;
}

/* ——— Legal / support static pages ——— */

.legal-doc {
  max-width: 40rem;
  margin: 0 auto;
  padding-top: var(--space-2);
  padding-bottom: var(--space-4);
}

.legal-doc__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  color: var(--text);
}

.legal-doc__meta {
  margin: 0 0 var(--space-4);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.legal-doc__body {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
}

.legal-doc__body h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: var(--space-4) 0 var(--space-2);
  letter-spacing: -0.02em;
  color: var(--text);
}

.legal-doc__body p {
  margin: 0 0 var(--space-2);
}

.legal-doc__body ul {
  margin: 0 0 var(--space-2);
  padding-left: 1.25rem;
}

.legal-doc__body li {
  margin-bottom: var(--space-1);
}

.legal-doc__body a {
  color: var(--text-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-doc__body a:hover,
.legal-doc__body a:focus-visible {
  color: var(--text);
}

.legal-doc__body code {
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.legal-doc__body li:last-child {
  margin-bottom: 0;
}

/* ——— Reveal ——— */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— Desktop dock ——— */

@media (min-width: 900px) {
  :root {
    --card-width: 320px;
    --dock-h: 58px;
    --strip-after: 1.25rem;
  }

  .page-editorial-landing .carousel {
    max-width: var(--max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    overflow: visible;
    scroll-snap-type: none;
  }

  .page-editorial-landing .feed-track--full {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    width: 100%;
    padding-bottom: 0;
  }

  .page-editorial-landing .feed-track--full > * {
    flex: none;
    width: auto;
    scroll-snap-align: unset;
  }

  .page-editorial-landing .rail-section__title {
    font-size: 1.25rem;
  }

  .site-dock {
    left: auto;
    right: max(var(--space-3), env(safe-area-inset-right, 0px));
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    padding: 0;
    flex-direction: column;
    align-items: flex-end;
  }

  .dock__inner {
    max-width: 88px;
  }

  .dock__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 8px;
    border-radius: var(--radius-xl);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  }

  .dock__item {
    flex-direction: column;
    padding: 10px 6px;
  }

  .dock__label {
    font-size: 0.5625rem;
  }

  .site-main {
    padding-bottom: var(--space-4);
    padding-right: calc(88px + var(--space-4) + env(safe-area-inset-right, 0px));
  }

  .site-footer {
    padding-bottom: var(--space-4);
    padding-right: calc(88px + var(--space-4) + env(safe-area-inset-right, 0px));
  }

  body.page-home .site-main {
    padding-right: calc(88px + var(--space-4) + env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 900px) and (max-height: 640px) {
  .site-dock {
    top: auto;
    bottom: max(var(--space-2), env(safe-area-inset-bottom, 0px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .dock__inner {
    max-width: min(100% - var(--space-3), 520px);
  }

  .dock__nav {
    flex-direction: row;
  }

  .site-main,
  .site-footer,
  body.page-home .site-main {
    padding-right: var(--space-3);
    padding-bottom: var(--page-pad-bottom);
  }
}

@media (min-width: 1100px) {
  .home-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .home-nav-card,
  .home-nav-card__content {
    min-height: 15.5rem;
  }

  .page-editorial-landing .feed-track--full {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ——— API loading / empty (minimal) ——— */

.opn-loading {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

.home-nav--loading {
  min-height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editorial-strip--loading,
.category-hero--loading {
  padding: 0;
}

.opn-empty-wrap {
  padding: var(--space-4) 0 var(--space-5);
}

.opn-empty {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-soft);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .home-nav-card,
  .home-nav-card__media img,
  .editorial-card__media img {
    transition: none;
  }

  .editorial-card:hover .editorial-card__title {
    transform: none;
  }

  .home-nav-card:hover,
  .home-nav-card:focus-visible {
    transform: none;
  }
}
