/* ==========================================================================
   Globe Vacations — Bureau of Wanderings (vintage edition)
   Palette:  warm paper, deep ink, postmark red, sun-bleached gold
   Type:     Fraunces (display), DM Sans (body), DM Mono (UI labels)
   ========================================================================== */

:root {
  --paper:       #ecddbc;
  --paper-deep:  #d8c597;
  --paper-light: #f6ecd1;
  --ink:         #1d2440;
  --ink-soft:    #3a3f5a;
  --red:         #b8443a;
  --red-deep:    #8e2f27;
  --gold:        #b8862a;
  --gold-deep:   #8d6620;
  --olive:       #5d6e3e;
  --teal:        #345b6b;
  --line:        rgba(29, 36, 64, 0.18);
  --line-soft:   rgba(29, 36, 64, 0.08);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(184, 134, 42, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 90%, rgba(184, 68, 58, 0.06), transparent 70%),
    radial-gradient(circle at 50% 50%, var(--paper) 0%, var(--paper-deep) 100%);
}

/* Paper grain + soft vignette */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(29, 36, 64, 0.025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(29, 36, 64, 0.025) 0 1px, transparent 1px 3px);
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 1;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(40, 25, 5, 0.18) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ---------- Globe scene ---------- */
.scene {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3;
}
#globe { width: 100%; height: 100%; }
#globe canvas {
  display: block;
  filter: sepia(0.28) saturate(0.85) contrast(1.05) brightness(0.97);
}

/* ---------- Brand bar (top-left) ---------- */
.brand {
  position: fixed;
  top: 24px;
  left: clamp(20px, 3vw, 36px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand__seal {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 22px;
  font-style: italic;
  letter-spacing: -0.03em;
  border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper);
  transform: rotate(-6deg);
}
.brand__text {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand__sub {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-top: 4px;
}

/* ---------- Meta top-right ---------- */
.meta-top {
  position: fixed;
  top: 28px;
  right: clamp(20px, 3vw, 36px);
  z-index: 10;
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.6;
}
.meta-top strong { color: var(--ink); font-weight: 500; }

/* ---------- Hero ---------- */
.hero {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  pointer-events: none;
  max-width: 720px;
  padding: 0 24px;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--red-deep);
}
.hero__eyebrow::before, .hero__eyebrow::after {
  content: '';
  width: 36px;
  height: 1px;
  background: var(--red-deep);
}
.hero__title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  margin: 10px 0 0;
}
.hero__title em { font-style: normal; color: var(--red-deep); }

/* ---------- Spin zone (bottom-center) ---------- */
.spin-zone {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.spin-btn {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 0;
  background: var(--red);
  color: var(--paper);
  cursor: pointer;
  font-family: 'Fraunces', serif;
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  box-shadow:
    0 0 0 6px var(--paper),
    0 0 0 8px var(--red-deep),
    0 18px 36px -8px rgba(80, 20, 10, 0.5);
}
.spin-btn::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px dashed rgba(236, 221, 188, 0.5);
}
.spin-btn:hover {
  transform: translateY(-3px) rotate(-4deg);
  box-shadow:
    0 0 0 6px var(--paper),
    0 0 0 8px var(--red-deep),
    0 26px 50px -10px rgba(80, 20, 10, 0.6);
}
.spin-btn:active { transform: translateY(0) rotate(0); }
.spin-btn:disabled { opacity: 0.85; cursor: progress; }
.spin-btn__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.spin-btn__top {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.85;
}
.spin-btn__main {
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
}
.spin-btn__compass {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  margin-top: 2px;
  display: inline-block;
}
.spin-btn.is-spinning .spin-btn__compass {
  animation: compass-spin 0.8s linear infinite;
}
@keyframes compass-spin { to { transform: rotate(360deg); } }

.spin-caption {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.8;
}

/* ---------- Compass deco (bottom-left) ---------- */
.compass-deco {
  position: fixed;
  bottom: 32px;
  left: clamp(20px, 3vw, 32px);
  z-index: 5;
  width: 96px;
  height: 96px;
  opacity: 0.5;
  pointer-events: none;
  color: var(--ink);
}

/* ---------- Coords (bottom-right) ---------- */
.coords {
  position: fixed;
  bottom: 36px;
  right: clamp(20px, 3vw, 32px);
  z-index: 5;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.6;
}
.coords strong { color: var(--ink); font-weight: 500; }

/* ---------- Postcard reveal ---------- */
.postcard {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  width: min(760px, 94vw);
  background: var(--paper-light);
  color: var(--ink);
  padding: 0;
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 30px 80px -20px rgba(20, 14, 4, 0.45),
    inset 0 0 0 1px rgba(29, 36, 64, 0.08);
  transform: translate(-50%, -50%) rotate(-1.5deg) scale(0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, transform 0.55s var(--ease-out);
  overflow: hidden;
  max-height: 92vh;
  overflow-y: auto;
}
.postcard.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-1.2deg) scale(1);
  pointer-events: auto;
}
.postcard::before,
.postcard::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 8px;
  opacity: 0.85;
  pointer-events: none;
}
.postcard::before {
  top: 0;
  background: repeating-linear-gradient(
    45deg,
    var(--red) 0 14px,
    transparent 14px 22px,
    var(--ink) 22px 36px,
    transparent 36px 44px
  );
}
.postcard::after {
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    var(--ink) 0 14px,
    transparent 14px 22px,
    var(--red) 22px 36px,
    transparent 36px 44px
  );
}

.postcard__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 0;
  padding: 28px 0;
}

.postcard__photo {
  position: relative;
  margin: 0 0 0 26px;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(29, 36, 64, 0.18),
    0 6px 14px -6px rgba(40, 25, 5, 0.4);
}
.postcard__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.4) saturate(0.92) contrast(1.05) brightness(0.97);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.postcard__photo img.is-loaded { opacity: 1; }
.postcard__photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(184, 134, 42, 0.12), rgba(29, 36, 64, 0.20));
  mix-blend-mode: multiply;
  pointer-events: none;
}
.postcard__photo-skeleton {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, var(--paper-deep) 30%, #c8b48a 50%, var(--paper-deep) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.postcard__photo-skeleton.is-hidden { display: none; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.postcard__photo-label {
  position: absolute;
  bottom: 10px; left: 12px; right: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.postcard__photo-credit {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 2;
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  background: rgba(29, 36, 64, 0.55);
  padding: 3px 7px;
  border-radius: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.postcard__photo-credit:hover { background: rgba(29, 36, 64, 0.8); }

/* Postcard body (right column) */
.postcard__body {
  padding: 0 28px 0 24px;
  position: relative;
}
.postcard__stamp {
  position: absolute;
  top: -6px;
  right: 18px;
  width: 84px;
  height: 96px;
  background: var(--paper-light);
  border: 2px dashed var(--red-deep);
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  transform: rotate(4deg);
  box-shadow: 0 4px 12px -6px rgba(40, 25, 5, 0.4);
}
.postcard__stamp::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--red);
}
.postcard__stamp-content {
  position: relative;
  z-index: 2;
  color: var(--paper);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 4px;
}
.postcard__stamp-top {
  font-family: 'DM Mono', monospace;
  font-size: 7px;
  letter-spacing: 0.2em;
}
.postcard__stamp-currency {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}
.postcard__stamp-bottom {
  font-family: 'DM Mono', monospace;
  font-size: 6px;
  letter-spacing: 0.18em;
}

.postcard__country {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin: 0 0 8px;
  max-width: 60%;
}
.postcard__name {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(36px, 4.8vw, 52px);
  line-height: 0.92;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: 0 0 12px;
  max-width: 90%;
}
.postcard__tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink-soft);
  margin: 0 0 12px;
  max-width: 85%;
}
.postcard__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 16px;
  max-width: 96%;
  text-wrap: pretty;
}

.postcard__meta-row {
  display: flex;
  gap: 18px;
  margin: 0 0 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(29, 36, 64, 0.25);
  flex-wrap: wrap;
}
.postcard__meta { min-width: 90px; }
.postcard__meta-k {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.postcard__meta-v {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
}
.postcard__meta-link {
  color: var(--red-deep);
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}
.postcard__meta-link:hover { color: var(--red); }

.postcard__actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.btn-depart, .btn-tours {
  flex: 1 1 0;
  min-width: 140px;
  padding: 13px 16px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  border-radius: 2px;
  border: 0;
  transition: background 0.2s, transform 0.2s;
}
.btn-depart {
  background: var(--ink);
  color: var(--paper);
}
.btn-depart:hover { background: var(--red-deep); transform: translateY(-1px); }
.btn-tours {
  background: var(--gold);
  color: #1a0f00;
}
.btn-tours:hover { background: var(--gold-deep); color: var(--paper); transform: translateY(-1px); }
.btn-depart__arrow {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-style: normal;
}

.postcard__secondary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed rgba(29, 36, 64, 0.18);
}
.link-tiny {
  background: transparent;
  border: 0;
  padding: 6px 2px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.link-tiny:hover { color: var(--red-deep); }
.link-tiny__sep { color: var(--line); font-family: 'DM Mono', monospace; }

.postcard__close {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 22px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  z-index: 5;
  transition: color 0.2s;
}
.postcard__close:hover { color: var(--red-deep); }

/* ---------- DISPATCHED postmark animation ---------- */
.postmark {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(2.5) rotate(-12deg);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-style: italic;
  color: var(--red-deep);
  border: 4px double var(--red-deep);
  padding: 14px 32px;
  border-radius: 60px;
  font-size: 28px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.postmark.is-stamped {
  animation: stamp 1.4s var(--ease-out) forwards;
}
@keyframes stamp {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(3) rotate(-12deg); }
  18%  { opacity: 0.95; transform: translate(-50%, -50%) scale(1) rotate(-12deg); }
  82%  { opacity: 0.95; transform: translate(-50%, -50%) scale(1) rotate(-12deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.12) rotate(-12deg); }
}
.postmark__date {
  display: block;
  font-family: 'DM Mono', monospace;
  font-style: normal;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-align: center;
  margin-top: 4px;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 5;
  padding: 32px clamp(20px, 4vw, 48px);
  margin-top: 100vh;
  text-align: center;
  color: var(--ink-soft);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer__sep { color: var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  z-index: 300;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,0.5);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { top: 80px; }
  .hero__title { font-size: 32px; }
  .meta-top { display: none; }
  .compass-deco { display: none; }
  .coords { display: none; }
  .spin-zone { bottom: 32px; }
  .spin-btn { width: 130px; height: 130px; }
  .spin-btn__main { font-size: 22px; }
  .brand__text { display: none; }
  .brand__sub { display: none; }

  .postcard { width: 96vw; max-height: 90vh; }
  .postcard__grid { grid-template-columns: 1fr; gap: 0; padding: 24px 0; }
  .postcard__photo { margin: 0 22px; aspect-ratio: 16/10; }
  .postcard__body { padding: 18px 22px 0; }
  .postcard__stamp { top: -78px; right: 18px; transform: rotate(6deg) scale(0.82); }
  .postcard__country { max-width: 100%; }
  .postcard__name { font-size: 32px; max-width: 100%; }
  .btn-depart, .btn-tours { min-width: 0; flex: 1; }
}

@media (max-width: 420px) {
  .postcard__stamp { display: none; }
  .postcard__name { font-size: 28px; }
  .postcard__actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .postcard, .postmark, .spin-btn { transition: none; animation: none; }
  .spin-btn.is-spinning .spin-btn__compass { animation: none; }
  .postcard__photo-skeleton { animation: none; }
}
