/* ==========================================================================
   Hideaway — shared foundation
   Tokens mirror the Figma variables (Full/*, Text/*, Spacing/*, Radius/*).
   ========================================================================== */

:root {
  /* Colors */
  --c-brown: #311c18;
  --c-brown-80: rgba(49, 28, 24, 0.8);
  --c-brown-60: rgba(49, 28, 24, 0.6);
  --c-brown-8: rgba(49, 28, 24, 0.08);
  --c-beige: #f9f2ed;
  --c-white: #ffffff;
  --c-white-75: rgba(255, 255, 255, 0.75);
  --c-white-15: rgba(255, 255, 255, 0.15);
  --c-black: #000000;
  --shadow-card: 0 4px 4px 0 rgba(49, 28, 24, 0.8);
  --shadow-card-inset: inset 0 4px 4px 0 rgba(49, 28, 24, 0.8);

  /* Spacing */
  --s-10: 10px;
  --s-15: 15px;
  --s-20: 20px;
  --s-30: 30px;
  --s-60: 60px;
  --s-100: 100px;
  --gutter: clamp(16px, 6.95vw, 100px); /* 100px at 1440 */

  /* Radius */
  --r-5: 5px;
  --r-round: 500px;

  /* Type */
  --f-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-hero: clamp(44px, 5.56vw, 80px);
  --fs-section: clamp(36px, 4.17vw, 60px);
  --fs-sub: clamp(28px, 2.78vw, 40px);
  --fs-body: 16px;
  --fs-small: 14px;

  --max-width: 1440px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Image hover zoom: one soft, slow, consistent motion everywhere */
  --ease-zoom: cubic-bezier(0.19, 1, 0.22, 1);
  --zoom-duration: 1.6s;
  --zoom-scale: 1.1;
  --zoom-filter: brightness(1.04) saturate(1.06);
}

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

html { -webkit-text-size-adjust: 100%; }
[tabindex="-1"]:focus { outline: none; }
/* the hidden attribute always wins over component display rules */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--c-white);
  color: var(--c-brown);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Layout ----------------------------------------------------------------- */
.page { max-width: var(--max-width); margin: 0 auto; position: relative; }
/* wider than the design: backgrounds go edge to edge, content stays in the 1440 column */
@media (min-width: 1441px) {
  :root { --gutter: calc((100vw - var(--max-width)) / 2 + 100px); }
  .page { max-width: none; }
}

.section {
  padding: var(--s-15) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--s-30);
}
.section--beige { background: var(--c-beige); }
.section--center { align-items: center; text-align: center; }

/* Typography ------------------------------------------------------------- */
.t-display {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}
.t-hero    { font-size: var(--fs-hero); }
.t-section { font-size: var(--fs-section); }
.t-sub     { font-size: var(--fs-sub); }
.t-body    { font-size: var(--fs-body); }
.t-small   { font-size: var(--fs-small); }
.t-muted   { color: var(--c-brown-60); }
.t-eyebrow { font-size: var(--fs-small); color: var(--c-brown-60); text-transform: uppercase; }

.section-head { display: flex; flex-direction: column; gap: var(--s-15); width: 100%; }
.section-head--tight { gap: var(--s-10); }
.section-head--center { text-align: center; }

/* Buttons (Btn_Variants) ------------------------------------------------- */
.btn {
  --btn-fg: var(--c-brown);
  --btn-bd: var(--c-brown);
  --btn-hover-bg: var(--c-brown);
  --btn-hover-fg: var(--c-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 57px;
  padding: var(--s-20);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-5);
  color: var(--btn-fg);
  font-size: var(--fs-small);
  font-weight: 300;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover,
.btn.is-active { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }

.btn--light {
  --btn-fg: var(--c-white);
  --btn-bd: var(--c-white);
  --btn-hover-bg: var(--c-white);
  --btn-hover-fg: var(--c-brown);
}
.btn--ghost { --btn-bd: transparent; --btn-hover-bg: var(--c-white-15); --btn-hover-fg: var(--c-white); --btn-fg: var(--c-white); }
.btn--block { display: flex; width: 100%; }
.btn--fixed { width: 115px; }   /* filter / nav size */
.btn--md    { min-width: 150px; }
.btn--lg    { min-width: 160px; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-15); justify-content: center; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-10); }
.chip-row--fill > .btn { flex: 1 1 0; }

/* Round arrow button (Btn_Arrow) */
.btn-arrow {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid var(--c-brown);
  border-radius: var(--r-round);
  background: var(--c-white);
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}
.btn-arrow img { width: 14px; height: 28px; }
.btn-arrow:hover { transform: translateX(3px); background: var(--c-beige); }
.btn-arrow--prev img { transform: scaleX(-1); }

/* Icons ------------------------------------------------------------------ */
.icon { flex-shrink: 0; width: 22px; height: 22px; object-fit: contain; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 24px; height: 25px; }

.meta-row { display: flex; align-items: center; gap: var(--s-15); font-size: var(--fs-small); color: var(--c-brown-60); }
.meta-row--body { font-size: var(--fs-body); color: var(--c-brown); }

/* Plain labels (look like text, not buttons) ------------------------------ */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: var(--fs-small); color: var(--c-brown-60); }
.tag-list li + li::before { content: "·"; margin: 0 0.6em; }

/* Dividers --------------------------------------------------------------- */
.divider-v { width: 0.75px; align-self: stretch; background: var(--c-brown-60); flex-shrink: 0; }
.divider-h { height: 0.75px; width: 100%; background: currentColor; opacity: 0.6; }

/* Navigation (Nav_Desktop) ----------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 97px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-20);
  padding: var(--s-20) var(--gutter);
  color: var(--c-white);
  background: var(--c-brown-8);
  transition: background-color 0.35s var(--ease), height 0.35s var(--ease);
}
/* no backdrop-filter: blurring a playing hero video every frame makes it stutter */
.nav.is-scrolled { background: rgba(49, 28, 24, 0.95); height: 80px; }
.nav__logo { font-size: var(--fs-small); letter-spacing: 0.04em; white-space: nowrap; }
.nav__links { display: flex; align-items: center; justify-content: space-between; width: min(586px, 50vw); }
.nav__links .btn { width: 115px; }
.nav__menu { display: contents; }
.nav__cta { width: 115px; }
.nav__toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav__toggle span,
.nav__toggle::before,
.nav__toggle::after {
  content: "";
  position: absolute; left: 10px; right: 10px;
  height: 1px; background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__toggle::before { top: 15px; }
.nav__toggle span    { top: 22px; }
.nav__toggle::after  { top: 29px; }
.nav.is-open .nav__toggle::before { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span    { opacity: 0; }
.nav.is-open .nav__toggle::after  { transform: translateY(-7px) rotate(-45deg); }

/* Hero (shared frame) ---------------------------------------------------- */
.hero {
  position: relative;
  height: 632px;
  overflow: hidden;
  color: var(--c-white);
  background: var(--c-brown);
}
.hero__media,
.hero__media img,
.hero__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.12); }
.hero__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-30);
  padding: 97px var(--gutter) var(--s-60);
  text-align: center;
}
.hero__text { display: flex; flex-direction: column; gap: var(--s-15); max-width: 920px; }

/* Media card (Card_Listing) — image with caption revealed on hover ------- */
.media-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--c-brown);
  border-radius: var(--r-5);
  background: var(--c-brown);
  color: var(--c-white);
  isolation: isolate;
}
.media-card > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--zoom-duration) var(--ease-zoom), filter var(--zoom-duration) var(--ease-zoom);
}
.media-card__footer {
  position: absolute; inset: 0;
  display: flex;
  align-items: stretch;
  gap: var(--s-15);
  padding: var(--s-15);
  background: linear-gradient(to top, rgba(49, 28, 24, 0.7), rgba(49, 28, 24, 0) 60%);
  opacity: 0;
  transition: opacity 0.9s var(--ease-zoom);
}
.media-card__text,
.media-card__actions { transform: translateY(10px); transition: transform 1.1s var(--ease-zoom); }
.media-card:hover .media-card__text,
.media-card:hover .media-card__actions,
.media-card:focus-within .media-card__text,
.media-card:focus-within .media-card__actions { transform: none; }
.media-card__text { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s-10); }
.media-card__title { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: var(--fs-sub); line-height: 1.1; }
.media-card__sub { font-size: var(--fs-small); color: var(--c-white-75); }
.media-card__actions { display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.media-card__actions img { width: 24px; height: 24px; }
.media-card__actions .save img { height: 22px; }
.media-card__actions .save { transition: transform 0.2s var(--ease); }
.media-card__actions .save { position: relative; }
.media-card__actions .save::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/icons/btn-save-filled.svg") center / contain no-repeat;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s var(--ease), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.media-card__actions .save.is-saved::after { opacity: 1; transform: scale(1); }
.media-card:hover > img,
.media-card:focus-within > img { transform: scale(var(--zoom-scale)); filter: var(--zoom-filter); }
.media-card:hover .media-card__footer,
.media-card:focus-within .media-card__footer { opacity: 1; }
@media (hover: none) { .media-card__footer { opacity: 1; } .media-card__text, .media-card__actions { transform: none; } }

/* Listing card (image + beige info) -------------------------------------- */
.listing-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-brown);
  border-radius: var(--r-5);
  background: var(--c-beige);
  min-width: 0;
}
.listing-card .media-card { flex: 1; min-height: 360px; border-width: 0 0 1px; border-radius: var(--r-5); }
.listing-card__info { display: flex; flex-direction: column; gap: var(--s-15); padding: var(--s-15); }
.listing-card__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-15); flex-wrap: wrap; }
.listing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-15); width: 100%; }

/* CTA band --------------------------------------------------------------- */
.cta {
  background: var(--c-brown);
  color: var(--c-white);
  padding: var(--s-60) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-15);
  text-align: center;
}
.cta p { color: var(--c-white-75); }

/* Footer ----------------------------------------------------------------- */
.footer {
  background: var(--c-black);
  color: var(--c-white-75);
  padding: var(--s-60);
  display: flex;
  flex-direction: column;
  gap: var(--s-15);
  font-size: var(--fs-small);
}
.footer__logo { font-size: var(--fs-body); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 0 0.6em; }
.footer__legal li + li::before { content: "|"; margin-right: 0.6em; }
.footer__links { display: flex; flex-direction: column; gap: var(--s-15); }
.footer a:hover { color: var(--c-white); }
.footer__disclaimer { max-width: 1260px; }
.footer__disclaimer a { text-decoration: underline; text-underline-offset: 3px; }

/* PHONE ONLY: hero buttons get a translucent white backing and sit one under another, full width */
@media (max-width: 600px) {
  .hero .btn--light { background: rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .hero .btn--light:hover { background: var(--c-white); color: var(--c-brown); }
  .hero .btn-row { flex-direction: column; align-items: stretch; width: 100%; max-width: 360px; }
  .hero .btn-row > .btn { flex: none; width: 100%; min-height: 52px; white-space: nowrap; }
}

/* PHONE ONLY: pages fade in softly instead of jumping (cross-page view transition where supported) */
@media (max-width: 600px) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  body { animation: page-in 0.7s cubic-bezier(0.45, 0, 0.55, 1) both; }
  @keyframes page-in { from { opacity: 0; } }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

/* PHONE / TOUCH ONLY: no hover zoom or brightening on touch screens —
   a tap would trigger them for an instant and make pictures flicker */
@media (hover: none) {
  :root { --zoom-scale: 1; --zoom-filter: none; }
  .media-card > img,
  .media-card__text,
  .media-card__actions { transition: none; }
}

/* Account link in the nav ------------------------------------------------ */
.nav__account { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; }
.nav__account img { width: 40px; height: 40px; border-radius: var(--r-round); border: 1px solid var(--c-white); object-fit: cover; transition: transform 0.4s var(--ease-zoom); }
.nav__account:hover img { transform: scale(1.06); }
.nav__account[aria-current="page"] img { box-shadow: 0 0 0 2px var(--c-white); }
.nav__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-white);
  color: var(--c-brown);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.nav__end { display: flex; align-items: center; gap: var(--s-15); }

/* Toast -------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border-radius: var(--r-5);
  background: var(--c-brown);
  color: var(--c-white);
  font-size: var(--fs-small);
  box-shadow: 0 12px 30px rgba(49, 28, 24, 0.3);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-zoom), transform 0.7s var(--ease-zoom);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }

/* Reveal on scroll ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 1.2s var(--ease-zoom), transform 1.4s var(--ease-zoom); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav { height: 72px; }
  .nav.is-scrolled { height: 72px; }
  .nav__toggle { display: block; color: var(--c-white); }
  .nav__menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-15);
    padding: var(--s-15) var(--gutter) var(--s-30);
    background: rgba(49, 28, 24, 0.97);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav__links { flex-direction: column; width: 100%; }
  .nav__links .btn,
  .nav__cta { width: 100%; }
  .nav__end { width: 100%; }
  .nav__end .nav__cta { flex: 1; }
  .nav.is-open { background: rgba(49, 28, 24, 0.97); }
  .nav.is-open .nav__menu { visibility: visible; opacity: 1; transform: none; }
  .hero { height: auto; min-height: 560px; }
  .footer { padding: var(--s-60) var(--gutter); }
}

@media (max-width: 600px) {
  .listing-grid { grid-template-columns: 1fr; }
  .btn { white-space: normal; }
  .btn-row > .btn { flex: 1 1 140px; }
}

/* Hero background video: fades in over the still image once it actually plays */
.hero__video { opacity: 0; transition: opacity 2s cubic-bezier(0.45, 0, 0.55, 1); }
.hero__video.is-playing { opacity: 1; }
/* twin used for the seamless cross-fade loop (js/main.js) — sits on top of the first video */
.hero__video.hero__video--twin { opacity: 0; transition: opacity 1.6s cubic-bezier(0.45, 0, 0.55, 1); }
.hero__video.hero__video--twin.is-front { opacity: 1; }
.hero__video.is-hidden { opacity: 0; }
