/* =============================================================
   CMDS West Coast — STORYBOOK direction
   Bright picture-book / vintage travel-poster look.
   (The dark sunset version lives on in style.css — untouched.)
   ============================================================= */

/* Korean glyphs only (unicode-range scoped) render in Nanum Gothic; Latin is
   untouched so the picture-book Latin type stays as designed. */
@font-face {
  font-family: "NanumKoSans";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/nanum-gothic@5.2.7/korean-400-normal.woff2) format("woff2");
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7A3, U+D7B0-D7FF;
}
@font-face {
  font-family: "NanumKoSans";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/nanum-gothic@5.2.7/korean-700-normal.woff2) format("woff2");
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7A3, U+D7B0-D7FF;
}

:root {
  /* --- Picture-book palette (pulled from the reference cover) --- */
  --sb-cobalt:   #1e4c8f;   /* deep border blue */
  --sb-blue:     #2e6fc4;   /* mid blue */
  --sb-sky:      #a9d6ef;   /* sky */
  --sb-sky-deep: #74b8e0;
  --sb-teal:     #4fb9a5;
  --sb-green:    #5bb04a;   /* kelly green fields */
  --sb-green-dk: #3d8236;
  --sb-gold:     #f2bd3a;   /* wheat gold */
  --sb-amber:    #e79a2f;
  --sb-red:      #d6342c;   /* flag red / roses */
  --sb-rose:     #e0596a;
  --sb-plum:     #7b5ba6;   /* distant mountains */
  --sb-coral:    #e0714a;   /* mesa */

  /* --- Paper --- */
  --paper:       #fdf6e3;
  --paper-warm:  #f7ecd2;
  --paper-edge:  #e8d9b5;
  --ink:         #2f2a24;   /* pencil/ink on paper */
  --ink-soft:    #6b6154;
  --ink-red:     #c0392b;

  /* --- Type --- */
  --sb-display: "Rye", "Bevan", Georgia, serif;        /* western slab, hand-lettered feel */
  --sb-script:  "Kaushan Script", cursive;             /* flowing script */
  --sb-hand:    "NanumKoSans", "Caveat", "Patrick Hand", cursive;  /* handwriting on notes; KO→Nanum */
  --sb-body:    "NanumKoSans", "Nunito", system-ui, sans-serif;    /* friendly, rounded; KO→Nanum */

  --sb-edge:    clamp(1.25rem, 5vw, 4rem);
  --sb-ease:    cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body.sb {
  margin: 0;
  font-family: var(--sb-body);
  color: var(--ink);
  background: var(--sb-sky);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain — reused by every paper surface */
.grain::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.5'/%3E%3C/svg%3E");
}

/* =============================================================
   DECORATIVE FRAME — the picture-book border
   ============================================================= */
.sb-frame {
  position: relative;
  border: clamp(10px, 2.4vw, 20px) solid var(--sb-cobalt);
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.5), inset 0 0 0 6px var(--sb-blue);
}

/* =============================================================
   HERO — the "cover"
   ============================================================= */
.sb-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--sb-sky) 0%, #cbe7f6 52%, var(--sb-gold) 100%);
  padding: clamp(1rem, 3vw, 2rem);
}
.sb-hero__inner { position: relative; z-index: 3; padding: var(--sb-edge); }

/* Ribbon banner behind the title */
.sb-banner {
  position: relative;
  display: inline-block;
  padding: 0.6em 2.2em;
  background: #fffdf7;
  color: var(--sb-red);
  box-shadow: 0 6px 0 rgba(0,0,0,0.06), 0 14px 30px rgba(30,76,143,0.18);
}
.sb-banner::before, .sb-banner::after {   /* ribbon tails */
  content: "";
  position: absolute; top: 0; bottom: 0; width: 26px;
  background: #eadfc4;
}
.sb-banner::before { left: -26px;  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.sb-banner::after  { right: -26px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }

.sb-title {
  margin: 0;
  font-family: var(--sb-display);
  font-size: clamp(2.6rem, 11vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--sb-red);
  text-shadow:
     2px 0 0 #fff,  -2px 0 0 #fff,  0 2px 0 #fff,  0 -2px 0 #fff,
     3px 3px 0 rgba(30,76,143,0.28);
}
/* Sits on top of a busy painting — it needs its own white outline to survive. */
.sb-script {
  display: block;
  font-family: var(--sb-script);
  font-size: clamp(1.8rem, 7vw, 3.4rem);
  color: var(--sb-blue);
  margin-top: 0.3em;
  transform: rotate(-2deg);
  text-shadow:
    -2px 0 0 #fffdf7,  2px 0 0 #fffdf7,  0 -2px 0 #fffdf7,  0 2px 0 #fffdf7,
    -2px -2px 0 #fffdf7, 2px -2px 0 #fffdf7, -2px 2px 0 #fffdf7, 2px 2px 0 #fffdf7,
    0 4px 12px rgba(12,38,72,0.45);
}
/* a little cream plaque so the dates read over anything */
.sb-hero__dates {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.3em 1.1em;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.92);
  font-family: var(--sb-hand);
  font-size: clamp(1.05rem, 4vw, 1.4rem);
  color: var(--sb-cobalt);
  box-shadow: 0 4px 14px rgba(12,38,72,0.28);
}
.sb-hero__scroll {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  z-index: 4;
  font-family: var(--sb-hand);
  font-size: 1.05rem;
  color: #fffdf7;
  text-shadow: 0 1px 3px rgba(12,38,72,0.9), 0 0 10px rgba(12,38,72,0.6);
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.sb-hero__scroll .arrow { animation: sb-bob 1.8s var(--sb-ease) infinite; font-size: 1.3rem; }
@keyframes sb-bob { 0%,100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(6px); opacity: 1; } }

/* Slot where an illustrated scene drops in later */
.sb-hero__scene {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  display: grid; place-items: end center;
}
.sb-hero__scene img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; }

/* =============================================================
   THE TRIP — the illustration IS the page.
   Full-bleed art per stop, a map rail down the left, and a
   post-it pinned on top that peels off toward the next stop.
   ============================================================= */
.trip { position: relative; }
.trip__stage { position: relative; height: 100svh; overflow: hidden; background: var(--sb-sky); }

/* --- background: the city's illustration, crossfading stop to stop --- */
.trip__bg { position: absolute; inset: 0; }
.trip__bg img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* the artwork ships with a painted cream margin around the plate, and at
     ~3:2 the viewport barely crops it — overscan enough that the frame never
     peeks in as a seam */
  transform: scale(1.14);
  opacity: 0;
  will-change: opacity;
}
.trip__bg img.is-on { opacity: 1; }

/* keeps the note and rail legible over busy artwork */
.trip__scrim {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12,38,72,0.50) 0%, rgba(12,38,72,0.18) 26%, transparent 52%),
    linear-gradient(0deg,  rgba(12,38,72,0.34) 0%, transparent 38%);
}

/* --- the map rail down the left --- */
.trip__rail {
  position: absolute;
  left: clamp(0.5rem, 2.5vw, 2rem);
  top: 0; bottom: 0;
  width: clamp(54px, 7vw, 88px);
  z-index: 3;
}
.trip__rail svg { width: 100%; height: 100%; display: block; overflow: visible; }
.rail__track { fill: none; stroke: rgba(255,253,247,0.30); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 7; }
.rail__line  { fill: none; stroke: var(--sb-red); stroke-width: 4; stroke-linecap: round;
               filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45)); }
.rail__pin   { fill: #fffdf7; stroke: var(--sb-red); stroke-width: 2.5; transition: r 0.3s var(--sb-ease); }
.rail__pin.is-active { fill: var(--sb-gold); r: 7.5; }
.rail__pin[data-tentative="true"] { fill: none; stroke-dasharray: 3 3; }
.rail__label {
  font-family: var(--sb-hand);
  font-size: 12px;
  fill: rgba(255,253,247,0.9);
  paint-order: stroke;
  stroke: rgba(12,38,72,0.6);
  stroke-width: 3px;
  opacity: 0;
  transition: opacity 0.3s;
}
.rail__label.is-active { opacity: 1; }

/* --- the post-it --- */
.trip__notes { position: absolute; inset: 0; z-index: 4; }
/* Real paper, not a card: no border, no radius — the sheet is built from
   layered paper stock (::before) + fibre grain (::after), both roughened at
   the edge, with the shadow cast from the actual torn silhouette. */
.postit {
  position: absolute;
  top: 50%; left: 50%;
  width: min(74vw, 21rem);
  transform: translate(-50%, -50%);
  padding: 1.5rem 1.4rem 1.3rem;
  background: none;
  border: 0;
  will-change: transform, opacity;
  filter:
    drop-shadow(0 1px 1px rgba(60, 45, 20, 0.22))
    drop-shadow(0 14px 26px rgba(10, 30, 60, 0.30));
}
/* the paper stock: warm base, uneven mottling, faint ruling */
.postit::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background-color: var(--paper);
  background-image:
    radial-gradient(72% 52% at 18% 14%, rgba(255,255,255,0.75), transparent 62%),
    radial-gradient(58% 46% at 88% 88%, rgba(203,182,140,0.42), transparent 68%),
    radial-gradient(40% 30% at 62% 40%, rgba(214,198,160,0.22), transparent 70%),
    repeating-linear-gradient(180deg, transparent 0 28px, rgba(30,76,143,0.045) 28px 29px);
  background-position: 0 0, 0 0, 0 0, 0 60px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  filter: url(#paper-edge);
}
/* fibre grain sitting in the paper, under the writing */
.postit::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  filter: url(#paper-edge);
}
/* desktop: the note sits to the right, clear of the rail */
@media (min-width: 860px) {
  .postit { left: auto; right: clamp(3rem, 10vw, 9rem); width: min(34vw, 24rem); }
}
.postit__tape {
  position: absolute; top: -11px; left: 50%;
  width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(242, 189, 58, 0.6);
  border-left: 1px dashed rgba(255,255,255,0.55);
  border-right: 1px dashed rgba(255,255,255,0.55);
  box-shadow: 0 2px 5px rgba(0,0,0,0.14);
}
.postit__mode { position: absolute; top: 1rem; right: 1.1rem; font-size: 1.4rem; transform: rotate(8deg); }
.postit__date { font-family: var(--sb-hand); font-size: 1.15rem; color: var(--ink-red); margin: 0; }
.postit__city {
  margin: 0.05em 0 0;
  font-family: var(--sb-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--sb-cobalt);
  line-height: 1.05;
}
.postit__region { font-family: var(--sb-body); font-size: 0.82rem; color: var(--ink-soft); margin: 0.15rem 0 0; }
.postit__note { font-family: var(--sb-hand); font-size: clamp(1.05rem, 3.6vw, 1.25rem); line-height: 1.45; color: var(--ink); margin: 0.7rem 0 0; }
.postit__stamp {
  display: inline-block; margin-top: 0.7rem;
  font-family: var(--sb-display); font-size: 0.72rem; letter-spacing: 0.1em;
  color: rgba(192,57,43,0.6); border: 2.5px solid rgba(192,57,43,0.5);
  border-radius: 5px; padding: 0.2em 0.5em; transform: rotate(-7deg);
}
.postit__cta {
  display: inline-flex; align-items: center; gap: 0.4em;
  margin-top: 0.9rem; padding: 0.45em 1em;
  border-radius: 999px; font-family: var(--sb-body); font-weight: 700; font-size: 0.85rem;
  color: #fffdf7; background: var(--sb-red); box-shadow: 0 3px 0 #a32a23;
}
/* Event notes are flagged by the colour of their tape — a hard ring around the
   sheet reads as a UI card, which is exactly what paper is not. */
.postit[data-highlight="jazz"] .postit__tape { background: rgba(232, 176, 75, 0.72); }
.postit[data-highlight="pkm"]  .postit__tape { background: rgba(167, 139, 250, 0.66); }

/* Fallback: no GSAP / reduced motion → plain readable stack */
.trip__stage.no-anim { height: auto; }
.trip__stage.no-anim .trip__bg,
.trip__stage.no-anim .trip__scrim,
.trip__stage.no-anim .trip__rail { display: none; }
.trip__stage.no-anim .trip__notes { position: relative; display: flex; flex-direction: column; gap: 2rem; padding: 3rem var(--sb-edge); }
.trip__stage.no-anim .postit { position: relative; top: auto; left: auto; right: auto; transform: none; width: 100%; max-width: 30rem; }

/* =============================================================
   THE JOURNAL — paper notes that flip past as you scroll
   ============================================================= */
.journal {
  position: relative;
  background:
    radial-gradient(120% 70% at 50% 0%, #cbe7f6 0%, transparent 60%),
    linear-gradient(180deg, var(--sb-sky-deep), var(--sb-teal) 60%, var(--sb-green) 100%);
}
.journal__head {
  text-align: center;
  padding: clamp(3rem, 9vh, 6rem) var(--sb-edge) 0;
}
.journal__head h2 {
  margin: 0;
  font-family: var(--sb-display);
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  color: #fffdf7;
  text-shadow: 2px 3px 0 rgba(30,76,143,0.5);
}
.journal__head p { font-family: var(--sb-hand); font-size: 1.2rem; color: #0d3a5c; margin-top: 0.4rem; }

/* Sticky stage the sheets flip inside */
.journal__stage {
  position: relative;
  height: 100svh;
  display: grid;
  place-items: center;
  perspective: 1800px;
  perspective-origin: 50% 30%;
}
.journal__book {
  position: relative;
  width: min(88vw, 30rem);
  height: min(76svh, 34rem);
  transform-style: preserve-3d;
}

/* --- a single paper note: a real two-sided leaf so you SEE it turn over --- */
.sheet {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0%;          /* hinge at the top edge — pages flip up */
  transform-style: preserve-3d;
  will-change: transform;
}
.sheet__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper);
  box-shadow:
    0 1px 0 var(--paper-edge),
    0 10px 24px rgba(20, 50, 40, 0.22),
    0 30px 60px rgba(20, 50, 40, 0.14);
}
.sheet__front {
  padding: clamp(1.4rem, 5vw, 2.2rem);
  padding-top: clamp(2.2rem, 7vw, 3rem);
  /* faint ruled lines, like a memo pad */
  background-image:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(30,76,143,0.10) 31px 32px);
  background-position: 0 76px;
}
/* the reverse of the leaf — blank paper, ruling ghosting through from behind */
.sheet__back {
  transform: rotateX(180deg);
  background-color: var(--paper-warm);
  background-image:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(30,76,143,0.05) 31px 32px);
}
.sheet__back::after {                 /* light catches the turning page */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(190deg, rgba(0,0,0,0.16), transparent 55%);
}
/* red margin rule down the left */
.sheet__front::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: clamp(1rem, 4vw, 1.6rem);
  width: 1px;
  background: rgba(192, 57, 43, 0.35);
}
/* washi tape holding the note down */
.sheet__tape {
  position: absolute; top: -10px; left: 50%;
  width: 108px; height: 30px;
  transform: translateX(-50%) rotate(-1.5deg);
  background: rgba(242, 189, 58, 0.55);
  border-left: 1px dashed rgba(255,255,255,0.5);
  border-right: 1px dashed rgba(255,255,255,0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.sheet__date {
  font-family: var(--sb-hand);
  font-size: 1.25rem;
  color: var(--ink-red);
  transform: rotate(-1.5deg);
}
.sheet__city {
  margin: 0.1em 0 0;
  font-family: var(--sb-display);
  font-size: clamp(1.7rem, 6.5vw, 2.4rem);
  color: var(--sb-cobalt);
  line-height: 1.05;
}
.sheet__region { font-family: var(--sb-body); font-size: 0.9rem; color: var(--ink-soft); }
.sheet__note {
  margin-top: 0.9rem;
  font-family: var(--sb-hand);
  font-size: clamp(1.15rem, 4.2vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
}
.sheet__mode {
  position: absolute; right: clamp(1rem, 4vw, 1.6rem); top: clamp(1.4rem, 5vw, 2rem);
  font-size: 1.6rem;
  transform: rotate(8deg);
}
/* illustration slot on the note */
.sheet__art { margin-top: 1rem; border-radius: 4px; overflow: hidden; }
.sheet__art img { width: 100%; display: block; }

/* rubber-stamp for still-being-planned stops */
.sheet[data-status="tentative"] .sheet__stamp {
  position: absolute; right: 8%; bottom: 9%;
  font-family: var(--sb-display);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: rgba(192, 57, 43, 0.55);
  border: 3px solid rgba(192, 57, 43, 0.45);
  border-radius: 6px;
  padding: 0.25em 0.6em;
  transform: rotate(-11deg);
}

/* event notes get a colored edge so they stand out in the stack */
.sheet[data-highlight="jazz"] .sheet__face { box-shadow: 0 0 0 4px var(--sb-gold), 0 12px 30px rgba(20,50,40,0.25); }
.sheet[data-highlight="pkm"]  .sheet__face { box-shadow: 0 0 0 4px var(--sb-plum), 0 12px 30px rgba(20,50,40,0.25); }

.sheet__cta {
  display: inline-flex; align-items: center; gap: 0.4em;
  margin-top: 1rem;
  padding: 0.5em 1.1em;
  border-radius: 999px;
  font-family: var(--sb-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fffdf7;
  background: var(--sb-red);
  box-shadow: 0 3px 0 #a32a23;
  transition: transform 0.2s var(--sb-ease);
}
.sheet__cta:hover { transform: translateY(-2px); }

/* Fallback: no GSAP or reduced-motion → the notes simply stack down the page */
.journal__stage.no-flip { height: auto; perspective: none; padding-block: 3rem; }
.journal__book.no-flip { height: auto; display: flex; flex-direction: column; gap: 2.5rem; }
.journal__book.no-flip .sheet {
  position: relative; inset: auto;
  transform: none !important;
  min-height: 22rem;
}
.journal__book.no-flip .sheet__front { position: relative; inset: auto; min-height: 22rem; }
.journal__book.no-flip .sheet__back { display: none; }

/* progress ticks down the side of the journal */
.journal__ticks {
  position: absolute; top: 50%; right: clamp(0.5rem, 2vw, 1.4rem);
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 7px;
  z-index: 5;
}
.journal__ticks i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,253,247,0.45);
  transition: background 0.3s, transform 0.3s;
}
.journal__ticks i.on { background: var(--sb-gold); transform: scale(1.5); }

/* The scroll runway that gives the flip its distance */
.journal__runway { height: 1px; }

/* =============================================================
   FOOTER
   ============================================================= */
.sb-footer {
  text-align: center;
  padding: 4rem var(--sb-edge);
  background: var(--sb-green);
  color: #f4ffe9;
}
.sb-footer h2 { font-family: var(--sb-display); font-size: clamp(1.6rem, 6vw, 2.6rem); margin: 0; text-shadow: 2px 3px 0 rgba(0,0,0,0.18); }
.sb-footer p { font-family: var(--sb-hand); font-size: 1.2rem; margin-top: 0.4rem; }
