/* ============================================================
   Rohingya Cries — stylesheet
   Dark-first, low-bandwidth, mobile-first testimony gallery.
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --bg-glow: rgba(255, 255, 255, 0.05);
  --text: #f2f2f4;
  --text-dim: #86868c;
  --pill-bg: rgba(22, 22, 25, 0.78);
  --pill-border: rgba(255, 255, 255, 0.07);
  --pill-hover: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(14, 14, 16, 0.82);
  --media-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --accent: #ffffff;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

html[data-theme="light"] {
  --bg: #f3f2ef;
  --bg-glow: rgba(0, 0, 0, 0.035);
  --text: #141416;
  --text-dim: #74747a;
  --pill-bg: rgba(255, 255, 255, 0.82);
  --pill-border: rgba(0, 0, 0, 0.07);
  --pill-hover: rgba(0, 0, 0, 0.06);
  --card-bg: rgba(255, 255, 255, 0.9);
  --media-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  --accent: #141416;
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg: #f3f2ef;
    --bg-glow: rgba(0, 0, 0, 0.035);
    --text: #141416;
    --text-dim: #74747a;
    --pill-bg: rgba(255, 255, 255, 0.82);
    --pill-border: rgba(0, 0, 0, 0.07);
    --pill-hover: rgba(0, 0, 0, 0.06);
    --card-bg: rgba(255, 255, 255, 0.9);
    --media-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
    --accent: #141416;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 45% at 50% 108%, var(--bg-glow), transparent 70%);
  z-index: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

svg { display: block; }

/* ============ CHROME (pills) ============ */

.chrome {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  z-index: 55; /* above the about panel so the menu button stays reachable */
  pointer-events: none;
}

/* while the about panel is open, dim the view switcher */
body.about-open .views {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.chrome-top { top: 0; }
.chrome-bottom { bottom: 0; }
.chrome > * { pointer-events: auto; }

.pill {
  display: flex;
  align-items: center;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* Brand / menu button */
.brand {
  gap: 12px;
  padding: 13px 18px 13px 15px;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.burger {
  position: relative;
  width: 20px;
  height: 12px;
  display: block;
}

.burger i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}

.burger i:first-child { top: 1px; }
.burger i:last-child { top: 9px; }

.brand.is-open .burger i:first-child { top: 5px; transform: rotate(45deg); }
.brand.is-open .burger i:last-child { top: 5px; transform: rotate(-45deg); }

/* View switcher */
.views { padding: 4px; gap: 2px; }

.view-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.35s ease, background-color 0.35s ease;
}

.view-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.view-btn:hover { color: var(--text); }

.view-btn.is-active {
  color: var(--text);
  background: var(--pill-hover);
}

/* Theme switch */
.theme-switch { padding: 4px; gap: 2px; }

.theme-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-dim);
  transition: color 0.35s ease, background-color 0.35s ease;
}

.theme-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.theme-btn:hover { color: var(--text); }
.theme-btn.is-active { color: var(--text); background: var(--pill-hover); }

/* Social button */
.social-btn {
  width: 44px;
  height: 44px;
  justify-content: center;
  color: var(--text);
}

.social-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.social-btn svg .filled { fill: currentColor; stroke: none; }

/* ============ FLOW VIEW ============ */

.view {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.flow-view {
  overflow: hidden;
  cursor: grab;
}

.flow-view.is-dragging { cursor: grabbing; }

/* stage carries the intro scale-up and the scroll "squeeze" */
.flow-stage {
  height: 100%;
  transform: scale(var(--stage-scale, 1));
  transform-origin: 50% 50%;
  will-change: transform;
}

/* intro: strip starts tiny and invisible, fades in, then grows into the gallery */
.flow-stage.is-intro {
  --stage-scale: 0.15;
  opacity: 0;
  transition: transform 0.55s var(--ease-expo), opacity 0.35s ease-out;
}

.flow-stage.is-intro.is-strip-in { opacity: 1; }

.flow-stage.is-intro-done {
  --stage-scale: 1;
}

.flow-track {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  height: 100%;
  width: max-content;
  padding-right: clamp(18px, 3vw, 42px); /* keeps the gap across the loop seam */
  will-change: transform;
}

.flow-item {
  position: relative;
  height: clamp(280px, 52vh, 620px);
  flex: none;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  /* horizontal squeeze driven by scroll velocity */
  transform: scaleX(var(--item-squeeze, 1));
  transform-origin: 50% 50%;
  transition: opacity 0.5s ease;
}

.flow-item:hover img { transform: scale(1.02); }

.flow-item img { transition: transform 0.7s var(--ease-out); }

/* intro entrance: photos rise from below as they arrive */
.flow-stage.is-intro .flow-item {
  opacity: 0;
  transform: scaleX(var(--item-squeeze, 1)) translateY(50%);
}

.flow-stage.is-intro .flow-item.is-in {
  opacity: 1;
  transform: scaleX(var(--item-squeeze, 1)) translateY(0);
  transition: opacity 0.6s var(--ease-expo), transform 0.6s var(--ease-expo);
}

/* items that enter the frame mid-drift are already visible, no transition */
.flow-stage.is-intro .flow-item.is-set {
  opacity: 1;
  transform: scaleX(var(--item-squeeze, 1)) translateY(0);
}

.flow-item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.flow-item.is-hidden { opacity: 0; pointer-events: none; }

/* duration chip on thumbnails */
.dur-chip {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

.dur-chip::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid rgba(255, 255, 255, 0.92);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* ============ GRID VIEW ============ */

.grid-view {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

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

.grid-feed {
  padding: 96px 20px 150px;
  column-count: 4;
  column-gap: 16px;
}

@media (min-width: 1700px) { .grid-feed { column-count: 5; } }
@media (max-width: 1200px) { .grid-feed { column-count: 3; } }
@media (max-width: 860px)  { .grid-feed { column-count: 2; } }
@media (max-width: 520px)  { .grid-feed { column-count: 1; } }

.grid-item {
  cursor: pointer;
  break-inside: avoid;
  margin-bottom: 16px;
}

.grid-item.is-filtered { display: none; }

.grid-item .gi-media {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.grid-item img {
  width: 100%;
  display: block;
  transition: transform 0.7s var(--ease-out);
}

.grid-item:hover img { transform: scale(1.03); }

.grid-item.is-hidden .gi-media { visibility: hidden; }

/* details surface on hover instead of sitting under every tile */
.gi-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.4s var(--ease-out);
  pointer-events: none;
}

.grid-item:hover .gi-info,
.grid-item:focus-visible .gi-info {
  opacity: 1;
  transform: translateY(0);
}

.gi-date {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.gi-place {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

/* the duration chip steps aside when the overlay comes up */
.grid-item:hover .dur-chip { opacity: 0; }
.dur-chip { transition: opacity 0.3s ease; }

/* ---- grid filters ---- */

.filter-wrap {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.filter-bar { padding: 4px; gap: 2px; }

.filter-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.3s ease, background-color 0.3s ease;
}

.filter-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.filter-btn:hover { color: var(--text); }
.filter-btn.is-active { color: var(--text); background: var(--pill-hover); }

.filter-pop {
  min-width: 190px;
  max-height: 46vh;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 6px;
  animation: popIn 0.3s var(--ease-out);
}

.filter-pop::-webkit-scrollbar { display: none; }

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.filter-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: left;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.filter-opt:hover { color: var(--text); background: var(--pill-hover); }
.filter-opt.is-selected { color: var(--text); }

.filter-opt .cnt {
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.8;
}

/* ============ MAP VIEW ============ */

.map-view { background: var(--bg); }

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-dim);
  font-size: 15px;
}

.map-marker {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out);
}

.map-marker:hover { transform: scale(1.25); }

/* discreet custom attribution (required by OpenStreetMap/CARTO licenses) */
.map-attrib {
  position: absolute;
  left: 14px;
  bottom: 8px;
  z-index: 5;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  opacity: 0.55;
  pointer-events: auto;
}

.map-attrib a { color: inherit; text-decoration: none; }

/* ============ LIGHTBOX ============ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.55s ease;
}

.lightbox.is-open .lb-backdrop { opacity: 0.88; }

.lb-media {
  position: absolute;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--media-shadow);
  background: #000;
  cursor: pointer;
}

.lb-media img,
.lb-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-poster {
  z-index: 2;
  transition: opacity 0.5s ease;
}

.lb-poster.is-gone { opacity: 0; }

.lb-video { z-index: 1; background: #000; }

.lb-error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  text-align: center;
  cursor: default;
}

.lb-error[hidden] { display: none; }

.lb-error span {
  font-size: 12px;
  letter-spacing: 0.03em;
}

.lb-error button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* progress bar */
.lb-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  z-index: 4;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lightbox.is-playing-ui .lb-progress { opacity: 1; }

.lb-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.lb-progress-fill {
  position: relative;
  height: 3px;
  width: 0%;
  background: #fff;
  z-index: 1;
}

.lb-time {
  position: absolute;
  left: 10px;
  bottom: 12px;
  z-index: 4;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.lightbox.is-playing-ui .lb-time { opacity: 1; }

/* center play/pause pulse */
.lb-playpulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.lb-playpulse svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.lb-playpulse .ic-pause { display: none; }

.lightbox.show-pulse .lb-playpulse {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.lightbox.is-paused .lb-playpulse .ic-play { display: block; }
.lightbox.is-paused .lb-playpulse .ic-pause { display: none; }
.lightbox:not(.is-paused) .lb-playpulse .ic-play { display: none; }
.lightbox:not(.is-paused) .lb-playpulse .ic-pause { display: block; }

/* arrows */
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.45s ease 0.15s, background-color 0.3s ease;
  z-index: 62;
}

.lightbox.is-open .lb-arrow { opacity: 0.75; }
.lb-arrow:hover { opacity: 1 !important; background: var(--pill-hover); }

.lb-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
}

.lb-prev { left: 22px; }
.lb-next { right: 22px; }

/* bottom bar */
.lb-bar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  padding: 5px;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.45s ease 0.2s, transform 0.45s var(--ease-out) 0.2s;
  z-index: 63;
}

.lightbox.is-open .lb-bar {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lb-bar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  transition: background-color 0.3s ease;
}

.lb-bar-btn:hover { background: var(--pill-hover); }

.lb-bar-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

/* details card */
.lb-details {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(10px);
  width: min(340px, calc(100vw - 48px));
  max-height: min(72vh, 640px);
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--card-bg);
  border: 1px solid var(--pill-border);
  border-radius: 18px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 22px 22px 18px;
  z-index: 64;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
}

.lb-details::-webkit-scrollbar { display: none; }

.lb-details.is-shown {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.dt-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 9px 0;
}

.dt-row svg {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  stroke: var(--text-dim);
  stroke-width: 1.6;
  fill: none;
  flex: none;
}

.dt-label {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.35;
}

.dt-value {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.dt-story {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--pill-border);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.dt-story .dt-label { margin-bottom: 6px; }

.dt-mapchip {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--pill-border);
  background:
    linear-gradient(var(--pill-border) 1px, transparent 1px) 0 0 / 100% 9px,
    linear-gradient(90deg, var(--pill-border) 1px, transparent 1px) 0 0 / 9px 100%;
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.dt-pin {
  width: 16px;
  height: 16px;
  fill: var(--text);
  flex: none;
}

/* ============ ABOUT PANEL (side sheet) ============ */

.about {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.about.is-open { pointer-events: auto; }

/* the gallery behind the sheet dims while the menu is open */
.about::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.about.is-open::before { opacity: 0.55; }

/* The panel grows out of the menu button's top-left corner (scale 0 -> 1),
   the way the reference does it — not a slide-in. */
.about-sheet {
  position: absolute;
  top: 12px;
  left: 12px;
  width: min(880px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  background: var(--sheet-bg);
  border: 1px solid var(--pill-border);
  border-radius: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transform-origin: 0 0;
  transform: scale(0.02);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.2s ease 0.3s;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
}

.about-sheet::-webkit-scrollbar { display: none; }

/* copy dissolves into the panel as it scrolls under the menu button
   instead of colliding with it */
.about-topfade {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 108px;
  margin-bottom: -108px;
  pointer-events: none;
  /* opaque past the button's lower edge (67px), then a soft tail */
  background: linear-gradient(
    to bottom,
    var(--sheet-bg) 0%,
    var(--sheet-bg) 58%,
    color-mix(in srgb, var(--sheet-bg) 62%, transparent) 80%,
    transparent 100%
  );
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .about-topfade {
    background: linear-gradient(to bottom, var(--sheet-bg) 60%, transparent 100%);
  }
}

.about.is-open .about-sheet {
  transform: scale(1);
  opacity: 1;
  transition: transform 0.62s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.16s ease;
}

/* the button sits on top of the panel and loses its pill while open */
body.about-open .brand {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root { --sheet-bg: #0d0d0f; }
html[data-theme="light"] { --sheet-bg: #fbfaf8; }
@media (prefers-color-scheme: light) {
  html[data-theme="system"] { --sheet-bg: #fbfaf8; }
}

.about-inner {
  max-width: 660px;
  padding: 96px 72px 70px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.about.is-open .about-inner {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease 0.26s, transform 0.6s var(--ease-out) 0.26s;
}

.about-title {
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 550;
  letter-spacing: -0.01em;
  margin-bottom: 44px;
}

.about-inner p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 30px;
  color: var(--text);
}

.about-quote {
  font-style: italic;
  color: var(--text-dim) !important;
  padding-left: 18px;
  border-left: 2px solid var(--pill-border);
}

.about-footer {
  margin-top: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease, transform 0.6s var(--ease-out);
}

.about.is-open .about-footer {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.62s; /* lands after the copy, like the reference */
}

.ab-id {
  display: flex;
  align-items: center;
  gap: 13px;
}

.ab-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: var(--pill-hover);
  display: grid;
  place-items: center;
}

.ab-initials {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}

.ab-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ab-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ab-name {
  font-size: 15px;
  font-weight: 600;
}

.ab-email {
  font-size: 13.5px;
  color: var(--text-dim);
  text-align: left;
  padding: 0;
  transition: color 0.3s ease;
}

.ab-email:hover { color: var(--text); }

.ab-sign-wrap { flex: none; }

/* Animated webp with a real alpha channel — white ink, no background to hide.
   Light theme flips the ink dark; the transparency is preserved either way. */
.ab-sign {
  height: 96px;
  width: auto;
  max-width: 250px;
  display: block;
  object-fit: contain;
}

html[data-theme="light"] .ab-sign { filter: invert(1); }

@media (prefers-color-scheme: light) {
  html[data-theme="system"] .ab-sign { filter: invert(1); }
}

/* ============ TOAST ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(10px);
  z-index: 90;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ BOOT PROGRESS ============ */

/* thin loading bar across the top while the posters preload */
.boot-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 110;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}

.boot-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: 0 50%;
  /* no transition: JS lerps the fill every frame, like the reference */
}

/* once loading completes the bar slides up out of the viewport */
.boot-progress.is-exit {
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.5s var(--ease-expo), opacity 0.5s var(--ease-expo);
}

body:not(.is-booting) .boot-progress { opacity: 0; }

/* ============ BOOT / CHROME REVEAL ============ */

/* the gallery ignores input until the intro has landed */
body.is-booting .flow-view { pointer-events: none; }

/* chrome pills hold off-stage until the intro has landed */
body.is-booting .chrome .pill {
  opacity: 0;
  pointer-events: none;
}

body.is-booting .chrome-top .pill { transform: translateY(-50%); }
body.is-booting .chrome-bottom .pill { transform: translateY(50%); }

body.is-booting .filter-wrap {
  opacity: 0;
  pointer-events: none;
}

/* during the reveal window the pills slide in, second pill trailing the first */
body.is-revealing .chrome .pill {
  transition: background-color 0.4s ease, border-color 0.4s ease,
    opacity 0.55s var(--ease-expo), transform 0.55s var(--ease-expo);
}

body.is-revealing .chrome .pill:nth-child(2) {
  transition-delay: 0s, 0s, 0.08s, 0.08s;
}

.filter-wrap {
  transition: opacity 0.6s ease;
}

/* view fade transitions */
.view { transition: opacity 0.45s ease; }
.view.is-fading { opacity: 0; }

/* ============ MOBILE ============ */

@media (max-width: 640px) {
  .chrome { padding: 14px 14px; }

  .brand { padding: 12px 15px 12px 13px; font-size: 14.5px; gap: 10px; }

  .view-btn span { display: none; }
  .view-btn { padding: 10px 12px; }
  .view-btn svg { width: 19px; height: 19px; }

  .flow-item { height: clamp(240px, 46vh, 480px); }

  .lb-arrow { display: none; }

  .lb-bar { bottom: max(18px, env(safe-area-inset-bottom)); }

  .lb-details {
    top: auto;
    bottom: 88px;
    left: 12px;
    right: 12px;
    width: auto;
    transform: translateY(14px);
    max-height: 58vh;
  }

  .lb-details.is-shown { transform: translateY(0); }

  .grid-feed { padding: 84px 12px 130px; }

  .about-sheet {
    top: 6px;
    left: 6px;
    bottom: 6px;
    width: calc(100vw - 12px);
    border-radius: 18px;
  }

  .about-inner { padding: 96px 26px 60px; }

  /* keep the desktop side-by-side layout on phones too */
  .about-footer {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .ab-id { gap: 10px; min-width: 0; }
  .ab-avatar-wrap { width: 40px; height: 40px; }
  .ab-name { font-size: 14px; }
  .ab-email { font-size: 12.5px; }

  .ab-sign {
    height: 62px;
    max-width: 140px;
  }

  .filter-wrap { bottom: 14px; }

  .toast { bottom: 78px; }
}

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
