:root {
  color-scheme: dark;
  --burgundy: #65090b;
  --burgundy-dark: #260204;
  --red: #a8171b;
  --gold: #d7a83f;
  --gold-light: #f4dc8c;
  --ivory: #fff8e7;
  --ink: #1d1010;
  font-family: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #180203; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% 32%, rgba(177, 26, 31, .42), transparent 34rem),
    linear-gradient(145deg, #180203 0%, #4d0608 46%, #160102 100%);
  overflow-x: hidden;
}

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

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

.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 14px;
  border-bottom: 1px solid rgba(236, 195, 91, .42);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-light);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.eyebrow span { color: #ff444c; padding: 0 .25rem; }

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: .01em;
}

.pdf-link, .quick-actions a, .controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 44px;
  border-radius: 999px;
  text-decoration: none;
}

.pdf-link {
  padding: .72rem 1rem;
  border: 1px solid rgba(236, 195, 91, .55);
  color: var(--ivory);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .86rem;
  background: rgba(27, 1, 2, .34);
}

svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

main { position: relative; z-index: 1; }

.experience {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 18px 20px calc(34px + env(safe-area-inset-bottom));
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: min(1120px, 100%);
  margin: 0 auto 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.status-row p { margin: 0; }

#brochure-status {
  color: var(--gold-light);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hint { color: rgba(255, 248, 231, .68); font-size: .82rem; }

.viewport {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: min(67vw, 700px);
  padding: 18px 0 28px;
  overflow: hidden;
  perspective: 2600px;
}

.brochure-trigger {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  perspective: 2600px;
}

.brochure-trigger:focus-visible .brochure {
  outline: 3px solid var(--gold-light);
  outline-offset: 8px;
}

.brochure {
  position: relative;
  display: block;
  width: min(1120px, 92vw);
  aspect-ratio: 4 / 3;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, .5));
  transform-style: preserve-3d;
  transition: filter .5s ease, transform .5s ease;
}

.brochure[data-state="closed"] {
  filter: drop-shadow(0 35px 35px rgba(0, 0, 0, .62));
  transform: scale(.88) translateY(-1%);
}

.spread-frame {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  transform-origin: center;
  transform: scaleX(.34);
  opacity: 0;
  transition:
    transform .95s cubic-bezier(.18, .76, .2, 1),
    opacity .25s ease,
    clip-path .95s cubic-bezier(.18, .76, .2, 1);
  clip-path: inset(0 33.1% 0 33.1%);
}

.spread-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transition: opacity .2s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cover-card {
  position: absolute;
  top: 0;
  left: 31.68%;
  display: block;
  width: 36.64%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(103, 55, 9, .35);
  background: #fff9e9;
  box-shadow: 0 18px 32px rgba(0, 0, 0, .4);
  transform: rotateY(0deg) translateZ(5px);
  transform-origin: left center;
  opacity: 1;
  transition:
    transform .8s cubic-bezier(.18, .76, .2, 1),
    opacity .22s ease .42s;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cover-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.crease {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(90, 46, 10, .1), rgba(90, 46, 10, .42), rgba(255, 255, 255, .38), rgba(90, 46, 10, .16));
  box-shadow: -3px 0 7px rgba(54, 25, 0, .08), 3px 0 7px rgba(255,255,255,.16);
  opacity: 0;
  transition: opacity .35s ease .55s;
}

.crease-one { left: 34.3%; }
.crease-two { left: 66.25%; }

.brochure[data-state="outside"] .crease-one { left: 31.9%; }
.brochure[data-state="outside"] .crease-two { left: 63.41%; }

.brochure[data-state="inside"] .spread-frame,
.brochure[data-state="outside"] .spread-frame {
  transform: scaleX(1);
  opacity: 1;
  clip-path: inset(0);
}

.brochure[data-state="inside"] .inside-layer,
.brochure[data-state="outside"] .outside-layer { opacity: 1; }

.brochure[data-state="inside"] .crease,
.brochure[data-state="outside"] .crease { opacity: .62; }

.brochure[data-state="inside"] .cover-card,
.brochure[data-state="outside"] .cover-card {
  transform: rotateY(-84deg) translateZ(5px);
  opacity: 0;
}

.brochure.is-turning .spread-frame {
  pointer-events: none;
}

.controls {
  display: flex;
  justify-content: center;
  gap: .7rem;
  margin-top: 4px;
}

.controls button {
  padding: .78rem 1.15rem;
  border: 1px solid transparent;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-control {
  min-width: 178px;
  background: linear-gradient(180deg, #c22b2f, #861014);
  box-shadow: inset 0 1px rgba(255,255,255,.28), 0 8px 18px rgba(0,0,0,.25);
}

.secondary-control {
  background: rgba(20, 1, 2, .45);
  border-color: rgba(236, 195, 91, .42) !important;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  width: min(900px, 100%);
  margin: 18px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(236, 195, 91, .24);
}

.quick-actions a {
  padding: .66rem .9rem;
  color: rgba(255, 248, 231, .88);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .84rem;
  background: rgba(255, 255, 255, .055);
}

.pdf-link:hover, .quick-actions a:hover, .secondary-control:hover { background: rgba(255, 255, 255, .12); }
.primary-control:hover { background: linear-gradient(180deg, #d73a3e, #981319); }

.experience:fullscreen {
  display: grid;
  align-content: center;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 45%, #65090b, #180203 70%);
}

.experience:fullscreen .viewport { min-height: min(72vw, 76vh); }

@media (max-width: 720px) {
  .masthead { width: calc(100% - 28px); padding-top: 18px; }
  .masthead h1 { font-size: 1.1rem; }
  .eyebrow { max-width: 13rem; line-height: 1.4; font-size: .65rem; }
  .pdf-link { width: 44px; padding: 0; font-size: 0; }
  .experience { padding-inline: 10px; }
  .status-row { padding-inline: 4px; }
  .hint { display: none; }
  .viewport { min-height: 76vw; padding: 10px 0 18px; }
  .brochure { width: 97vw; }
  .brochure[data-state="closed"] { transform: scale(.94); }
  .controls { flex-wrap: wrap; }
  .controls button { min-height: 46px; }
  .quick-actions { margin-top: 14px; padding-top: 14px; }
  .quick-actions a { flex: 1 1 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
