/* =============================================================================
   Bermstone — landing page
   Architecture:
     1. Design tokens          5. Layout primitives
     2. Reset & base           6. Components
     3. Typography             7. Sections
     4. Utilities              8. Responsive & motion
   ========================================================================== */

/* 1. ---------- Design tokens ---------------------------------------------- */
:root {
  /* Brand colour ramp */
  --navy-900: #0b1218;
  --navy-800: #0e171f;
  --navy-700: #15202b;
  --navy-600: #1d2b38;
  --navy-500: #28394a;

  --gold-300: #e6cf95;
  --gold-400: #d4b061;
  --gold-500: #c79a4b;
  --gold-600: #a87d33;

  --cream: #f7f3ec;
  --paper: #ffffff;
  --paper-2: #fbf9f4;

  --ink-900: #16202a;
  --ink-700: #3c4a57;
  --ink-500: #6a7682;
  --ink-300: #aab4bd;

  --wa: #25d366;
  --wa-dark: #1da851;

  /* Semantic */
  --bg: var(--cream);
  --surface: var(--paper);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --border: rgba(22, 32, 42, 0.10);
  --border-gold: rgba(199, 154, 75, 0.32);
  --ring: rgba(199, 154, 75, 0.45);

  /* Type */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.85rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-2xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --fs-3xl: clamp(2.25rem, 1.7rem + 2.6vw, 3.5rem);
  --fs-hero: clamp(3rem, 2rem + 6vw, 6rem);

  --lh-tight: 1.12;
  --lh-snug: 1.35;
  --lh-base: 1.65;
  --tracking-wide: 0.16em;
  --tracking-wider: 0.28em;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section-y: clamp(4rem, 2rem + 7vw, 7.5rem);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11, 18, 24, 0.06), 0 2px 6px rgba(11, 18, 24, 0.05);
  --shadow-md: 0 8px 24px rgba(11, 18, 24, 0.08), 0 2px 6px rgba(11, 18, 24, 0.05);
  --shadow-lg: 0 24px 60px rgba(11, 18, 24, 0.14);
  --shadow-gold: 0 10px 30px rgba(199, 154, 75, 0.30);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms;
  --t-med: 240ms;

  /* Layout */
  --container: 1140px;
  --container-pad: clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  --header-h: 76px;
  --z-header: 100;
  --z-fab: 90;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
:where(input, textarea) { font: inherit; }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  background: var(--navy-800);
  color: var(--cream);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  transition: top var(--t-med) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

/* 3. ---------- Typography -------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: var(--lh-tight); }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: var(--space-4);
}
.eyebrow--light { color: var(--gold-400); }

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* 4. ---------- Layout primitives ------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--section-y); }

.section__head {
  max-width: 44rem;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.section__title {
  font-size: var(--fs-3xl);
  color: var(--navy-700);
  letter-spacing: 0.01em;
}
.section__title--light { color: var(--gold-300); }
.section__intro {
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-lg);
  font-weight: 300;
}

.link {
  color: var(--gold-600);
  font-weight: 600;
  border-bottom: 1px solid var(--border-gold);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.link:hover { color: var(--gold-500); border-color: var(--gold-500); }

/* 5. ---------- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-med) var(--ease),
              background var(--t-med) var(--ease),
              color var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--block { width: 100%; }
.btn .icon { width: 1.05em; height: 1.05em; }

.btn--gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 60%, var(--gold-600));
  color: var(--navy-900);
  box-shadow: var(--shadow-gold);
}
.btn--gold:hover { box-shadow: 0 14px 36px rgba(199, 154, 75, 0.4); }

.btn--outline {
  background: transparent;
  color: var(--cream);
  border-color: rgba(230, 207, 149, 0.5);
}
.btn--outline:hover { background: rgba(230, 207, 149, 0.1); border-color: var(--gold-300); }

.btn--whatsapp {
  background: var(--wa);
  color: #fff;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.28);
}
.btn--whatsapp:hover { background: var(--wa-dark); }

/* 6. ---------- Header / nav ------------------------------------------------ */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(14, 23, 31, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease);
}
.header.is-scrolled {
  background: rgba(11, 18, 24, 0.94);
  border-bottom-color: var(--border-gold);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: var(--space-3); }
.brand__mark { width: 40px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.brand__name--light { color: var(--gold-300); }
.brand__tagline {
  font-size: 0.56rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-300);
  margin-top: 2px;
}

.nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
}
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #d6dde3;
  border-radius: var(--radius-pill);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
/* underline reveal only on plain text links */
.nav__link:not([class*="--"])::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.3rem;
  height: 1.5px;
  background: var(--gold-400);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.nav__link:not([class*="--"]):hover { color: var(--gold-300); }
.nav__link:not([class*="--"]):hover::after { transform: scaleX(1); }

.nav__link--whatsapp { background: var(--wa); color: #fff; font-weight: 600; padding-inline: 1rem; }
.nav__link--whatsapp:hover { background: var(--wa-dark); color: #fff; }

.nav__link--ghost {
  color: var(--gold-300);
  border: 1px solid var(--border-gold);
}
.nav__link--ghost:hover { background: rgba(199, 154, 75, 0.14); color: #fff; }

.nav__link--airbnb {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
  color: var(--navy-900);
  font-weight: 700;
  padding-inline: 1.1rem;
}
.nav__link--airbnb:hover { color: var(--navy-900); filter: brightness(1.05); }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
}
.nav-toggle__bar {
  width: 24px; height: 2px; border-radius: 2px;
  background: var(--gold-300);
  transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 7. ---------- Hero -------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(88vh, 760px);
  text-align: center;
  color: var(--cream);
  background:
    radial-gradient(110% 90% at 50% -10%, var(--navy-500) 0%, var(--navy-700) 38%, var(--navy-900) 100%);
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  inset: auto 0 -40% 0;
  height: 70%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(199, 154, 75, 0.18), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: var(--space-9);
}
.hero__mark { width: clamp(72px, 10vw, 96px); height: auto; margin-bottom: var(--space-5); filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45)); }
.hero__title {
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-300);
  line-height: 1;
}
.hero__rule {
  width: 96px; height: 1px;
  margin: var(--space-5) 0;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}
.hero__lead {
  max-width: 38rem;
  font-size: var(--fs-xl);
  font-weight: 300;
  color: #c8d1d9;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

/* 7. ---------- Shortlets / listings (horizontal carousel) ----------------- */
.section--listings { background: var(--bg); }

.listings-wrap { position: relative; }

/* The horizontal, snap-scrolling track */
.listings {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-left: var(--space-1);
  padding: var(--space-2) var(--space-1) var(--space-5);
  /* room for the cards' hover-lift and collage spill */
  margin-inline: calc(var(--space-1) * -1);
  scrollbar-width: thin;
  scrollbar-color: var(--gold-500) rgba(22, 32, 42, 0.08);
}
.listings:focus-visible { outline-offset: 4px; }
.listings::-webkit-scrollbar { height: 8px; }
.listings::-webkit-scrollbar-track { background: rgba(22, 32, 42, 0.08); border-radius: var(--radius-pill); }
.listings::-webkit-scrollbar-thumb { background: var(--gold-500); border-radius: var(--radius-pill); }
.listings::-webkit-scrollbar-thumb:hover { background: var(--gold-600); }

/* Each shortlet is a fixed-width card */
.listing {
  flex: 0 0 auto;
  width: clamp(270px, 80vw, 340px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
}
.listing:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-gold);
}
.listing__media { padding: var(--space-5) var(--space-5) 0; }
.listing__body { display: flex; flex-direction: column; padding: var(--space-5); }

/* Carousel arrow controls */
.listings__nav {
  position: absolute;
  top: 33%;
  transform: translateY(-50%);
  z-index: 5;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--gold-300);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-md);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.listings__nav:hover { background: var(--navy-900); transform: translateY(-50%) scale(1.08); }
.listings__nav svg { width: 22px; height: 22px; }
.listings__nav--prev { left: 0; margin-left: calc(var(--space-5) * -1); }
.listings__nav--next { right: 0; margin-right: calc(var(--space-5) * -1); }
.listings__nav[hidden] { display: none; }

/* --- Collage (clickable photo-stack, links to the Airbnb booking) --- */
.collage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}
.collage:focus-visible { outline-offset: 6px; }
.collage__img {
  position: absolute;
  object-fit: cover;
  border: 6px solid var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: transform var(--t-med) var(--ease);
}
.collage__img--b1 {
  width: 60%; aspect-ratio: 1 / 1;
  top: 0; right: 3%;
  transform: rotate(6deg);
  z-index: 1;
}
.collage__img--b2 {
  width: 54%; aspect-ratio: 1 / 1;
  top: 12%; left: 2%;
  transform: rotate(-8deg);
  z-index: 2;
}
.collage__img--main {
  width: 66%; aspect-ratio: 4 / 3;
  bottom: 0; left: 17%;
  transform: rotate(-1deg);
  z-index: 3;
  border-color: var(--gold-300);
}
.listing:hover .collage__img--b1 { transform: rotate(10deg) translate(8px, -8px); }
.listing:hover .collage__img--b2 { transform: rotate(-12deg) translate(-8px, 6px); }
.listing:hover .collage__img--main { transform: rotate(0deg) translateY(-6px); }

.listing__title { font-size: var(--fs-2xl); color: var(--navy-700); margin-top: var(--space-1); }
.listing__desc { margin: var(--space-3) 0 var(--space-6); color: var(--text-muted); font-size: var(--fs-lg); font-weight: 300; }

/* 7. ---------- About ------------------------------------------------------- */
.section--about {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-900));
  color: var(--cream);
}
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.about__text {
  color: #c4cdd5;
  font-weight: 300;
  font-size: var(--fs-lg);
  margin-top: var(--space-4);
}
.about__actions { margin-top: var(--space-6); }

.stats {
  list-style: none;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}
.stat { display: flex; flex-direction: column; gap: 2px; padding-block: var(--space-2); }
.stat + .stat { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: var(--space-4); }
.stat__value {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold-300);
  line-height: 1;
}
.stat__label {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-300);
}

/* 7. ---------- Contact / form --------------------------------------------- */
.section--contact { background: var(--bg); }
.contact { max-width: 44rem; margin-inline: auto; }
.form {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.form__field { margin-bottom: var(--space-5); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--navy-700);
}
.form__optional { color: var(--text-muted); font-weight: 400; }
.form__input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  background: var(--paper-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.form__input::placeholder { color: var(--ink-300); }
.form__input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--ring);
}
.form__textarea { resize: vertical; min-height: 120px; }
.form__honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__status { margin-top: var(--space-4); text-align: center; font-size: var(--fs-sm); min-height: 1.4em; }
.form__status.is-ok { color: var(--wa-dark); font-weight: 600; }
.form__status.is-error { color: #c0392b; font-weight: 600; }
#submitBtn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

/* 7. ---------- Footer ------------------------------------------------------ */
.footer { background: var(--navy-900); color: var(--ink-300); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-8);
}
.footer__brand { display: flex; flex-direction: column; gap: var(--space-1); }
.footer__brand .brand__name { font-size: 1.25rem; }
.footer__mark { width: 46px; height: auto; margin-bottom: var(--space-2); }
.footer__tagline { font-size: 0.6rem; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--ink-500); }
.footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.footer__link { font-size: var(--fs-sm); color: #c8d1d9; transition: color var(--t-fast) var(--ease); }
.footer__link:hover { color: var(--gold-300); }
.footer__base { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.footer__copy { padding-block: var(--space-5); font-size: var(--fs-xs); color: var(--ink-500); text-align: center; }

/* 7. ---------- Floating WhatsApp ------------------------------------------ */
.fab {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: var(--z-fab);
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.45);
  transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.fab:hover { transform: translateY(-3px) scale(1.05); background: var(--wa-dark); }
.fab svg { width: 28px; height: 28px; fill: currentColor; }

/* 8. ---------- Reveal animation ------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* 8. ---------- Responsive -------------------------------------------------- */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  /* On smaller screens, swipe the carousel instead of using arrows */
  .listings__nav { display: none; }
  .listings { scroll-padding-left: var(--container-pad); }
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--navy-900);
    border-bottom: 1px solid var(--border-gold);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--t-med) var(--ease);
  }
  .nav.is-open { max-height: calc(100vh - var(--header-h)); }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-5) var(--container-pad);
  }
  .nav__link { justify-content: center; padding-block: 0.8rem; font-size: var(--fs-base); }
  .nav__link:not([class*="--"])::after { content: none; }
}

@media (max-width: 720px) {
  .form__row { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* 8. ---------- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .btn:hover, .fab:hover, .listing:hover .collage__img--main { transform: none; }
}
