/*
 * Esteút Pavilon — cinematic story layout
 */

:root {
  --void: #070607;
  --ink: #121015;
  --smoke: #1b171d;
  --fog: #c9c2bc;
  --muted: #8a817a;
  --ember: #e07a4f;
  --wine: #6c2234;
  --amber-glow: rgba(232, 168, 91, 0.35);
  --frame-pad: clamp(1.25rem, 4vw, 4rem);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fog);
  background: var(--void);
  overflow-x: hidden;
}

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

a {
  color: var(--ember);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

a:hover,
a:focus-visible {
  color: #f29a72;
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

/* —— Film grain overlay —— */
.story-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Skip link —— */
.skip {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  background: var(--ink);
  color: var(--fog);
  padding: 0.5rem 1rem;
  z-index: 200;
}

.skip:focus {
  left: 0.75rem;
}

/* —— Floating story rail (not a classic header) —— */
.story-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--frame-pad);
  background: linear-gradient(
    to bottom,
    rgba(7, 6, 7, 0.78) 0%,
    rgba(7, 6, 7, 0.2) 72%,
    transparent 100%
  );
  pointer-events: none;
}

.story-rail a,
.story-rail button {
  pointer-events: auto;
}

.story-mark {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f2ebe3;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.55);
}

.story-rail .story-mark {
  color: #f2ebe3;
  text-decoration: none;
}

.story-rail .story-mark:hover,
.story-rail .story-mark:focus-visible {
  color: #fff;
}

.story-mark span {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 0.25rem;
}

.story-rail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: flex-end;
  max-width: min(520px, 70vw);
}

.story-rail__links a {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(249, 242, 235, 0.82);
  border-bottom: 1px solid transparent;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}

.story-rail__links a:hover {
  border-bottom-color: rgba(232, 168, 91, 0.65);
  color: #fff;
}

/* —— Story scene shell —— */
.story-root {
  position: relative;
}

.story-frame {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: stretch;
  overflow: clip;
}

.story-frame__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.story-frame__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.05);
}

.story-frame__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    115deg,
    rgba(7, 6, 7, 0.88) 0%,
    rgba(7, 6, 7, 0.45) 42%,
    rgba(18, 16, 21, 0.75) 100%
  );
}

.story-frame__veil--warm {
  background: radial-gradient(
      circle at 20% 30%,
      rgba(224, 122, 79, 0.12) 0%,
      transparent 45%
    ),
    linear-gradient(
      to bottom,
      rgba(7, 6, 7, 0.2) 0%,
      rgba(7, 6, 7, 0.88) 100%
    );
}

.story-frame__veil--corridor {
  background: linear-gradient(
    90deg,
    rgba(7, 6, 7, 0.95) 0%,
    rgba(7, 6, 7, 0.55) 38%,
    rgba(108, 34, 52, 0.25) 100%
  );
}

.story-frame__content {
  position: relative;
  z-index: 2;
  padding: clamp(5rem, 12vw, 8rem) var(--frame-pad) var(--frame-pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.story-frame--tight .story-frame__content {
  justify-content: center;
  max-width: 46rem;
}

.story-frame--void {
  background: var(--void);
}

.story-frame--void .story-frame__content {
  justify-content: center;
  min-height: 55vh;
}

.story-frame--split {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .story-frame--split {
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
  }

  .story-frame--split .story-frame__content {
    justify-content: center;
    padding-top: clamp(6rem, 10vw, 9rem);
  }

  .story-frame--split .story-frame__panel--image {
    min-height: 100vh;
  }
}

.story-frame--split .story-frame__panel--image {
  position: relative;
  min-height: 48vh;
}

.story-frame--split .story-frame__bg,
.story-frame--split .story-frame__veil {
  position: absolute;
}

.story-caption {
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(249, 242, 235, 0.55);
}

.story-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 8vw, 5.25rem);
  line-height: 0.98;
  color: #f5ede4;
  max-width: 14ch;
}

.story-body {
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  max-width: 38rem;
  color: rgba(233, 225, 218, 0.9);
}

.story-body p + p {
  margin-top: 1.1em;
}

.story-remark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: rgba(249, 242, 235, 0.75);
}

.story-space {
  min-height: clamp(4rem, 12vh, 10rem);
}

.story-rule-line {
  width: min(100%, 12rem);
  height: 1px;
  background: linear-gradient(90deg, var(--ember), transparent);
  margin: 0.5rem 0 1.25rem;
}

/* —— Lists as “shot list” —— */
.shot-list {
  list-style: none;
  margin: 1.5rem 0 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 1.25rem;
}

.shot-list li {
  margin-bottom: 0.85rem;
  color: rgba(233, 225, 218, 0.82);
  font-size: 0.95rem;
}

.shot-list li strong {
  color: #f2ebe3;
  font-weight: 600;
}

/* —— Asymmetrical pull quote —— */
.story-pull {
  margin-top: 2rem;
  padding: 1.25rem 0 1.25rem 1.5rem;
  border-left: 3px solid var(--wine);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.35;
  color: rgba(249, 242, 235, 0.88);
}

/* —— Scene label bottom —— */
.story-slug {
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* —— Entry / reveal —— */
.story-frame[data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

html.js-on .story-frame[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(4px);
  transition:
    opacity 1.1s var(--ease-out),
    transform 1.1s var(--ease-out),
    filter 1.1s var(--ease-out);
}

html.js-on .story-frame.is-visible[data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* —— Kaszino horizontal filmstrip —— */
.filmstrip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filmstrip figure {
  flex: 0 0 min(88vw, 640px);
  scroll-snap-align: start;
  position: relative;
  margin: 0;
}

.filmstrip img {
  width: 100%;
  height: min(70vh, 520px);
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.08);
}

.filmstrip figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(233, 225, 218, 0.45);
  background: var(--smoke);
}

/* —— Screenplay block —— */
.screenplay {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  color: rgba(200, 192, 184, 0.9);
  white-space: pre-wrap;
  max-width: 36rem;
}

/* —— Age gate —— */
.age-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
}

.age-modal.show {
  opacity: 1;
  visibility: visible;
}

.age-modal__shade {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 5, 0.92);
  backdrop-filter: blur(10px);
}

.age-modal__box {
  position: relative;
  z-index: 1;
  background: var(--smoke);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem;
  max-width: 420px;
  width: 92%;
}

.age-modal__box h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: #f5ede4;
  margin-bottom: 0.75rem;
}

.age-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-thread {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #f2ebe3;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.btn-thread:hover {
  border-color: var(--ember);
  background: rgba(224, 122, 79, 0.12);
}

.btn-thread--solid {
  background: var(--wine);
  border-color: var(--wine);
}

.btn-thread--solid:hover {
  background: #852a40;
  border-color: #852a40;
}

/* —— Cookie ribbon —— */
.cookie-ribbon {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 250;
  transform: translateY(110%);
  transition: transform 0.45s var(--ease-out);
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem var(--frame-pad);
}

.cookie-ribbon.show {
  transform: translateY(0);
}

.cookie-ribbon__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: 72rem;
  margin: 0 auto;
}

.cookie-ribbon p {
  flex: 1 1 260px;
  font-size: 0.78rem;
  color: rgba(201, 194, 188, 0.88);
}

/* —— Minimal footer —— */
.story-foot {
  padding: 3rem var(--frame-pad) 5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: rgba(138, 129, 122, 0.95);
}

.story-foot__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  max-width: 72rem;
  margin: 0 auto;
}

.story-foot__row a {
  color: rgba(201, 194, 188, 0.85);
}

.story-foot__row a:hover {
  color: var(--ember);
}

/* —— Legal document layout —— */
.legal-stage {
  min-height: 100vh;
  background: radial-gradient(
      ellipse at 50% 0%,
      rgba(108, 34, 52, 0.18),
      transparent 55%
    ),
    var(--void);
  padding: clamp(5rem, 12vw, 7rem) var(--frame-pad) 4rem;
}

.legal-stage__sheet {
  max-width: 42rem;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(18, 16, 21, 0.65);
  backdrop-filter: blur(12px);
  padding: clamp(1.75rem, 4vw, 3rem);
}

.legal-stage__kicker {
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(249, 242, 235, 0.45);
  margin-bottom: 1rem;
}

.legal-stage h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.85rem);
  color: #f5ede4;
  font-weight: 500;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.legal-stage h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: rgba(249, 242, 235, 0.92);
  margin: 2rem 0 0.65rem;
  font-weight: 500;
}

.legal-stage p {
  margin-bottom: 0.85rem;
  color: rgba(201, 194, 188, 0.92);
  font-size: 0.95rem;
}

.legal-stage ul {
  margin: 0.5rem 0 1rem 1.15rem;
  color: rgba(201, 194, 188, 0.9);
}

.legal-back {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

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

  html.js-on .story-frame[data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .cookie-ribbon {
    transition: none;
  }
}
