/* =========================================================================
   Casa Alegria — design system
   Type:  Cormorant Garamond (display serif) + Hanken Grotesk (sans body)
   Color: warm cream paper, espresso ink, terracotta / azulejo accents
   ========================================================================= */

:root {
  /* paper + ink (warm neutral) */
  --bg:        oklch(0.976 0.012 78);
  --bg-2:      oklch(0.948 0.016 72);
  --bg-ink:    oklch(0.255 0.018 56);   /* dark sections */
  --surface:   oklch(0.992 0.006 80);
  --ink:       oklch(0.275 0.018 52);
  --ink-soft:  oklch(0.44 0.020 50);
  --muted:     oklch(0.575 0.016 55);
  --line:      oklch(0.885 0.014 72);
  --line-soft: oklch(0.918 0.012 74);

  /* accents — share chroma/lightness, vary hue */
  --accent:      oklch(0.585 0.128 46);   /* terracotta */
  --accent-deep: oklch(0.475 0.115 42);
  --accent-soft: oklch(0.93 0.030 55);
  --gold:        oklch(0.74 0.095 78);    /* lisbon light */

  --shadow-sm: 0 1px 2px oklch(0.3 0.02 50 / 0.06), 0 2px 8px oklch(0.3 0.02 50 / 0.05);
  --shadow-md: 0 6px 24px oklch(0.3 0.02 50 / 0.09), 0 2px 6px oklch(0.3 0.02 50 / 0.06);
  --shadow-lg: 0 24px 60px oklch(0.25 0.02 50 / 0.16), 0 8px 24px oklch(0.25 0.02 50 / 0.08);

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="azulejo"] {
  --accent:      oklch(0.555 0.115 248);
  --accent-deep: oklch(0.445 0.105 250);
  --accent-soft: oklch(0.925 0.030 248);
}
[data-theme="olive"] {
  --accent:      oklch(0.565 0.085 128);
  --accent-deep: oklch(0.455 0.078 130);
  --accent-soft: oklch(0.928 0.028 124);
}

/* ----------------------------------------------------------------- reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ----------------------------------------------------------------- type */
.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}
.eyebrow.center::before { display: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.04; letter-spacing: -0.01em; color: var(--ink); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-soft); line-height: 1.7; }
.serif-italic { font-style: italic; }

/* ----------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 140px); position: relative; }
.section.tight { padding-block: clamp(56px, 8vw, 96px); }
.section--paper2 { background: var(--bg-2); }
.section-head { max-width: 640px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 1.1rem; }
.section-head p { margin-top: 1.2rem; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-weight: 600; font-size: 0.92rem; letter-spacing: 0.01em;
  padding: 0.95em 1.7em; border-radius: 100px; border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--primary { background: var(--accent); color: oklch(0.99 0.01 80); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn--light { background: oklch(0.99 0.01 80); color: var(--ink); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ----------------------------------------------------------------- nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background .35s var(--ease), box-shadow .35s var(--ease), padding .35s var(--ease);
}
.nav.scrolled {
  background: oklch(0.976 0.012 78 / 0.86);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line-soft);
  padding-block: 12px;
}
.brand { display: inline-flex; align-items: baseline; gap: 0.5ch; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; flex-shrink: 0; }
.brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; transform: translateY(-2px); }
.brand small { font-family: var(--sans); font-size: 0.6rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.nav-links a { font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--accent-deep); }
.nav-links .btn { padding: 0.7em 1.3em; }
.nav-links a.btn--primary { color: oklch(0.99 0.01 80); }
.nav-links a.btn--primary:hover { color: oklch(0.99 0.01 80); }
@media (max-width: 860px) { .nav-links a:not(.btn) { display: none; } }

/* ----------------------------------------------------------------- hero */
.hero { position: relative; padding-top: 120px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.hero-copy { max-width: 560px; }
.hero h1 { font-size: clamp(3.1rem, 7vw, 5.6rem); margin: 1.4rem 0 0; }
.hero h1 .alt { font-style: italic; color: var(--accent-deep); }
.hero .place { display: flex; align-items: center; gap: 0.6ch; color: var(--muted); font-size: 0.95rem; margin-top: 1.4rem; font-weight: 500; }
.hero .lead { margin-top: 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2.2rem; }
.hero-facts { display: flex; gap: clamp(20px, 3vw, 44px); margin-top: 2.6rem; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.fact .n { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; line-height: 1; }
.fact .l { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 0.5rem; font-weight: 600; }

.hero-art { position: relative; }
.hero-art .main { width: 100%; aspect-ratio: 4/5; box-shadow: var(--shadow-lg); }
.hero-art .stamp {
  position: absolute; right: -22px; bottom: -22px;
  width: 124px; height: 124px; border-radius: 50%;
  background: var(--accent); color: oklch(0.99 0.01 80);
  display: grid; place-content: center; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; line-height: 1.15;
  box-shadow: var(--shadow-md); transform: rotate(-8deg);
}
.hero-art .stamp b { font-style: normal; display: block; font-size: 1.7rem; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 460px; }
  .hero-art .main { aspect-ratio: 4/3; }
}

/* ----------------------------------------------------------------- image slots */
image-slot {
  --is-bg: var(--bg-2);
  background: var(--bg-2);
  color: var(--muted);
}

/* ----------------------------------------------------------------- highlights */
.hl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 26px); margin-top: clamp(40px, 6vw, 64px); }
.hl-card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 18px;
  padding: 30px 28px; box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.hl-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--line); }
.hl-ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-content: center;
  background: var(--accent-soft); color: var(--accent-deep); margin-bottom: 18px;
}
.hl-ic svg { width: 23px; height: 23px; }
.hl-card h3 { font-size: 1.32rem; margin-bottom: 0.5rem; }
.hl-card p { color: var(--ink-soft); font-size: 0.96rem; line-height: 1.6; }
@media (max-width: 820px) { .hl-grid { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 14px; }
.gallery image-slot { width: 100%; height: 100%; }
.g-tall { grid-row: span 2; }
.g-wide { grid-column: span 2; }
@media (max-width: 820px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .g-wide { grid-column: span 2; }
  .g-tall { grid-row: span 1; }
}

/* ----------------------------------------------------------------- the space (split) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.split.flip .split-art { order: 2; }
.split-art image-slot { width: 100%; aspect-ratio: 5/4; box-shadow: var(--shadow-md); }
.split-art .floorplan { width: 100%; aspect-ratio: 1448 / 1086; object-fit: cover; display: block;
  border-radius: 16px; box-shadow: var(--shadow-md); border: 1px solid var(--line); background: #f5efe6; }
.rooms { display: grid; gap: 2px; margin-top: 2rem; border-top: 1px solid var(--line); }
.room { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.room .r-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.room .r-desc { color: var(--muted); font-size: 0.92rem; text-align: right; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split.flip .split-art { order: -1; } }

/* ----------------------------------------------------------------- amenities */
.amen-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: clamp(36px, 5vw, 56px); }
.amen {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px;
  font-weight: 500; font-size: 0.96rem;
}
.amen svg { width: 22px; height: 22px; color: var(--accent-deep); flex-shrink: 0; }
@media (max-width: 820px) { .amen-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .amen-grid { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- location */
.loc-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.nearby { display: grid; gap: 2px; margin-top: 2rem; }
.near { display: flex; align-items: center; gap: 16px; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.near .dist { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--accent-deep); min-width: 86px; }
.near .place { font-weight: 600; }
.near .sub { color: var(--muted); font-size: 0.86rem; }
.loc-art image-slot { width: 100%; aspect-ratio: 1/1; box-shadow: var(--shadow-md); }
@media (max-width: 820px) { .loc-grid { grid-template-columns: 1fr; } }

/* illustrated neighbourhood map */
.site-map { display: block; width: 100%; aspect-ratio: 1448 / 1086; border-radius: 18px;
  box-shadow: var(--shadow-md); border: 1px solid var(--line); object-fit: cover; background: #f5efe6; }

/* ----------------------------------------------------------------- reviews */
.reviews-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.rating { text-align: right; flex-shrink: 0; }
.rating .stars { color: var(--accent); letter-spacing: 3px; font-size: 1.05rem; }
.rating .score { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; line-height: 1; margin-top: 0.3rem; }
.rating .score span { color: var(--muted); font-size: 1.1rem; }
.rating .sub { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 0.4rem; }
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); margin-top: clamp(36px, 5vw, 56px); }
.review-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.review-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.review-card .stars { color: var(--accent); letter-spacing: 2px; font-size: 0.95rem; margin-bottom: 16px; }
.review-card .stars .off, .rating .stars .off { color: var(--line); }
.review-card blockquote { font-family: var(--serif); font-style: italic; font-size: 1.2rem; line-height: 1.5;
  color: var(--ink); margin: 0; flex-grow: 1; text-wrap: pretty; }
.review-card .who { display: flex; align-items: center; gap: 13px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.review-card .avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: grid; place-content: center;
  background: var(--accent-soft); color: var(--accent-deep); font-family: var(--sans); font-weight: 700; font-size: 0.92rem; }
.review-card .who .n { font-weight: 600; font-size: 0.96rem; }
.review-card .who .m { color: var(--muted); font-size: 0.82rem; margin-top: 1px; }
@media (max-width: 860px) { .review-grid { grid-template-columns: 1fr; } .rating { text-align: left; } }

/* ----------------------------------------------------------------- contact / dark */
.contact { background: var(--bg-ink); color: oklch(0.94 0.01 80); }
.contact .eyebrow { color: var(--gold); }
.contact .eyebrow::before { background: var(--gold); }
.contact h2 { color: oklch(0.97 0.01 80); }
.contact .lead { color: oklch(0.82 0.012 75); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 90px); align-items: start; }
.contact-side .c-item { padding: 1.1rem 0; border-top: 1px solid oklch(0.4 0.02 60 / 0.5); }
.contact-side .c-item:last-child { border-bottom: 1px solid oklch(0.4 0.02 60 / 0.5); }
.contact-side .c-item .k { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.contact-side .c-item .v { font-family: var(--serif); font-size: 1.3rem; margin-top: 0.3rem; }

/* form */
.form { background: oklch(0.31 0.018 56); border: 1px solid oklch(0.4 0.02 60 / 0.5); border-radius: 22px; padding: clamp(26px, 3.5vw, 40px); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: oklch(0.8 0.012 75); font-weight: 600; margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; font-family: inherit; font-size: 0.98rem; color: oklch(0.96 0.01 80);
  background: oklch(0.26 0.016 56); border: 1px solid oklch(0.44 0.02 60 / 0.6);
  border-radius: 11px; padding: 0.85em 1em; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: oklch(0.62 0.015 60); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px oklch(0.74 0.095 78 / 0.18);
}
.field.invalid input, .field.invalid textarea { border-color: oklch(0.6 0.16 28); }
.field .err { font-size: 0.78rem; color: oklch(0.74 0.13 30); margin-top: 6px; display: none; }
.field.invalid .err { display: block; }
.form .btn--primary { width: 100%; justify-content: center; margin-top: 6px; padding-block: 1.05em; }
.form-note { font-size: 0.82rem; color: oklch(0.7 0.012 70); margin-top: 14px; text-align: center; }

.form-success { text-align: center; padding: clamp(30px, 5vw, 56px) 20px; }
.form-success .ck { width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: var(--bg-ink); display: grid; place-content: center; margin: 0 auto 22px; }
.form-success .ck svg { width: 30px; height: 30px; }
.form-success h3 { color: oklch(0.97 0.01 80); font-size: 1.7rem; }
.form-success p { color: oklch(0.82 0.012 75); margin-top: 10px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- footer */
.footer { background: var(--bg-ink); color: oklch(0.74 0.012 70); padding: 40px var(--gutter); border-top: 1px solid oklch(0.36 0.02 60 / 0.5); }
.footer-in { max-width: var(--container); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer .brand { color: oklch(0.94 0.01 80); font-size: 1.2rem; }
.footer small { font-size: 0.84rem; }

/* ----------------------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ----------------------------------------------------------------- decorative azulejo divider */
.tile-rule { height: 8px; width: 100%;
  background-image: repeating-linear-gradient(45deg, var(--accent) 0 6px, transparent 6px 12px);
  opacity: 0.5; }
