/* ==========================================================================
   MIGOMBANI HOMESTAY — RESET, TYPOGRAPHY, LAYOUT PRIMITIVES, MOTION
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  color-scheme: light dark;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100svh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  transition: background-color var(--t-slow) var(--e-soft), color var(--t-slow) var(--e-soft);
}

body.is-locked { overflow: hidden; }

/* clip, not hidden — clip does not create a scroll container, so
   position: sticky inside the page keeps working. */
main { overflow-x: clip; }

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
/* Placeholder tint while a photo loads — only where a photo is expected,
   never on the logo (a filter would paint the background too). */
.card-media, .masonry figure, .room-gallery-main, .bk-room-media,
.story-media, .photo-pair figure { background-color: var(--surface-2); }

input, button, textarea, select { font: inherit; color: inherit; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul[class], ol[class] { list-style: none; padding: 0; }

:target { scroll-margin-top: calc(var(--header-h) + 2rem); }

/* ── Focus: never removed, always obvious ─────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.on-dark :focus-visible { outline-color: var(--banana-300); }

::selection { background: var(--accent); color: var(--on-accent); }

/* ── Scrollbar ────────────────────────────────────────────────────────── */
@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: var(--forest-500) transparent; }
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--forest-500) 55%, transparent);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--forest-500); background-clip: content-box; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-optical-sizing: auto;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); }
h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-normal);
}
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-sm); }

/* Bodoni's hairlines shatter below ~22px — never let it get that small. */
.display-xl  { font-size: var(--fs-hero); }
.display-lg  { font-size: var(--fs-4xl); }
.display-md  { font-size: var(--fs-3xl); }
.display-sm  { font-size: var(--fs-2xl); }

.italic-note { font-style: italic; font-family: var(--font-display); }

/* Eyebrow — mono, spaced, the "technical" counterpoint to the serif */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: var(--sp-4);
}
.on-dark .eyebrow { color: var(--banana-300); }

.eyebrow::before {
  content: '';
  width: 1.75rem; height: 1px;
  background: currentColor;
  opacity: .6;
  flex: none;
}
.eyebrow.is-centred { justify-content: center; }
.eyebrow.is-centred::after {
  content: '';
  width: 1.75rem; height: 1px;
  background: currentColor;
  opacity: .6;
  flex: none;
}
.eyebrow.no-rule::before { display: none; }

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  font-weight: 300;
}

.prose p { max-width: var(--maxw-text); color: var(--ink-2); }
.prose p + p { margin-top: var(--sp-4); }

.muted { color: var(--ink-3); }
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum  { font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

a { color: inherit; text-decoration: none; }

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .28em;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  transition: text-decoration-color var(--t-fast) var(--e-soft), color var(--t-fast) var(--e-soft);
}
.link:hover { text-decoration-color: var(--accent); color: var(--brand); }
.on-dark .link:hover { color: var(--banana-300); }

/* Text link with a sliding arrow */
.arrow-link {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--ink);
  padding-block: .4rem;
  cursor: pointer;
  background: none; border: 0;
}
.arrow-link { position: relative; }
.arrow-link svg { width: 1.05em; height: 1.05em; transition: transform var(--t-base) var(--e-out); }
.arrow-link > span { position: relative; }
.arrow-link > span::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -.28em; height: 1px;
  background: currentColor; opacity: .3;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--e-out), opacity var(--t-base) var(--e-soft);
}
.arrow-link:hover > span::after { transform: scaleX(1); opacity: .8; }
.arrow-link:hover svg { transform: translateX(4px); }

/* ==========================================================================
   LAYOUT PRIMITIVES
   ========================================================================== */

.wrap      { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { width: 100%; max-width: var(--maxw-wide); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-text { width: 100%; max-width: calc(var(--maxw-text) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section-y); position: relative; }
.section-sm { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3rem); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.flex { display: flex; gap: var(--sp-3); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.center { text-align: center; }
.center-x { margin-inline: auto; }

.hr {
  height: 1px; border: 0;
  background: linear-gradient(to right, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

/* Section heading block */
.sec-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.sec-head.is-centred { margin-inline: auto; text-align: center; }
.sec-head h2 { margin-bottom: var(--sp-4); }
.sec-head .lead { max-width: 42rem; }
.sec-head.is-centred .lead { margin-inline: auto; }

.sec-head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-6); flex-wrap: wrap;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.sec-head-row > div:first-child { max-width: 40rem; }

/* Screen-reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -140%);
  z-index: var(--z-toast);
  background: var(--accent); color: var(--on-accent);
  padding: .75rem 1.5rem;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-family: var(--font-mono); font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  transition: transform var(--t-base) var(--e-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); outline-offset: -3px; }

/* ==========================================================================
   ATMOSPHERE — grain, aurora, hairlines
   ========================================================================== */

/* Filmic grain over the whole page. Pure CSS, no image request. */
body::after {
  content: '';
  position: fixed; inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme='dark'] body::after { opacity: .22; }

/* Soft drifting colour fields. Sit behind everything in a section. */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora::before, .aurora::after {
  content: '';
  position: absolute;
  width: 58vw; height: 58vw;
  min-width: 22rem; min-height: 22rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.aurora::before {
  top: -22%; left: -14%;
  background: radial-gradient(circle at 35% 35%, var(--aurora-1), transparent 68%);
  animation: drift-a 26s var(--e-inout) infinite alternate;
}
.aurora::after {
  bottom: -26%; right: -12%;
  background: radial-gradient(circle at 60% 60%, var(--aurora-2), transparent 68%);
  animation: drift-b 32s var(--e-inout) infinite alternate;
}
.aurora.has-third .aurora-3 {
  position: absolute; top: 30%; right: 22%;
  width: 34vw; height: 34vw; min-width: 16rem; min-height: 16rem;
  border-radius: 50%; filter: blur(100px); opacity: .38;
  background: radial-gradient(circle, var(--aurora-3), transparent 70%);
  animation: drift-c 38s var(--e-inout) infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(14%, 18%, 0) scale(1.18); } }
@keyframes drift-b { to { transform: translate3d(-16%, -12%, 0) scale(1.12); } }
@keyframes drift-c { to { transform: translate3d(-22%, 16%, 0) scale(.86); } }

.section > .wrap, .section > .wrap-wide, .section > .wrap-text { position: relative; z-index: 1; }

/* Hairline rule that fades at both ends — used between sections */
.edge-top    { border-top: 1px solid var(--line); }
.edge-bottom { border-bottom: 1px solid var(--line); }

.bg-alt   { background: var(--bg-alt); }
.bg-deep  { background: var(--bg-deep); }
.bg-sunk  { background: var(--surface-sunk); }

/* ==========================================================================
   SCROLL REVEAL
   Elements marked [data-reveal] start hidden and are released by
   IntersectionObserver adding .is-in. Everything degrades to visible
   if JS never runs (see the <noscript> rule at the end).
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--reveal-y, 18px), 0);
  transition:
    opacity var(--t-reveal) var(--e-out) var(--reveal-delay, 0ms),
    transform var(--t-reveal) var(--e-out) var(--reveal-delay, 0ms),
    filter var(--t-reveal) var(--e-out) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal='blur']  { filter: blur(10px); }
[data-reveal='left']  { transform: translate3d(-28px, 0, 0); }
[data-reveal='right'] { transform: translate3d(28px, 0, 0); }
[data-reveal='scale'] { transform: scale(.94); }

/* On a narrow screen a sideways start position pokes past the viewport and
   creates a horizontal scrollbar until the element reveals. Come up instead. */
@media (max-width: 48rem) {
  [data-reveal='left'], [data-reveal='right'] { transform: translate3d(0, 18px, 0); }
}
[data-reveal='mask']  { opacity: 1; clip-path: inset(0 0 100% 0); transform: none; }

[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

/* Word-by-word headline reveal, built by app.js */
.split-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.split-word {
  display: inline-block;
  transform: translate3d(0, 110%, 0) rotate(2.5deg);
  opacity: 0;
  transition: transform 900ms var(--e-out), opacity 700ms var(--e-soft);
  transition-delay: var(--d, 0ms);
}
.is-in .split-word, .split-ready .split-word { transform: none; opacity: 1; }

/* ==========================================================================
   REDUCED MOTION — honoured everywhere, not just here
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
  .split-word { opacity: 1 !important; transform: none !important; }
  .aurora::before, .aurora::after, .aurora .aurora-3 { animation: none !important; }
  .ken-burns { animation: none !important; }
}

/* No JavaScript at all — show everything rather than a blank page. */
.no-js [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
.no-js .split-word { opacity: 1 !important; transform: none !important; }
