/* ===========================================================
   CABIN FLUX — Catalog 05 · ADVENTURE
   Diary · multi-segment · Patagonia × Monos × Béis × July Aus.
   =========================================================== */

:root {
  --charcoal:   #222222;
  --camel:      #D4A24A;
  --sage:       #7A8B6E;
  --cream:      #F3EFE6;
  --cream-warm: #ECE6D8;
  --paper:      #FAF7EF;
  --coral:      #D67860;
  --coral-deep: #B95B43;
  --ink:        #1A1A1A;
  --muted:      #6E6A60;
  --rule:       #d6cfbe;

  --sans:    'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --serif:   'Source Serif Pro', 'Georgia', serif;
  --hand:    'Kalam', 'Caveat', cursive;
}

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

html, body {
  background: #16181a;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
em { font-style: italic; }
img { max-width: 100%; display: block; }

/* ============ VIEWER SHELL ============ */
.viewer-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: radial-gradient(ellipse at center, #2a2c2f 0%, #16181a 100%);
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(214, 120, 96, 0.18);
  background: rgba(15, 17, 19, 0.7);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.viewer-header .brand-mark {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #f0eee9;
  text-transform: uppercase;
}
.viewer-header .brand-mark .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
  vertical-align: middle;
  margin: 0 8px 3px 8px;
}
.viewer-title {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #98908a;
  flex: 1;
  text-align: center;
}
.viewer-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
#pg-indicator {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--coral);
  background: rgba(214,120,96,0.08);
  padding: 6px 12px;
  border-radius: 2px;
  border: 1px solid rgba(214,120,96,0.25);
}
#full-btn {
  background: transparent;
  border: 1px solid rgba(214,120,96,0.28);
  color: #f0eee9;
  width: 34px; height: 34px;
  border-radius: 3px;
  font-size: 16px;
  transition: all 0.2s ease;
}
#full-btn:hover { background: rgba(214,120,96,0.12); }

/* ============ BOOK STAGE ============ */
.book-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 22px 60px;
  min-height: 0;
}
#book {
  width: 100%; max-width: 1400px;
  height: 100%;
  margin: 0 auto;
}
.nav-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: #f0eee9;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  z-index: 6;
  transition: all 0.2s ease;
}
.nav-arrow:hover {
  background: var(--coral);
  border-color: var(--coral);
}
.nav-arrow--prev { left: 14px; }
.nav-arrow--next { right: 14px; }

.viewer-footer {
  padding: 9px 24px;
  text-align: center;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #7a767a;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(15, 17, 19, 0.55);
  flex-shrink: 0;
}

/* ============ PAGE BASE ============ */
.page {
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  position: relative;
  font-family: var(--sans);
}
.page--cream { background: var(--cream); }
.page--cream-warm { background: var(--cream-warm); }
.page--charcoal {
  background: var(--charcoal);
  color: var(--cream);
}
.page--full-image {
  background: #111;
}
.page-inner {
  position: absolute;
  inset: 0;
  padding: 38px 36px 30px 36px;
  display: flex;
  flex-direction: column;
}

/* ============ TYPE PRIMITIVES ============ */
.kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--coral-deep);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.kicker--charcoal {
  color: var(--coral);
}
.section-num {
  font-family: var(--hand);
  font-size: 22px;
  color: var(--coral);
  letter-spacing: 0.04em;
}
.lead {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 11px;
}
.lead--small {
  font-size: 12.5px;
}
.body-sans {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.handwritten {
  font-family: var(--hand);
  color: var(--coral);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
}
.handwritten--small { font-size: 18px; }
.handwritten--tiny  { font-size: 14px; }
.handwritten--lg    { font-size: 40px; }
.handwritten--xl    { font-size: 60px; line-height: 1; }

.footer-bar {
  position: absolute;
  bottom: 16px; left: 36px; right: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
.footer-bar .page-no {
  color: var(--coral-deep);
  font-weight: 600;
}
.footer-bar--dark {
  color: rgba(243, 239, 230, 0.55);
  border-top-color: rgba(243, 239, 230, 0.18);
}
.footer-bar--dark .page-no { color: var(--coral); }

/* =============================================
   PAGE 01 · COVER (multi-gen airport)
   ============================================= */
.page--cover {
  background: #1c1c1e;
  position: relative;
  overflow: hidden;
}
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(0,0,0,0.40) 0%,
      rgba(0,0,0,0.05) 32%,
      rgba(0,0,0,0.10) 65%,
      rgba(0,0,0,0.78) 100%);
}
.cover-wordmark {
  position: absolute;
  top: 26px; left: 28px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.32em;
  color: #ffffff;
  text-transform: uppercase;
}
.cover-wordmark .dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--coral);
  border-radius: 50%;
  vertical-align: middle;
  margin: 0 8px 3px;
}
.cover-bottom {
  position: absolute;
  bottom: 30px; left: 32px; right: 32px;
  color: #fff;
}
.cover-handnote {
  font-family: var(--hand);
  color: #ffffff;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 400;
  text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}
.cover-handnote .accent {
  color: var(--coral);
}
.cover-issue {
  margin-top: 14px;
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.55);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

/* =============================================
   PAGE 02 · INTRO (editor's note)
   ============================================= */
.intro-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.intro-content h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  margin-bottom: 18px;
  margin-top: 16px;
}
.intro-content h1 em {
  color: var(--coral-deep);
}
.intro-body p {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 11px;
  color: var(--ink);
}
.intro-sign {
  margin-top: auto;
  padding-top: 18px;
}
.intro-sign .sig {
  font-family: var(--hand);
  font-size: 22px;
  color: var(--coral);
  line-height: 1;
}
.intro-sign .sig-line {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* =============================================
   FULL-BLEED IMAGE PAGES
   ============================================= */
.full-bleed-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.full-bleed-grad-top {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0) 38%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.45) 100%);
}
.section-label {
  position: absolute;
  top: 36px; right: 36px;
  text-align: right;
  z-index: 4;
}
.section-label .num {
  font-family: var(--hand);
  font-size: 50px;
  color: var(--coral);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.section-label .name {
  font-family: var(--hand);
  font-size: 26px;
  color: #ffffff;
  line-height: 1.05;
  margin-top: 4px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}
.image-caption {
  position: absolute;
  bottom: 32px; left: 36px;
  color: #ffffff;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.3;
  max-width: 76%;
  text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}
.image-caption--small {
  font-size: 13px;
  font-style: normal;
  font-family: var(--sans);
  letter-spacing: 0.02em;
}

/* =============================================
   PRODUCT STORY PAGES
   ============================================= */
.product-story {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  padding: 30px 32px 24px;
}
.product-story .ps-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.product-story .ps-head .kicker { margin-bottom: 0; }
.product-story .ps-head .tag {
  font-family: var(--hand);
  font-size: 16px;
  color: var(--coral);
}
.product-story h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 6px;
}
.product-story h2 em { color: var(--coral-deep); }
.product-story .ps-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 14px;
  max-width: 92%;
}

.ps-stage {
  position: relative;
  margin: 6px auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
}
.ps-stage img {
  max-width: 90%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(34,34,34,0.22));
}

.ps-meta {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.ps-meta .meta-block .lbl {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}
.ps-meta .meta-block .val {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.swatch-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  display: inline-block;
}
.swatch--blue   { background: #4078a3; }
.swatch--green  { background: #6f7a55; }
.swatch--grey   { background: #777879; }
.swatch--camel  { background: #D4A24A; }
.swatch--black  { background: #1a1a1a; }
.swatch--pink   { background: #e8c5c1; }
.swatch--lilac  { background: #c8b6cb; }
.swatch--cream  { background: #efe6d4; }
.swatch--rose   { background: #d59c97; }
.swatch--olive  { background: #6c7549; }
.swatch--navy   { background: #283450; }
.swatch--red    { background: #b13a36; }
.swatch--mint   { background: #b6cdb3; }
.swatch--turq   { background: #5e9faa; }
.swatch--yellow { background: #d8b450; }

/* Hand-scribble callouts */
.scribble {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}
.scribble svg {
  display: block;
  overflow: visible;
}

.callout {
  position: absolute;
  z-index: 6;
  font-family: var(--hand);
  color: var(--coral);
  font-size: 17px;
  line-height: 1.15;
  max-width: 170px;
}

/* =============================================
   DUO PRODUCT PAGE
   ============================================= */
.page--duo .page-inner {
  padding: 32px 30px 30px;
}
.duo-head {
  margin-bottom: 12px;
}
.duo-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.1;
}
.duo-head h2 em { color: var(--coral-deep); }
.duo-head p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.duo-cell {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 14px 14px 14px;
  position: relative;
}
.duo-cell .duo-img {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 6px;
}
.duo-cell .duo-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(34,34,34,0.18));
}
.duo-cell h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 4px;
}
.duo-cell .duo-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.duo-cell .duo-swatches {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.duo-cell .duo-mini-label {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

/* =============================================
   PEOPLE WE SERVE PAGE
   ============================================= */
.page--people {
  background: var(--paper);
}
.people-img-wrap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 64%;
}
.people-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.people-caption {
  position: absolute;
  top: 65%; left: 36px; right: 36px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
}
.people-caption .lede {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 10px;
  color: var(--ink);
}
.people-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--hand);
  color: var(--coral);
  font-size: 15px;
  letter-spacing: 0.01em;
  padding-top: 6px;
  border-top: 1px dashed var(--rule);
  margin-top: auto;
}
.people-labels span { flex: 1; text-align: center; }
.people-labels .sep { color: var(--rule); font-family: var(--sans); }

/* =============================================
   BACK COVER
   ============================================= */
.page--back {
  background: var(--cream);
  position: relative;
}
.back-content {
  position: absolute;
  inset: 0;
  padding: 50px 40px 40px;
  display: flex;
  flex-direction: column;
}
.back-wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.28em;
  color: var(--ink);
  text-transform: uppercase;
}
.back-wordmark .dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--coral);
  border-radius: 50%;
  margin: 0 12px 3px;
}
.back-distrib {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.back-contact {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.back-contact .row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(34,34,34,0.12);
}
.back-contact .row .lbl {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 100px;
}
.back-contact .row .val {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.back-handwritten {
  margin-top: auto;
  text-align: right;
  font-family: var(--hand);
  font-size: 64px;
  color: var(--coral);
  line-height: 0.95;
}
.back-handwritten .small {
  display: block;
  font-size: 16px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--sans);
}
.back-pageno {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =============================================
   MOBILE FALLBACK (<768px) — vertical scroll
   ============================================= */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
  }
  .viewer-shell {
    height: auto;
    min-height: 100vh;
  }
  .book-stage {
    padding: 12px 8px;
  }
  .nav-arrow { display: none; }
  #book {
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
  }
  /* override page-flip in mobile */
  #book > .page,
  .stf__block .stf__item,
  .stf__wrapper {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 540px !important;
    aspect-ratio: 600 / 848;
    transform: none !important;
    display: block !important;
    margin-bottom: 14px !important;
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
  }
  .stf__parent { height: auto !important; }
  .viewer-footer { font-size: 9.5px; }
  .image-caption { font-size: 13px; }
  .section-label .num { font-size: 38px; }
  .section-label .name { font-size: 22px; }
}
