/* ============================================================
   Budarina — paper, linen & ink
   ============================================================ */

:root {
  --bg: #e7dbbf;
  --bg-deep: #d9cba9;
  --ink: #33261a;
  --ink-soft: #6b5a45;
  --ink-faint: #9c8a6e;
  --maroon: #7e2f23;
  --card-bg: #efe6d0;
  --card-line: #b3a284;
  --btn-bg: #372a1e;
  --btn-fg: #efe4cd;
  --serif: "Playfair Display", "Didot", "Bodoni 72", "Times New Roman", serif;
  --mono: "Space Mono", "SF Mono", "Menlo", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* ---------- linen / paper texture ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(0deg,  rgba(120, 96, 60, 0.045) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 96, 60, 0.045) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 40%, rgba(255, 248, 226, 0.55) 0%, rgba(214, 197, 160, 0.0) 55%),
    linear-gradient(180deg, #e9ddc2 0%, #e5d8ba 55%, #ddcda9 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.36 0 0 0 0 0.29 0 0 0 0 0.18 0 0 0 0.05 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
/* vignette */
#vignette {
  position: fixed; inset: 0; z-index: 39; pointer-events: none;
  background: radial-gradient(130% 110% at 50% 45%, transparent 55%, rgba(92, 71, 44, 0.16) 100%);
}

/* ============================================================
   top navigation
   ============================================================ */
header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex; align-items: center;
  padding: 18px 34px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.logo {
  font-weight: 700;
  color: #4a3423;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-right: 34px;
}
nav { display: flex; align-items: center; gap: 8px; }
nav a {
  color: var(--ink-faint);
  text-decoration: none;
  padding: 4px 6px;
  transition: color 0.35s ease;
  cursor: pointer;
}
nav a.active { color: #3c2d1d; }
nav a:hover { color: #55432e; }
nav .dot { color: var(--ink-faint); opacity: 0.6; font-size: 10px; }
nav a.disabled { pointer-events: none; }

.configure {
  margin-left: auto;
  font-family: var(--serif);
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: none;
  padding: 8px 20px 9px;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(55, 42, 30, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.configure:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(55, 42, 30, 0.4); }
.configure:active { transform: translateY(0); }

/* ============================================================
   stage (roof + shadow live here; curtain is on the canvas)
   ============================================================ */
#stage {
  position: fixed; inset: 0;
  z-index: 5;
}
#curtainCanvas {
  position: fixed; inset: 0;
  z-index: 6;
  display: block;
}
#stageLayer {
  position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  z-index: 7;
  will-change: transform;
}
/* wedge shadows live BELOW the canvas so glyphs stay crisp above them */
#wedgeLayer {
  position: fixed; top: 0; left: 0;
  width: 0; height: 0;
  z-index: 4;
  will-change: transform;
}
.roof-holder {
  position: absolute;
  transform: translate(-50%, 0);
  pointer-events: none;
}
.roof-svg { display: block; width: 100%; height: auto; }

/* projected wedge shadow (cast to the lower right) */
.wedge {
  position: absolute;
  pointer-events: none;
  transform-origin: top left;
  transform: skewX(30deg);   /* y grows downward: +tan pushes the hem right */
  filter: blur(24px);
  background: linear-gradient(102deg,
      rgba(96, 72, 44, 0.25) 0%,
      rgba(96, 72, 44, 0.12) 42%,
      rgba(96, 72, 44, 0.0) 70%);
}

/* ============================================================
   editorial content
   ============================================================ */
#content {
  position: fixed; inset: 0;
  z-index: 20;
  pointer-events: none;
}
.kicker {
  position: absolute;
  left: 6.4vw; top: 47.5vh;
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  max-width: 250px;
  line-height: 1.7;
}
.kicker .native { color: #463a26; }
.kicker b { color: #463a26; font-weight: 700; }

.headline {
  position: absolute;
  left: 6.3vw; top: 51.5vh;
  width: 5.6em;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 6.6vh, 84px);
  line-height: 0.97;
  letter-spacing: -0.005em;
  color: #33261a;
}
.headline .w {
  display: inline-block;
  will-change: transform, filter, opacity;
}
.headline .dash {
  display: inline-block;
  width: 1.35em; height: 0.055em;
  background: #33261a;
  vertical-align: 0.3em;
  margin: 0 0.02em;
}

.desc {
  position: absolute;
  right: 6.4vw; bottom: 7.5vh;
  width: 212px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* word in/out animation */
.w, .kicker, .desc { transition: none; }
.anim-piece {
  display: inline-block;
  opacity: 0;
  filter: blur(9px);
  transform: translateY(12px);
}
.anim-piece.in {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  transition:
    opacity 0.55s cubic-bezier(.23,.9,.32,1),
    filter 0.55s cubic-bezier(.23,.9,.32,1),
    transform 0.55s cubic-bezier(.23,.9,.32,1);
}
.anim-piece.out {
  opacity: 0;
  filter: blur(9px);
  transform: translateY(-8px);
  transition:
    opacity 0.3s ease-in,
    filter 0.3s ease-in,
    transform 0.3s ease-in;
}

.fade-block { transition: opacity 0.45s ease; }
.fade-block.hidden { opacity: 0; }

/* ============================================================
   prev / next stamp cards
   ============================================================ */
.nav-card {
  position: absolute;
  top: 27.5vh;
  width: 64px;
  padding: 7px 6px 5px;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    2px 4px 10px rgba(90, 68, 40, 0.22);
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
}
.nav-card:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 2px 8px 18px rgba(90, 68, 40, 0.3);
}
.nav-card.prev { left: 6.3vw; }
.nav-card.next { right: 6.3vw; }
.nav-card .thumb {
  width: 100%; height: 34px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.nav-card .thumb svg { width: 46px; height: auto; filter: none; }
.nav-card .cname {
  font-family: var(--serif);
  font-size: 10.5px;
  color: #4a3a28;
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* ============================================================
   progress line
   ============================================================ */
#progress {
  position: fixed;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  width: 88px; height: 3px;
  background: rgba(74, 58, 40, 0.18);
  border-radius: 2px;
  z-index: 30;
  overflow: hidden;
}
#progress .fill {
  height: 100%;
  background: #4a3a28;
  border-radius: 2px;
  width: 20%;
  transition: width 0.6s cubic-bezier(.6,.05,.2,1), transform 0.6s cubic-bezier(.6,.05,.2,1);
}

/* ============================================================
   quill cursor
   ============================================================ */
#quill {
  position: fixed;
  left: 0; top: 0;
  width: 34px; height: 34px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform;
}
body.quill-on #quill { opacity: 1; }
body.quill-on #curtainCanvas { cursor: none; }

/* ============================================================
   overview (Destinations) mode
   ============================================================ */
#overviewLayer {
  position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  z-index: 7;
  will-change: transform;
}
#overviewLayer .roof-holder { pointer-events: none; }
.ov-label {
  position: absolute;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 17px;
  color: #4a3a28;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ov-hint {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  z-index: 30;
  text-transform: uppercase;
}

/* mode transitions */
.mode-fade {
  transition: opacity 0.4s ease;
}
.mode-fade.gone { opacity: 0; pointer-events: none !important; }
.mode-fade.gone * { pointer-events: none !important; }
