/* ============================================================
   Ember Coffee — Bean Passport microsite
   Scoped styles. Inherits tokens from ../style.css
   ============================================================ */

/* ---------- Shell ---------- */
body.passport-page {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(206, 107, 72, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(176, 74, 46, 0.18), transparent 55%),
    linear-gradient(180deg, #2b140c 0%, #3a1a10 100%) fixed;
  color: var(--cream);
  min-height: 100vh;
  font-family: 'Outfit', sans-serif;
}

.passport-back {
  position: fixed;
  top: 88px;
  left: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--cream);
  background: rgba(43, 20, 12, 0.6);
  border: 1px solid rgba(241, 179, 142, 0.3);
  border-radius: 999px;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.passport-back:hover { background: rgba(176, 74, 46, 0.7); transform: translateX(-3px); }
.passport-back svg { width: 14px; height: 14px; }

/* ---------- Index: passport covers grid ---------- */
.passport-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 140px 24px 40px;
  text-align: center;
}
.passport-hero__eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--peach);
  letter-spacing: 0.05em;
}
.passport-hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
  margin: 8px 0 16px;
  color: var(--cream);
}
.passport-hero__lede {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--peach);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}

.passport-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 120px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
}

/* passport cover card */
.cover {
  position: relative;
  aspect-ratio: 3 / 4.2;
  border-radius: 6px 14px 14px 6px;
  padding: 28px 24px;
  color: var(--peach);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.4),
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(241, 179, 142, 0.25);
  background:
    radial-gradient(circle at 30% 20%, rgba(241, 179, 142, 0.18), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(74, 30, 18, 0.6), transparent 60%),
    linear-gradient(135deg, var(--deep) 0%, var(--darkest) 85%);
  transform: rotate(-0.4deg);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s;
  will-change: transform;
}
.cover:nth-child(2) { transform: rotate(0.6deg); }
.cover:nth-child(3) { transform: rotate(-0.2deg); }

.cover:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.45),
    0 40px 80px -20px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(241, 179, 142, 0.45);
}

/* leather texture overlay */
.cover::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 15% 35%, rgba(0,0,0,0.25) 0, transparent 2px),
    radial-gradient(circle at 75% 22%, rgba(0,0,0,0.18) 0, transparent 2px),
    radial-gradient(circle at 42% 78%, rgba(0,0,0,0.2) 0, transparent 2px),
    radial-gradient(circle at 88% 65%, rgba(0,0,0,0.15) 0, transparent 2px),
    radial-gradient(circle at 28% 88%, rgba(0,0,0,0.22) 0, transparent 2px);
  background-size: 180px 180px, 220px 220px, 140px 140px, 260px 260px, 200px 200px;
  opacity: 0.9;
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* gold-embossed inner frame */
.cover::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(241, 179, 142, 0.35);
  border-radius: 3px;
  pointer-events: none;
}

.cover__top {
  position: relative;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(241, 179, 142, 0.85);
}
.cover__top strong { display: block; font-weight: 600; color: var(--peach); }
.cover__top span { display: block; font-size: 0.62rem; letter-spacing: 0.28em; margin-top: 4px; opacity: 0.75; }

.cover__crest {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto;
  align-self: center;
}
.cover__crest svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(241,179,142,0.2)); }

.cover__origin {
  position: relative;
  text-align: center;
  padding-top: 8px;
}
.cover__origin-country {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--peach);
  opacity: 0.8;
}
.cover__origin-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1.05;
  color: var(--cream);
  margin-top: -2px;
}
.cover__origin-vol {
  display: inline-block;
  margin-top: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(241,179,142,0.75);
  border-top: 1px solid rgba(241,179,142,0.3);
  border-bottom: 1px solid rgba(241,179,142,0.3);
  padding: 6px 14px;
}

/* ---------- Origin pages: passport spread ---------- */
.passport-spread-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}
.passport-meta {
  text-align: center;
  margin-bottom: 30px;
}
.passport-meta__eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--peach);
}
.passport-meta__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1;
  margin: 4px 0 10px;
  color: var(--cream);
}
.passport-meta__sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--peach);
  opacity: 0.8;
}

/* the spread — two "pages" side by side */
.spread {
  position: relative;
  aspect-ratio: 2 / 1.25;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--linen);
  box-shadow:
    0 2px 0 rgba(0,0,0,0.25),
    0 40px 80px -20px rgba(0,0,0,0.55),
    0 0 0 10px rgba(43,20,12,0.35);
  perspective: 2200px;
  transform-style: preserve-3d;
}
/* center gutter shadow */
.spread::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 42px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(43,20,12,0.12) 35%,
    rgba(43,20,12,0.32) 50%,
    rgba(43,20,12,0.12) 65%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

.page {
  position: relative;
  padding: 42px 48px;
  color: var(--text-dark);
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(206,107,72,0.08), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(176,74,46,0.08), transparent 55%),
    repeating-linear-gradient(
      0deg,
      transparent 0 38px,
      rgba(176,74,46,0.05) 38px 39px
    ),
    var(--linen);
}
.page::before {
  /* aged paper speckle */
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(106,45,30,0.08) 0, transparent 2px),
    radial-gradient(circle at 72% 48%, rgba(106,45,30,0.06) 0, transparent 2px),
    radial-gradient(circle at 38% 78%, rgba(106,45,30,0.07) 0, transparent 2px),
    radial-gradient(circle at 85% 15%, rgba(106,45,30,0.05) 0, transparent 2px);
  background-size: 160px 160px, 220px 220px, 180px 180px, 240px 240px;
  pointer-events: none;
}
.page--left { border-right: 1px solid rgba(106,45,30,0.15); }
.page--right { border-left: 1px solid rgba(106,45,30,0.12); }

/* edge curl for page-turn affordance */
.page--right::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 40px 40px;
  border-color: transparent transparent var(--sand) transparent;
  filter: drop-shadow(-2px -2px 3px rgba(0,0,0,0.15));
  z-index: 3;
  transition: border-width 0.25s ease;
}
.page--right:hover::after { border-width: 0 0 60px 60px; }

/* ---------- Page content typography ---------- */
.page h2 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2rem;
  color: var(--darkest);
  line-height: 1;
  margin: 0 0 6px;
}
.page h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--deep);
  margin: 20px 0 6px;
}
.page p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0 0 10px;
}
.page .handwritten {
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  color: var(--deep);
  line-height: 1.2;
}

/* stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin: 18px 0 8px;
  padding: 14px 0;
  border-top: 1px dashed rgba(106,45,30,0.3);
  border-bottom: 1px dashed rgba(106,45,30,0.3);
}
.stat-grid__row { display: flex; flex-direction: column; }
.stat-grid__label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--deep);
  opacity: 0.85;
}
.stat-grid__value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-dark);
  margin-top: 2px;
}

/* farmer card */
.farmer {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px;
  background: rgba(241, 179, 142, 0.18);
  border: 1px solid rgba(106,45,30,0.15);
  border-radius: 3px;
  transform: rotate(-0.4deg);
}
.farmer__portrait {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid var(--cream);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--deep);
  font-style: italic;
}
.farmer__body { flex: 1; }
.farmer__name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--darkest);
}
.farmer__caption {
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.2;
  margin-top: 2px;
}

/* map area */
.origin-map {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 6px 0 12px;
}
.origin-map svg { width: 100%; height: 100%; display: block; }
.origin-map__dot {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--deep);
  box-shadow: 0 0 0 4px rgba(176,74,46,0.25), 0 0 14px rgba(224,138,98,0.7);
  transform: translate(-50%, -50%);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(176,74,46,0.25), 0 0 10px rgba(224,138,98,0.6); }
  50%      { box-shadow: 0 0 0 8px rgba(176,74,46,0.12), 0 0 18px rgba(224,138,98,0.9); }
}
.origin-map__caption {
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: var(--text-body);
  text-align: center;
  margin-top: 4px;
}

/* tasting notes */
.tasting {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-body);
  padding: 10px 0 4px;
}
.tasting strong { color: var(--deep); font-weight: 600; font-style: normal; }

/* passport stamp (corner) */
.stamp {
  position: absolute;
  top: 20px; right: 24px;
  width: 130px; height: 130px;
  transform: rotate(-14deg);
  opacity: 0.92;
  pointer-events: none;
  z-index: 4;
}
.stamp svg { width: 100%; height: 100%; }

.stamp--alt {
  top: auto; right: auto;
  bottom: 26px; left: 28px;
  transform: rotate(9deg);
  width: 110px; height: 110px;
}

/* journey map section — full width under spread */
.journey {
  position: relative;
  max-width: 1160px;
  margin: 60px auto 0;
  padding: 32px 24px 40px;
}
.journey__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px; flex-wrap: wrap;
}
.journey__title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2rem;
  color: var(--cream);
}
.journey__note {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--peach);
  opacity: 0.8;
}
.journey__map {
  position: relative;
  width: 100%;
  aspect-ratio: 24 / 9;
  background: rgba(248, 235, 214, 0.04);
  border: 1px dashed rgba(241, 179, 142, 0.2);
  border-radius: 6px;
  overflow: hidden;
}
.journey__map svg { width: 100%; height: 100%; display: block; }
.journey__line {
  fill: none;
  stroke: var(--peach);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  filter: drop-shadow(0 0 8px rgba(241,179,142,0.6));
  transition: stroke-dashoffset 0.1s linear;
}
.journey__plane {
  font-size: 18px;
  fill: var(--cream);
  opacity: 0;
  transition: opacity 0.3s;
}

/* controls */
.spread-controls {
  display: flex; gap: 10px; justify-content: center;
  margin: 24px 0 0;
}
.spread-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(43,20,12,0.6);
  border: 1px solid rgba(241,179,142,0.3);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.spread-btn:hover { background: rgba(176,74,46,0.7); }
.spread-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* page-turn animation (custom CSS 3D) */
.spread.is-turning .page--right {
  animation: pageFlip 900ms cubic-bezier(.65,.05,.4,.95) forwards;
  transform-origin: left center;
  z-index: 5;
}
@keyframes pageFlip {
  0%   { transform: rotateY(0deg); box-shadow: 0 0 0 transparent; }
  50%  { transform: rotateY(-90deg); box-shadow: -20px 0 40px rgba(0,0,0,0.3); }
  100% { transform: rotateY(-180deg); box-shadow: -20px 0 40px rgba(0,0,0,0.15); }
}

/* ---------- Footer slim ---------- */
.passport-footer {
  margin-top: 80px;
  padding: 40px 24px;
  text-align: center;
  color: rgba(241,179,142,0.7);
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  border-top: 1px solid rgba(241,179,142,0.15);
}
.passport-footer a { color: var(--peach); text-decoration: underline; }

/* ---------- Tablet: hide gutter before stack kicks in ---------- */
@media (max-width: 900px) {
  .spread::before { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 780px) {
  .passport-hero { padding: 110px 20px 20px; }
  .passport-spread-wrap { padding: 100px 16px 40px; }
  .spread {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }
  .spread::before { display: none; }
  .page { padding: 28px 24px; }
  .page--left { border-right: none; border-bottom: 1px dashed rgba(106,45,30,0.25); }
  .page--right { border-left: none; }
  .page--right::after { display: none; }
  .spread.is-turning .page--right {
    animation: pageFadeIn 500ms ease-out forwards;
    transform-origin: center;
  }
  @keyframes pageFadeIn {
    0%   { opacity: 0.3; transform: translateY(10px); }
    100% { opacity: 1;   transform: translateY(0); }
  }
  .stamp { width: 100px; height: 100px; top: 14px; right: 14px; }
  .stamp--alt { width: 88px; height: 88px; bottom: 14px; left: 14px; }
  .cover { aspect-ratio: 3 / 4; }
  .journey__map { aspect-ratio: 16 / 11; }
  .passport-back { top: 76px; left: 14px; font-size: 1rem; }
  .passport-hero__title { font-size: 2.4rem; }
  .passport-meta__title { font-size: 2.1rem; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .origin-map__dot { animation: none; }
  .spread.is-turning .page--right { animation: none; }
  .journey__line { transition: none; }
}
