/* Mbeach Nest — mobile-first styles. Mobile is the design; desktop is the adaptation.
   The authored signature: one 1px sea-teal horizon at 38% of the hero, repeated
   as the only divider between sections. No other borders separate blocks. */

/* ---------- utilities ---------- */
*, *::before, *::after { box-sizing: border-box; }
.wrap { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-button { appearance: none; background: transparent; border: 0; color: inherit; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-sm); cursor: pointer; }
.icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: var(--s-3) var(--s-6); background: var(--c-accent); color: var(--c-accent-ink); font: inherit; font-weight: 600; border: 0; border-radius: var(--r-md); text-decoration: none; }
.button:hover { filter: brightness(.92); }
.button.secondary { background: transparent; color: var(--c-accent); border: 1.5px solid var(--c-accent); padding: calc(var(--s-3) - 1.5px) calc(var(--s-6) - 1.5px); }
.button.secondary:hover { filter: none; background: var(--c-tint); }

/* Header and sticky height are measured at runtime; these feed anchor offsets. */
html { scroll-padding-top: calc(var(--header-h, 4rem) + var(--s-4)); scroll-padding-bottom: calc(var(--sticky-cta-h, 4rem) + var(--s-2)); }

/* ---------- header ---------- */
.site-header { position: fixed; inset-inline: 0; top: 0; z-index: 50; background: transparent; }
.site-header[data-state="scrolled"] { background: var(--c-bg); }
.header-inner { display: flex; align-items: center; gap: var(--s-3); min-height: 3.5rem; }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-2); line-height: 1.1; color: var(--c-ink); text-decoration: none; }
.lang-switch { display: flex; align-items: center; gap: var(--s-3); margin-inline-start: auto; }
.lang-switch a { color: var(--c-ink); text-decoration: none; font-size: var(--fs-0); font-weight: 500; padding-block: var(--s-3); }
.lang-switch a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.desktop-nav, .header-cta { display: none; }
.menu-toggle { color: var(--c-ink); }
@media (max-width: 1023px) {
  /* The mobile drawing shows only the other languages in the header; the full
     three-link switcher stays reachable in the drawer. */
  html[data-lang="en"] .header-lang [data-lang-switch="en"],
  html[data-lang="si"] .header-lang [data-lang-switch="si"],
  html[data-lang="ta"] .header-lang [data-lang-switch="ta"] { display: none; }
}
@media (min-width: 1024px) {
  .header-inner { min-height: 4rem; }
  .menu-toggle { display: none; }
  .desktop-nav { display: flex; gap: var(--s-6); margin-inline: auto; }
  .desktop-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-ink); text-decoration: none; font-weight: 500; }
  .desktop-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
  .lang-switch { margin-inline-start: 0; }
  .header-cta { display: inline-flex; }
}

/* ---------- hero ---------- */
.hero { position: relative; }
.hero-media { position: relative; }
.hero-media picture, .hero-media img { display: block; width: 100%; }
.hero-media img { height: auto; }
/* Signature occurrence 1: the sea/sky horizon at exactly 38% of the hero media. */
.hero-horizon { position: absolute; inset-inline: 0; top: 38%; height: 1px; background: var(--c-accent); z-index: 2; }
.hero-copy { position: absolute; top: calc(var(--header-h, 3.5rem) + var(--s-4)); inset-inline: 0; z-index: 3; }
.hero-copy .kicker { margin: 0 0 var(--s-2); font-size: var(--fs-0); font-weight: 600; color: var(--c-ink); }
.hero-panel-row { position: relative; z-index: 3; margin-top: -48px; }
.hero-panel { max-width: 40rem; background: var(--c-tint); border-radius: var(--r-lg); padding: var(--s-6); }
.hero-subline { margin: 0; }
.hero-actions { display: grid; gap: var(--s-3); margin-top: var(--s-6); }
.fact-chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-6) 0 0; padding: 0; }
.fact-chips li { background: var(--c-surface); color: var(--c-ink); border-radius: var(--r-lg); padding: var(--s-1) var(--s-3); font-size: var(--fs-0); font-weight: 500; }
@media (min-width: 769px) {
  .hero-actions { display: flex; flex-wrap: wrap; }
  /* A 16:9 hero at tablet width leaves too little sky for the headline, so the
     media box grows from the top-anchored minimum. The resulting cover crop is
     horizontal only, which keeps the authored horizon at 38% of the box. */
  .hero-media { width: 100%; aspect-ratio: 16 / 9; min-height: 64vh; }
  .hero-media picture { position: absolute; inset: 0; }
  .hero-media img { width: 100%; height: 100%; object-fit: cover; }
  .hero-copy { top: calc(var(--header-h, 3.5rem) + var(--s-3)); }
  .hero-copy h1 { font-size: calc(min(var(--fs-4), 3rem) * var(--scale-heading)); }
}
@media (min-width: 769px) and (max-height: 720px) {
  /* Short landscape tablets: keep the copy above the 38% rule. */
  .hero-copy { top: calc(var(--header-h, 3.5rem) + var(--s-1)); }
  .hero-copy h1 { font-size: calc(1.65rem * var(--scale-heading)); }
}
@media (min-width: 1024px) {
  .hero-media { min-height: 78vh; }
  .hero-copy { top: calc(var(--header-h, 4rem) + var(--s-4)); }
  .hero-copy h1 { font-size: calc(var(--fs-4) * var(--scale-heading)); max-width: 34rem; }
}
@media (max-width: 430px) {
  /* Small phones: hold the headline at the authored clamp minimum so the whole
     copy block stays above the 38% rule in all three scripts. */
  .hero-copy h1 { font-size: calc(min(var(--fs-4), 2.2rem) * var(--scale-heading)); }
}
@media (max-width: 360px) {
  /* At 320px the headline would otherwise cross the 38% rule: tighten the
     start offset and the kicker step, and drop one display step. */
  .hero-copy { top: calc(var(--header-h, 3.5rem) + var(--s-1)); }
  .hero-copy .kicker { margin-bottom: var(--s-1); }
  .hero-copy h1 { font-size: calc(1.75rem * var(--scale-heading)); }
}

/* Signature occurrences 2–7: the same rule, the only divider between sections. */
.horizon-rule { height: 1px; background: var(--c-accent); margin-block: var(--s-16); }

/* ---------- sections ---------- */
.section h2 { margin-bottom: var(--s-6); }
.section-intro { max-width: 44rem; }
.section-intro p, .gallery-heading p { color: var(--c-muted); }

/* about */
.about-grid { display: grid; gap: var(--s-8); margin-top: var(--s-6); }
.prose p { margin: 0 0 var(--s-4); max-width: 42rem; }
.prose p:last-child { margin-bottom: 0; }
.about-figure { margin: 0; position: relative; }
.about-figure picture, .about-figure img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
.image-note { position: absolute; left: var(--s-3); bottom: var(--s-3); background: rgb(18 48 58 / .85); color: #fff; font-size: 11px; font-weight: 500; line-height: 1.7; padding: 0 8px; border-radius: var(--r-sm); }
.highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-6); margin: var(--s-8) 0 0; }
.highlights div { border-top: 1px solid var(--c-line); padding-top: var(--s-2); }
.highlights dt { font-size: var(--fs-0); font-weight: 600; color: var(--c-muted); }
.highlights dd { margin: var(--s-1) 0 0; font-weight: 500; }
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: 7fr 5fr; align-items: start; }
  .highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* services */
.service-list { list-style: none; margin: var(--s-8) 0 0; padding: 0; display: grid; gap: var(--s-6); }
.service-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.service-icon { color: var(--c-accent); }
.service-icon svg { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.service-text h3 { margin: 0 0 var(--s-1); }
.service-text p { margin: 0; color: var(--c-muted); }
.services-note { margin-top: var(--s-8); color: var(--c-muted); font-size: var(--fs-0); }
@media (min-width: 1024px) {
  .service-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-8) var(--s-6); }
  .service-list li { display: block; }
  .service-icon { display: block; margin-bottom: var(--s-3); }
}

/* gallery — 2 columns mobile, 4 desktop, intrinsic heights, packing enhancement */
.gallery-heading { max-width: 46rem; }
.gallery-grid { list-style: none; padding: 0; margin: var(--s-8) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.gallery-link { position: relative; display: block; aspect-ratio: var(--tile-ratio); border-radius: var(--r-md); overflow: hidden; }
.gallery-link picture, .gallery-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sample-badge { position: absolute; left: var(--s-3); bottom: var(--s-3); background: rgb(18 48 58 / .85); color: #fff; font-size: 11px; font-weight: 500; line-height: 1.7; padding: 0 8px; border-radius: var(--r-sm); }
.gallery-grid[data-masonry="true"] { grid-auto-rows: 0.5px; }
.gallery-grid[data-masonry="true"] .gallery-link { aspect-ratio: var(--tile-ratio); height: auto; }
.offer-link[hidden] { display: none; }
.wordmark, .trust-score { font-family: "Fraunces", Georgia, serif; }
.icon-button { flex-shrink: 0; }
.lang-switch a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.header-inner > * { min-width: 0; }
.viewer-image { touch-action: pan-y; }
.sticky-cta a:focus-visible, .button:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 3px; }
.sticky-cta a:focus-visible { outline-color: var(--c-surface); outline-offset: -5px; }
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* trust — centred only here */
.trust-section .wrap { text-align: center; }
.trust-pair { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-8) var(--s-16); margin-top: var(--s-8); }
.trust-score { margin: 0; font-size: calc(var(--fs-4) * var(--scale-heading)); font-weight: 600; color: var(--c-accent); }
.trust-source { margin: var(--s-2) 0 0; font-weight: 500; }
.trust-detail { margin: var(--s-1) 0 0; color: var(--c-muted); font-size: var(--fs-0); }
.trust-disclaimer { max-width: 44rem; margin: var(--s-8) auto 0; color: var(--c-muted); font-size: var(--fs-0); }

/* contact */
.contact-grid { display: grid; gap: var(--s-8); }
.contact-intro { color: var(--c-muted); max-width: 40rem; }
.contact-rows { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: var(--s-3); }
.contact-link { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; min-height: 48px; padding: var(--s-4); background: var(--c-surface); border-radius: var(--r-md); color: var(--c-ink); text-decoration: none; }
.contact-link:hover { background: var(--c-tint); }
.contact-icon { color: var(--c-accent); }
.contact-icon svg { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.contact-label { display: block; font-size: var(--fs-0); font-weight: 500; color: var(--c-muted); }
.contact-value { display: block; font-weight: 600; overflow-wrap: anywhere; }
.contact-block { margin-top: var(--s-6); }
.contact-block h3, .map-column h3 { font-family: var(--font-body); font-size: var(--fs-0); font-weight: 600; color: var(--c-muted); margin: 0 0 var(--s-2); }
.contact-block p, .contact-block address { margin: 0; }
.map-card { margin-top: var(--s-4); aspect-ratio: 4 / 3; background: var(--c-tint); border-radius: var(--r-md); display: grid; overflow: hidden; }
.map-card iframe { width: 100%; height: 100%; border: 0; }
.map-placeholder { display: grid; gap: var(--s-4); justify-items: center; align-content: center; text-align: center; padding: var(--s-6); }
.map-placeholder p { margin: 0; color: var(--c-muted); }
.map-pin { color: var(--c-accent); }
.map-pin svg { width: 40px; height: 40px; display: block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.maps-link { display: inline-flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); min-height: 44px; font-weight: 600; }
@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-12); align-items: start; }
}

/* ---------- footer ---------- */
.site-footer { padding-bottom: calc(var(--sticky-cta-h, 4rem) + var(--s-8)); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-6); }
.footer-top p { margin: var(--s-2) 0 0; color: var(--c-muted); }
.back-top { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; font-weight: 600; }
.footer-bottom { margin-top: var(--s-6); display: grid; gap: var(--s-1); color: var(--c-muted); font-size: var(--fs-0); }
.footer-bottom p { margin: 0; }
.preview-notice { margin-top: var(--s-8); padding: var(--s-4); background: var(--c-tint); border-radius: var(--r-md); font-size: var(--fs-0); }
.preview-notice p { margin: 0; }
.offer-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s-2); font-weight: 600; }
@media (min-width: 1024px) {
  .site-footer { padding-bottom: var(--s-12); }
}

/* ---------- sticky CTA ---------- */
.sticky-cta { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; background: var(--c-accent); }
.sticky-cta a { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: var(--s-2) var(--gutter) calc(var(--s-2) + env(safe-area-inset-bottom)); color: var(--c-accent-ink); font-weight: 600; text-decoration: none; }
@media (min-width: 1024px) {
  .sticky-cta { display: none; }
}

/* ---------- drawer ---------- */
.drawer { margin: 0; inset-block: 0; width: min(22rem, 88vw); max-width: none; max-height: none; height: 100%; padding: var(--s-4); border: 0; border-radius: 0 var(--r-lg) var(--r-lg) 0; background: var(--c-bg); box-shadow: var(--shadow-1); color: var(--c-ink); }
.drawer::backdrop { background: rgb(18 48 58 / .45); }
.drawer, .lightbox { overscroll-behavior: contain; }
h2[id] { scroll-margin-top: calc(var(--header-h, 4rem) + var(--s-4)); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.drawer-lang { margin: var(--s-4) 0 0; }
.drawer-nav { display: grid; gap: var(--s-1); margin-top: var(--s-6); }
.drawer-nav a { font-family: var(--font-display); font-size: var(--fs-2); color: var(--c-ink); text-decoration: none; padding-block: var(--s-2); }
.drawer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.drawer-cta { margin-top: var(--s-6); width: 100%; }

/* ---------- lightbox ---------- */
.lightbox { width: min(56rem, 94vw); max-width: none; padding: 0; border: 0; border-radius: var(--r-md); background: var(--c-bg); color: var(--c-ink); box-shadow: var(--shadow-1); }
.lightbox::backdrop { background: rgb(18 48 58 / .6); }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) var(--s-3); }
.viewer-badge { font-size: 11px; font-weight: 500; line-height: 1.7; padding: 0 8px; border-radius: var(--r-sm); background: rgb(18 48 58 / .85); color: #fff; }
.viewer-image { background: var(--c-ink); display: grid; place-items: center; min-height: 40vh; }
.viewer-image img { max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.viewer-bottom { padding: var(--s-3); }
#viewer-caption { margin: 0; color: var(--c-muted); font-size: var(--fs-0); }
.viewer-controls { display: flex; align-items: center; justify-content: center; gap: var(--s-4); margin-top: var(--s-2); }
.viewer-count { font-weight: 600; }

/* ---------- image failure state ---------- */
.image-unavailable { position: relative; display: block; }
.image-unavailable img { visibility: hidden; }
.image-unavailable::after { content: attr(data-fallback-label); position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-4); background: var(--c-tint); color: var(--c-muted); font-size: var(--fs-0); text-align: center; }

/* ---------- motion: one hero entrance, nothing else automatic ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-media picture { animation: hero-fade var(--t-hero) var(--ease) both; }
  .hero-copy h1 { animation: hero-rise var(--t-hero) var(--ease) both; }
}
@keyframes hero-fade { from { opacity: .92; } }
@keyframes hero-rise { from { transform: translateY(12px); } }
