/* ============================================================
   cala. — design system
   Property care & trusted trades across the Balearics
   ============================================================ */

:root {
  /* Palette */
  --ink: #13333c;
  --ink-soft: #43616a;
  --ink-faint: #6d868d;
  --sand: #faf6ef;
  --sand-deep: #f1e9dc;
  --white: #ffffff;
  --terracotta: #c25e3b;
  --terracotta-deep: #a84d2e;
  --terracotta-tint: #f7e8e1;
  --sea: #1f6d68;
  --sea-deep: #175450;
  --sea-tint: #e4efec;
  --gold: #d9a441;
  --line: rgba(19, 51, 60, 0.12);
  --line-soft: rgba(19, 51, 60, 0.07);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Shape & shadow */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(19, 51, 60, 0.06), 0 2px 8px rgba(19, 51, 60, 0.05);
  --shadow-md: 0 2px 4px rgba(19, 51, 60, 0.05), 0 12px 32px rgba(19, 51, 60, 0.10);
  --shadow-lg: 0 4px 8px rgba(19, 51, 60, 0.06), 0 24px 64px rgba(19, 51, 60, 0.14);

  /* Rhythm */
  --section-pad: clamp(4rem, 9vw, 7.5rem);
  --container: 1160px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--sea-deep); }
::selection { background: var(--terracotta); color: var(--sand); }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 96px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1, .h1 { font-size: clamp(2.5rem, 6.2vw, 4.25rem); }
h2, .h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3, .h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.25; }
h4 { font-size: 1.0625rem; font-weight: 650; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--terracotta);
  border-radius: 2px;
}

.lede {
  font-size: clamp(1.125rem, 1.8vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38em;
}
.muted { color: var(--ink-soft); }
.small { font-size: 0.9375rem; }

em.accent { font-style: italic; color: var(--terracotta); }

/* ---------- Layout ---------- */
.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}
.section { padding-block: var(--section-pad); }
.section-tight { padding-block: calc(var(--section-pad) * 0.6); }
.section-alt { background: var(--white); }
.section-ink { background: var(--ink); color: var(--sand); }
.section-ink h2, .section-ink h3 { color: var(--sand); }
.section-ink .muted, .section-ink .lede { color: rgba(250, 246, 239, 0.75); }

.section-head { max-width: 46em; margin-bottom: clamp(2.2rem, 5vw, 3.5rem); }
.section-head.centered { margin-inline: auto; text-align: center; }
.section-head.centered .lede { margin-inline: auto; }
.section-head.centered .eyebrow::before { display: none; }

.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.7rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }

.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-deep); color: var(--white); box-shadow: 0 8px 24px rgba(194, 94, 59, 0.35); }

.btn-ink { background: var(--ink); color: var(--sand); }
.btn-ink:hover { background: #0d262d; color: var(--sand); box-shadow: 0 8px 24px rgba(19, 51, 60, 0.3); }

.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.section-ink .btn-ghost { border-color: rgba(250, 246, 239, 0.4); color: var(--sand); }
.section-ink .btn-ghost:hover { border-color: var(--sand); }

.btn-light { background: var(--sand); color: var(--ink); }
.btn-light:hover { background: var(--white); color: var(--ink); }

.btn-lg { padding: 1.05rem 2.1rem; font-size: 1.0625rem; }
.btn-sm { padding: 0.55rem 1.15rem; font-size: 0.9rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 246, 239, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line-soft); box-shadow: 0 4px 24px rgba(19, 51, 60, 0.06); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-dot { color: var(--terracotta); }

.site-nav { display: flex; align-items: center; gap: 1.9rem; }
.site-nav > a:not(.btn) {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 550;
  font-size: 0.99rem;
  transition: color 0.15s ease;
}
.site-nav > a:not(.btn):hover { color: var(--ink); }
.site-nav > a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.site-nav .nav-cta { margin-left: 0.4rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px; height: 46px;
  padding: 11px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--sand);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(19, 51, 60, 0.14);
    padding: 0.6rem 1.25rem 1.25rem;
    display: none;
  }
  html.nav-open .site-nav { display: flex; }
  .site-nav > a:not(.btn) {
    padding: 0.9rem 0.25rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--line-soft);
  }
  .site-nav .nav-cta { margin: 1rem 0 0; justify-content: center; }
  html.nav-open .nav-toggle span:not(.sr-only):nth-child(1) { transform: translateY(7px) rotate(45deg); }
  html.nav-open .nav-toggle span:not(.sr-only):nth-child(2) { opacity: 0; }
  html.nav-open .nav-toggle span:not(.sr-only):nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  html.nav-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4rem, 9vw, 7rem); position: relative; overflow: hidden; }
.hero .lede { margin-top: 1.4rem; }
.hero .btn-row { margin-top: 2.2rem; }

.hero-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.8rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card.hover:hover, a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line);
}
a.card { display: block; text-decoration: none; color: inherit; }

.card-icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--sea-tint);
  color: var(--sea);
  margin-bottom: 1.1rem;
}
.card-icon.warm { background: var(--terracotta-tint); color: var(--terracotta); }
.card h3 + p, .card h4 + p { margin-top: 0.5rem; }
.card p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active, .chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sand);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--sea-tint);
  color: var(--sea-deep);
}
.badge.warm { background: var(--terracotta-tint); color: var(--terracotta-deep); }
.badge.gold { background: #f8efdc; color: #8a6414; }
.badge svg { width: 13px; height: 13px; }

.stars { color: var(--gold); letter-spacing: 0.05em; font-size: 0.95rem; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 0; counter-increment: step; }
.step-num {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--terracotta);
  opacity: 0.85;
  margin-bottom: 0.9rem;
}
.step h3 { margin-bottom: 0.45rem; }
.step p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Stats ---------- */
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label { margin-top: 0.5rem; font-size: 0.95rem; color: var(--ink-soft); }
.section-ink .stat-label { color: rgba(250, 246, 239, 0.7); }

/* ---------- FAQ (native details) ---------- */
details.faq {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 0;
  transition: box-shadow 0.2s ease;
}
details.faq + details.faq { margin-top: 0.75rem; }
details.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  font-weight: 600;
  font-size: 1.02rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--terracotta);
  transition: transform 0.2s ease;
  flex: none;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq[open] { box-shadow: var(--shadow-sm); }
details.faq .faq-body { padding: 0 1.4rem 1.3rem; color: var(--ink-soft); font-size: 0.99rem; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--ink-faint); }
.input, .field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea {
  padding: 0.85rem 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(31, 109, 104, 0.15);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* Selectable option cards (radio-style) */
.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.option-card:hover { border-color: var(--ink-faint); }
.option-card.selected, .option-card:has(input:checked) {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(31, 109, 104, 0.14);
  background: #fdfcf9;
}
.option-card input { accent-color: var(--sea); margin-top: 0.3rem; }

/* ---------- Pricing ---------- */
.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 2.1rem 1.9rem;
  box-shadow: var(--shadow-sm);
}
.package-card.featured {
  background: var(--ink);
  color: var(--sand);
  border-color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.package-card.featured h3 { color: var(--sand); }
.package-card.featured .muted, .package-card.featured li { color: rgba(250, 246, 239, 0.8); }
.package-flag {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: var(--terracotta);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.price {
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.price .per { font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.package-card.featured .price .per { color: rgba(250, 246, 239, 0.6); }

.tick-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.tick-list li { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.98rem; color: var(--ink-soft); }
.tick-list li::before {
  content: "";
  flex: none;
  width: 18px; height: 18px;
  margin-top: 0.2em;
  border-radius: 50%;
  background: var(--sea-tint) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231f6d68" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 13l4 4 10-10"/></svg>') center / 11px no-repeat;
}
.package-card.featured .tick-list li::before {
  background-color: rgba(250, 246, 239, 0.14);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23faf6ef" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 13l4 4 10-10"/></svg>');
}

/* Billing toggle */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.4rem;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
}
.billing-toggle button {
  border: 0;
  background: transparent;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s ease;
}
.billing-toggle button.active { background: var(--ink); color: var(--sand); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--white); }
table.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 0.97rem; }
table.compare th, table.compare td { padding: 0.95rem 1.2rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
table.compare thead th { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
table.compare tbody tr:last-child td { border-bottom: 0; }
table.compare td.yes { color: var(--sea); font-weight: 600; }
table.compare td.no { color: var(--ink-faint); }

/* ---------- Testimonials ---------- */
.quote-card { display: flex; flex-direction: column; gap: 1.2rem; height: 100%; }
.quote-card blockquote {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 450;
  line-height: 1.45;
  font-style: italic;
  color: var(--ink);
}
.quote-card .who { margin-top: auto; display: flex; align-items: center; gap: 0.85rem; }
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--white);
  flex: none;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(250, 246, 239, 0.75); font-size: 0.95rem; }
.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: 4rem 3rem;
}
@media (max-width: 880px) { .footer-main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-main { grid-template-columns: 1fr; } }
.site-footer .brand-name { color: var(--sand); }
.site-footer h4 { color: var(--sand); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.site-footer a { color: rgba(250, 246, 239, 0.75); text-decoration: none; }
.site-footer a:hover { color: var(--sand); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(250, 246, 239, 0.14);
  font-size: 0.875rem;
  color: rgba(250, 246, 239, 0.55);
}

/* ---------- Reveal animations ---------- */
/* Hide-before-reveal only when scripting is available, so content
   never stays invisible if main.js is blocked or JS is disabled. */
@media (scripting: enabled) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s ease; transition-delay: var(--reveal-delay, 0s); }
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---------- Decorative ---------- */
.wave-divider { display: block; width: 100%; height: auto; margin-bottom: -1px; }

.island-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}
