/* ---------------------------------------------------------
   Chiang Mai — three days
   Soft pastel paper: beige ground, blue and apricot washes.
   Fraunces (display) + Newsreader (text), both serifs.
   --------------------------------------------------------- */

:root {
  --paper:      #f8f3ea;
  --paper-deep: #efe6d6;
  --sand:       #e7dcc7;
  --ink:        #3b3833;
  --ink-soft:   #6d675d;
  --ink-faint:  #9a9285;

  --blue:       #a9c9e4;
  --blue-wash:  #dbe8f3;
  --blue-deep:  #6f9cc0;

  --apricot:    #f0b98d;
  --apricot-wash:#f8e2cd;
  --apricot-deep:#cf8354;

  --radius:     22px;
  --radius-sm:  14px;
  --shadow:     0 18px 40px -28px rgba(89, 71, 51, .55);
  --shadow-soft:0 10px 30px -24px rgba(89, 71, 51, .5);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text:    "Newsreader", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* layered pastel washes — soft, not flat */
  background-image:
    radial-gradient(1100px 620px at 8% -6%,  var(--blue-wash)     0%, transparent 62%),
    radial-gradient(900px 560px at 96% 4%,   var(--apricot-wash)  0%, transparent 58%),
    radial-gradient(1200px 800px at 50% 118%, var(--paper-deep)  0%, transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--text);
  font-size: 19px;
  line-height: 1.68;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.16'/></svg>");
}

.page {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1.15rem, 5vw, 3rem) 4rem;
}

/* ---------- masthead ---------- */

.masthead { max-width: 660px; margin-bottom: clamp(2rem, 5vw, 3.25rem); }

.kicker {
  font-family: var(--display);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--apricot-deep);
  margin: 0 0 .9rem;
}

.title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.1rem, 13vw, 6.2rem);
  line-height: .92;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--ink);
  font-variation-settings: "SOFT" 60, "WONK" 1;
}

.title em { font-style: italic; color: var(--blue-deep); }

.subtitle {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 3.4vw, 1.5rem);
  color: var(--ink-soft);
  margin: .7rem 0 0;
}

.lede {
  margin: 1.35rem 0 0;
  max-width: 34rem;
  color: var(--ink-soft);
}

/* ---------- hero ---------- */

.hero { margin: 0 0 clamp(3rem, 8vw, 5rem); }

.hero img {
  display: block;
  width: 100%;
  height: clamp(260px, 46vw, 520px);
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero figcaption,
.stop__fig figcaption {
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  margin-top: .6rem;
}

/* ---------- day blocks ---------- */

.day {
  position: relative;
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4.5vw, 2.9rem);
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .55);
}

.day--blue   { background: linear-gradient(160deg, var(--blue-wash) 0%, rgba(255,255,255,.35) 100%); }
.day--orange { background: linear-gradient(160deg, var(--apricot-wash) 0%, rgba(255,255,255,.35) 100%); }
.day--beige  { background: linear-gradient(160deg, var(--paper-deep) 0%, rgba(255,255,255,.35) 100%); }

.day__head {
  display: flex;
  align-items: flex-start;
  gap: clamp(.9rem, 3vw, 1.6rem);
  padding-bottom: 1.4rem;
  border-bottom: 1px solid rgba(59, 56, 51, .12);
  margin-bottom: 1.6rem;
}

.day__num {
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  opacity: .32;
  font-variation-settings: "SOFT" 80;
}

.day--blue   .day__num { color: var(--blue-deep);    opacity: .6; }
.day--orange .day__num { color: var(--apricot-deep); opacity: .6; }

.day__head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.45rem, 4.4vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: .1rem 0 .35rem;
}

.day__head p {
  margin: 0;
  font-size: .96rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 30rem;
}

/* ---------- stops ---------- */

.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.9rem; }

.stop {
  display: grid;
  gap: 1.15rem;
  align-items: start;
}

.stop__fig { margin: 0; }

.stop__fig img {
  display: block;
  width: 100%;
  height: clamp(190px, 34vw, 290px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.stop__meta {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .3rem;
}

.stop__meta time {
  font-family: var(--display);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--ink);
}

.tag {
  font-family: var(--display);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: .22rem .62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(59, 56, 51, .12);
  color: var(--ink-soft);
}

.stop__body h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.15rem, 3.2vw, 1.42rem);
  line-height: 1.25;
  margin: .1rem 0 .35rem;
  color: var(--ink);
}

.stop__body p {
  margin: 0;
  font-size: .97rem;
  color: var(--ink-soft);
}

.stop__body em { font-style: italic; color: var(--ink); }

/* text-only stops get a hairline rule and a nudge inward */
.stop--text {
  border-left: 2px solid rgba(59, 56, 51, .12);
  padding-left: 1.1rem;
}

/* wider screens: image beside text, gently alternating */
@media (min-width: 720px) {
  .stop {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.2rem, 4vw, 2.2rem);
  }
  .stop--text { grid-template-columns: 1fr; }
  .stop--text .stop__body { max-width: 40rem; }
}

/* ---------- notes ---------- */

.notes {
  background: linear-gradient(165deg, #fffdf9 0%, var(--paper-deep) 100%);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4.5vw, 2.9rem);
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
  box-shadow: var(--shadow-soft);
}

.notes__title,
.credits h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.8vw, 1.75rem);
  margin: 0 0 1.3rem;
}

.notes__grid {
  display: grid;
  gap: 1.25rem 2rem;
  margin: 0;
}

@media (min-width: 640px) { .notes__grid { grid-template-columns: 1fr 1fr; } }

.notes__grid dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .02em;
  color: var(--blue-deep);
  margin-bottom: .2rem;
}

.notes__grid dd { margin: 0; font-size: .93rem; color: var(--ink-soft); }

/* ---------- credits ---------- */

.credits {
  border-top: 1px solid rgba(59, 56, 51, .12);
  padding-top: 2rem;
}

.credits p { font-size: .88rem; color: var(--ink-soft); max-width: 40rem; margin: 0 0 1rem; }

.credits__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .4rem .5rem;
  font-size: .8rem;
  color: var(--ink-faint);
}

@media (min-width: 640px) { .credits__list { grid-template-columns: 1fr 1fr; } }

a { color: var(--apricot-deep); text-decoration-color: rgba(207, 131, 84, .35); text-underline-offset: 3px; }
.credits__list a { color: var(--ink-soft); }
a:hover { color: var(--blue-deep); }

/* ---------- footer ---------- */

.footer {
  margin-top: 3rem;
  text-align: center;
  font-size: .8rem;
  color: var(--ink-faint);
}

/* ---------- entrance motion (CSS only, staggered) ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .masthead > *,
  .hero,
  .day,
  .notes,
  .credits,
  .footer {
    animation: rise .85s cubic-bezier(.22, .8, .28, 1) both;
  }
  .masthead > *:nth-child(1) { animation-delay: .05s; }
  .masthead > *:nth-child(2) { animation-delay: .13s; }
  .masthead > *:nth-child(3) { animation-delay: .21s; }
  .masthead > *:nth-child(4) { animation-delay: .29s; }
  .hero    { animation-delay: .38s; }
  .day:nth-of-type(1) { animation-delay: .05s; }
  .day:nth-of-type(2) { animation-delay: .12s; }
  .day:nth-of-type(3) { animation-delay: .19s; }
  .notes   { animation-delay: .1s; }
  .credits { animation-delay: .14s; }

  .stop__fig img { transition: transform .7s cubic-bezier(.22, .8, .28, 1), box-shadow .7s ease; }
  .stop__fig img:hover { transform: translateY(-4px) scale(1.012); box-shadow: 0 24px 46px -26px rgba(89, 71, 51, .6); }
}
