/* ============================================================
   Triniton — deep space, warm gold, book-weight serif.
   ============================================================ */

:root {
  --tr-space: #0b0f26;
  --tr-gold:  #f0b95c;
  --tr-cream: #f4ead2;
  --tr-sand:  #d9cda9;
  --tr-brass: #c8a86a;
}

body { background: var(--tr-space); color: var(--tr-cream); font-family: var(--serif); }
a { color: var(--tr-gold); }

@keyframes glowPulse { 0%, 100% { opacity: .5 } 50% { opacity: .9 } }

.backbar { position: relative; z-index: 5; background: rgba(11, 15, 38, .6); }
.backbar__links a { color: #b7ab8e; }

.r-section { padding: clamp(64px, 9vw, 110px) var(--gutter); }
.r-inner { max-width: var(--wide); margin: 0 auto; }
.r-eyebrow { margin: 0; font: 400 12px/1 var(--mono); letter-spacing: .3em; color: var(--tr-brass); }
.r-h2 { margin: 20px 0 0; font: 400 clamp(26px, 4.6vw, 44px)/1.15 var(--captain); color: var(--tr-cream); letter-spacing: .04em; }
.r-body { margin: 22px auto 0; font: 300 clamp(15px, 2.2vw, 18px)/1.8 var(--serif); color: var(--tr-sand); max-width: 58ch; text-wrap: pretty; }

/* ── Hero ───────────────────────────────────────────────────── */

.r-hero {
  position: relative;
  min-height: 92svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(48px, 7vw, 90px) var(--gutter);
  margin-top: -64px;
  background: #0b0f26 center / cover no-repeat;
  background-image: image-set(url('assets/triniton_space-1280.webp') type('image/webp') 1x,
                              url('assets/triniton_space-1920.webp') type('image/webp') 1.5x);
}
@supports (background-image: image-set(url('x.avif') type('image/avif') 1x)) {
  .r-hero {
    background-image: image-set(url('assets/triniton_space-1280.avif') type('image/avif') 1x,
                                url('assets/triniton_space-1920.avif') type('image/avif') 1.5x);
  }
}
.r-hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .6;
  border: 0;
}
.r-hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 38, .55) 0%, rgba(11, 15, 38, .25) 45%, rgba(11, 15, 38, .92) 100%);
}
.r-hero__inner { position: relative; max-width: 760px; padding-top: 64px; }
.r-logo { width: clamp(150px, 26vw, 230px); margin: 0 auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); animation: floaty 7s ease-in-out infinite; }
.r-h1 { margin: 26px 0 0; font: 400 clamp(40px, 8vw, 84px)/1 var(--captain); color: var(--tr-gold); letter-spacing: .04em; }
.r-tagline { margin: 12px 0 0; font: italic 400 clamp(16px, 2.6vw, 22px)/1.4 var(--serif); color: #e8dcbc; }
.r-chip { display: inline-block; margin: 18px 0 0; font: 400 11px/1 var(--mono); letter-spacing: .18em; color: var(--tr-space); background: var(--tr-gold); border-radius: 3px; padding: 9px 14px; }
.r-hero .r-body { margin-top: 24px; max-width: 52ch; }

.r-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 32px; }
.r-btn {
  display: inline-flex; align-items: center;
  min-height: 52px; padding: 0 30px;
  background: var(--tr-gold); color: #241a06;
  border-radius: 3px; font: 400 15px/1 var(--captain); letter-spacing: .05em;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .5);
}
.r-btn--ghost { background: none; color: var(--tr-gold); border: 2px solid var(--tr-gold); padding: 0 26px; font-size: 14px; box-shadow: none; }
.r-jump { display: inline-block; margin-top: 20px; font: 400 13px/1 var(--mono); letter-spacing: .12em; color: var(--tr-sand); border-bottom: 1px solid rgba(217, 205, 169, .5); padding: 8px 0 4px; }

/* ── Why band ───────────────────────────────────────────────── */

.r-why {
  text-align: center;
  padding: clamp(72px, 10vw, 130px) var(--gutter);
  background:
    linear-gradient(rgba(11, 15, 38, .78), rgba(11, 15, 38, .9)),
    image-set(url('assets/triniton_space-1280.webp') type('image/webp') 1x,
              url('assets/triniton_space-1920.webp') type('image/webp') 1.5x)
      center / cover no-repeat;
}
@supports (background-image: image-set(url('x.avif') type('image/avif') 1x)) {
  .r-why {
    background:
      linear-gradient(rgba(11, 15, 38, .78), rgba(11, 15, 38, .9)),
      image-set(url('assets/triniton_space-1280.avif') type('image/avif') 1x,
                url('assets/triniton_space-1920.avif') type('image/avif') 1.5x)
        center / cover no-repeat;
  }
}
.r-why .r-inner { max-width: 820px; }
.r-why .r-h2 { margin-top: 24px; line-height: 1.3; }

/* ── Trailer ────────────────────────────────────────────────── */

.r-trailer { background: radial-gradient(70% 90% at 50% 100%, rgba(240, 185, 92, .12) 0%, rgba(11, 15, 38, 0) 60%); }
.r-trailer .r-inner { max-width: 920px; text-align: center; }
.r-frame {
  position: relative; aspect-ratio: 16 / 9; margin-top: 32px;
  border: 1px solid rgba(240, 185, 92, .4); border-radius: 8px;
  overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.r-frame .facade { height: 100%; }
.r-frame .facade img { height: 100%; object-fit: cover; }

/* ── What's in the box ──────────────────────────────────────── */

.r-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 42px; }
.r-card { background: rgba(240, 185, 92, .07); border: 1px solid rgba(240, 185, 92, .28); border-radius: 8px; padding: 24px 22px; }
.r-card h3 { margin: 0; font: 400 16px/1.3 var(--captain); color: var(--tr-gold); }
.r-card p { margin: 10px 0 0; font: 300 14px/1.7 var(--serif); color: var(--tr-sand); }

/* ── Press ──────────────────────────────────────────────────── */

.r-press-row { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 32px); margin-top: 34px; align-items: center; }
.r-press-row > .r-review { flex: 1 1 380px; min-width: min(270px, 100%); border-radius: 10px; overflow: hidden; border: 1px solid rgba(240, 185, 92, .4); }
.r-review .facade img { filter: brightness(.85); }
.r-quotes { flex: 1 1 340px; min-width: min(300px, 100%); display: grid; gap: 12px; }
.r-quote {
  display: block;
  border: 1px solid rgba(240, 185, 92, .28); border-radius: 8px;
  padding: 22px 22px 20px;
  color: var(--tr-cream); background: rgba(11, 15, 38, .5);
}
.r-quote p { margin: 0; font: italic 400 17px/1.5 var(--serif); }
.r-quote span { display: block; margin-top: 14px; font: 400 11px/1 var(--mono); letter-spacing: .14em; color: var(--tr-brass); }
.r-quotes--more { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 14px; }
.r-quotes--more[hidden] { display: none; }
.r-quotes--more .r-quote p { font-size: 16px; }

.r-togglewrap { text-align: center; margin-top: 26px; }
.r-toggle {
  min-height: 46px; padding: 0 26px;
  background: none; border: 1.5px solid rgba(240, 185, 92, .5); border-radius: 999px;
  color: var(--tr-gold); font: 400 12px/1 var(--mono); letter-spacing: .14em; cursor: pointer;
}

/* ── Team ───────────────────────────────────────────────────── */

.r-team { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.r-member {
  flex: 1 1 300px;
  display: flex; align-items: center; gap: 18px;
  border: 1px solid rgba(240, 185, 92, .28); border-radius: 8px;
  padding: 18px 20px; color: var(--tr-cream);
}
.r-member picture { width: 84px; flex: none; }
.r-member img { height: 76px; object-fit: cover; border-radius: 6px; }
.r-member--contain img { object-fit: contain; background: rgba(244, 234, 210, .08); padding: 6px; }
.r-member strong { display: block; font: 400 15px/1.3 var(--captain); color: var(--tr-gold); }
.r-member span span { font: 300 13px/1.5 var(--serif); color: var(--tr-sand); }

/* ── Art band ───────────────────────────────────────────────── */

.r-band {
  height: clamp(240px, 42vw, 480px);
  background:
    linear-gradient(180deg, rgba(11, 15, 38, .35) 0%, rgba(11, 15, 38, 0) 30%, rgba(11, 15, 38, 0) 70%, rgba(11, 15, 38, .55) 100%),
    image-set(url('assets/tri_arbes-1280.webp') type('image/webp') 1x,
              url('assets/tri_arbes-1920.webp') type('image/webp') 1.5x)
      center / cover no-repeat;
}
@supports (background-image: image-set(url('x.avif') type('image/avif') 1x)) {
  .r-band {
    background:
      linear-gradient(180deg, rgba(11, 15, 38, .35) 0%, rgba(11, 15, 38, 0) 30%, rgba(11, 15, 38, 0) 70%, rgba(11, 15, 38, .55) 100%),
      image-set(url('assets/tri_arbes-1280.avif') type('image/avif') 1x,
                url('assets/tri_arbes-1920.avif') type('image/avif') 1.5x)
        center / cover no-repeat;
  }
}

/* ── Big why + buy ──────────────────────────────────────────── */

.r-why2 { text-align: center; }
.r-why2 .r-inner { max-width: 820px; }
.r-kicker { margin: 24px 0 0; font: italic 400 15px/1.6 var(--serif); color: var(--tr-brass); }

.r-buy {
  text-align: center;
  background: radial-gradient(90% 100% at 50% 0%, rgba(240, 185, 92, .16) 0%, rgba(11, 15, 38, 0) 55%);
  border-top: 1px solid rgba(240, 185, 92, .2);
}
.r-buy__box { width: min(300px, 100%, 64vw); margin: 0 auto; filter: drop-shadow(0 26px 46px rgba(0, 0, 0, .6)); animation: floaty 7s ease-in-out infinite; }
.r-buy .r-h2 { margin-top: 30px; }
.r-buy__note { margin: 14px auto 0; font: 300 15px/1.7 var(--serif); color: var(--tr-sand); max-width: 46ch; }

/* ── Why + trailer, merged ──────────────────────────────────── */

.r-why .r-frame { max-width: 920px; margin: 38px auto 0; }

/* ── The book: a real two-page spread that folds ─────────────
   Closed, only the cover shows. Opening slides the block left and
   swings the cover across the spine to reveal the first spread. */

.r-mag { padding-top: clamp(48px, 7vw, 80px); }
.r-mag .r-inner { max-width: 980px; text-align: center; }

.book {
  position: relative;
  /* 62vw, not more: closed, the block shifts right by a quarter of its
     own width, and a wider book would push the cover off the screen. */
  width: min(860px, 62vw);
  aspect-ratio: 2876 / 1862;          /* two 1438x1862 pages, side by side */
  margin: 40px auto 0;
  perspective: 2800px;
  transition: transform .85s cubic-bezier(.2, .8, .2, 1);
}
.book--closed { transform: translateX(-25%); }

.book__inner { position: absolute; inset: 0; transform-style: preserve-3d; }

.book__side {
  position: absolute; top: 0; height: 100%; width: 50%;
  overflow: hidden; background: #080b1c;
  transition: opacity .4s ease;
}
.book__side--left  { left: 0;  box-shadow: inset -26px 0 40px -20px rgba(0, 0, 0, .9); }
.book__side--right { right: 0; box-shadow: inset  26px 0 40px -20px rgba(0, 0, 0, .9); }
.book__side img { display: block; width: 100%; height: 100%; object-fit: cover; }
.book--closed .book__side--left { opacity: 0; }

/* the block of paper you can see along the outer edges */
.book__inner::before, .book__inner::after {
  content: ''; position: absolute; top: 1.2%; bottom: 1.2%; width: 7px;
  background: repeating-linear-gradient(180deg, #efe6cf 0 2px, #cdc0a2 2px 4px);
  transition: opacity .5s ease;
}
.book__inner::before { left: -7px;  border-radius: 3px 0 0 3px; box-shadow: -3px 0 10px rgba(0,0,0,.5); }
.book__inner::after  { right: -7px; border-radius: 0 3px 3px 0; box-shadow:  3px 0 10px rgba(0,0,0,.5); }
.book--closed .book__inner::before { opacity: 0; }

/* ── the turning leaf ──────────────────────────────────────── */

.leaf {
  position: absolute; top: 0; width: 50%; height: 100%;
  transform-style: preserve-3d;
  z-index: 6;
  will-change: transform;
}
.leaf--fwd  { right: 0; transform-origin: left center;  animation: leafFwd  .95s cubic-bezier(.5, .02, .3, 1) both; }
.leaf--back { left: 0;  transform-origin: right center; animation: leafBack .95s cubic-bezier(.5, .02, .3, 1) both; }

@keyframes leafFwd  { from { transform: rotateY(0) } to { transform: rotateY(-180deg) } }
@keyframes leafBack { from { transform: rotateY(0) } to { transform: rotateY(180deg) } }

.leaf__face {
  position: absolute; inset: 0;
  overflow: hidden; background: #080b1c;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.leaf__face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.leaf__face--back { transform: rotateY(180deg); }

/* light rakes across the leaf as it swings through the vertical */
.leaf__face::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 62%);
  opacity: 0;
  animation: leafShade .95s ease-in-out both;
}
.leaf__face--back::after { background: linear-gradient(270deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 62%); }
@keyframes leafShade { 0% { opacity: 0 } 45% { opacity: .95 } 100% { opacity: 0 } }

/* and a shadow sweeps the page it is uncovering */
.book__sweep {
  position: absolute; top: 0; height: 100%; width: 50%;
  pointer-events: none; z-index: 5; opacity: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
  animation: sweep .95s ease-out both;
}
.book__sweep--right { right: 0; }
.book__sweep--left  { left: 0; background: linear-gradient(270deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); }
@keyframes sweep { 0% { opacity: .85 } 100% { opacity: 0 } }

/* ── controls ──────────────────────────────────────────────── */

.mag__bar {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(12px, 3vw, 26px); flex-wrap: wrap;
  margin-top: 26px;
}
.mag__nav {
  width: 48px; height: 48px; flex: none;
  border: 2px solid rgba(240, 185, 92, .55); border-radius: 50%;
  background: rgba(11, 15, 38, .7); color: var(--tr-gold);
  font: 400 22px/1 var(--serif); cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.mag__nav:hover:not(:disabled) { background: rgba(240, 185, 92, .18); transform: scale(1.08); }
.mag__nav:disabled { opacity: .28; cursor: default; }
.mag__count { font: 400 12px/1 var(--mono); letter-spacing: .14em; color: var(--tr-brass); min-width: 12ch; }
.mag__hint { font: 300 14px/1.6 var(--serif); color: var(--tr-sand); margin: 12px 0 0; }

@media (max-width: 700px) {
  /* a spread is unreadable on a phone, so it becomes a single-page reader:
     left page, right page, then on to the next spread */
  .book { width: min(340px, 78vw); aspect-ratio: 1438 / 1862; transform: none; }
  .book--closed { transform: none; }
  .book__side { width: 100%; }
  .book__side--left { display: none; }
  .book__inner::before { display: none; }
  .leaf { width: 100%; transform-origin: left center; }
  .leaf--back { left: 0; transform-origin: left center; animation-name: leafBackPhone; }
}
@keyframes leafBackPhone { from { transform: rotateY(-180deg) } to { transform: rotateY(0) } }

@media (prefers-reduced-motion: reduce) {
  .book, .leaf, .leaf__face::after, .book__sweep { transition: none !important; animation-duration: 1ms !important; }
}
