:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #242321;
  background: #193936;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --edge: clamp(24px, 4vw, 56px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --block-edge: 20px;
  --content-top: calc(var(--safe-top) + var(--block-edge));
  --content-bottom: calc(var(--safe-bottom) + var(--block-edge));
  --header-bottom: calc(var(--content-top) + 44px);
  --format-top: calc(var(--header-bottom) + 34px);
  --social-reserve: 64px;
  --social-edge: var(--edge);
  --social-height: 184px;
  --social-bottom: max(var(--content-bottom), min(calc(var(--content-bottom) + 78px), calc(100% - var(--format-top) - var(--social-height) - 12px)));
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #193936;
}

/* The first paint belongs to the app, before its modules restore a journey. */
.app-loading :is(.feed, .feed-header, .position, .feed-hint) { visibility: hidden; }
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #f3f2e5;
  background: radial-gradient(ellipse at 78% 35%, #387263 0%, transparent 58%), #193936;
  text-align: center;
  transition: opacity 220ms ease, visibility 220ms step-end;
}
.app-splash--done { opacity: 0; visibility: hidden; pointer-events: none; }
.app-splash--done .app-splash__status { animation: none; opacity: 0; }
.app-splash--done .app-splash__retry { animation: none; visibility: hidden; }
.app-splash__logo { display: block; width: clamp(170px, 48vw, 230px); height: auto; }
.app-splash__indicator { width: 36px; height: 3px; margin-top: 8px; border-radius: 3px; background: #c3ea1b; animation: app-splash-pulse 1.2s ease-in-out infinite alternate; }
.app-splash__status { margin: 0; color: #d1dcd3; font-size: 13px; line-height: 1.5; opacity: 0; animation: app-splash-reveal 180ms ease 850ms forwards; }
.app-splash__retry { padding: 8px 14px; color: #f3f2e5; font-size: 13px; text-underline-offset: 4px; visibility: hidden; opacity: 0; animation: app-splash-retry 1ms 8s forwards; }
.app-splash__retry:focus-visible { outline: 2px solid #c3ea1b; outline-offset: 4px; }
.app-splash--error .app-splash__status, .app-splash--error .app-splash__retry { animation: none; opacity: 1; visibility: visible; }
.app-splash--error .app-splash__indicator { animation: none; }
@keyframes app-splash-pulse { to { opacity: .35; transform: scaleX(.7); } }
@keyframes app-splash-reveal { to { opacity: 1; } }
@keyframes app-splash-retry { to { opacity: 1; visibility: visible; } }
@media (prefers-reduced-motion: reduce) {
  .app-splash { transition: none; }
  .app-splash__indicator, .app-splash__status { animation: none; }
  .app-splash__status { opacity: 1; }
}

.feed {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
  /* Media/iframe changes must not choose a new scroll anchor mid-slide. */
  overflow-anchor: none;
  scroll-behavior: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
  touch-action: pan-y pinch-zoom;
}

.feed.has-swipe { touch-action: pan-x pinch-zoom; }
/* The controller consumes card scrolling first and hands any remaining
   vertical movement to the feed. Editors, sliders and modal bodies remain
   native scrolling surfaces with their own touch-action. */
.feed.has-swipe :is([data-feed-scroll], .content, .content > article) { touch-action: pan-x pinch-zoom; }
/* Even clipped text can form a scroll container. Carry the gesture policy
   through the card, while explicit editor/slider/modal policies still win. */
:where(.feed.has-swipe .content *) { touch-action: inherit; }
.feed.is-controlled { scroll-snap-type: none; }
.feed.is-dragging { cursor: grabbing; }

@media (hover: hover) and (pointer: fine) {
  .feed { cursor: grab; }
  .feed.is-dragging { cursor: grabbing; }
}

.feed::-webkit-scrollbar { display: none; }
.feed:focus-visible { outline: 2px solid #242321; outline-offset: -5px; }

.content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 80px 40px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  user-select: none;
  -webkit-user-select: none;
}

.content.content--immersive { padding: 0; }
.feed-header--light { color: #fff; text-shadow: 0 1px 12px #0003; }

.feed-header {
  position: fixed;
  top: var(--content-top);
  left: max(var(--edge), env(safe-area-inset-left));
  right: max(var(--edge), env(safe-area-inset-right));
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.feed-header__title {
  padding-bottom: 9px;
  border-bottom: 2px solid currentColor;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.feed-header__title { justify-self: start; }

.feed-header__count {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.feed-header__divider { margin: 0 10px; opacity: 0.5; }

.position {
  position: fixed;
  top: 50%;
  right: max(var(--edge), env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  transform: translateY(-50%);
  pointer-events: none;
}

.position__dot {
  width: 4px;
  height: 4px;
  border-radius: 4px;
  background: currentColor;
  opacity: 0.22;
  transition: height 160ms ease, opacity 160ms ease;
}

.position__dot.is-active { height: 20px; opacity: 1; }

.feed-hint {
  position: fixed;
  bottom: var(--content-bottom);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.015em;
  pointer-events: none;
}

.feed-hint.is-last svg { transform: rotate(180deg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .position__dot { transition: none; }
}

[hidden] { display: none !important; }
.feed.is-navigation-locked { overflow-y: hidden; touch-action: none; }
.feed-message { max-width: 30ch; text-align: center; font-size: 18px; font-weight: 500; line-height: 1.5; }

@media (max-width: 699px) {
  :root { --edge: 12px; --block-edge: 12px; --social-edge: 6px; }
  .content { padding-inline: max(var(--edge), env(safe-area-inset-left)) max(var(--edge), env(safe-area-inset-right)); }
}

.prototype-update {
  position: fixed;
  z-index: 10000;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #193936;
  color: #fff;
  box-shadow: 0 4px 24px #0004;
  font: 14px/1.4 system-ui, sans-serif;
}
.prototype-update span { flex: 1; }
.prototype-update button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #193936;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
