/* ============================================================
   Inheritance of Memory — shared styles
   Warm sepia / aged parchment / dusty blue-grey / brown-black
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;1,400;1,500;1,600&family=Cormorant+Garamond:ital,wght@0,500;1,500;1,600&family=Pinyon+Script&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

:root {
  /* palette */
  --ink:        #2a201a;   /* deep brown-black, primary text */
  --ink-soft:   #4a3a2e;   /* softened brown for secondary text */
  --parchment:  #f3e7d0;   /* aged parchment, page base */
  --parchment-2:#ece0c6;   /* slightly deeper panel */
  --sepia:      #b07a45;   /* warm sepia accent */
  --sepia-deep: #8a5a2f;   /* deeper sepia for hovers */
  --bluegrey:   #6c7783;   /* dusty blue-grey, the only "cool" */
  --bluegrey-d: #515b66;
  --line:       #cdb893;   /* hairline / rule color */
  --gold:       #c79a52;

  /* cool "journey" accent — the globe/map thread. Constant across warmth presets. */
  --navy:       #1b2c4f;   /* matches the journey route lines */
  --navy-ink:   #1c3866;   /* a touch richer, tuned for large type on parchment */

  /* aging / warmth knobs (overridable by Tweaks) */
  --sepia-strength: 1;
  --vignette-strength: 1;

  --serif-title: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --serif-body:  'Spectral', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

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

body {
  background-color: var(--parchment);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(255,247,228,.55), transparent 60%),
    radial-gradient(ellipse 140% 120% at 50% 120%, rgba(60,40,24,calc(.10 * var(--vignette-strength))), transparent 55%);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper grain overlay applied at page level */
.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: calc(.5 * var(--vignette-strength));
  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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { font-weight: 500; line-height: 1.12; margin: 0; }
p { margin: 0 0 1.1em; text-wrap: pretty; }
a { color: var(--sepia-deep); text-decoration: none; }
a:hover { color: var(--ink); }

/* ---- display title treatment ---- */
.display {
  font-family: var(--serif-title);
  font-style: italic;
  font-weight: 500;
  letter-spacing: .005em;
  line-height: 1.02;
}

.eyebrow {
  font-family: var(--serif-body);
  font-weight: 500;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .72rem;
  color: var(--sepia-deep);
}

.rule {
  width: 56px; height: 1px;
  background: var(--sepia);
  border: 0;
  margin: 1.4rem 0;
}
.rule.center { margin-left: auto; margin-right: auto; }

/* ============================================================
   Site chrome — top bar
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: linear-gradient(to bottom, rgba(243,231,208,.92), rgba(243,231,208,0));
  backdrop-filter: blur(2px);
  transition: background .3s;
}
.topbar.solid {
  background: rgba(243,231,208,.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 30px rgba(60,40,24,.08);
}
.brand {
  display: flex; flex-direction: column; line-height: 1.05;
  font-family: var(--serif-title);
  font-style: italic;
  font-size: 1.18rem;
  color: var(--ink);
  white-space: nowrap;
}
.brand .sep { color: var(--sepia); font-style: normal; }
.brand .sub { font-family: var(--serif-body); font-style: normal; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--bluegrey-d); margin-top: 2px; }
.navlinks { display: flex; gap: 1.6rem; align-items: center; }
.navlinks a {
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.navlinks a.active, .navlinks a:hover { color: var(--sepia-deep); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--serif-body);
  font-size: .9rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .85rem 1.6rem;
  border: 1px solid var(--sepia-deep);
  color: var(--parchment);
  background: var(--sepia-deep);
  border-radius: 2px;
  cursor: pointer;
  transition: all .25s ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--parchment); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; color: var(--sepia-deep);
}
.btn.ghost:hover { background: rgba(138,90,47,.08); color: var(--ink); }

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.measure { max-width: 60ch; }

/* ============================================================
   Footer
   ============================================================ */
.sitefoot {
  border-top: 1px solid var(--line);
  margin-top: 5rem;
  padding: 3rem 28px 3.5rem;
  background: var(--parchment-2);
}
.sitefoot .wrap { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.sitefoot .col h4 { font-family: var(--serif-title); font-style: italic; font-size: 1.1rem; margin-bottom: .6rem; }
.sitefoot a { display: block; color: var(--ink-soft); font-size: .95rem; margin-bottom: .35rem; }
.sitefoot a:hover { color: var(--sepia-deep); }
.sitefoot .fineprint { width: 100%; border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: .5rem; font-size: .8rem; color: var(--bluegrey-d); }

/* selection */
::selection { background: rgba(176,122,69,.28); }

/* ============================================================
   Tweak-driven theming
   ============================================================ */
/* title font swaps */
html[data-title-font="cormorant"] { --serif-title: 'Cormorant Garamond', Georgia, serif; }
html[data-title-font="pinyon"]    { --serif-title: 'Pinyon Script', 'Playfair Display', cursive; }
html[data-title-font="pinyon"] .hero-title h1 { line-height: 1.05; padding-bottom: .12em; }

/* palette warmth presets */
html[data-warmth="faded"] {
  --parchment: #efe9da; --parchment-2: #e6dfcc; --sepia: #a78a64; --sepia-deep: #836b48;
  --line: #d3c7ad; --gold: #b9a06e; --ink: #34291f;
}
html[data-warmth="golden"] {
  --parchment: #f6e6c4; --parchment-2: #efdcb4; --sepia: #bd7d3c; --sepia-deep: #97591f;
  --line: #d8be8b; --gold: #cf9a3e; --ink: #2c1f12;
}

/* tweak panel (vanilla) */
#iom-tweaks {
  position: fixed; right: 18px; bottom: 18px; z-index: 200; width: 290px;
  background: rgba(28,17,9,.96); color: #f3e7d0; border: 1px solid rgba(199,154,82,.45);
  border-radius: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.45); padding: 16px 16px 18px;
  font-family: var(--serif-body); display: none; backdrop-filter: blur(4px);
}
#iom-tweaks.open { display: block; }
#iom-tweaks .tk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
#iom-tweaks .tk-head h4 { font-family: var(--serif-title); font-style: italic; font-size: 1.2rem; color: #f6ecd6; }
#iom-tweaks .tk-x { cursor: pointer; background: none; border: 0; color: rgba(243,231,208,.7); font-size: 1.1rem; line-height: 1; }
#iom-tweaks .tk-x:hover { color: #fff; }
#iom-tweaks .tk-row { margin-bottom: 1rem; }
#iom-tweaks .tk-row > label { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: .5rem; }
#iom-tweaks .seg { display: flex; gap: 4px; }
#iom-tweaks .seg button {
  flex: 1; padding: .42rem .3rem; font-family: var(--serif-body); font-size: .82rem;
  background: rgba(243,231,208,.07); color: rgba(243,231,208,.8); border: 1px solid rgba(199,154,82,.3);
  border-radius: 3px; cursor: pointer; transition: all .15s;
}
#iom-tweaks .seg button:hover { background: rgba(243,231,208,.14); }
#iom-tweaks .seg button.on { background: var(--gold); color: #2a1808; border-color: var(--gold); }
#iom-tweaks input[type=range] { width: 100%; accent-color: var(--gold); }
#iom-tweaks .tk-val { float: right; font-family: var(--mono); font-size: .72rem; color: rgba(243,231,208,.6); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
