/* Chifstay — two apartments in Funchal.
 *
 * The brief was: the movement and polish of chifbay.com, but an Airbnb-shaped
 * site with its own colours. So the reveal-on-scroll and the parallax are the
 * same technique as Chifbay, and everything else is deliberately the opposite:
 *
 *   Chifbay   dark navy ground, gold accent, huge serif display type, photos
 *             bled edge to edge, a video hero.
 *   Chifstay  white ground, terracotta accent, one clean sans, photos in a
 *             rounded grid with air around them, a still photo hero.
 *
 * Terracotta and sea teal come from the apartments themselves - the roof tiles
 * and the water in the real photos - not from Airbnb's pink, which belongs to
 * Airbnb.
 */

:root{
  /* ground and ink */
  --paper:#ffffff;
  --sand:#faf8f5;          /* section bands, so white sections still separate */
  --line:#e6e2dc;
  --ink:#1f1d1b;
  --ink-2:#57524c;         /* secondary text, passes AA on both grounds */
  --ink-3:#8a837a;

  /* accents */
  --terra:#c9563a;         /* the roof tiles */
  --terra-dark:#a8402a;
  --teal:#125f63;          /* the water */
  --gold:#c9922f;          /* the review stars only */

  --radius:14px;
  --radius-lg:20px;
  --shadow:0 2px 6px rgba(31,29,27,.05),0 12px 28px rgba(31,29,27,.07);
  --shadow-lift:0 4px 10px rgba(31,29,27,.07),0 20px 44px rgba(31,29,27,.12);
  --wrap:1180px;
  --nav-h:76px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
h1,h2,h3,h4{margin:0;line-height:1.14;letter-spacing:-.022em;font-weight:700}
h1{font-size:clamp(2.1rem,4.6vw,3.6rem);letter-spacing:-.032em}
h2{font-size:clamp(1.6rem,2.9vw,2.4rem)}
h3{font-size:1.12rem}
p{margin:0 0 1em}
.wrap{width:min(100% - 40px,var(--wrap));margin-inline:auto}
.lede{font-size:1.09rem;color:var(--ink-2);max-width:62ch}
.eyebrow{
  font-size:.7rem;font-weight:700;letter-spacing:.15em;text-transform:uppercase;
  color:var(--terra);margin-bottom:14px;
}
.sand{background:var(--sand)}
section{padding:clamp(56px,8vw,104px) 0}
.sec-head{max-width:66ch;margin-bottom:clamp(28px,4vw,48px)}

/* ------------------------------------------------------------------ nav */
.nav{
  position:sticky;top:0;z-index:60;height:var(--nav-h);
  display:flex;align-items:center;
  background:rgba(255,255,255,.86);backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid transparent;transition:border-color .3s,box-shadow .3s;
}
.nav.stuck{border-bottom-color:var(--line);box-shadow:0 1px 12px rgba(31,29,27,.05)}
.nav .wrap{display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:baseline;gap:9px;font-weight:800;font-size:1.24rem;letter-spacing:-.03em}
.brand span{color:var(--terra)}
.brand small{font-weight:500;font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-3)}
.nav-links{display:flex;align-items:center;gap:30px;font-size:.93rem;font-weight:500;color:var(--ink-2)}
.nav-links a{position:relative;padding:4px 0}
.nav-links a::after{
  content:"";position:absolute;left:0;right:100%;bottom:0;height:2px;
  background:var(--terra);transition:right .3s cubic-bezier(.2,.8,.2,1);
}
.nav-links a:hover{color:var(--ink)}
.nav-links a:hover::after{right:0}
.nav-toggle{display:none;background:none;border:0;padding:8px;cursor:pointer}
.nav-toggle span{display:block;width:22px;height:2px;background:var(--ink);margin:5px 0;transition:transform .3s,opacity .3s}

/* ---------------------------------------------------------------- button */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  padding:13px 24px;border-radius:999px;font-weight:600;font-size:.95rem;
  border:1px solid transparent;cursor:pointer;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s,background .22s,color .22s;
}
.btn:hover{transform:translateY(-2px)}
.btn-p{background:var(--terra);color:#fff;box-shadow:0 6px 18px rgba(201,86,58,.26)}
.btn-p:hover{background:var(--terra-dark);box-shadow:0 10px 26px rgba(201,86,58,.34)}
.btn-o{border-color:var(--line);background:#fff;color:var(--ink)}
.btn-o:hover{border-color:var(--ink);box-shadow:var(--shadow)}
.btn-lg{padding:16px 30px;font-size:1rem}

/* ------------------------------------------------------------------ hero
   A photo grid, the way a listing site opens: one tall picture and a stack of
   smaller ones. It also does the work of showing both flats at once, which a
   single hero image cannot. */
.hero{padding:clamp(28px,4vw,44px) 0 clamp(44px,6vw,72px)}
.hero-copy{max-width:min(100%,760px);margin-bottom:clamp(26px,3.4vw,40px)}
.hero h1{max-width:15ch}
.hero h1 em{font-style:normal;color:var(--terra)}
.hero-grid{
  display:grid;gap:12px;border-radius:var(--radius-lg);overflow:hidden;
  grid-template-columns:1.62fr 1fr 1fr;
  grid-template-rows:repeat(2,minmax(0,1fr));
  height:clamp(320px,52vw,540px);
}
.hero-grid figure{margin:0;position:relative;overflow:hidden;background:var(--sand)}
.hero-grid figure:first-child{grid-row:span 2}
.hero-grid img{width:100%;height:100%;object-fit:cover;transition:transform 1.1s cubic-bezier(.2,.8,.2,1)}
.hero-grid figure:hover img{transform:scale(1.045)}
.hero-facts{display:flex;flex-wrap:wrap;gap:8px 26px;margin-top:24px;font-size:.9rem;color:var(--ink-2)}
.hero-facts b{color:var(--ink);font-weight:600}

/* ------------------------------------------------------------ stay cards */
.stays{display:grid;gap:clamp(24px,3vw,36px);grid-template-columns:repeat(2,1fr)}
.stay{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius-lg);
  overflow:hidden;display:flex;flex-direction:column;
  transition:transform .35s cubic-bezier(.2,.8,.2,1),box-shadow .35s,border-color .35s;
}
.stay:hover{transform:translateY(-6px);box-shadow:var(--shadow-lift);border-color:transparent}
.stay-shot{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--sand)}
.stay-shot img{width:100%;height:100%;object-fit:cover;transition:transform 1.1s cubic-bezier(.2,.8,.2,1)}
.stay:hover .stay-shot img{transform:scale(1.05)}
.badge{
  position:absolute;top:14px;left:14px;z-index:2;
  background:rgba(255,255,255,.95);border-radius:999px;padding:7px 14px;
  font-size:.74rem;font-weight:700;letter-spacing:.03em;box-shadow:var(--shadow);
}
.stay-body{padding:22px 24px 26px;display:flex;flex-direction:column;flex:1}
.stay-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.rating{display:inline-flex;align-items:center;gap:5px;font-size:.9rem;font-weight:600;white-space:nowrap}
.rating svg{width:14px;height:14px;fill:var(--gold)}
.rating span{color:var(--ink-3);font-weight:400}
.stay-where{color:var(--ink-3);font-size:.9rem;margin:5px 0 12px}
.stay-body p{color:var(--ink-2);font-size:.96rem}
.stay-meta{
  display:flex;flex-wrap:wrap;gap:6px 16px;margin:2px 0 20px;
  font-size:.87rem;color:var(--ink-2);
}
.stay-meta span{display:inline-flex;align-items:center;gap:7px}
.stay-meta svg{width:15px;height:15px;stroke:var(--ink-3);fill:none;stroke-width:1.7}
.stay-cta{margin-top:auto;display:flex;gap:10px;flex-wrap:wrap}

/* ------------------------------------------------------------- feature row */
.feats{display:grid;gap:clamp(22px,3vw,34px);grid-template-columns:repeat(3,1fr)}
.feat{padding:26px;border-radius:var(--radius);background:#fff;border:1px solid var(--line)}
.feat .ico{
  width:42px;height:42px;border-radius:12px;display:grid;place-items:center;
  background:rgba(201,86,58,.09);margin-bottom:16px;
}
.feat .ico svg{width:20px;height:20px;stroke:var(--terra);fill:none;stroke-width:1.8}
.feat h3{margin-bottom:8px}
.feat p{color:var(--ink-2);font-size:.95rem;margin:0}

/* --------------------------------------------------------------- listing */
.listing-head{padding:clamp(24px,3vw,36px) 0 0}
.listing-head h1{margin-bottom:10px}
.listing-sub{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;color:var(--ink-2);font-size:.95rem}
.gal{
  display:grid;gap:10px;grid-template-columns:2fr 1fr 1fr;
  grid-template-rows:repeat(2,minmax(0,1fr));
  height:clamp(300px,44vw,480px);border-radius:var(--radius-lg);overflow:hidden;margin:24px 0;
}
.gal figure{margin:0;overflow:hidden;position:relative;background:var(--sand);cursor:zoom-in}
.gal figure:first-child{grid-row:span 2}
.gal img{width:100%;height:100%;object-fit:cover;transition:transform 1s cubic-bezier(.2,.8,.2,1)}
.gal figure:hover img{transform:scale(1.05)}
.gal-more{
  position:absolute;right:16px;bottom:16px;background:rgba(255,255,255,.95);
  border-radius:10px;padding:9px 15px;font-size:.85rem;font-weight:600;box-shadow:var(--shadow);
}
.cols{display:grid;grid-template-columns:1fr 380px;gap:clamp(30px,4vw,58px);align-items:start}
.facts{display:flex;flex-wrap:wrap;align-items:center;gap:10px 28px;padding-bottom:26px;border-bottom:1px solid var(--line);margin-bottom:26px}
.facts span{display:inline-flex;align-items:center;gap:9px}
/* without an explicit size an inline SVG takes its natural box, which here was
   about 300px tall and pushed the row apart */
.facts svg{width:18px;height:18px;stroke:var(--ink-3);fill:none;stroke-width:1.7;flex:none}
.facts b{font-weight:600}

/* the every-room grid: photos vary in shape, so the frame has to be fixed or
   the rows go ragged */
.shots{display:grid;gap:14px;grid-template-columns:repeat(3,1fr)}
.shots figure{margin:0;aspect-ratio:4/3;overflow:hidden;border-radius:var(--radius);background:var(--sand);cursor:zoom-in}
.shots img{width:100%;height:100%;object-fit:cover;transition:transform 1s cubic-bezier(.2,.8,.2,1)}
.shots figure:hover img{transform:scale(1.05)}
@media(max-width:860px){.shots{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.shots{grid-template-columns:1fr}}
.amen{display:grid;grid-template-columns:repeat(2,1fr);gap:13px 24px;margin:0;padding:0;list-style:none}
.amen li{display:flex;align-items:center;gap:11px;color:var(--ink-2);font-size:.96rem}
.amen svg{width:17px;height:17px;stroke:var(--teal);fill:none;stroke-width:1.7;flex:none}
.amen li.off{color:var(--ink-3);text-decoration:line-through;text-decoration-color:var(--line)}
.amen li.off svg{stroke:var(--ink-3)}

/* booking card: sticky on desktop, a plain block on a phone */
.book{
  position:sticky;top:calc(var(--nav-h) + 22px);
  border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:24px;box-shadow:var(--shadow);background:#fff;
}
.book .rating{margin-bottom:14px}
.book h3{margin-bottom:6px}
.book .note{font-size:.86rem;color:var(--ink-3);margin:14px 0 0}
.book .btn{width:100%}
.book-list{list-style:none;margin:18px 0 0;padding:18px 0 0;border-top:1px solid var(--line);font-size:.9rem;color:var(--ink-2)}
.book-list li{display:flex;justify-content:space-between;gap:14px;padding:5px 0}

/* --------------------------------------------------------------- reviews */
.revs{display:grid;gap:20px;grid-template-columns:repeat(3,1fr)}
.rev{border:1px solid var(--line);border-radius:var(--radius);padding:22px;background:#fff}
.rev .stars{color:var(--gold);letter-spacing:2px;font-size:.85rem;margin-bottom:10px}
.rev p{font-size:.95rem;color:var(--ink-2)}
.rev cite{font-style:normal;font-weight:600;font-size:.9rem}

/* -------------------------------------------------------------------- faq */
.faq{max-width:820px}
.faq details{border-bottom:1px solid var(--line);padding:20px 0}
.faq summary{
  cursor:pointer;font-weight:600;list-style:none;display:flex;
  justify-content:space-between;align-items:center;gap:20px;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";font-size:1.4rem;color:var(--terra);transition:transform .3s;line-height:1}
.faq details[open] summary::after{transform:rotate(45deg)}
.faq p{margin:14px 0 0;color:var(--ink-2)}

/* ----------------------------------------------------------------- footer */
footer{background:var(--ink);color:#cfc9c1;padding:64px 0 34px;font-size:.92rem}
footer a:hover{color:#fff}
.foot-grid{display:grid;grid-template-columns:1.6fr 1fr 1fr;gap:38px;margin-bottom:40px}
footer h4{color:#fff;font-size:.76rem;letter-spacing:.14em;text-transform:uppercase;margin-bottom:16px;font-weight:700}
footer ul{list-style:none;margin:0;padding:0}
footer li{margin-bottom:9px}
.foot-brand{font-size:1.3rem;font-weight:800;color:#fff;letter-spacing:-.03em;margin-bottom:12px}
.foot-brand span{color:var(--terra)}
.foot-legal{border-top:1px solid rgba(255,255,255,.13);padding-top:22px;display:flex;flex-wrap:wrap;gap:8px 26px;justify-content:space-between;color:var(--ink-3);font-size:.83rem}

/* --------------------------------------------------------------- lightbox */
.lb{
  position:fixed;inset:0;z-index:200;background:rgba(20,18,16,.94);
  display:none;place-items:center;padding:28px;
}
.lb.on{display:grid}
.lb img{max-width:min(1200px,94vw);max-height:88vh;object-fit:contain;border-radius:8px}
.lb-close,.lb-prev,.lb-next{
  position:absolute;background:rgba(255,255,255,.12);border:0;color:#fff;
  width:46px;height:46px;border-radius:50%;font-size:1.3rem;cursor:pointer;
  display:grid;place-items:center;transition:background .2s;
}
.lb-close:hover,.lb-prev:hover,.lb-next:hover{background:rgba(255,255,255,.26)}
.lb-close{top:22px;right:22px}
.lb-prev{left:22px;top:50%;transform:translateY(-50%)}
.lb-next{right:22px;top:50%;transform:translateY(-50%)}
.lb-count{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);color:#fff;font-size:.86rem;opacity:.75}

/* ------------------------------------------------------------------ motion
   Same idea as Chifbay: everything with .rv starts a little low and faded, and
   an IntersectionObserver adds .in when it arrives. Children of .rv-group are
   staggered by an inline delay so a row of cards arrives one after another. */
.rv{opacity:0;transform:translateY(24px);
    transition:opacity .8s cubic-bezier(.16,.8,.16,1),transform .8s cubic-bezier(.16,.8,.16,1)}
.rv.in{opacity:1;transform:none}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .rv{opacity:1;transform:none;transition:none}
  .stay:hover,.btn:hover{transform:none}
  .hero-grid img,.gal img,.stay-shot img{transition:none}
}

/* ------------------------------------------------------------- responsive */
@media (max-width:960px){
  .cols{grid-template-columns:1fr}
  .book{position:static}
  .stays,.feats,.revs,.foot-grid{grid-template-columns:1fr}
  .feats,.revs{gap:16px}
}
@media (max-width:760px){
  .nav-links{
    position:fixed;inset:var(--nav-h) 0 auto;background:#fff;flex-direction:column;
    align-items:stretch;gap:0;padding:8px 20px 22px;border-bottom:1px solid var(--line);
    transform:translateY(-120%);transition:transform .34s cubic-bezier(.2,.8,.2,1);
  }
  .nav-links.open{transform:none}
  .nav-links a{padding:14px 0;border-bottom:1px solid var(--line)}
  .nav-toggle{display:block}
  .hero-grid,.gal{grid-template-columns:1fr;grid-template-rows:none;height:auto}
  .hero-grid figure:first-child,.gal figure:first-child{grid-row:auto}
  .hero-grid figure,.gal figure{aspect-ratio:4/3}
  .hero-grid figure:nth-child(n+3),.gal figure:nth-child(n+3){display:none}
  .amen{grid-template-columns:1fr}
}

/* ------------------------------------------------------------------ prices */
.price{font-size:.96rem;color:var(--ink-2);margin:0 0 16px}
.price b{color:var(--ink);font-size:1.05rem}
.price span{display:block;color:var(--terra);font-size:.85rem;font-weight:600;margin-top:2px}
.book-price{font-size:1.6rem;font-weight:700;letter-spacing:-.03em;margin:2px 0 4px}
.book-price span{font-size:.95rem;font-weight:400;color:var(--ink-2)}
.book-save{font-size:.88rem;color:var(--terra);font-weight:600;margin:0 0 14px}

/* --------------------------------------------------------------- wordmark
   The logo is a raster wordmark, so it is exported twice rather than
   recoloured by CSS: inverting anti-aliased black leaves grey fringes on the
   dark footer. Black on the nav, white on the footer, each with its own alpha. */
.brand img{height:34px;width:auto;display:block}
.foot-brand img{height:38px;width:auto;margin-bottom:12px}
@media (max-width:760px){ .brand img{height:28px} .brand small{display:none} }

/* ----------------------------------------------------------------- booking
   Lives inside the sticky card. Taken nights are struck through as well as
   greyed: colour alone is not a signal a colour-blind guest can read. */
.bk-wait,.bk-down{font-size:.92rem;color:var(--ink-2)}
.bk-down{border:1px solid var(--line);border-radius:var(--radius);padding:16px;background:var(--sand)}
.bk-down p{margin:0 0 8px}.bk-down p:last-child{margin:0;color:var(--ink-3);font-size:.86rem}
.bk-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.bk-head strong{font-size:.98rem}
.bk-nav{width:32px;height:32px;border-radius:50%;border:1px solid var(--line);background:#fff;
  cursor:pointer;font-size:1.1rem;line-height:1;color:var(--ink);transition:border-color .2s,background .2s}
.bk-nav:hover:not(:disabled){border-color:var(--ink)}
.bk-nav:disabled{opacity:.3;cursor:default}
.bk-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;margin-bottom:16px}
.bk-dow{text-align:center;font-size:.68rem;font-weight:700;letter-spacing:.06em;color:var(--ink-3);padding:4px 0}
.bk-pad{aspect-ratio:1}
.bk-day{aspect-ratio:1;border:0;background:none;border-radius:8px;cursor:pointer;font-size:.85rem;
  color:var(--ink);font-family:inherit;transition:background .15s,color .15s}
.bk-day:hover:not(:disabled){background:rgba(201,86,58,.12)}
.bk-day.is-taken{color:var(--ink-3);text-decoration:line-through;cursor:not-allowed}
.bk-day.is-past{color:var(--line);cursor:not-allowed}
.bk-day.is-from,.bk-day.is-to{background:var(--terra);color:#fff;font-weight:700}
.bk-day.is-mid{background:rgba(201,86,58,.16)}
.bk-sum{border-top:1px solid var(--line);padding-top:14px}
.bk-hint{font-size:.9rem;color:var(--ink-2);margin:0 0 6px}
.bk-rate{font-size:1.05rem;font-weight:700;margin:0}
.bk-row{display:flex;justify-content:space-between;gap:12px;font-size:.92rem;margin-bottom:10px}
.bk-total{display:flex;justify-content:space-between;align-items:baseline;gap:12px;
  padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:14px}
.bk-amount{font-size:1.5rem;letter-spacing:-.03em}
.bk-field{display:block;margin-bottom:10px}
.bk-field span{display:block;font-size:.78rem;font-weight:600;color:var(--ink-2);margin-bottom:4px}
.bk-field input{width:100%;padding:11px 13px;border:1px solid var(--line);border-radius:10px;
  font-family:inherit;font-size:.95rem;color:var(--ink);background:#fff}
.bk-field input:focus{outline:none;border-color:var(--terra);box-shadow:0 0 0 3px rgba(201,86,58,.14)}
.bk-go{width:100%;margin-top:4px}
.bk-note{font-size:.8rem;color:var(--ink-3);margin:10px 0 0;text-align:center}
.bk-err{font-size:.86rem;color:var(--terra-dark);font-weight:600;margin:10px 0 0}
