/* Character site styles: same design language as 3dvr-girl/styles.css
   (dark botanical theme, sand/sage/cyan accents, Georgia display serif). */
:root {
  color-scheme: dark;
  --bg: #0b0f0d;
  --bg-soft: #101612;
  --panel: #151c18;
  --panel-warm: #1c1a15;
  --text: #f1e8db;
  --muted: #aaa497;
  --sand: #d3b98f;
  --sage: #91aa91;
  --cyan: #77b9c0;
  --line: rgba(241, 232, 219, 0.13);
  --line-strong: rgba(241, 232, 219, 0.24);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 12%, rgba(79, 112, 87, 0.13), transparent 30rem),
    radial-gradient(circle at 7% 58%, rgba(119, 185, 192, 0.07), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; color: inherit; }

/* The hidden attribute always wins on this page: tab panels, paginated
   cards, and the lock panel all toggle it. */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px clamp(18px, 4vw, 56px) 10px;
  border-bottom: 1px solid rgba(241, 232, 219, 0.08);
  background: linear-gradient(180deg, rgba(5, 8, 6, 0.9), rgba(5, 8, 6, 0.52));
  backdrop-filter: blur(18px);
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

/* One always-reachable strip under the brand row: the character
   switcher and the section tabs, side by side, scrolling sideways on
   narrow screens instead of disappearing. */
.topbar__strip {
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

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

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand__mark {
  color: var(--cyan);
  letter-spacing: 0.04em;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.topbar__nav a { transition: color 160ms ease; }
.topbar__nav a:hover, .topbar__nav a:focus-visible { color: var(--text); }
.topbar__nav a.is-active { color: var(--sand); }

.topbar__portal {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.hero {
  position: relative;
  min-height: 94svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero__image, .hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  z-index: -3;
  object-fit: cover;
  object-position: 50% 22%;
  filter: saturate(0.92);
}

.hero__veil {
  z-index: -2;
  background: linear-gradient(0deg, rgba(5, 8, 6, 0.88), rgba(5, 8, 6, 0.12) 55%, rgba(5, 8, 6, 0.25));
}

.hero__content {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 140px 0 64px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1, .section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.6rem, 11vw, 8.5rem);
  line-height: 0.8;
  text-wrap: balance;
}

.hero__copy {
  max-width: 570px;
  margin: 30px 0 20px;
  color: #ddd4c7;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.45;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.hero__tags span {
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #d3cec5;
  background: rgba(8, 11, 9, 0.45);
  font-size: 0.76rem;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid rgba(211, 185, 143, 0.56);
  border-radius: 999px;
  background: rgba(211, 185, 143, 0.1);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover, .button:focus-visible {
  transform: translateY(-2px);
  background: rgba(211, 185, 143, 0.18);
}

.button--quiet {
  border-color: var(--line-strong);
  background: rgba(8, 11, 9, 0.35);
}

.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.switcher {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.switcher a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.switcher a[aria-current="page"] {
  border-color: rgba(211, 185, 143, 0.56);
  color: var(--text);
  background: rgba(211, 185, 143, 0.12);
}

/* Tab panels: only one shows at a time (JS toggles hidden). The margin
   keeps a scrolled-to panel clear of the fixed header. */
.tab-panel { scroll-margin-top: 128px; }

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(76px, 10vw, 136px) 0;
}

.section h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 0.95;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(46px, 8vw, 120px);
  align-items: end;
}

.intro__copy > div > p {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
  max-width: 56ch;
}

.intro__copy > div > p:first-child {
  color: #ddd4c7;
  font-size: 1.25rem;
}

.identity-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel-warm);
  box-shadow: var(--shadow);
}

.identity-card dl { margin: 0; display: grid; gap: 14px; }

.identity-card dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
}

.identity-card dt {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 3px;
}

.identity-card dd { margin: 0; color: #ddd4c7; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 28px;
}

.section-heading > p {
  max-width: 340px;
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.55;
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.world-card {
  grid-column: span 5;
  min-height: 420px;
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--panel);
}

.world-card--wide { grid-column: span 7; }

.world-card img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: block;
  object-fit: cover;
  object-position: 50% 34%;
  filter: saturate(0.88);
  transition: transform 500ms ease, filter 500ms ease;
}

.world-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 8, 6, 0.84), transparent 52%);
  pointer-events: none;
}

.world-card:hover img { transform: scale(1.025); filter: saturate(1); }

.world-card figcaption {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 13px;
  align-items: baseline;
}

.world-card figcaption span {
  grid-row: 1 / span 2;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
}

.world-card figcaption strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 500;
}

.world-card figcaption small { color: #c1bbb0; }

.gallery-grid {
  columns: 4 230px;
  column-gap: 12px;
}

.gallery-card {
  width: 100%;
  margin: 0 0 12px;
  position: relative;
  display: block;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  background: var(--panel);
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.83) brightness(0.92);
  transition: transform 320ms ease, filter 320ms ease;
}

.gallery-card:hover img { transform: scale(1.03); filter: saturate(1); }

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(0deg, rgba(4, 7, 5, 0.9), transparent);
  pointer-events: none;
}

.gallery-card__caption {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: grid;
  gap: 1px;
}

.gallery-card__caption span {
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-card__caption strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.gallery-card__caption small { color: #c1bbb0; font-size: 0.8rem; }

/* Golden hour clips: the caption sits under the video instead of over
   it, so the native play controls stay clear. */
.gallery-card--video::after { display: none; }

.gallery-card--video video {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-card--video .gallery-card__caption {
  position: static;
  padding: 10px 14px 12px;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.story-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--panel);
  padding-bottom: 14px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.story-card:hover, .story-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.story-card img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.story-card span {
  display: block;
  margin: 12px 16px 0;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.story-card strong {
  display: block;
  margin: 2px 16px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
}

.chat-section { padding-top: 0; }

.chat-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 28px);
}

.chat-log {
  display: grid;
  gap: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px 2px 10px;
}

.msg { max-width: 75ch; }

.msg__label {
  display: block;
  margin-bottom: 3px;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.msg p {
  margin: 0;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  line-height: 1.55;
  white-space: pre-wrap;
}

.msg--her p {
  border-color: rgba(211, 185, 143, 0.4);
  background: var(--panel-warm);
}

.msg--you { justify-self: end; }
.msg--you .msg__label { color: var(--sand); text-align: right; }

.chat-form {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.chat-form textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  resize: vertical;
}

.chat-form textarea:disabled { opacity: 0.5; }

.chat-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; }
  .world-card, .world-card--wide { grid-column: span 12; min-height: 320px; }
  .world-card img { min-height: 320px; }
  .story-grid { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; align-items: start; }
  .msg { max-width: 100%; }
}

/* After Dark: the paywalled private frames. The lock panel mirrors the
   world page's; locked frames render blurred and unlinkable. */
.after-dark__lock {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  max-width: 620px;
  margin-bottom: 28px;
}

.after-dark__lock p {
  margin: 0 0 10px;
}

.after-dark__lock .button {
  margin-top: 8px;
}

.private-card {
  margin: 0;
}

.private-card img.is-blurred {
  filter: blur(18px) saturate(0.85);
  transform: scale(1.06);
  pointer-events: none;
  user-select: none;
}

/* Unlock button before the payment link exists: visibly pending,
   never a link that pretends to work. */
.button--pending {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.button--pending:hover, .button--pending:focus-visible {
  transform: none;
  background: rgba(211, 185, 143, 0.1);
}

/* Scroll sentinels under the auto-revealing grids: invisible markers
   the script watches so the next chunk renders as the visitor
   scrolls toward the bottom of the grid. */
.scroll-sentinel {
  height: 1px;
}

/* Lightbox: same full-screen viewer language as the world page. */
.gallery-dialog {
  width: 100%;
  max-width: 100%;
  height: 100svh;
  max-height: 100svh;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(3, 5, 4, 0.97);
  color: var(--text);
}

.gallery-dialog::backdrop { background: rgba(3, 5, 4, 0.97); }

.gallery-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-dialog__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.gallery-dialog__figure img {
  max-width: 100vw;
  max-height: calc(100svh - 96px);
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-dialog__caption {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 0.95rem;
}

.gallery-dialog__caption span {
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.gallery-dialog__copy {
  margin: 2px auto 0;
  max-width: 56ch;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0.85;
}

.gallery-dialog__close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-dialog__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 56px;
  height: 72px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 2.6rem;
  cursor: pointer;
  opacity: 0.75;
}

.gallery-dialog__nav--prev { left: 2px; }
.gallery-dialog__nav--next { right: 2px; }

/* Back to top, bottom-right; on phones it lifts clear of the
   portal-wide issue pill that spans the bottom center. */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(8, 11, 9, 0.82);
  color: var(--text);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
  .back-to-top { bottom: 96px; right: 12px; }
}
