/* ============================================================
   renai.wiki — Frutiger-Aero (Lacquered)
   Gold-on-black luxury, diagonal mountain ascent, Commissioner-only
   ============================================================ */

:root {
  --lacquer-black: #0b0a08;
  --deeper-lacquer: #050503;
  --gold: #c8a24a;
  --gold-pale: #e8d18a;
  --gold-shadow: #7a6024;
  --gold-spec: #f6e6a8;
  --ivory: #f3ead8;

  --slope: -7.5deg;
  --slope-anti: 7.5deg;

  --gold-grad: linear-gradient(18deg, var(--gold-shadow) 0%, var(--gold) 50%, var(--gold-pale) 100%);
  --gold-grad-mid: linear-gradient(18deg, var(--gold-shadow) 0%, #d4ae5a 50%, var(--gold-pale) 100%);
  --gold-bevel-shadow:
    inset 0 1px 0 var(--gold-spec),
    inset 0 -2px 4px var(--deeper-lacquer);

  --col: 58ch;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Commissioner', system-ui, sans-serif;
  font-weight: 300;
  font-stretch: 87.5%;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ivory);
  background-color: var(--lacquer-black);
  background-image:
    radial-gradient(ellipse 1400px 1000px at 18% 8%, rgba(200, 162, 74, 0.045), transparent 60%),
    radial-gradient(ellipse 1200px 900px at 88% 92%, rgba(200, 162, 74, 0.025), transparent 65%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lacquer noise overlay — 1.5% noise via SVG turbulence */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.55;
  background:
    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.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.043  0 0 0 0 0.039  0 0 0 0 0.031  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.025'/></svg>");
  mix-blend-mode: overlay;
}

.lacquer-noise { position: absolute; }

/* Soft directional light from upper left */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle 1100px at 12% 4%, rgba(232, 209, 138, 0.05), transparent 55%);
}

/* ========== Mountain Ridge (right margin) ========== */
.ridge {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 100px;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(200, 162, 74, 0.25));
}

.ridge-fill { filter: drop-shadow(0 1px 0 rgba(246, 230, 168, 0.4)); }
.ridge-hi   { opacity: 0.8; }

/* ========== Main Layout ========== */
.almanac {
  position: relative;
  z-index: 5;
  max-width: 100%;
  padding: 0 0 0 0;
}

/* ========== Plate (diagonal trapezoid) ==========
   Each plate slants at -7.5°. Inner content counter-rotates so type is readable.
   The slant produces the "mountain ridge" feel via gold hairlines top and bottom.
*/
.plate {
  position: relative;
  width: 100%;
  padding: 14vh 7vw 14vh 6vw;
  margin: 0;
  overflow: visible;
}

/* Gold hairlines top + bottom of each plate, slanted -7.5° */
.plate::before,
.plate::after {
  content: "";
  position: absolute;
  left: -2vw;
  right: -2vw;
  height: 1.5px;
  background: var(--gold-grad);
  box-shadow:
    0 1px 0 0 var(--gold-spec) inset,
    0 -1px 2px 0 var(--deeper-lacquer) inset,
    0 0 8px rgba(200, 162, 74, 0.3);
  transform: rotate(var(--slope));
  transform-origin: center;
  z-index: 4;
}
.plate::before { top: 0; }
.plate::after  { bottom: 0; }

.plate-inner {
  position: relative;
  max-width: var(--col);
  transform: rotate(var(--slope));
  transform-origin: left center;
  margin-left: 4vw;
  z-index: 6;
}

/* Stagger ascending offset — each plate sits a bit higher to the right via inner shift */
.plate-i   .plate-inner { margin-top: 0;    }
.plate-ii  .plate-inner { margin-top: -1.5vh; margin-left: 6vw; }
.plate-iii .plate-inner { margin-top: -2vh;   margin-left: 8vw; }
.plate-iv  .plate-inner { margin-top: -2.5vh; margin-left: 10vw; }
.plate-v   .plate-inner { margin-top: -2.5vh; margin-left: 12vw; }
.plate-vi  .plate-inner { margin-top: -2vh;   margin-left: 14vw; }
.plate-vii .plate-inner { margin-top: -1vh;   margin-left: 16vw; }

/* ========== Plate Label (tiny topographic marker) ========== */
.plate-label {
  font-family: 'Commissioner', sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(246, 230, 168, 0.05);
}

/* ========== Plate I — Base Camp ========== */
.wordmark {
  font-family: 'Commissioner', sans-serif;
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(48px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em 0;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 rgba(246, 230, 168, 0.1),
    0 2px 6px rgba(5, 5, 3, 0.6);
  filter: drop-shadow(0 1px 0 rgba(246, 230, 168, 0.18));
}

.gold-slash {
  width: 60%;
  height: 3px;
  background: var(--gold-grad);
  box-shadow: var(--gold-bevel-shadow);
  margin: 1.2em 0 1.6em 0;
  border-radius: 1px;
  position: relative;
}
.gold-slash::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--gold-spec);
  opacity: 0.7;
}

.caption {
  font-family: 'Commissioner', sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-style: italic;
  font-size: 19px;
  letter-spacing: 0.005em;
  color: var(--ivory);
  margin: 0;
  max-width: 50ch;
}

/* ========== Plate titles ========== */
.plate-title {
  font-family: 'Commissioner', sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 2em 0;
}

/* ========== Plate II — Glossary Ridge (two columns) ========== */
.glossary {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4em 3.2em;
}
.g-entry { margin: 0; }
.glossary dt {
  font-family: 'Commissioner', sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-size: 17px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 0.25em 0;
  letter-spacing: 0.005em;
  transition: filter 240ms ease, letter-spacing 240ms ease;
}
.glossary dt:hover {
  background: var(--gold-grad-mid);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(232, 209, 138, 0.35));
  letter-spacing: 0.012em;
}
.glossary dd {
  font-family: 'Commissioner', sans-serif;
  font-weight: 300;
  font-stretch: 87.5%;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ivory);
  margin: 0;
}

/* ========== Plate III — Stations ========== */
.stations {
  margin: 0;
  padding: 0;
  list-style: none;
}
.station {
  display: grid;
  grid-template-columns: 3.4em 9em 1fr;
  align-items: baseline;
  gap: 1.2em;
  padding: 1.05em 0;
  position: relative;
}
.station + .station::before {
  content: "";
  position: absolute;
  top: 0;
  left: -1em;
  right: -2em;
  height: 1px;
  background: var(--gold-grad);
  box-shadow:
    0 1px 0 var(--gold-spec) inset,
    0 0 4px rgba(200, 162, 74, 0.3);
  /* Slant slightly more than -7.5°, gives "switchback" feel */
  transform: rotate(-2deg);
  transform-origin: left center;
  opacity: 0.85;
}
.st-num {
  font-family: 'Commissioner', sans-serif;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 28px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.st-name {
  font-family: 'Commissioner', sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.st-desc {
  font-family: 'Commissioner', sans-serif;
  font-weight: 300;
  font-stretch: 87.5%;
  font-size: 15.5px;
  color: var(--ivory);
  line-height: 1.55;
}

/* ========== Plate IV — Field Notes ========== */
.field-notes {
  display: flex;
  flex-direction: column;
  gap: 1.4em;
}
.note {
  display: grid;
  grid-template-columns: 3em 1fr;
  gap: 1em;
  align-items: baseline;
}
.note-num {
  font-family: 'Commissioner', sans-serif;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 20px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}
.note p {
  font-family: 'Commissioner', sans-serif;
  font-weight: 300;
  font-stretch: 87.5%;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ivory);
  margin: 0;
}

/* ========== Plate V — Index of Mistakes (dense two-column, condensed) ========== */
.mistakes {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 3em;
}
.mistakes li {
  font-family: 'Commissioner', sans-serif;
  font-weight: 300;
  font-stretch: 75%;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ivory);
  break-inside: avoid;
  padding: 0.45em 0;
  border-bottom: 1px dotted rgba(200, 162, 74, 0.18);
}
.mk-tag {
  display: inline-block;
  min-width: 2.4em;
  font-weight: 500;
  font-stretch: 100%;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ========== Plate VI — The Lacquer Box (cartouche) ========== */
.cartouche {
  position: relative;
  width: 70%;
  min-height: 200px;
  margin: 0 auto;
  padding: 2px;
  background: var(--gold-grad);
  border-radius: 8px;
  box-shadow:
    0 0 16px rgba(200, 162, 74, 0.25),
    0 1px 0 var(--gold-spec) inset,
    0 -2px 4px var(--deeper-lacquer) inset;
  cursor: default;
}
.cartouche::before {
  content: "";
  position: absolute;
  top: 1px; left: 1px; right: 1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-spec) 30%, var(--gold-spec) 70%, transparent);
  border-radius: 7px 7px 0 0;
  opacity: 0.85;
  pointer-events: none;
}
.cartouche-inner {
  position: relative;
  background: radial-gradient(ellipse at center, #1a1612 0%, var(--lacquer-black) 80%);
  border-radius: 6px;
  padding: 3em 3.2em;
  box-shadow:
    inset 0 0 24px var(--deeper-lacquer),
    inset 0 1px 0 rgba(232, 209, 138, 0.08);
  cursor: none;
}
.cartouche-inner p {
  font-family: 'Commissioner', sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-style: italic;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ivory);
  margin: 0;
  text-align: left;
  letter-spacing: 0.005em;
}

/* Custom gold-dot cursor for inside cartouche */
.gold-cursor {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 0 1px var(--ivory),
    0 0 6px var(--gold-pale);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 180ms ease;
  transform: translate(-50%, -50%);
}
.gold-cursor.visible { opacity: 1; }

/* ========== Plate VII — Summit ========== */
.plate-vii { padding-bottom: 18vh; }

.ideogram {
  font-family: 'Commissioner', sans-serif;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 38vh;
  line-height: 0.95;
  text-align: center;
  margin: 0.1em 0 0.4em 0;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 rgba(246, 230, 168, 0.18),
    0 6px 24px rgba(5, 5, 3, 0.7);
  filter: drop-shadow(0 2px 0 rgba(246, 230, 168, 0.12));
  letter-spacing: -0.04em;
  /* Offset slightly to follow diagonal */
  transform: translateX(2vw);
}

.summit-footer {
  font-family: 'Commissioner', sans-serif;
  font-weight: 300;
  font-stretch: 75%;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ivory);
  opacity: 0.7;
  margin: 0;
}

/* ========== Fade-Reveal animation (the ONLY motion pattern) ========== */
.fade-row {
  opacity: 0;
  transition: opacity 900ms ease-out;
  transition-delay: 0ms;
  will-change: opacity;
}
.fade-row.is-visible {
  opacity: 1;
}

/* ========== Hover treatment for glossy gold elements ========== */
.gold-slash,
.cartouche {
  transition: filter 240ms ease, box-shadow 240ms ease, background-image 240ms ease;
}
.gold-slash:hover,
.cartouche:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 22px rgba(232, 209, 138, 0.42),
    0 1px 0 var(--gold-spec) inset,
    0 -2px 4px var(--deeper-lacquer) inset;
}

/* Stations on hover: brighten the gold name */
.station {
  transition: background-color 240ms ease;
}
.station:hover .st-name,
.station:hover .st-num {
  background: var(--gold-grad-mid);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(232, 209, 138, 0.35));
}

/* ========== Responsive ========== */
@media (max-width: 720px) {
  :root {
    --slope: -3.5deg;
    --slope-anti: 3.5deg;
    --col: 100%;
  }
  body {
    font-stretch: 100%;
    font-size: 15px;
  }
  .plate {
    padding: 10vh 5vw 10vh 5vw;
  }
  .plate-inner {
    margin-left: 2vw;
    max-width: 92vw;
  }
  .plate-i .plate-inner,
  .plate-ii .plate-inner,
  .plate-iii .plate-inner,
  .plate-iv .plate-inner,
  .plate-v .plate-inner,
  .plate-vi .plate-inner,
  .plate-vii .plate-inner {
    margin-left: 2vw;
  }
  .ridge { width: 56px; }
  .wordmark { font-size: clamp(40px, 14vw, 80px); }
  .glossary {
    grid-template-columns: 1fr;
    gap: 1.1em;
  }
  .station {
    grid-template-columns: 2.6em 7em 1fr;
    gap: 0.7em;
  }
  .mistakes { columns: 1; }
  .cartouche { width: 92%; }
  .cartouche-inner { padding: 2em 1.6em; }
  .ideogram { font-size: 24vh; }
  .field-notes .note { grid-template-columns: 2.3em 1fr; }
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
  .fade-row {
    opacity: 1;
    transition: none;
  }
  .gold-slash,
  .cartouche,
  .station,
  .glossary dt {
    transition: none;
  }
}
