:root {
  --bg: #0c0b0a;
  --bg2: #161412;
  --surface: #1c1916;
  --text: #f3eee6;
  --muted: rgba(243, 238, 230, 0.55);
  --accent: #e8a87c;
  --line: rgba(243, 238, 230, 0.1);
  --ring: conic-gradient(from 210deg, #e8a87c, #f0d9a0, #7eb8a8, #e8a87c);
  --sans: "Instrument Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232, 168, 124, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(126, 184, 168, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body { padding-bottom: 3rem; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.9rem;
  background: rgba(12, 11, 10, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand-kicker {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span { color: var(--accent); }

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}

.tab.is-active {
  background: var(--text);
  color: var(--bg);
}

.pane { display: none; padding: 1.5rem 1.25rem 2rem; position: relative; z-index: 2; }
.pane.is-active { display: block; animation: in 0.35s ease; }

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

.pane-head { margin-bottom: 1.25rem; max-width: 36rem; }
.pane-head h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.pane-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stories-rail {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  padding: 0.25rem 0.15rem 1rem;
  scroll-snap-type: x mandatory;
}

.story {
  flex: 0 0 auto;
  width: 92px;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: center;
  scroll-snap-align: start;
}

.story-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 3px;
  background: var(--ring);
  margin: 0 auto 0.5rem;
}

.story-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--bg);
  display: block;
  background: var(--surface);
}

.story span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid {
  columns: 2;
  column-gap: 0.65rem;
}

.grid figure {
  break-inside: avoid;
  margin: 0 0 0.65rem;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}

.grid img {
  width: 100%;
  display: block;
  vertical-align: middle;
  transition: transform 0.45s ease;
}

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

.grid figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.5rem 0.7rem 0.65rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  font-size: 0.75rem;
  color: rgba(255,255,255,0.9);
}

.empty {
  display: grid;
  gap: 0.4rem;
  place-items: start;
  max-width: 22rem;
  margin: 2rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
}

.empty strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 1.2rem;
}

.foot {
  position: relative;
  z-index: 2;
  padding: 0 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Story player */
.story-player {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  display: grid;
  place-items: center;
}

.story-player[hidden],
.viewer[hidden] { display: none !important; }

.story-progress {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  right: 0.65rem;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.story-progress i {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  overflow: hidden;
}

.story-progress i::after {
  content: "";
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
}

.story-progress i.is-done::after { width: 100%; }
.story-progress i.is-active::after {
  width: var(--p, 0%);
  transition: width 0.05s linear;
}

.story-player img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.story-caption {
  position: absolute;
  left: 1rem; right: 1rem; bottom: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.story-close, .viewer-close {
  position: absolute;
  top: 1.4rem;
  right: 0.75rem;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.hit {
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hit-prev { left: 0; }
.hit-next { right: 0; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.94);
  display: grid;
  place-items: center;
  padding: 2rem 1rem 4rem;
}

.viewer img {
  max-width: min(100%, 820px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
}

.viewer-caption {
  position: absolute;
  left: 1rem; right: 1rem; bottom: 1.25rem;
  text-align: center;
  color: var(--muted);
  margin: 0;
}

@media (min-width: 800px) {
  .grid { columns: 3; }
  .pane { padding-inline: 2rem; }
}

@media (min-width: 1100px) {
  .grid { columns: 4; max-width: 1100px; }
}
