/* ==========================================================================
   BASE — reset, elements, typography primitives, layout helpers
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* `clip` rather than `hidden`: it prevents off-canvas panels from creating a
     scrollbar without turning the root into a scroll container, which would
     break position:sticky further down the tree. */
  overflow-x: clip;
  /* Anchor targets clear the sticky header. */
  scroll-padding-top: calc(var(--nav-h) + var(--s-6));
}

body {
  margin: 0;
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* clip, not hidden: `hidden` makes the body a scroll container and silently
     breaks every position:sticky on the page (same reasoning as html above). */
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

img, video, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

/* Running text never ends a paragraph on a lone word. */
p, li, figcaption, blockquote { text-wrap: pretty; }

/* Touch: no grey flash and no 300ms double-tap wait on anything tappable;
   every control already has its own :active and :focus-visible state. */
a, button, [role='button'], label, summary, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button { background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--c-ink); color: var(--c-bg); }

/* --- Focus ---------------------------------------------------------------
   Visible, high-contrast, and never removed. Uses :focus-visible so mouse
   users don't see rings, keyboard users always do. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.on-dark :focus-visible,
.is-dark :focus-visible { outline-color: var(--c-text-invert); }

.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -140%);
  z-index: 200;
  background: var(--c-ink);
  color: var(--c-text-invert);
  padding: var(--s-3) var(--s-5);
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  transition: transform var(--d-fast) var(--e-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   TYPOGRAPHY PRIMITIVES
   ========================================================================== */

.display-xl, .display-l, .display-m, .display-s {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: var(--ls-display);
  line-height: var(--lh-display);
  text-wrap: balance;
}
.display-xl { font-size: var(--t-display-xl); }
.display-l  { font-size: var(--t-display-l); }
.display-m  { font-size: var(--t-display-m); line-height: var(--lh-heading); }
.display-s  { font-size: var(--t-display-s); line-height: var(--lh-heading); }

/* Italic serif for the quiet emphasis inside a heading. */
.em { font-style: italic; font-weight: 300; }

/* The uppercase micro-label. Used everywhere; never larger than 12px. */
.label {
  display: block;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-text-muted);
  line-height: 1.4;
}
.label--accent { color: var(--c-accent); }
.label--wide { letter-spacing: var(--ls-label-wide); }
.label--rule {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.label--rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* Numeric index: "01 /". A visual mark that isn't an icon. */
.index {
  font-family: var(--font-display);
  font-size: var(--t-body-s);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.08em;
  color: var(--c-accent);
}

.lede {
  font-size: var(--t-body-l);
  line-height: 1.68;
  color: var(--c-text-muted);
  max-width: var(--w-text);
}
.prose p { max-width: var(--w-text); color: var(--c-text-muted); }
.prose p + p { margin-top: var(--s-5); }

.text-muted { color: var(--c-text-muted); }
.text-faint { color: var(--c-text-faint); }
/* Lining as well as tabular: Cormorant's default old-style figures read as
   letters at small sizes ("01" becomes "oɪ"), and every numeral on this site
   is information rather than ornament. */
.tnum { font-variant-numeric: lining-nums tabular-nums; }

/* The display face is used for prices, times and indices throughout, so it
   gets lining figures globally rather than per-component. */
.display-xl, .display-l, .display-m, .display-s,
.phase__time, .index, .stat__value, .summary__nights,
.kpi__value, .travel__time, .around__travel b,
.stay-panel__index, .stay-panel__price, .day-aside__length,
.confirm__ref, .calendar__caption, .steps__num {
  font-variant-numeric: lining-nums tabular-nums;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--s-gutter);
}
.shell--narrow { max-width: var(--w-narrow); }

.section { padding-block: var(--s-section); }
.section--tight { padding-block: clamp(3.5rem, 7vw, 7rem); }
.section--dark {
  background: var(--c-surface-dark);
  color: var(--c-text-invert);
}
.section--dark .index,
.section--dark .label,
.section--dark .lede,
.section--dark .prose p { color: var(--c-text-invert-muted); }
.section--sunk { background: var(--c-surface-sunk); }

.rule { height: 1px; background: var(--c-border); border: 0; margin: 0; }
.section--dark .rule { background: var(--c-border-invert); }

/* Editorial two-column head: label left, heading + copy right. */
.head {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  gap: var(--s-6) var(--s-8);
  align-items: start;
}
.head__body > * + * { margin-top: var(--s-5); }
@media (max-width: 860px) {
  .head { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* ==========================================================================
   MEDIA
   ========================================================================== */

.media {
  position: relative;
  overflow: hidden;
  background: var(--c-sand);
  border-radius: var(--radius-media);
}
.media > img,
.media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--3x4  { aspect-ratio: 3 / 4; }
.media--4x5  { aspect-ratio: 4 / 5; }
.media--1x1  { aspect-ratio: 1 / 1; }
.media--4x3  { aspect-ratio: 4 / 3; }
.media--3x2  { aspect-ratio: 3 / 2; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--21x9 { aspect-ratio: 21 / 9; }

/* A slow, small scale on hover. 1.04 is the ceiling — anything more is showy. */
.media--zoom > img { transition: transform var(--d-image) var(--e-out); }
a:hover .media--zoom > img,
.media-link:hover .media--zoom > img { transform: scale(1.04); }

.caption {
  margin-top: var(--s-4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
}

/* ==========================================================================
   MOTION — scroll reveal
   One mechanism for the whole site: elements start slightly low and clear,
   then settle. Fully disabled under reduced-motion.
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--d-slow) var(--e-out),
    transform var(--d-slow) var(--e-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Line-by-line heading reveal. */
.reveal-lines .line { display: block; overflow: hidden; }
.reveal-lines .line > span {
  display: block;
  transform: translateY(100%);
  transition: transform var(--d-slow) var(--e-out);
  transition-delay: var(--line-delay, 0ms);
}
.reveal-lines.is-in .line > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .reveal-lines .line > span { transform: none; }
}

/* ==========================================================================
   PAGE TRANSITION
   A short neutral wash on navigation. Never blocks longer than ~320ms.
   ========================================================================== */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--c-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--e-out);
}
.page-veil.is-out { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .page-veil { display: none; } }
