/* ==========================================================================
   Haven Stays & Hospitality — 01. BASE
   Design tokens, reset, typography, layout primitives, utilities.
   Palette: ivory + sand grounds, deep navy structure, gold accent.
   ========================================================================== */

/* ------------------------------------------------------------ 1. Tokens -- */
:root {
    /* Brand */
    --navy-900: #071B33;
    --navy-800: #0B2545;
    --navy-700: #123A63;
    --navy-600: #1C4E80;
    --navy-500: #2C6BA8;

    --gold-700: #8C6A28;
    --gold-600: #A8823B;
    --gold-500: #C8A45C;
    --gold-400: #DCC086;
    --gold-300: #EBDCB8;
    --gold-100: #F7F0DE;

    /* Neutrals — light theme grounds */
    --white:    #FFFFFF;
    --ivory:    #FDFBF7;
    --sand-100: #F8F4EC;
    --sand-200: #F1EADD;
    --sand-300: #E7DDCB;
    --line:     #E8E0D2;
    --line-2:   #F0EAE0;

    /* Text */
    --ink:      #13202F;
    --ink-soft: #3A4A5C;
    --body:     #58687A;
    --muted:    #8494A4;

    /* Status */
    --green:    #1F8A5F;
    --amber:    #C68A17;
    --red:      #C0392B;

    /* Type */
    --f-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --f-logo:    'Cinzel', Georgia, serif;
    --f-body:    'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Fluid type scale */
    --t-h1: clamp(2.25rem, 1.35rem + 3.6vw, 4.25rem);
    --t-h2: clamp(1.85rem, 1.25rem + 2.2vw, 3rem);
    --t-h3: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
    --t-h4: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
    --t-h5: clamp(1.02rem, 0.96rem + 0.28vw, 1.15rem);
    --t-lead: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
    --t-body: 1rem;
    --t-sm: 0.9375rem;
    --t-xs: 0.8125rem;

    /* Space */
    --gap: clamp(1rem, 0.6rem + 1.4vw, 1.75rem);
    --sec-y: clamp(3.75rem, 2.2rem + 6vw, 7.5rem);
    --sec-y-sm: clamp(2.75rem, 1.8rem + 4vw, 5rem);
    --container: 1240px;
    --container-pad: clamp(1.15rem, 0.8rem + 1.4vw, 2.25rem);

    /* Shape */
    --r-xs: 6px;
    --r-sm: 10px;
    --r: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-pill: 999px;

    /* Elevation — warm-tinted, never grey */
    --sh-xs: 0 1px 2px rgba(11, 37, 69, .05);
    --sh-sm: 0 4px 14px rgba(11, 37, 69, .06);
    --sh: 0 10px 30px rgba(11, 37, 69, .08);
    --sh-lg: 0 20px 50px rgba(11, 37, 69, .11);
    --sh-gold: 0 12px 30px rgba(168, 130, 59, .22);

    /* Motion */
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --t-fast: .2s;
    --t-mid: .35s;
    --t-slow: .6s;

    --header-h: 84px;
}

/* ------------------------------------------------------------- 2. Reset -- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    font-family: var(--f-body);
    font-size: var(--t-body);
    font-weight: 400;
    line-height: 1.75;
    color: var(--body);
    background: var(--ivory);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

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

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

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

a { color: var(--navy-700); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--gold-600); }

ul, ol { list-style: none; }

table { border-collapse: collapse; width: 100%; }

:focus-visible {
    outline: 2px solid var(--gold-600);
    outline-offset: 3px;
    border-radius: 3px;
}

::selection { background: var(--gold-300); color: var(--navy-900); }

/* -------------------------------------------------------- 3. Typography -- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-display);
    font-weight: 600;
    line-height: 1.18;
    color: var(--navy-800);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--t-h1); line-height: 1.08; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }
h5 { font-size: var(--t-h5); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; color: var(--ink-soft); }

.lead {
    font-size: var(--t-lead);
    line-height: 1.8;
    color: var(--body);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: var(--f-body);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-600);
    margin-bottom: 1rem;
}
.eyebrow::before {
    content: "";
    width: 30px;
    height: 1px;
    background: var(--gold-500);
}
.eyebrow.is-centered::after {
    content: "";
    width: 30px;
    height: 1px;
    background: var(--gold-500);
}
.eyebrow.on-dark { color: var(--gold-400); }
.eyebrow.on-dark::before, .eyebrow.on-dark::after { background: var(--gold-400); }

.script {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 400;
    color: var(--gold-600);
}

/* Gold-underlined emphasis inside headings */
.hl { position: relative; white-space: nowrap; color: var(--gold-600); }

/* --------------------------------------------------------- 4. Structure -- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}
.container-wide { max-width: 1440px; }
.container-narrow { max-width: 860px; }

.section { padding-block: var(--sec-y); position: relative; }
.section-sm { padding-block: var(--sec-y-sm); }
.section-top-0 { padding-top: 0; }
.section-bottom-0 { padding-bottom: 0; }

.bg-ivory { background: var(--ivory); }
.bg-white { background: var(--white); }
.bg-sand { background: var(--sand-100); }
.bg-sand-2 { background: var(--sand-200); }
.bg-navy { background: var(--navy-800); }

.section-head {
    max-width: 720px;
    margin-bottom: clamp(2.25rem, 1.4rem + 2.4vw, 3.75rem);
}
.section-head.is-centered { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: 1rem; }
.section-head .lead { max-width: 62ch; }
.section-head.is-centered .lead { margin-inline: auto; }

/* Head with an action button on the right */
.section-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: clamp(2.25rem, 1.4rem + 2.4vw, 3.5rem);
}
.section-head-row .section-head { margin-bottom: 0; flex: 1 1 420px; }

/* ------------------------------------------------------------- 5. Grid --- */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-auto-260 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-auto-300 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g-auto-340 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.flex { display: flex; }
.f-wrap { flex-wrap: wrap; }
.f-center { align-items: center; }
.f-between { justify-content: space-between; }
.f-gap { gap: var(--gap); }
.f-gap-sm { gap: .75rem; }

/* ------------------------------------------------------- 6. Utilities ---- */
.tc { text-align: center; }
.tr { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.w-100 { width: 100%; }

.text-gold { color: var(--gold-600); }
.text-navy { color: var(--navy-800); }
.text-white { color: #fff; }
.text-muted { color: var(--muted); }

.on-dark, .on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4, .on-dark h5 { color: #fff; }
.on-dark p, .on-dark .lead { color: rgba(255, 255, 255, .8); }

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

.skip-link {
    position: absolute;
    top: -60px; left: 1rem;
    z-index: 2000;
    background: var(--navy-800);
    color: #fff;
    padding: .7rem 1.25rem;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* Decorative separators */
.rule-gold {
    width: 64px; height: 2px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    border-radius: 2px;
}
.rule-gold.is-centered { margin-inline: auto; }

/* ------------------------------------------------- 7. Scroll reveal ------ */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
    will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="zoom"]  { transform: scale(.94); }
[data-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* Horizontal entrances would stick out past a narrow viewport, so below the
   tablet breakpoint every reveal enters vertically instead. */
@media (max-width: 900px) {
    [data-reveal="left"],
    [data-reveal="right"] { transform: translateY(28px); }
}

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

/* ------------------------------------------------------ 8. Preloader ----- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: grid;
    place-items: center;
    background: var(--ivory);
    transition: opacity .5s var(--ease), visibility .5s var(--ease);
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__mark {
    font-family: var(--f-logo);
    font-size: clamp(1.1rem, .9rem + 1vw, 1.6rem);
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--navy-800);
    text-align: center;
}
.preloader__bar {
    width: 180px;
    height: 2px;
    margin: 1.25rem auto 0;
    background: var(--sand-300);
    overflow: hidden;
    border-radius: 2px;
}
.preloader__bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--gold-500);
    animation: loadSlide 1.1s var(--ease) infinite;
}
@keyframes loadSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* --------------------------------------------------------- 9. Printing --- */
@media print {
    .site-header, .site-footer, .floaters, .preloader, .hero { display: none !important; }
    body { background: #fff; color: #000; }
}
