/* ============================================================================
   Design tokens — 3-Point Fluid Model (SCALING.md v3.3)

   Baseline frame for this project is 1440px: every token below renders its
   exact design value at 1440px, interpolates linearly up to 2560px (2K), and
   locks to the 1440px value below that.

     min  = design_px / 16          rem   (value at 1440px, the design floor)
     vw   = design_px / 14.4        vw    (linear term through the origin)
     max  = design_px * 1.7778 / 16 rem  = design_px / 9 rem (value at 2560px)

   The trailing comment on each token records the design_px it was derived from.
   Unscaled by rule: 1px hairlines, box-shadow, 999px pill radii, unitless
   line-heights, and em-based letter-spacing.
   ========================================================================= */

:root {
  --font-serif: "Lora", Georgia, serif;
  --font-sans: "Switzer", ui-sans-serif, system-ui, sans-serif;
  --font-ui: "Inter", ui-sans-serif, system-ui, sans-serif;
  /* Brand palette (brand asset sheet): teal #265b63, sage #8c957e, sand #bdba9b,
     cream #fffdf1. Each brand hex is pinned at the step whose OKLCH lightness it
     matches; the other steps keep its hue and taper its chroma toward the ends.
     Neutral is a near-grey on the sand hue for text, lines and dark bands.
     Text on light surfaces: step 600 and up only (>= 4.9:1 on cream). */
  --teal-50: #edf9fb;
  --teal-100: #def1f4;
  --teal-200: #c3e1e6;
  --teal-300: #a1cdd4;
  --teal-400: #7eb2ba;
  --teal-500: #5f97a0;
  --teal-600: #417981;
  --teal-700: #265b63; /* brand: logo */
  --teal-800: #1b4a51;
  --teal-900: #10363c;
  --teal-950: #032126;

  --sage-50: #f5f8f2;
  --sage-100: #ebeee6;
  --sage-200: #d8ddd0;
  --sage-300: #c0c7b5;
  --sage-400: #a3ac96;
  --sage-500: #8c957e; /* brand: "Hill Penida" wordmark */
  --sage-600: #6a725c;
  --sage-700: #515945;
  --sage-800: #3f4534;
  --sage-900: #2d3325;
  --sage-950: #1b1f14;

  --sand-50: #fffdf1; /* brand: cream */
  --sand-100: #f5f3e5;
  --sand-200: #e3e1ca;
  --sand-300: #bdba9b; /* brand */
  --sand-400: #adaa85;
  --sand-500: #928e67;
  --sand-600: #74704b;
  --sand-700: #5a5734;
  --sand-800: #474326;
  --sand-900: #343119;
  --sand-950: #201e0a;

  --neutral-50: #f8f7f2;
  --neutral-100: #eeede7;
  --neutral-200: #dcdbd4;
  --neutral-300: #c5c4bd;
  --neutral-400: #a9a8a2;
  --neutral-500: #8d8c87;
  --neutral-600: #706f6a;
  --neutral-700: #565551;
  --neutral-800: #43423f;
  --neutral-900: #2d2d2a;
  --neutral-950: #1d1d1a;

  /* Semantic roles. Components use these, never the steps above.
     Every color-mix() of a role sits under an rgb() line holding the same
     color as plain channels, for browsers without color-mix() (Safari < 16.2,
     Chrome < 111). Changing a role's hex means updating those lines too. */
  --color-bg: var(--sand-50);
  --color-surface: var(--sand-100);
  --color-ink: var(--neutral-900);
  --color-muted: var(--neutral-700);
  --color-soft: var(--neutral-600); /* 4.5:1 on --color-surface, 4.9:1 on --color-bg */
  --color-accent: var(--teal-700); /* primary button, active chip */
  --color-accent-dark: var(--teal-800);
  --color-brand: var(--teal-700); /* footer surface */
  --color-highlight: var(--sand-400); /* rules, stars, icons, kicker on dark */
  --color-sand-button: var(--sand-300); /* main action on photo/dark; ink label 7:1 */
  --color-sand-button-hover: var(--sand-400); /* ink label 5.8:1 */
  --color-line: var(--sand-200);
  --color-error: #e11d48;
  --color-success: #2f7a4f;
  --color-whatsapp: #25d366;

  /* ---- Spacing ---- */
  --space-1: clamp(0.1875rem, 0.2083vw, 0.3333rem);   /* 3px */
  --space-2: clamp(0.375rem, 0.4167vw, 0.6667rem);    /* 6px */
  --space-3: clamp(0.5625rem, 0.625vw, 1rem);         /* 9px */
  --space-4: clamp(0.75rem, 0.8333vw, 1.3333rem);     /* 12px */
  --space-5: clamp(0.9375rem, 1.0417vw, 1.6667rem);   /* 15px */
  --space-6: clamp(1.125rem, 1.25vw, 2rem);           /* 18px */
  --space-8: clamp(1.5rem, 1.6667vw, 2.6667rem);      /* 24px */
  --space-10: clamp(1.875rem, 2.0833vw, 3.3333rem);   /* 30px */
  --space-12: clamp(2.25rem, 2.5vw, 4rem);            /* 36px */
  --space-16: clamp(3rem, 3.3333vw, 5.3333rem);       /* 48px */
  --space-20: clamp(3.75rem, 4.1667vw, 6.6667rem);    /* 60px */
  --space-24: clamp(5.625rem, 6.25vw, 10rem);         /* 90px */

  /* ---- Radii (pill/circle stay symbolic, see base rules) ---- */
  --radius-sm: clamp(0.46875rem, 0.5208vw, 0.8333rem); /* 7.5px */
  --radius-md: clamp(0.75rem, 0.8333vw, 1.3333rem);    /* 12px */
  --radius-lg: clamp(1.125rem, 1.25vw, 2rem);          /* 18px */

  /* ---- Layout ---- */
  --layout-max: 160rem;                                       /* 2560px ultrawide cap */
  --layout-content-max: clamp(75rem, 83.3333vw, 133.3333rem); /* 1200px */
  /* Content shell must widen with the frame, otherwise 2K displays get a
     1200px column stranded in ~680px of dead space on either side. */
  --content-width: clamp(75rem, 83.3333vw, 133.3333rem);      /* 1200px */
  /* Single horizontal gutter token so every full-width section aligns.
     Overridden per breakpoint below. */
  --gutter: var(--space-8);

  /* ---- Motion ----
     Shared curves so every transition on the site retargets the same way.
     UI durations (hover colour, menus, buttons) stay inline per rule; the
     page-level motion every page shares is set once here (design.md 3.8). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-reveal: 900ms;   /* scroll reveal: fade + 24px rise */
  --stagger: 80ms;       /* between items revealed in the same batch */
  --dur-zoom: 500ms;     /* photo hover zoom, in and out */
  --zoom-scale: 1.04;
  --dur-page: 300ms;     /* cross-page fade (view transition) */
  --parallax-shift: 8%;  /* scroll drift of editorial photos, each way */

  /* ---- Type scale ----
     Design px at 1440 -> same 3-point formula. Sub-1440 sizes are restored by
     the <=1439px block below so phones/tablets keep their tuned scale. */
  --text-caption: clamp(0.75rem, 0.8333vw, 1.3333rem);     /* 12px */
  --text-label: clamp(0.8125rem, 0.9028vw, 1.4444rem);     /* 13px */
  --text-body-sm: clamp(0.9375rem, 1.0417vw, 1.6667rem);   /* 15px */
  --text-body: clamp(1rem, 1.1111vw, 1.7778rem);           /* 16px */
  --text-body-lg: clamp(1.1875rem, 1.3194vw, 2.1111rem);   /* 19px */
  --text-h4: clamp(1.5rem, 1.6667vw, 2.6667rem);           /* 24px */
  --text-h3: clamp(2.25rem, 2.5vw, 4rem);                  /* 36px */
  --text-h2: clamp(3.25rem, 3.6111vw, 5.7778rem);          /* 52px */
  --text-h1: clamp(5.5rem, 6.1111vw, 9.7778rem);           /* 88px */

  --line-tight: 1.15;
  --line-snug: 1.4;
  --line-body: 1.6;
  --line-loose: 1.8;

  --tracking-caps: 0.06em;

  /* ---- Icons ---- */
  --icon-sm: clamp(0.875rem, 0.9722vw, 1.5556rem);  /* 14px */
  --icon-md: clamp(1.125rem, 1.25vw, 2rem);         /* 18px */
  --icon-lg: clamp(1.25rem, 1.3889vw, 2.2222rem);   /* 20px */

  /* ---- Controls ----
     Floors stay at the 44px / 40px hit-target minimum and grow from there. */
  --control-min: clamp(2.75rem, 3.0556vw, 4.8889rem);   /* 44px */
  --control-min-sm: clamp(2.5rem, 2.7778vw, 4.4444rem); /* 40px */
  --rule-thick: clamp(0.125rem, 0.1389vw, 0.2222rem);   /* 2px */
  --dot-sm: clamp(0.375rem, 0.4167vw, 0.6667rem);       /* 6px */
  --emblem-size: clamp(3rem, 3.3333vw, 5.3333rem);      /* 48px */

  /* ---- Measures (prose and panel caps) ---- */
  --measure-sm: clamp(36rem, 40vw, 64rem);              /* 576px */
  --measure-md: clamp(40rem, 44.4444vw, 71.1111rem);    /* 640px */
  --measure-lg: clamp(64rem, 71.1111vw, 113.7778rem);   /* 1024px */

  /* ---- Media block heights ---- */
  --media-h-sm: clamp(13.125rem, 14.5833vw, 23.3333rem); /* 210px  amenity card */
  --media-h-md: clamp(21.875rem, 24.3056vw, 38.8889rem); /* 350px  chapter, phone */
  --media-h-lg: clamp(31.25rem, 34.7222vw, 55.5556rem);  /* 500px  chapter, map */
  --frame-h-room: clamp(25rem, 27.7778vw, 44.4444rem);   /* 400px  room gallery */

  /* ---- Map POI markers ---- */
  --poi-size: clamp(1.875rem, 2.0833vw, 3.3333rem);      /* 30px */
  --poi-size-lg: clamp(2.25rem, 2.5vw, 4rem);            /* 36px */
  --poi-icon: clamp(1rem, 1.1111vw, 1.7778rem);          /* 16px */
  --poi-label-max: clamp(8.25rem, 9.1667vw, 14.6667rem); /* 132px */
  --poi-label-max-lg: clamp(8.125rem, 9.0278vw, 14.4444rem); /* 130px */
  --poi-label-gap: clamp(0.375rem, 0.4167vw, 0.6667rem); /* 6px */

  --color-card: #fff;
  --color-inverse: #fff;
  --color-focus: var(--color-ink);

  /* Highlight dark enough for text on light surfaces (>= 7:1 on --color-bg and #fff).
     --color-highlight stays for rules, icons, and text on dark. */
  --color-highlight-text: var(--sand-700);
}

/* Below the 1440px baseline the clamps above lock to their design floor, which
   is correct for spacing but too heavy for display type on narrow viewports.
   Restore the tuned sub-baseline type ramp (SCALING.md section 8). */
@media (max-width: 1439px) {
  :root {
    --text-body-lg: clamp(1rem, 0.9rem + 0.5vw, 1.1875rem);
    --text-h4: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
    --text-h3: clamp(1.375rem, 1.15rem + 1.1vw, 2.25rem);
    --text-h2: clamp(1.875rem, 1.5rem + 1.9vw, 3.25rem);
    --text-h1: clamp(2.5rem, 1.6rem + 4.5vw, 5.5rem);
  }
}

@media (max-width: 1024px) {
  :root {
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
  }
}

/* Phone: tighter gutter and shorter section rhythm so sections do not
   read as mostly empty space on a 375-430px viewport. */
@media (max-width: 767px) {
  :root {
    --gutter: 1.5rem;
    --space-16: 3rem;
    --space-20: 3.5rem;
    --space-24: 4.5rem;
    /* Media blocks drop to their phone heights; the desktop tokens above are
       floors, not phone values. */
    --media-h-sm: 11.25rem;  /* 180px */
    --media-h-md: 21.875rem; /* 350px */
    --media-h-lg: 23.75rem;  /* 380px */
  }
}

@media (max-width: 479px) {
  :root {
    --gutter: 1.25rem;
    --space-24: 4rem;
  }
}
