/* ============================================================
   MIRAGE STAYS — base tokens & system
   Vanilla CSS. British English. Mobile-first.
   ============================================================ */

/* Self-hosted Manrope (variable, latin subset) — replaces Google Fonts CDN */
@font-face{
  font-family:"Manrope";
  font-style:normal;
  font-weight:200 800;
  font-display:swap;
  src:url("../fonts/manrope-variable.woff2") format("woff2");
}

:root{
  /* Brand palette (locked) */
  --sand:        #eae1dd;   /* primary background — warm sand */
  --brown:       #653f28;   /* light brown */
  --bark:        #39271e;   /* dark brown — deep text / dark sections */
  --olive:       #626b2e;   /* accent */

  /* Derived warm neutrals */
  --sand-deep:   #e0d5ce;   /* section alt / hairline fills */
  --card:        #f3eee9;   /* raised card on sand */
  --paper:       #f6f1ed;   /* lightest warm white */
  --olive-deep:  #515824;   /* hover */
  --bark-soft:   #4a342a;   /* raised card on bark */

  /* Ink (text) tokens — flip with theme */
  --ink:         var(--bark);
  --ink-soft:    color-mix(in oklch, var(--bark) 68%, var(--sand));
  --ink-faint:   color-mix(in oklch, var(--bark) 42%, var(--sand));
  --line:        color-mix(in oklch, var(--bark) 16%, transparent);
  --line-strong: color-mix(in oklch, var(--bark) 28%, transparent);
  --bg:          var(--sand);

  /* Type */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tracking-eyebrow: .2em;

  /* Rhythm */
  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1240px;
  --maxw-narrow: 920px;
  --section-y: clamp(4.5rem, 11vh, 9rem);
  --radius: 4px;     /* restrained, near-square */
  --radius-lg: 8px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* Dark theme context (for sections on --bark) */
.theme-dark{
  --ink:         var(--sand);
  --ink-soft:    color-mix(in oklch, var(--sand) 78%, var(--bark));
  --ink-faint:   color-mix(in oklch, var(--sand) 52%, var(--bark));
  --line:        color-mix(in oklch, var(--sand) 18%, transparent);
  --line-strong: color-mix(in oklch, var(--sand) 32%, transparent);
  --bg:          var(--bark);
  --card:        var(--bark-soft);
}

/* ---------- reset ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } }
body{
  margin:0;
  font-family:var(--font);
  font-weight:400;
  background:var(--sand);
  color:var(--ink);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
img,svg,video{ display:block; max-width:100%; }
button{ font:inherit; color:inherit; cursor:pointer; }
a{ color:inherit; text-decoration:none; }
:focus-visible{ outline:2.5px solid var(--olive); outline-offset:3px; border-radius:2px; }

/* ---------- layout ---------- */
.wrap{ width:100%; max-width:var(--maxw); margin-inline:auto; padding-inline:var(--gutter); }
.wrap--narrow{ max-width:var(--maxw-narrow); }
section{ position:relative; }
.section{ padding-block:var(--section-y); }
.theme-dark.section, section.theme-dark{ background:var(--bark); color:var(--sand); }
.bg-paper{ background:var(--paper); }

/* ---------- type ---------- */
h1,h2,h3,h4{ margin:0; font-weight:800; line-height:1.04; letter-spacing:-.02em; color:var(--ink); }
p{ margin:0; }
.eyebrow{
  display:inline-flex; align-items:center; gap:.7em;
  font-size:.76rem; font-weight:700; letter-spacing:var(--tracking-eyebrow);
  text-transform:uppercase; color:var(--olive);
}
.theme-dark .eyebrow{ color:color-mix(in oklch, var(--olive) 60%, var(--sand)); }
.eyebrow::before{ content:""; width:26px; height:1.5px; background:currentColor; opacity:.85; }

.display{ font-size:clamp(2.7rem, 6.6vw, 5.4rem); font-weight:800; letter-spacing:-.035em; line-height:.98; }
.h2{ font-size:clamp(2rem, 4.2vw, 3.4rem); font-weight:800; letter-spacing:-.03em; line-height:1.02; }
.h3{ font-size:clamp(1.3rem, 2vw, 1.7rem); font-weight:700; letter-spacing:-.02em; }
.lede{ font-size:clamp(1.08rem, 1.5vw, 1.32rem); line-height:1.6; color:var(--ink-soft); font-weight:400; }
.body{ font-size:1.075rem; line-height:1.78; color:var(--ink-soft); font-weight:400; }
.body.tight{ line-height:1.6; }
.muted{ color:var(--ink-faint); }
.balance{ text-wrap:balance; }
.pretty{ text-wrap:pretty; }

/* ---------- buttons ---------- */
.btn{
  --bbg:var(--olive); --bfg:var(--paper); --bbd:var(--olive);
  display:inline-flex; align-items:center; justify-content:center; gap:.65em;
  padding:1.02em 1.7em; font-size:.93rem; font-weight:700; letter-spacing:.01em;
  background:var(--bbg); color:var(--bfg); border:1.5px solid var(--bbd);
  border-radius:var(--radius); transition:background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
  text-align:center;
}
.btn:hover{ --bbg:var(--olive-deep); --bbd:var(--olive-deep); transform:translateY(-2px); }
.btn:active{ transform:translateY(0); }
.btn .ar{ width:1.05em; height:1.05em; transition:transform .35s var(--ease); }
.btn:hover .ar{ transform:translate(3px,-3px); }
.btn--ghost{ --bbg:transparent; --bfg:var(--ink); --bbd:var(--line-strong); }
.btn--ghost:hover{ --bbg:var(--ink); --bfg:var(--bg); --bbd:var(--ink); }
.btn--light{ --bbg:var(--sand); --bfg:var(--bark); --bbd:var(--sand); }
.btn--light:hover{ --bbg:var(--paper); --bbd:var(--paper); }
.btn--lg{ padding:1.15em 2.1em; font-size:1rem; }
.btn--block{ width:100%; }

.link-arrow{
  display:inline-flex; align-items:center; gap:.55em;
  font-weight:700; font-size:.95rem; color:var(--olive);
  border-bottom:1.5px solid transparent; padding-bottom:2px;
  transition:border-color .3s var(--ease), gap .3s var(--ease);
}
.theme-dark .link-arrow{ color:color-mix(in oklch, var(--olive) 55%, var(--sand)); }
.link-arrow.is-sand{ color:var(--sand); }
.link-arrow:hover{ border-color:currentColor; gap:.85em; }
.link-arrow .ar{ width:1em; height:1em; }

/* ---------- dividers ---------- */
.rule{ height:1px; background:var(--line); border:0; margin:0; }

/* ---------- scroll reveal ---------- */
[data-rise]{ opacity:0; transform:translateY(26px); }
.reveal-on [data-rise]{ opacity:1; transform:none;
  transition:opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay:var(--d, 0ms); }
@media (prefers-reduced-motion: reduce){
  [data-rise]{ opacity:1 !important; transform:none !important; }
}
