/*
 * Riarano · design tokens (single source for colours, type, space, motion).
 * Reference: docs/DESIGN.md. Components use the semantic aliases (second block), never the primitives.
 * Two tiers only: primitives (ramps) -> semantic aliases. The ".theme-night" class flips the aliases.
 */

/* ---------- Fonts (self-hosted, latin subset, WOFF2) ---------- */
@font-face {
  font-family: "Riarano Display"; /* renamed latin subset of Marcellus (Astigmatic, OFL 1.1, RFN clause) */
  src: url("../fonts/riarano-display-latin.4786c51d6a02.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Albert Sans";
  src: url("../fonts/albert-sans-latin-var.fa37c471f81d.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Albert Sans";
  src: url("../fonts/albert-sans-italic-latin-var.6f263e0ccc95.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched fallbacks: keep line breaks stable while the web fonts load on slow connections (CLS). */
@font-face {
  font-family: "Riarano Display Fallback";
  src: local("Times New Roman"), local("Liberation Serif"), local("Noto Serif"), local("Georgia");
  size-adjust: 113.83%;
  ascent-override: 85.57%;
  descent-override: 24.58%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Albert Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans"), local("Roboto");
  size-adjust: 103.65%;
  ascent-override: 91.66%;
  descent-override: 24.12%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;

  /* ---------- Primitives: colour ramps (sRGB hex of the OKLCH values noted) ---------- */
  /* River: one neutral ramp, hue 195 (river water, slate, mist). Light end = "brume", dark end = "encre". */
  --river-50: #F4F8F8;   /* oklch(0.976 0.004 195) */
  --river-100: #EAF0F0;  /* oklch(0.951 0.006 195) */
  --river-200: #D9E2E1;  /* oklch(0.905 0.009 195) */
  --river-300: #C2CDCD;  /* oklch(0.840 0.012 195) */
  --river-400: #9EADAC;  /* oklch(0.735 0.016 195) */
  --river-500: #788888;  /* oklch(0.615 0.019 195) */
  --river-600: #576968;  /* oklch(0.505 0.021 195) */
  --river-700: #3A4D4D;  /* oklch(0.405 0.024 195) */
  --river-800: #223636;  /* oklch(0.315 0.026 195) */
  --river-900: #0E2323;  /* oklch(0.240 0.027 195) */
  --river-950: #051616;  /* oklch(0.185 0.024 195) */
  /* Laterite: the single accent (Madagascar red earth, the brick of Ampefy). */
  --laterite-50: #FEF1EE;
  --laterite-100: #FDE3DB;
  --laterite-200: #F9CABB;
  --laterite-300: #EEA791;
  --laterite-400: #DD7E61;
  --laterite-500: #C75C3A;
  --laterite-600: #AD4828;  /* oklch(0.530 0.140 38) */
  --laterite-700: #913A1E;
  --laterite-800: #702E19;
  /* Status (always paired with an icon + text, never colour alone). */
  --success-700: #296A3B;
  --success-50: #EBF6ED;
  --warning-700: #895709;
  --warning-50: #FAF1E7;
  --danger-700: #B1262D;
  --danger-50: #FFECE9;
  --info-700: #1F6284;
  --info-50: #EAF4FA;
  --white: #FFFFFF;

  /* ---------- Semantic aliases: "jour" (default light theme) ---------- */
  /* Contrast (WCAG 2.2): foreground/background 15.3:1, muted-foreground 5.4:1, primary-foreground on primary 5.6:1,
     input border 3.5:1 (non-text 3:1), ring 5.3:1. */
  --background: var(--river-50);
  --foreground: var(--river-900);
  --card: var(--white);
  --card-foreground: var(--river-900);
  --popover: var(--white);
  --popover-foreground: var(--river-900);
  --muted: var(--river-100);                /* alternate section / subtle fill */
  --muted-foreground: var(--river-600);     /* captions, meta, helper text */
  --secondary: var(--river-100);
  --secondary-foreground: var(--river-800);
  --primary: var(--laterite-600);           /* the one accent: main CTA, links on hover, active states */
  --primary-hover: var(--laterite-700);
  --primary-foreground: var(--white);
  --accent: var(--laterite-50);             /* subtle accent tint (selected chip, badge bg) */
  --accent-foreground: var(--laterite-700);
  --link: var(--river-900);
  --link-hover: var(--laterite-700);
  --border: var(--river-200);               /* hairlines, card borders */
  --border-strong: var(--river-300);
  --input: var(--river-500);                /* form control borders: >= 3:1 against background */
  --input-background: var(--white);
  --ring: var(--laterite-600);              /* focus ring */
  --destructive: var(--danger-700);
  --destructive-background: var(--danger-50);
  --success: var(--success-700);
  --success-background: var(--success-50);
  --warning: var(--warning-700);
  --warning-background: var(--warning-50);
  --info: var(--info-700);
  --info-background: var(--info-50);
  --outline-image: rgb(14 35 35 / 0.08);    /* 1px inset outline separating photos from the background */
  --pattern-color: rgb(14 35 35 / 0.07);    /* water-lines motif on light surfaces */
  --scrim-top: linear-gradient(180deg, rgb(5 22 22 / 0.55) 0%, rgb(5 22 22 / 0) 100%);
  --scrim-bottom: linear-gradient(0deg, rgb(5 22 22 / 0.72) 0%, rgb(5 22 22 / 0.35) 45%, rgb(5 22 22 / 0) 100%);
  --scrim-side: linear-gradient(90deg, rgb(5 22 22 / 0.5) 0%, rgb(5 22 22 / 0.22) 42%, rgb(5 22 22 / 0) 68%);
  --on-image: var(--white);                 /* text/logo over photos, always with a scrim */

  /* ---------- Typography ---------- */
  --font-display: "Riarano Display", "Riarano Display Fallback", "Times New Roman", serif;
  --font-sans: "Albert Sans", "Albert Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Fluid scale, 360px -> 1440px viewport (ratio ~1.25). Body never below 16px. */
  --text-xs: 0.8125rem;                                          /* 13px: credits, legal */
  --text-sm: 0.875rem;                                           /* 14px: meta, labels, helper */
  --text-base: clamp(1rem, 0.979rem + 0.093vw, 1.0625rem);       /* 16 -> 17px: body */
  --text-lg: clamp(1.125rem, 1.083rem + 0.185vw, 1.25rem);       /* 18 -> 20px: lead, card titles */
  --text-xl: clamp(1.25rem, 1.167rem + 0.37vw, 1.5rem);          /* 20 -> 24px: h4 */
  --text-2xl: clamp(1.5rem, 1.333rem + 0.741vw, 2rem);           /* 24 -> 32px: h3 */
  --text-3xl: clamp(1.875rem, 1.583rem + 1.296vw, 2.75rem);      /* 30 -> 44px: h2 */
  --text-4xl: clamp(2.25rem, 1.75rem + 2.222vw, 3.75rem);        /* 36 -> 60px: page title */
  --text-display: clamp(2.5rem, 1.75rem + 3.333vw, 4.75rem);     /* 40 -> 76px: home hero only */
  --leading-display: 1.06;
  --leading-heading: 1.15;
  --leading-snug: 1.35;
  --leading-body: 1.62;
  --tracking-display: -0.01em;
  --tracking-normal: 0;
  --tracking-label: 0.08em;   /* small uppercase labels (rationed: see DESIGN.md) */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --measure: 65ch;

  /* ---------- Space (base 4) ---------- */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */
  --space-9: 6rem;     /* 96 */
  --space-10: 8rem;    /* 128 */
  --gutter: clamp(1rem, 0.5rem + 2.222vw, 2.5rem);          /* page side padding 16 -> 40 */
  --grid-gap: clamp(1rem, 0.667rem + 1.481vw, 2rem);        /* 16 -> 32 */
  --section-y: clamp(4rem, 2.667rem + 5.926vw, 8rem);       /* section padding 64 -> 128 */
  --stack-y: clamp(1.5rem, 1.167rem + 1.481vw, 2.5rem);     /* heading -> content 24 -> 40 */

  /* ---------- Layout ---------- */
  --container-sm: 40rem;     /* 640: forms, booking steps, prose */
  --container-md: 56rem;     /* 896: article body with images */
  --container-lg: 76rem;     /* 1216: default content width */
  --container-xl: 90rem;     /* 1440: full editorial grids */
  --header-h: clamp(4rem, 3.833rem + 0.741vw, 4.5rem);      /* 64 -> 72 */
  --tap-min: 2.75rem;        /* 44px minimum touch target */

  /* ---------- Shape ---------- */
  --radius-sm: 4px;          /* buttons, inputs, badges, small controls */
  --radius-md: 8px;          /* cards, photos, tiles */
  --radius-lg: 16px;         /* floating panels: booking bar, dialogs, payment panel */
  --radius-pill: 999px;      /* chips and segmented toggles only */
  --border-width: 1px;
  --focus-width: 2px;
  --focus-offset: 2px;

  /* ---------- Elevation (shadows tinted with river-900, never pure black) ---------- */
  --shadow-sm: 0 1px 2px rgb(14 35 35 / 0.06), 0 1px 1px rgb(14 35 35 / 0.04);
  --shadow-md: 0 6px 16px -6px rgb(14 35 35 / 0.14), 0 2px 4px -2px rgb(14 35 35 / 0.06);
  --shadow-lg: 0 28px 56px -20px rgb(14 35 35 / 0.32), 0 10px 20px -10px rgb(14 35 35 / 0.14);

  /* ---------- Motion ---------- */
  --duration-fast: 140ms;     /* hover, press */
  --duration-base: 240ms;     /* header state, menus, accordions */
  --duration-slow: 420ms;     /* panels, lightbox */
  --duration-reveal: 720ms;   /* scroll reveals (once) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* default: entering, reveals */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);   /* state toggles both ways */
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);        /* leaving */
  --reveal-distance: 16px;

  /* ---------- Layers ---------- */
  --z-base: 0;
  --z-raised: 1;
  --z-dropdown: 100;
  --z-sticky: 200;    /* site header, sticky booking summary */
  --z-overlay: 300;   /* mobile menu backdrop */
  --z-modal: 400;     /* mobile menu panel, lightbox, dialogs */
  --z-toast: 500;
  --z-skip: 600;      /* skip link */

  /* ---------- Brand motif: "lignes d'eau" (from the logo's wave). Use as a mask so colour comes from CSS:
     background-color: var(--pattern-color); mask: var(--pattern-waterlines) 0 0 / 160px 28px repeat; ---------- */
  --pattern-waterlines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='28' viewBox='0 0 160 28'%3E%3Cpath d='M0 14C26.7 4 53.3 4 80 14s53.3 10 80 0' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
  --pattern-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='12' viewBox='0 0 96 12'%3E%3Cpath d='M1 8C17 2 31 2 48 6s31 4 47-2' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- "Nuit" section theme: night by the pool. Flips aliases only. ---------- */
.theme-night {
  color-scheme: dark;
  --background: var(--river-900);
  --foreground: var(--river-50);
  --card: var(--river-800);
  --card-foreground: var(--river-50);
  --popover: var(--river-800);
  --popover-foreground: var(--river-50);
  --muted: var(--river-800);
  --muted-foreground: var(--river-300);     /* 10.1:1 on river-900 */
  --secondary: var(--river-800);
  --secondary-foreground: var(--river-100);
  --primary: var(--river-50);               /* on dark, the main CTA is a light button with ink text (17:1) */
  --primary-hover: var(--white);
  --primary-foreground: var(--river-900);
  --accent: rgb(221 126 97 / 0.14);
  --accent-foreground: var(--laterite-300);  /* 8.2:1 on river-900: small accents, icons, links on hover */
  --link: var(--river-50);
  --link-hover: var(--laterite-300);
  --border: rgb(244 248 248 / 0.14);
  --border-strong: rgb(244 248 248 / 0.28);
  --input: var(--river-400);
  --input-background: var(--river-950);
  --ring: var(--laterite-300);
  --outline-image: rgb(244 248 248 / 0.10);
  --pattern-color: rgb(244 248 248 / 0.06);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01ms;
    --duration-base: 0.01ms;
    --duration-slow: 0.01ms;
    --duration-reveal: 0.01ms;
    --reveal-distance: 0px;
  }
}
