/* =============================================================
   Fold Lodge — Editorial Dark Warm (archetype 02, adapted)
   Off-grid cabins, Patagonia. Ember amber on forest-night.
   Standalone build — no shared demo.css.
   ============================================================= */

/* 1 · Tokens ------------------------------------------------- */
:root {
  --bg:      #131009;
  --bg-2:    #1a1610;
  --bg-3:    #241d14;   /* card */
  --bg-4:    #2e2619;   /* raised */

  --cream:   #efe7d4;
  --cream-2: #d7ccb3;
  --cream-3: #948868;   /* metadata */

  --accent:   #d98a3c;  /* ember / lantern */
  --accent-2: #b1691f;
  --gold:     #c39a5f;
  --pine:     #6f8a78;   /* cold counter — sparing */

  --line:   rgba(239, 231, 212, 0.12);
  --line-2: rgba(239, 231, 212, 0.07);

  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 20px 44px -22px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.45), 0 40px 80px -36px rgba(0, 0, 0, 0.75);

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --r: 6px;
  --r-lg: 10px;

  --gutter: clamp(1.15rem, 5vw, 2.6rem);
  --maxw: 1160px;
  --space-section: clamp(4.5rem, 11vw, 8rem);
}

@property --mesh-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* 2 · Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--cream-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--cream);
  text-wrap: balance;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }
::selection { background: var(--accent); color: #17120b; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--cream); color: var(--bg);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* 3 · Kicker (mono) --------------------------------------- */
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.kicker::before {
  content: "";
  width: 1.6rem; height: 1px;
  background: var(--accent);
}

.u-link { position: relative; color: var(--accent); font-weight: 600; }
.u-link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 1px; background: currentColor; transition: right .3s var(--ease-out);
}
.u-link:hover::after { right: 0; }

/* 4 · Grain + entrance ---------------------------------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  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.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
/* Entrance: the hero simply fades up on load — CSS only, no overlay layer, no JS timing.
   (Replaced the old black "Fold Lodge" splash, which flickered in some browsers.) */
.hero-bg { animation: heroBgIn 1.4s var(--ease-out) both; }
.hero-inner { animation: heroIn 1s var(--ease-out) .15s both; }
@keyframes heroBgIn { from { opacity: 0; } }
@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } }

/* 5 · Demo honesty bar (system chrome, not lodge design) --- */
.demo-bar {
  position: relative; z-index: 200;
  background: #0c0a05;
  color: var(--cream-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 0.8rem;
  line-height: 1.45;
}
.demo-bar .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.35rem 1rem; padding-block: 0.65rem;
}
.demo-bar strong { color: var(--cream); font-weight: 600; }
.demo-bar a {
  color: var(--cream); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.demo-bar a:hover { color: var(--accent); }

.demo-note {
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: rgba(239, 231, 212, 0.03);
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--cream-2);
  max-width: 46rem;
}
.demo-note strong { color: var(--cream); }

/* 6 · Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.5rem;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1;
  transition: transform .3s var(--ease-out), background-color .25s var(--ease-out),
              border-color .25s var(--ease-out), color .25s var(--ease-out);
}
.btn-arrow { display: inline-block; transition: transform .3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--accent);
  color: #17120b;
  box-shadow: 0 12px 30px -14px rgba(217, 138, 60, 0.6);
}
.btn-primary:hover { background: #e69a4f; transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--cream);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* 7 · Nav ----------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 150;
  padding: 1.1rem var(--gutter);
  transition: padding .35s var(--ease-out), background-color .35s var(--ease-out);
}
.nav.is-scrolled {
  padding-block: 0.65rem;
  background: rgba(19, 16, 9, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--cream);
  display: inline-flex; align-items: baseline; gap: 0.5rem;
}
.brand small {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-3);
}
.nav-links { display: none; margin-left: auto; gap: 1.6rem; }
.nav-links a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-3);
  padding: 0.3rem 0;
  transition: color .2s var(--ease-out);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--accent);
  transition: right .3s var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--cream); }
.nav-links a:hover::after, .nav-links a.is-active::after { right: 0; }
.nav-cta { margin-left: auto; padding: 0.68rem 1.15rem; font-size: 0.82rem; white-space: nowrap; }
.nav-links + .nav-cta { margin-left: 0; }
@media (max-width: 600px) {
  .nav-cta { padding: 0.6rem 0.9rem; font-size: 0.78rem; }
  .brand small { display: none; }
}

/* 8 · Hero --------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 9rem var(--gutter) clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; background: #0e0b06; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.72; }
.hero-mesh {
  position: absolute; inset: -30%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 32% at var(--mx, 32%) var(--my, 78%), rgba(217, 138, 60, 0.4), transparent 70%),
    radial-gradient(30% 26% at 82% 30%, rgba(111, 138, 120, 0.22), transparent 72%);
  filter: blur(60px);
  animation: meshDrift 26s var(--ease-soft) infinite;
}
@keyframes meshDrift {
  0%, 100% { --mesh-a: 0deg; transform: rotate(0deg) scale(1); }
  50%      { --mesh-a: 180deg; transform: rotate(8deg) scale(1.12); }
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(14,11,6,0.55) 0%, transparent 30%, transparent 44%, rgba(14,11,6,0.86) 100%);
}
.hero-inner { width: 100%; max-width: var(--maxw); margin-inline: auto; }
.hero h1 {
  font-size: clamp(2.6rem, 6.6vw, 4.9rem);
  font-weight: 500;
  line-height: 1.04;
  max-width: 18ch;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}
.hero-sub {
  margin-top: 1.3rem;
  font-size: clamp(1.04rem, 2vw, 1.22rem);
  max-width: 46ch;
  color: var(--cream);
  text-shadow: 0 1px 20px rgba(0,0,0,0.55);
}
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-meta {
  margin-top: 1.8rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-2);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-meta span::before { content: ""; width: 4px; height: 4px; background: var(--accent); }

/* 9 · Sections --------------------------------------- */
.section { position: relative; padding: var(--space-section) 0; scroll-margin-top: 6rem; }
.section.alt { background: var(--bg-2); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
.section-lead { margin-top: 1.1rem; color: var(--cream-2); font-size: 1.05rem; max-width: 42rem; }

/* 10 · The place / pillars --------------------------- */
.place-figure {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: var(--bg-3);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-2);
}
.place-figure img { width: 100%; height: 100%; object-fit: cover; }
.place-copy { margin-top: 2.4rem; max-width: 46rem; }
.place-copy p { color: var(--cream-2); font-size: 1.05rem; }
.place-copy p + p { margin-top: 1rem; }
.pillars {
  margin-top: 3rem;
  display: grid; gap: 1.6rem;
}
.pillar { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.pillar h3 {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.pillar p { color: var(--cream-2); font-size: 0.97rem; }

/* 11 · Cabins showcase (horizontal snap) ------------- */
.cabins-track {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  padding: 0.5rem var(--gutter) 2.5rem;
  margin-inline: calc(-1 * var(--gutter));
  scrollbar-width: thin;
  scrollbar-color: var(--accent-2) transparent;
}
.cabins-track::-webkit-scrollbar { height: 6px; }
.cabins-track::-webkit-scrollbar-thumb { background: var(--accent-2); border-radius: 999px; }
.cabin {
  flex: 0 0 clamp(258px, 80vw, 360px);
  scroll-snap-align: center;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .4s var(--ease-out), border-color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.cabin:hover { transform: translateY(-6px); border-color: rgba(217, 138, 60, 0.4); box-shadow: var(--shadow-lg); }
.cabin-media { aspect-ratio: 4 / 3; background: var(--bg-4); overflow: hidden; }
.cabin-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.cabin:hover .cabin-media img { transform: scale(1.05); }
.cabin-body { padding: 1.3rem 1.4rem 1.5rem; }
.cabin-body h3 { font-size: 1.5rem; }
.cabin-spec {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-3);
  margin: 0.4rem 0 0.7rem;
}
.cabin-body p { color: var(--cream-2); font-size: 0.94rem; }
.cabin-rate {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}
.cabins-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-3);
  margin-top: 0.5rem;
}

/* 12 · Gallery -------------------------------------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.gallery figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  aspect-ratio: 3 / 2;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption {
  position: absolute; left: 0.8rem; bottom: 0.8rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(14, 11, 6, 0.6);
  padding: 0.3rem 0.6rem;
  border-radius: var(--r);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 13 · Getting here -------------------------------- */
.here-grid { display: grid; gap: clamp(1.8rem, 5vw, 3rem); align-items: start; }
.here-copy p { color: var(--cream-2); }
.here-copy p + p { margin-top: 0.9rem; }
.here-list { margin-top: 1.3rem; display: grid; gap: 0.7rem; }
.here-list li {
  list-style: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cream-2);
  padding-left: 1.3rem;
  position: relative;
}
.here-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 6px; height: 6px; background: var(--accent);
}
.map-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 78% 20%, rgba(111, 138, 120, 0.18), transparent 60%),
    linear-gradient(160deg, #1c1810 0%, #211b12 55%, #171309 100%);
}
.map-card::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(239,231,212,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239,231,212,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-pin {
  position: absolute; left: 50%; top: 47%;
  width: 18px; height: 18px;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.6);
}
.map-note {
  position: absolute; left: 0.8rem; bottom: 0.8rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-2);
  background: rgba(14,11,6,0.6);
  padding: 0.3rem 0.6rem;
  border-radius: var(--r);
}

/* 14 · Stay / form -------------------------------- */
.stay-grid { display: grid; gap: clamp(2.2rem, 6vw, 3.6rem); align-items: start; }
.stay-copy { max-width: 34rem; }
.stay-copy h2 { font-size: clamp(2rem, 4vw, 2.7rem); margin-bottom: 1rem; }
.stay-copy > p { color: var(--cream-2); }
.stay-direct {
  margin-top: 1.8rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: grid; gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.stay-direct dt { color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.7rem; }
.stay-direct dd { color: var(--cream); }
.stay-direct .fine { color: var(--cream-3); }

.stay-form {
  padding: 1.9rem 1.8rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.stay-form .row { display: grid; gap: 1rem; }
@media (min-width: 480px) { .stay-form .row-2 { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-3);
  margin-bottom: 0.45rem;
}
.field .opt { text-transform: none; letter-spacing: 0; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(14, 11, 6, 0.4);
  font: inherit;
  color: var(--cream);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.field input::placeholder, .field textarea::placeholder { color: var(--cream-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 138, 60, 0.16);
}
.field textarea { resize: vertical; min-height: 90px; }
.form-status { margin-top: 0.9rem; font-size: 0.88rem; font-weight: 500; min-height: 1.2em; font-family: var(--mono); }
.form-status.is-ok { color: var(--accent); }
.form-status.is-err { color: #e0794f; }

/* 15 · Footer ------------------------------------ */
.footer {
  padding: clamp(3rem, 7vw, 4.5rem) var(--gutter) 2.2rem;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer-inner { max-width: var(--maxw); margin-inline: auto; display: grid; gap: 1.6rem; }
.footer .brand { font-size: 1.2rem; }
.footer-tag { color: var(--cream-2); font-size: 0.95rem; max-width: 34rem; }
.footer-disclosure {
  font-size: 0.88rem;
  color: var(--cream-2);
  max-width: 46rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--r-lg);
  background: rgba(239, 231, 212, 0.035);
  border: 1px solid var(--line-2);
}
.footer-disclosure strong { color: var(--cream); }
.footer-bottom {
  max-width: var(--maxw);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--cream-3);
}
.footer-bottom a { color: var(--accent); }

/* 16 · Reveal + tilt ---------------------------- */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
.cabin.reveal:nth-child(2) { transition-delay: .06s; }
.cabin.reveal:nth-child(3) { transition-delay: .12s; }
.cabin.reveal:nth-child(4) { transition-delay: .18s; }
.gallery .reveal:nth-child(2) { transition-delay: .06s; }
.gallery .reveal:nth-child(3) { transition-delay: .12s; }
.gallery .reveal:nth-child(4) { transition-delay: .18s; }

[data-tilt] { transform-style: preserve-3d; will-change: transform; }

/* 17 · Responsive ------------------------------ */
@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-cta { margin-left: 0; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .here-grid { grid-template-columns: 1.1fr 0.9fr; }
  .stay-grid { grid-template-columns: 1fr 1fr; }
  .stay-form { position: sticky; top: 6rem; }
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

/* 18 · Reduced motion ------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-mesh { animation: none; }
  .hero-bg, .hero-inner { animation: none; }
  .reveal { transition-duration: .001s; }
  .cabin:hover .cabin-media img,
  .gallery figure:hover img { transform: none; }
}
