/* ============================================================
   The Gore Coach House — Heritage editorial site
   Warm sepia / cream palette · serif display + sans body
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Type scale */
  --text-xs: 0.78rem;
  --text-sm: 0.9rem;
  --text-base: 1.0625rem;
  --text-lg: 1.3rem;
  --text-xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.8vw, 3.2rem);
  --text-hero: clamp(2.8rem, 1.8rem + 5.4vw, 6rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --maxw: 1180px;
  --measure: 66ch;
  --radius: 4px;

  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Switzer', system-ui, sans-serif;

  /* Light (parchment) */
  --bg: #f4ece0;
  --bg-2: #ece0cf;
  --surface: #faf4ea;
  --ink: #2a2118;
  --ink-soft: #5a4c3b;
  --ink-faint: #8a7a64;
  --line: #d8c8b2;
  --accent: #8c3a24;        /* oxblood / foundry red */
  --accent-soft: #b1583c;
  --brass: #9a7b3f;
  --hero-overlay: linear-gradient(180deg, rgba(38,28,18,.30) 0%, rgba(38,28,18,.55) 100%);

  --shadow-sm: 0 1px 3px rgba(40,30,18,.12);
  --shadow-md: 0 12px 34px rgba(40,30,18,.18);
  --transition: 0.4s cubic-bezier(.16,1,.3,1);
}

[data-theme="dark"] {
  --bg: #181410;
  --bg-2: #211a13;
  --surface: #221b14;
  --ink: #f0e6d6;
  --ink-soft: #c5b39a;
  --ink-faint: #8f7e66;
  --line: #3a2f23;
  --accent: #d77a5c;
  --accent-soft: #e08a6c;
  --brass: #c9a85e;
  --hero-overlay: linear-gradient(180deg, rgba(12,8,4,.45) 0%, rgba(12,8,4,.72) 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 14px 40px rgba(0,0,0,.55);
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }

h1,h2,h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space-6); }
.section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.lead { font-size: var(--text-lg); color: var(--ink-soft); max-width: var(--measure); }
.prose p { max-width: var(--measure); margin-bottom: var(--space-4); color: var(--ink-soft); }
.prose p strong { color: var(--ink); font-weight: 600; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.header.scrolled { border-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); height: 68px; }
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--ink); flex: none; }
.brand svg { color: var(--accent); flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; white-space: nowrap; }
.brand-sub { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: clamp(var(--space-3), 1.6vw, var(--space-6)); list-style: none; }
.nav-links a { text-decoration: none; font-size: var(--text-sm); color: var(--ink-soft); transition: color .2s; position: relative; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 88vh; display: flex; align-items: flex-end; color: #f7eedf; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-overlay); }
.hero-inner { padding-bottom: clamp(var(--space-16), 8vw, var(--space-32)); }
.hero h1 { font-size: var(--text-hero); color: #fff; max-width: 14ch; text-shadow: 0 2px 30px rgba(0,0,0,.4); }
.hero .eyebrow { color: #f0c9b3; }
.hero p { max-width: 52ch; font-size: var(--text-lg); margin-top: var(--space-6); color: #f0e6d6; text-shadow: 0 1px 14px rgba(0,0,0,.45); }
.hero-meta { display: flex; gap: var(--space-8); margin-top: var(--space-8); flex-wrap: wrap; }
.hero-meta div span { display: block; }
.hero-meta .k { font-family: var(--font-display); font-size: 1.6rem; color: #fff; }
.hero-meta .l { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .15em; color: #e2c4ad; }
.scroll-cue { position: absolute; left: 50%; bottom: var(--space-8); transform: translateX(-50%); color: #f0e6d6; opacity: .8; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,8px);} }

/* ---------- Section heads ---------- */
.section-head { max-width: 56ch; margin-bottom: var(--space-12); }
.section-head h2 { font-size: var(--text-2xl); margin-bottom: var(--space-4); }

/* ---------- Editorial two-column ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(var(--space-8), 5vw, var(--space-24)); align-items: center; }
.split.rev .split-media { order: 2; }
.split-media figure { margin: 0; }
.split-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); }
figcaption { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-3); font-style: italic; }

/* ---------- Bands ---------- */
.band { background: var(--bg-2); }
.band-surface { background: var(--surface); border-block: 1px solid var(--line); }

/* ---------- Full-bleed image break ---------- */
.bleed { position: relative; height: clamp(40vh, 52vh, 620px); overflow: hidden; }
.bleed img { width: 100%; height: 100%; object-fit: cover; }
.bleed .bleed-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-8) var(--space-6);
  background: linear-gradient(0deg, rgba(20,12,6,.75), transparent);
  color: #f3e8d8;
}
.bleed .bleed-cap .wrap { font-size: var(--text-sm); }
.bleed .bleed-cap strong { font-family: var(--font-display); font-size: var(--text-lg); display: block; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 760px; margin-inline: auto; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-left: var(--space-12); margin-bottom: var(--space-8); }
.tl-item::before { content: ""; position: absolute; left: 3px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.tl-year { font-family: var(--font-display); font-size: var(--text-lg); color: var(--accent); }
.tl-item h3 { font-size: var(--text-lg); margin: var(--space-1) 0 var(--space-2); }
.tl-item p { color: var(--ink-soft); font-size: var(--text-base); max-width: 60ch; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: var(--space-6); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-8); transition: var(--transition); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.card h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.card p { color: var(--ink-soft); font-size: var(--text-sm); }
.card .icon { color: var(--accent); margin-bottom: var(--space-4); }

/* ---------- Chamberlin callout ---------- */
.chamberlin {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(var(--space-6), 4vw, var(--space-12));
  align-items: center;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: clamp(var(--space-6), 4vw, var(--space-12)); box-shadow: var(--shadow-sm);
}
.chamberlin-photo { margin: 0; }
.chamberlin-photo img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); filter: sepia(.12); }
.chamberlin-body .icon { color: var(--accent); margin-bottom: var(--space-4); }
.chamberlin-body h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.chamberlin-body p { color: var(--ink-soft); font-size: var(--text-base); max-width: 60ch; }
.chamberlin-body p strong { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .chamberlin { grid-template-columns: 1fr; } }

/* ---------- Context illustration ---------- */
.ctx-illustration { margin: 0 0 var(--space-12); }
.ctx-illustration img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--line); filter: sepia(.08); }
.ctx-illustration figcaption { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-3); font-style: italic; text-align: center; }

/* ---------- Context cards ---------- */
.context-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.ctx-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: var(--radius); padding: var(--space-8); }
.ctx-card .ctx-year { font-family: var(--font-display); font-size: var(--text-xl); color: var(--accent); display: block; line-height: 1; }
.ctx-card h3 { font-size: var(--text-lg); margin: var(--space-3) 0 var(--space-2); }
.ctx-card p { font-size: var(--text-sm); color: var(--ink-soft); }
.ctx-origin { display: block; font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: calc(var(--space-2) * -1) 0 var(--space-3); }
.ctx-card-feature { border-top-color: var(--accent); box-shadow: var(--shadow-md); }
.ctx-card-feature h3 { color: var(--accent); }
.ctx-card p strong { color: var(--ink); font-weight: 600; }
.ctx-note { margin-top: var(--space-8); max-width: 70ch; font-size: var(--text-sm); font-style: italic; color: var(--ink-faint); border-left: 2px solid var(--line); padding-left: var(--space-4); }
@media (max-width: 760px) { .context-cards { grid-template-columns: 1fr; } }

/* ---------- Pull quote ---------- */
.pullquote { max-width: 820px; margin-inline: auto; text-align: center; }
.pullquote blockquote { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.3; color: var(--ink); font-style: italic; }
.pullquote cite { display: block; margin-top: var(--space-6); font-style: normal; font-size: var(--text-sm); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- Lamp feature ---------- */
.lamp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(var(--space-8),5vw,var(--space-16)); align-items: center; }
.lamp-photos { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-4); }
.lamp-photos img { border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; height: 100%; object-fit: cover; }
.lamp-photos .tall { grid-row: span 1; }
.spec-list { list-style: none; margin-top: var(--space-6); }
.spec-list li { display: flex; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.spec-list .sk { color: var(--ink-faint); min-width: 130px; }
.spec-list .sv { color: var(--ink); }

/* ---------- People ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: var(--space-8); }
.person { border-top: 3px solid var(--accent); padding-top: var(--space-4); }
.person .role { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .15em; color: var(--ink-faint); }
.person h3 { font-size: var(--text-lg); margin: var(--space-1) 0 var(--space-3); }
.person p { font-size: var(--text-sm); color: var(--ink-soft); }
.person .yrs { color: var(--accent); font-family: var(--font-display); }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: var(--space-16); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-12); }
.footer h4 { font-family: var(--font-display); font-size: var(--text-lg); margin-bottom: var(--space-3); }
.footer p, .footer a, .footer li { font-size: var(--text-sm); color: var(--ink-soft); }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: var(--space-2); }
.footer a { text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--accent); }
.footer-bottom { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--ink-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Mill feature ---------- */
.mill-feature { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(var(--space-8),5vw,var(--space-16)); align-items: center; }
.mill-feature.rev .mill-media { order: 2; }
.mill-media { margin: 0; }
.mill-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.mill-facts { list-style: none; margin-top: var(--space-6); }
.mill-facts li { display: flex; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.mill-facts .mk { color: var(--ink-faint); min-width: 132px; }
.mill-facts .mv { color: var(--ink); }
@media (max-width: 860px) { .mill-feature { grid-template-columns: 1fr; } .mill-feature.rev .mill-media { order: 0; } }

/* ---------- Photo gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); }
.gallery figure:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; filter: sepia(.1); }
.gallery figcaption { padding: var(--space-3) var(--space-4) var(--space-4); font-size: var(--text-xs); color: var(--ink-faint); font-style: italic; margin: 0; }
.gallery .span-2 { grid-column: 1 / -1; }
.gallery .span-2 img { aspect-ratio: 21 / 9; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } .gallery .span-2 img { aspect-ratio: 3 / 2; } }

/* ---------- Hauntings / legend ---------- */
.haunt { position: relative; }
.haunt .haunt-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(var(--space-8),5vw,var(--space-16)); align-items: center; }
.haunt-media { margin: 0; position: relative; }
.haunt-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); filter: grayscale(.35) contrast(1.05) brightness(.92); }
.legend-tag { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .18em; font-weight: 600; color: var(--brass); border: 1px solid var(--brass); border-radius: 999px; padding: .3rem .8rem; margin-bottom: var(--space-4); }
.haunt blockquote { font-family: var(--font-display); font-style: italic; font-size: var(--text-lg); color: var(--ink); line-height: 1.4; border-left: 3px solid var(--accent); padding-left: var(--space-4); margin: var(--space-6) 0; }
.haunt .disclaimer { margin-top: var(--space-6); font-size: var(--text-sm); font-style: italic; color: var(--ink-faint); border-left: 2px solid var(--line); padding-left: var(--space-4); max-width: 64ch; }
@media (max-width: 860px) { .haunt .haunt-inner { grid-template-columns: 1fr; } }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity:1; transform:none; transition:none; } .scroll-cue { animation:none; } html { scroll-behavior:auto; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .split, .lamp-grid { grid-template-columns: 1fr; }
  .split.rev .split-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
/* Collapse the 7-item nav to a menu while there isn't room to lay it out horizontally */
@media (max-width: 1024px) {
  .nav-links { display: none; position: absolute; top: 68px; left:0; right:0; flex-direction: column; align-items: flex-start; background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--space-6); gap: var(--space-4); }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: var(--text-base); }
  .menu-btn { display: grid; place-items: center; }
}

/* ===== 360 Tour ===== */
.tour-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.tour-tile { position: relative; display: block; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm); transition: var(--transition); font: inherit; color: inherit; text-align: left; width: 100%; }
.tour-tile:hover, .tour-tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-md); outline: none; }
.tour-tile:focus-visible { border-color: var(--accent); }
.tour-tile img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; filter: sepia(.1); }
.tour-tile-cap { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-family: var(--font-display, inherit); font-size: var(--text-sm); color: var(--ink); }
.tour-360 { display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--accent); border-radius: 999px; padding: .18rem .5rem; }
.tour-tile::after { content: "Drag to look around"; position: absolute; top: var(--space-3); right: var(--space-3); font-size: var(--text-xs); letter-spacing: .04em; color: #fff; background: rgba(20,14,8,.55); border-radius: 999px; padding: .2rem .6rem; opacity: 0; transition: var(--transition); }
.tour-tile:hover::after, .tour-tile:focus-visible::after { opacity: 1; }
.pano-viewer { margin-top: var(--space-8); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); background: #0c0907; }
.pano-viewer-bar { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--line); }
.pano-viewer-bar strong { font-family: var(--font-display, inherit); font-size: var(--text-base); color: var(--ink); }
.pano-close { font: inherit; font-size: var(--text-sm); cursor: pointer; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .9rem; color: var(--ink-soft); transition: var(--transition); }
.pano-close:hover { color: var(--accent); border-color: var(--accent); }
.pano-stage { width: 100%; height: clamp(360px, 56vh, 620px); }
.pano-stage .pnlm-container { background: #0c0907; }
#tour .disclaimer { margin-top: var(--space-6); font-size: var(--text-sm); font-style: italic; color: var(--ink-faint); border-left: 2px solid var(--line); padding-left: var(--space-4); max-width: 70ch; }
@media (max-width: 880px) { .tour-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tour-grid { grid-template-columns: 1fr; } }
