:root {
  --bg: #090909;
  --panel: #0d0d0d;
  --text: #ece9e2;
  --muted: rgba(236, 233, 226, 0.5);
  --faint: rgba(255, 255, 255, 0.08);
  --crawl-duration: 108s;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

/* Opening card */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #050505;
  opacity: 1;
  transition: opacity 1.2s ease;
}

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

.intro__inner {
  text-align: center;
  transform: translateY(-1vh);
  animation: introReveal 2.2s ease both;
}

.intro__brand {
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  letter-spacing: 0.44em;
  text-transform: uppercase;
}

.intro__presents {
  margin-top: 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-style: italic;
  color: rgba(236, 233, 226, 0.46);
}

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

/* Main experience */
.experience {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(360px, 42%);
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  transition: opacity 700ms ease, transform 700ms ease;
}

.experience[aria-hidden="true"] {
  opacity: 0;
  transform: scale(1.008);
  pointer-events: none;
}

.photo-panel,
.story-panel {
  min-width: 0;
}

.photo-panel {
  position: relative;
  overflow: hidden;
  background: #161616;
}

.hero-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.9) contrast(1.03);
  transform: scale(1.035);
  opacity: 0;
  animation: photoIn 2.5s 2.6s ease-out forwards;
}

.photo-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 68%, rgba(9, 9, 9, 0.74) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.28), transparent 24%);
}

@keyframes photoIn {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1.015); }
}

.brand-link {
  position: absolute;
  z-index: 5;
  top: 34px;
  left: 38px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-decoration: none;
  text-transform: uppercase;
}

.photo-meta {
  position: absolute;
  z-index: 5;
  right: 30px;
  bottom: 27px;
  left: 38px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.story-panel {
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--faint);
  background:
    radial-gradient(circle at 45% 40%, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--panel);
}

.story-header {
  position: absolute;
  z-index: 10;
  top: 7.5vh;
  right: 10%;
  left: 10%;
  opacity: 0;
  animation: headerIn 1.6s 3.1s ease forwards;
}

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

.kicker {
  margin: 0 0 1rem;
  color: rgba(236, 233, 226, 0.38);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.story-header h1 {
  margin: 0;
  max-width: 520px;
  color: #f1eee7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.03;
}

.place {
  margin: 0.9rem 0 0;
  color: rgba(236, 233, 226, 0.39);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-style: italic;
}

.place[hidden] {
  display: none;
}

.story-stage {
  position: absolute;
  top: 31vh;
  right: 7%;
  bottom: 13vh;
  left: 7%;
  overflow: hidden;
  perspective: 760px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 84%, transparent 100%);
  opacity: 0;
  animation: stageIn 1.2s 3s ease forwards;
}

@keyframes stageIn {
  to { opacity: 1; }
}

.story-crawl {
  position: absolute;
  top: 0;
  left: 8%;
  width: 84%;
  color: rgba(240, 237, 230, 0.88);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.28vw, 1.28rem);
  line-height: 1.85;
  text-wrap: pretty;
  transform-origin: 50% 100%;
  /* Reading speed stays unchanged; only the entry point is earlier. */
  transform: translateY(30vh) rotateX(6deg);
  animation: crawl var(--crawl-duration) 2.75s linear both;
  will-change: transform;
}

.story-crawl p {
  margin: 0 0 1.55em;
}

.story-crawl p:first-child::first-letter {
  float: left;
  margin: 0.13em 0.12em 0 0;
  color: #fff;
  font-size: 4.2em;
  line-height: 0.72;
}

.story-end {
  display: grid;
  place-items: center;
  height: 33vh;
  color: rgba(236, 233, 226, 0.35);
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

@keyframes crawl {
  from {
    transform: translateY(30vh) rotateX(6deg);
  }
  to {
    transform: translateY(-138%) rotateX(6deg);
  }
}

.story-footer {
  position: absolute;
  z-index: 12;
  right: 10%;
  bottom: 4.6vh;
  left: 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  opacity: 0;
  animation: footerIn 1.3s 4.1s ease forwards;
}

@keyframes footerIn {
  to { opacity: 1; }
}

.controls {
  display: flex;
  gap: 0.35rem;
}

.story-actions {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.read-link {
  color: rgba(236, 233, 226, 0.46);
}


.control {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  padding: 0.52rem 0.65rem;
  color: rgba(236, 233, 226, 0.56);
  font: inherit;
  font-size: 0.67rem;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.control:hover,
.control:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.92);
  outline: none;
}

.read-link,
.next-link,
.finale__site-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(236, 233, 226, 0.66);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.035em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.read-link::after,
.next-link::after,
.finale__site-link::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.17);
  transform-origin: left;
  transition: transform 180ms ease, background 180ms ease;
}

.read-link:hover::after,
.read-link:focus-visible::after,
.next-link:hover::after,
.next-link:focus-visible::after,
.finale__site-link:hover::after,
.finale__site-link:focus-visible::after {
  background: rgba(255, 255, 255, 0.72);
  transform: scaleX(0.78);
}

.read-link:focus-visible,
.next-link:focus-visible,
.finale__site-link:focus-visible {
  outline: none;
  color: #fff;
}

/* Language switch */
.language-switch {
  position: absolute;
  z-index: 20;
  top: 34px;
  right: 10%;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  opacity: 0;
  animation: footerIn 1.3s 3.7s ease forwards;
}

.language-switch__button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(236, 233, 226, 0.36);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 160ms ease;
}

.language-switch__button:hover,
.language-switch__button:focus-visible,
.language-switch__button.is-active {
  color: rgba(255, 255, 255, 0.92);
  outline: none;
}

.language-switch__button.is-active {
  cursor: default;
}

.language-switch__separator {
  color: rgba(236, 233, 226, 0.2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.72rem;
}


/* Static reading lightbox */
.reader {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 54px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.reader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 260ms ease, visibility 0s linear 0s;
}

.reader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.reader__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(820px, 92vw);
  height: min(82vh, 860px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,.025), transparent 38%),
    #0b0b0b;
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
}

.reader__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(24px, 4vw, 42px) clamp(24px, 5vw, 54px) 22px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.reader__eyebrow {
  margin: 0 0 .8rem;
  color: rgba(236,233,226,.34);
  font-size: .62rem;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.reader h2 {
  margin: 0;
  color: #f1eee7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.4vw, 3.55rem);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.02;
}

.reader__place {
  margin: .8rem 0 0;
  color: rgba(236,233,226,.39);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .86rem;
  font-style: italic;
}

.reader__place:empty {
  display: none;
}

.reader__close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.11);
  background: transparent;
  color: rgba(236,233,226,.56);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.reader__close:hover,
.reader__close:focus-visible {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.025);
  color: #fff;
  outline: none;
}

.reader__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
  padding: 30px clamp(24px, 5vw, 54px) 50px;
}

.reader__scroll:focus-visible {
  outline: 1px solid rgba(255,255,255,.16);
  outline-offset: -1px;
}

.reader__story {
  width: min(640px, 100%);
  margin: 0 auto;
  color: rgba(240,237,230,.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.04rem, 1.45vw, 1.18rem);
  line-height: 1.86;
}

.reader__story p {
  margin: 0 0 1.45em;
}

.reader__story p:first-child::first-letter {
  float: left;
  margin: .14em .12em 0 0;
  color: #fff;
  font-size: 4em;
  line-height: .7;
}

body.reader-open {
  overflow: hidden;
}


/* Book finale */
.finale {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8vh 8vw;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.035), transparent 34%),
    #070707;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 900ms ease, visibility 0s linear 900ms;
}

.finale::before,
.finale::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.finale::before {
  top: 11vh;
  bottom: 11vh;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.09), transparent);
  opacity: 0.55;
}

.finale::after {
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,.018), transparent 22%, transparent 78%, rgba(255,255,255,.015));
}

.finale.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 900ms ease, visibility 0s linear 0s;
}

.finale__language {
  top: 34px;
  right: 6vw;
  opacity: 1;
  animation: none;
}

.finale__content {
  position: relative;
  z-index: 2;
  width: min(760px, 84vw);
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
}

.finale.is-visible .finale__content {
  animation: finaleContentIn 1.35s 420ms ease forwards;
}

@keyframes finaleContentIn {
  to { opacity: 1; transform: translateY(0); }
}

.finale__eyebrow {
  margin: 0 0 1.35rem;
  color: rgba(236, 233, 226, 0.34);
  font-size: 0.66rem;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.finale h2 {
  margin: 0;
  color: #f1eee7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.finale__copy {
  width: min(640px, 100%);
  margin: 2.1rem auto 0;
  color: rgba(236, 233, 226, 0.64);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.78;
}

.finale__status {
  display: inline-block;
  margin: 1.7rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255,255,255,.11);
  color: rgba(236, 233, 226, 0.42);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.finale__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  margin-top: 2.35rem;
}

.finale__button {
  border: 1px solid rgba(255,255,255,.14);
  background: transparent;
  padding: .72rem .9rem;
  color: rgba(236, 233, 226, 0.58);
  font-size: .7rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.finale__button:hover,
.finale__button:focus-visible {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.025);
  color: #fff;
  outline: none;
}

/* Tablet / mobile */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .experience {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
  }

  .photo-panel {
    height: 56vh;
  }

  .photo-panel::after {
    background: linear-gradient(0deg, #0d0d0d 0%, transparent 30%);
  }

  .story-panel {
    min-height: 850px;
    border-left: 0;
  }

  .story-header {
    top: 58px;
    right: 8%;
    left: 8%;
  }

  .story-header h1 {
    font-size: clamp(2.1rem, 9vw, 3.3rem);
  }

  .story-stage {
    top: 270px;
    right: 5%;
    bottom: 100px;
    left: 5%;
  }

  .story-crawl {
    left: 6%;
    width: 88%;
    font-size: 1.05rem;
    line-height: 1.78;
  }

  .story-footer {
    right: 8%;
    bottom: 34px;
    left: 8%;
  }

  .brand-link,
  .photo-meta {
    left: 22px;
  }

  .brand-link {
    top: 22px;
  }

  .photo-meta {
    right: 22px;
    bottom: 20px;
  }

  .language-switch {
    top: 22px;
    right: 8%;
  }

  .finale {
    padding: 8vh 9vw;
  }

  .finale::before {
    display: none;
  }

  .finale__language {
    right: 8%;
  }
}

@media (max-width: 560px) {
  .photo-panel {
    height: 49vh;
  }

  .story-panel {
    min-height: 820px;
  }

  .photo-meta span:last-child {
    max-width: 68%;
    text-align: right;
  }

  .story-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .story-actions {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  .reader {
    padding: 10px;
  }

  .reader__panel {
    width: 100%;
    height: 92vh;
  }

  .reader__header {
    padding: 24px 22px 18px;
  }

  .reader__scroll {
    padding: 24px 22px 40px;
  }

  .finale h2 {
    font-size: clamp(2.6rem, 13vw, 4.1rem);
  }

  .finale__actions {
    flex-direction: column;
    gap: 1.15rem;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  body {
    overflow: auto;
  }

  .intro {
    display: none;
  }

  .experience {
    height: auto;
    min-height: 100vh;
  }

  .hero-photo,
  .story-header,
  .story-stage,
  .story-footer,
  .language-switch {
    opacity: 1;
    animation: none;
  }

  .story-panel {
    min-height: 980px;
  }

  .story-stage {
    overflow-y: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .story-crawl {
    position: static;
    width: 84%;
    margin: 0 auto;
    transform: none;
    animation: none;
  }

  .finale,
  .finale__content {
    transition: none;
    animation: none !important;
  }

  .finale.is-visible .finale__content {
    opacity: 1;
    transform: none;
  }
}


/* Global site credit / developer promotion */
.site-credit {
  position: fixed;
  z-index: 85;
  right: 18px;
  bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
  color: rgba(236, 233, 226, 0.28);
  font-size: 0.58rem;
  letter-spacing: 0.055em;
  white-space: nowrap;
  transition: opacity 180ms ease;
}

.site-credit__legal {
  display: flex;
  align-items: baseline;
  gap: 0.34rem;
}

.site-credit__separator,
.site-credit__divider {
  color: rgba(236, 233, 226, 0.2);
}

.site-credit__divider {
  margin: 0 0.18rem;
}

.site-credit a {
  color: rgba(236, 233, 226, 0.52);
  text-decoration: none;
  border-bottom: 1px solid rgba(236, 233, 226, 0.16);
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}

.site-credit .site-credit__robnet {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  vertical-align: middle;
}

.site-credit__robnet-icon {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 14px;
  position: relative;
  top: -1px;
  opacity: 0.72;
}

.site-credit a:hover,
.site-credit a:focus-visible {
  color: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.6);
  outline: none;
}

body.reader-open .site-credit {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 700px) {
  .site-credit {
    right: 12px;
    bottom: 8px;
    left: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    row-gap: 0.28rem;
    font-size: 0.54rem;
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .site-credit__divider {
    display: none;
  }

  .site-credit {
    column-gap: 0.5rem;
  }
}
