/* ==========================================================
   daitoua.quest -- Pan-Pacific Railway Brochure
   Palette: warm-earthy, no cool tones
   ========================================================== */

:root {
  --aged-ivory: #F2E8D0;
  --warm-linen: #E8DECA;
  --ink-walnut: #2A1A0B;
  --umber-mid: #8B7355;
  --burnt-sienna: #A65A38;
  --ochre-gold: #C19A3A;
  --aged-red: #933A2A;
  --deep-umber: #362114;
  --umber-display: #3E2B1C;
  --aged-ivory-bright: #F5ECD7;

  --ease-settle: cubic-bezier(0.22, 0.61, 0.36, 1.0);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--aged-ivory);
  color: var(--ink-walnut);
  font-family: 'Crimson Text', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.8;
  scroll-snap-type: y proximity;
  overflow-x: hidden;
}

main { display: block; }

h1, h2, h3 {
  margin: 0;
  font-weight: normal;
  color: var(--deep-umber);
}

h1 {
  font-family: 'Playfair Display SC', 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  letter-spacing: 0.14em;
  line-height: 1.1;
  color: var(--umber-display); /* #3E2B1C deep-umber display tone */
}

h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  letter-spacing: 0.05em;
  color: var(--deep-umber);
  margin-bottom: 16px;
}

p { margin: 0 0 24px; }
p:last-child { margin-bottom: 0; }

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

/* Reveal animation pattern */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 900ms var(--ease-settle), transform 900ms var(--ease-settle);
  transition-delay: calc(var(--stagger-index, 0) * 180ms);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  scroll-snap-align: start;
}

.hero-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 78%, rgba(166, 90, 56, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 92%, rgba(54, 33, 20, 0.7) 0%, transparent 60%),
    linear-gradient(180deg,
      #6B3A1E 0%,
      #8B4A22 18%,
      #A65A38 38%,
      #C19A3A 58%,
      #B07530 72%,
      #6B3A1E 88%,
      #2A1A0B 100%);
}

.hero-sky::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 70%;
  height: 8%;
  background: linear-gradient(180deg, transparent, rgba(42, 26, 11, 0.55), transparent);
  filter: blur(4px);
}

.hero-sky::after {
  content: "";
  position: absolute;
  inset: 70% 0 0 0;
  background:
    linear-gradient(180deg,
      rgba(54, 33, 20, 0.1) 0%,
      rgba(54, 33, 20, 0.55) 50%,
      rgba(42, 26, 11, 0.85) 100%),
    repeating-linear-gradient(90deg,
      rgba(42, 26, 11, 0.18) 0px,
      rgba(42, 26, 11, 0.18) 1px,
      transparent 1px,
      transparent 80px);
}

.hero-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: url(#grain-noise);
  opacity: 0.18;
  mix-blend-mode: overlay;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(42, 26, 11, 0.65) 100%);
}

.cartouche-wrap {
  position: relative;
  z-index: 2;
  padding: 24px;
}

.cartouche-outer {
  border: 1px solid var(--aged-red);
  padding: 8px;
  background: rgba(242, 232, 208, 0.06);
  backdrop-filter: blur(0.5px);
  border-radius: 4px;
  max-width: 720px;
  width: min(720px, 92vw);
}

.cartouche-inner {
  border: 2px solid var(--ochre-gold);
  border-radius: 2px;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 5vw, 56px);
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(242, 232, 208, 0.08) 0%, rgba(54, 33, 20, 0.18) 100%);
}

.cartouche-eyebrow {
  font-family: 'Cormorant SC', 'Cormorant Garamond', serif;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--ochre-gold);
  margin: 0 0 24px;
  text-transform: uppercase;
}

.cartouche-title {
  color: var(--aged-ivory-bright); /* #F5ECD7 aged ivory on dark background */
  text-shadow: 0 1px 0 rgba(42,26,11,0.5);
}

.cartouche-rule {
  width: 56px;
  height: 8px;
  margin: 24px auto;
  background:
    linear-gradient(90deg, transparent 0%, var(--ochre-gold) 20%, var(--ochre-gold) 80%, transparent 100%);
  position: relative;
}
.cartouche-rule::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  background: var(--ochre-gold);
  transform: translate(-50%,-50%) rotate(45deg);
}

.cartouche-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--aged-ivory);
  letter-spacing: 0.04em;
  margin: 0 0 24px;
}

.cartouche-foot {
  font-family: 'Cormorant SC', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--ochre-gold);
  margin: 0;
  text-transform: uppercase;
}

/* Scroll indicator */
.scroll-arrow {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
  animation: arrowPulse 2400ms ease-in-out infinite;
}
.arrow-line {
  width: 1px;
  height: 32px;
  background: var(--aged-ivory);
  opacity: 0.7;
}
.arrow-head {
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--aged-ivory);
  border-bottom: 1px solid var(--aged-ivory);
  transform: rotate(45deg);
  margin-top: -8px;
  opacity: 0.7;
}
@keyframes arrowPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ==========================================================
   TEXT PANELS
   ========================================================== */
.text-panel {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  scroll-snap-align: start;
}

.panel-inner {
  max-width: 680px;
  width: 100%;
}

.panel-inner h2 {
  text-align: center;
  margin-bottom: 8px;
}

.dateline {
  font-family: 'Cormorant SC', serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--umber-mid);
  text-align: center;
  margin: 0 0 48px;
  text-transform: uppercase;
}

/* Diamond rule ornament */
.diamond-rule {
  height: 16px;
  margin: 32px auto;
  width: 100%;
  background:
    repeating-linear-gradient(45deg,
      var(--umber-mid) 0px,
      var(--umber-mid) 1px,
      transparent 1px,
      transparent 8px),
    repeating-linear-gradient(-45deg,
      var(--umber-mid) 0px,
      var(--umber-mid) 1px,
      transparent 1px,
      transparent 8px);
  background-size: 8px 8px;
  background-position: center;
  background-repeat: repeat-x;
  -webkit-mask: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  opacity: 0.85;
}

/* Pull quote */
.pull-quote {
  margin: 48px 0;
  padding: 24px 0 24px 32px;
  border-left: 3px solid var(--burnt-sienna);
  border-top: 1px solid rgba(166, 90, 56, 0.35);
  border-bottom: 1px solid rgba(166, 90, 56, 0.35);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  line-height: 1.5;
  color: var(--deep-umber);
  transition: border-color 300ms ease;
}
.pull-quote:hover {
  border-left-color: rgba(166, 90, 56, 0.6);
}
.pull-quote p { margin: 0 0 16px; }
.pull-quote cite {
  display: block;
  font-family: 'Cormorant SC', serif;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--umber-mid);
  text-transform: uppercase;
}

.quote-panel { background: var(--warm-linen); }

/* ==========================================================
   PLATE SECTIONS
   ========================================================== */
.plate-section {
  min-height: 90vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  scroll-snap-align: start;
  background: var(--aged-ivory);
}

.plate {
  position: relative;
  max-width: 1200px;
  width: 100%;
  margin: 0;
}

.plate-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--deep-umber);
  filter: sepia(0.55) contrast(0.9) brightness(1.08) saturate(0.8);
  overflow: hidden;
}

/* Plate I: Rangoon terminus interior */
.plate-image-terminus {
  background:
    /* light pooling from above */
    radial-gradient(ellipse at 50% 0%, rgba(242, 232, 208, 0.7) 0%, transparent 35%),
    /* arched window glow */
    radial-gradient(ellipse at 30% 20%, rgba(193, 154, 58, 0.4) 0%, transparent 22%),
    radial-gradient(ellipse at 70% 20%, rgba(193, 154, 58, 0.4) 0%, transparent 22%),
    /* columns */
    repeating-linear-gradient(90deg,
      transparent 0%,
      transparent 14%,
      rgba(54, 33, 20, 0.55) 14.5%,
      rgba(54, 33, 20, 0.55) 16%,
      transparent 16.5%,
      transparent 18%),
    /* floor */
    linear-gradient(180deg,
      #4A2A18 0%,
      #6B3A1E 35%,
      #8B5A2F 60%,
      #A6743A 78%,
      #5A3318 100%);
}

/* Plate II: platform at dusk */
.plate-image-platform {
  background:
    /* lamp glows */
    radial-gradient(circle at 18% 30%, rgba(193, 154, 58, 0.55) 0%, transparent 8%),
    radial-gradient(circle at 50% 28%, rgba(193, 154, 58, 0.55) 0%, transparent 8%),
    radial-gradient(circle at 82% 30%, rgba(193, 154, 58, 0.55) 0%, transparent 8%),
    /* dusk sky */
    linear-gradient(180deg,
      #5A3318 0%,
      #8B4A22 15%,
      #A65A38 28%,
      #6B3A1E 45%,
      #362114 65%,
      #2A1A0B 100%),
    /* platform edge */
    linear-gradient(180deg, transparent 60%, rgba(42, 26, 11, 0.7) 60%, rgba(42, 26, 11, 0.95) 100%);
}

.plate-grain {
  position: absolute;
  inset: 0;
  filter: url(#grain-noise);
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.plate-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(42, 26, 11, 0.4) 100%);
}

/* Deckled edges -- plate I */
.plate-deckled .plate-image {
  clip-path: polygon(
    0% 1%, 4% 0%, 12% 2%, 22% 0%, 35% 1%, 48% 0%, 60% 2%, 72% 0%, 85% 1%, 96% 0%, 100% 2%,
    99% 12%, 100% 25%, 98% 38%, 100% 52%, 99% 65%, 100% 78%, 98% 90%, 100% 100%,
    88% 99%, 75% 100%, 62% 98%, 48% 100%, 35% 99%, 22% 100%, 10% 98%, 0% 100%,
    1% 88%, 0% 75%, 2% 62%, 0% 48%, 1% 35%, 0% 22%, 2% 10%
  );
}

/* Postage perforations -- plate II */
.plate-perforated {
  padding: 14px;
  background:
    radial-gradient(circle at 14px 0, transparent 7px, var(--aged-ivory) 7.5px) 0 0 / 28px 14px repeat-x,
    radial-gradient(circle at 14px 14px, transparent 7px, var(--aged-ivory) 7.5px) 0 100% / 28px 14px repeat-x,
    radial-gradient(circle at 0 14px, transparent 7px, var(--aged-ivory) 7.5px) 0 0 / 14px 28px repeat-y,
    radial-gradient(circle at 14px 14px, transparent 7px, var(--aged-ivory) 7.5px) 100% 0 / 14px 28px repeat-y,
    var(--warm-linen);
}
.plate-perforated .plate-image {
  border: 1px solid var(--deep-umber);
}

/* Station stamp */
.station-stamp {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 64px;
  height: 64px;
  border: 2px solid var(--aged-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 232, 208, 0.4);
  transform: rotate(-8deg);
  z-index: 3;
  filter: blur(0.2px);
  opacity: 0.85;
}
.station-stamp-alt {
  bottom: 38px;
  left: 38px;
  transform: rotate(6deg);
}
.stamp-square {
  width: 32px;
  height: 32px;
  border: 1px solid var(--aged-red);
  transform: rotate(45deg);
  position: absolute;
}
.stamp-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--aged-red);
  position: absolute;
}

/* Plate caption */
.plate-caption {
  margin-top: 24px;
  text-align: center;
  font-family: 'Cormorant SC', serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--umber-mid);
  text-transform: uppercase;
  display: block;
}
.caption-roman {
  color: var(--aged-red);
  margin-right: 12px;
  font-weight: 500;
}

/* ==========================================================
   TIMETABLE
   ========================================================== */
.timetable-section {
  min-height: 85vh;
  background: var(--warm-linen);
  padding: 100px 24px;
  position: relative;
  scroll-snap-align: start;
  background-image:
    repeating-linear-gradient(0deg,
      rgba(139, 115, 85, 0.06) 0px,
      rgba(139, 115, 85, 0.06) 1px,
      transparent 1px,
      transparent 40px),
    repeating-linear-gradient(90deg,
      rgba(139, 115, 85, 0.06) 0px,
      rgba(139, 115, 85, 0.06) 1px,
      transparent 1px,
      transparent 40px);
  background-color: var(--warm-linen);
}

.timetable-inner {
  max-width: 880px;
  margin: 0 auto;
}

.timetable-inner h2 {
  text-align: center;
}

.timetable {
  margin: 32px 0 24px;
  border-top: 2px solid var(--deep-umber);
  border-bottom: 2px solid var(--deep-umber);
  font-family: 'Cormorant SC', 'Cormorant Garamond', serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--ink-walnut);
  text-transform: uppercase;
}

.tt-row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 1.4fr;
  border-bottom: 1px solid rgba(54, 33, 20, 0.25);
  padding: 14px 8px;
}
.tt-row:last-child { border-bottom: none; }
.tt-row:nth-child(even) { background: rgba(193, 154, 58, 0.06); }

.tt-head {
  border-bottom: 1px solid var(--deep-umber);
  font-weight: 500;
  color: var(--aged-red);
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.tt-cell {
  padding: 0 8px;
}

.tt-station { font-style: normal; }
.tt-arrive, .tt-depart { font-feature-settings: "tnum" on; }
.tt-note { color: var(--umber-mid); font-size: 0.82rem; }

.tt-foot {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.92rem;
  text-align: center;
  color: var(--umber-mid);
  margin-top: 32px;
}

/* ==========================================================
   COLOPHON
   ========================================================== */
.colophon {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--aged-ivory);
  padding: 100px 24px;
  scroll-snap-align: start;
}

.colophon-inner {
  text-align: center;
  max-width: 520px;
}

.mon {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 32px;
  border-radius: 50%;
  background: var(--deep-umber);
  border: 1px solid var(--ochre-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mon-petal {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ochre-gold);
  border-radius: 50% 0 50% 0;
  top: 50%;
  left: 50%;
}
.mon-petal:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg); }
.mon-petal:nth-child(2) { transform: translate(-50%, -50%) rotate(60deg); }
.mon-petal:nth-child(3) { transform: translate(-50%, -50%) rotate(120deg); }
.mon-center {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--ochre-gold);
  border-radius: 50%;
}

.colophon-text {
  font-family: 'Cormorant SC', serif;
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  color: var(--ink-walnut);
  text-transform: uppercase;
  margin: 0 0 12px;
}
.colophon-fine {
  font-size: 0.72rem;
  color: var(--umber-mid);
  letter-spacing: 0.16em;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 480px) {
  h1 { letter-spacing: 0.06em; }
  .text-panel, .colophon, .timetable-section { padding: 64px 20px; }
  .plate-section { padding: 48px 16px; }
  .tt-row {
    grid-template-columns: 1.8fr 1fr 1fr;
    font-size: 0.82rem;
  }
  .tt-row .tt-note { display: none; }
  .pull-quote { padding-left: 20px; }
}

@media (max-width: 720px) {
  .tt-row { font-size: 0.84rem; }
  .station-stamp { width: 48px; height: 48px; }
  .station-stamp .stamp-square { width: 22px; height: 22px; }
}

/* ==========================================================
   PRINT
   ========================================================== */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-sky, .hero-grain, .hero-vignette,
  .plate-image, .plate-grain, .plate-vignette,
  .scroll-arrow, .station-stamp, .mon, .diamond-rule,
  .cartouche-rule {
    display: none !important;
  }
  body { font-size: 11pt; line-height: 1.5; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .cartouche-outer, .cartouche-inner {
    border: none !important;
    padding: 0 !important;
  }
  .hero, .text-panel, .plate-section, .timetable-section, .colophon {
    min-height: auto;
    padding: 16pt 0;
    page-break-inside: avoid;
  }
  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; }
}
