/* =========================================================================
   Bumrungrad International Hospital — Phuket
   Corporate Identity palette, modern "liquid glass" UI language.

   CI notes honoured in this stylesheet:
   - Composition stays 60–70% white / off-white; CI colours are used only as
     accents (headings, icons, CTA, thin dividers, footer swatches).
   - No embossing, drop-shadow illustration, or colour gradients are used on
     brand marks, headings, or flat surfaces.
   - The single translucency/blur affordance ("liquid glass") is treated as a
     modern *UI chrome* material (pills, cards, nav) rather than a graphic
     treatment of the logo or CI colours themselves — kept intentionally
     restrained (soft blur + 1px hairline + faint elevation only).
   ========================================================================= */

:root {
  /* ---- Corporate Identity colours ---- */
  --cb-golden-brown: #8A6E4B;
  --cb-golden: #B68400;
  --cb-mustard: #DAA900;
  --cb-olive: #7A7F34;
  --cb-dark-grey: #5A656F;
  --cb-light-grey: #8C9D9C;

  /* ---- Neutral / white system (60–70% of composition) ---- */
  --paper: #FFFFFF;
  --paper-warm: #FAF8F5;
  --paper-tint: #F4F3EF;
  --ink: #22262A;
  --ink-soft: var(--cb-dark-grey);

  /* ---- Glass material tokens ---- */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-border-dark: rgba(34, 38, 42, 0.08);
  --glass-blur: 20px;
  --glass-elevation: 0 1px 1px rgba(34, 38, 42, 0.04), 0 8px 24px rgba(34, 38, 42, 0.06);

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* =========================== Headings =========================== */

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.accent { color: var(--cb-golden-brown); font-style: italic; }

.section-kicker {
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cb-golden-brown);
  margin: 0 0 14px;
}
.section-kicker-light { color: rgba(255,255,255,0.75); }

.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  max-width: 18ch;
  margin-bottom: 20px;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 40px;
}

/* =========================== Glass utilities =========================== */

.glass-pill,
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-elevation);
}

.glass-card {
  border-radius: var(--radius-md);
  padding: 28px;
}

/* =========================== Header =========================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 18px clamp(16px, 4vw, 40px) 0;
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 1160px;
  border-radius: var(--radius-pill);
  padding: 10px 10px 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}

.site-header.is-scrolled .header-inner {
  background: var(--glass-bg-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  flex: none;
}

.header-actions { display: flex; align-items: center; }

/* =========================== Buttons =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--cb-golden-brown);
  color: #fff;
}
.btn-primary:hover { background: #7a5f40; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--glass-border-dark);
}
.btn-ghost:hover { border-color: var(--cb-golden-brown); color: var(--cb-golden-brown); }

.btn-glass {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  color: var(--ink);
}
.btn-glass:hover { background: var(--cb-golden-brown); color: #fff; }
.btn-inquiry svg { transition: transform .25s var(--ease); }
.btn-inquiry:hover svg { transform: translateX(3px); }

/* =========================== Hero =========================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--cb-dark-grey);
  padding-top: clamp(96px, 16vh, 160px);
}
.hero-placeholder-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.55);
  text-align: left;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px dashed rgba(255,255,255,0.25);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.hero-placeholder-inner svg { flex: none; width: 20px; height: 20px; }
/* Hidden automatically once a real video source loads — see main.js */
.hero.has-video .hero-placeholder { display: none; }

.hero-scrim {
  position: absolute;
  inset: 0;
  /* Gradient scrim: darkens the video (stronger near the bottom, where
     the text sits) instead of a flat dark tint, so the footage stays
     visible but never competes with the copy on top. No blur — keep
     the footage sharp. */
  background: linear-gradient(
    to bottom,
    rgba(20, 20, 18, 0.22) 0%,
    rgba(20, 20, 18, 0.34) 45%,
    rgba(20, 20, 18, 0.6) 100%
  );
  -webkit-backdrop-filter: blur(0) saturate(140%);
  backdrop-filter: blur(0) saturate(140%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 0 clamp(20px, 5vw, 48px) clamp(64px, 10vh, 120px);
  max-width: 900px;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cb-mustard);
  margin: 0 0 18px;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.06;
  font-weight: 500;
  margin-bottom: 22px;
  /* The global "h1, h2, h3, h4" rule sets a dark --ink colour directly on
     the element, which otherwise overrides the white inherited from
     .hero-content and makes the headline blend into the video. */
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: rgba(255,255,255,0.85);
  max-width: 56ch;
  margin: 0 0 36px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-cta .btn-ghost { border-color: rgba(255,255,255,0.4); color: #fff; }
.hero-cta .btn-ghost:hover { border-color: var(--cb-mustard); color: var(--cb-mustard); }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-pill);
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.scroll-cue span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--cb-mustard);
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

/* =========================== Sections (generic) =========================== */

.section {
  padding: clamp(64px, 10vw, 128px) 0;
  background: var(--paper);
}
.section + .section { border-top: 1px solid var(--glass-border-dark); }

.about { background: var(--paper-warm); }

.statement {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  max-width: 20ch;
  margin-bottom: 28px;
}
.statement-sub {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* =========================== Stat grid =========================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0 64px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--glass-border-dark);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.stat-value {
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--cb-golden-brown);
}
.stat-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* =========================== Press release =========================== */

.press {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  margin-top: 8px;
}

.press-article p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.75;
  margin: 0 0 20px;
}
.press-article p:last-child { margin-bottom: 0; }

.press-aside {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* =========================== Split layout =========================== */

.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.split-reverse { grid-template-columns: 1fr 1.1fr; }
.split-reverse .split-text { order: 2; }
.split-reverse .split-media { order: 1; }

.split-text h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.split-text p { color: var(--ink-soft); }
.split-text .btn { margin-top: 18px; }

.media-card {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  background: var(--paper-tint);
}
.media-card-label {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  color: var(--cb-golden-brown);
}
.media-card-note { font-size: 0.88rem; color: var(--ink-soft); }

.media-card.has-image {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  justify-content: flex-start;
  gap: 0;
}
.media-card-img { object-position: center 40%; }
.media-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-card-tag {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin: 14px 0 0 14px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 18, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.media-card-overlay {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 40px 20px 16px;
  background: linear-gradient(to top, rgba(20, 20, 18, 0.82) 0%, rgba(20, 20, 18, 0.35) 65%, rgba(20, 20, 18, 0) 100%);
}
.media-card-overlay .media-card-label { color: #fff; }
.media-card-overlay .media-card-note { color: rgba(255, 255, 255, 0.85); }

.map-card { padding: 0; overflow: hidden; aspect-ratio: 4 / 3; }
.map-card iframe { width: 100%; height: 100%; border: 0; }

/* =========================== Timeline =========================== */

.timeline-section { background: var(--paper-warm); }

.timeline {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.timeline-item {
  position: relative;
  padding-top: 26px;
  border-top: 2px solid var(--cb-light-grey);
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cb-golden-brown);
}
.timeline-item.is-future { border-top-color: var(--cb-mustard); }
.timeline-item.is-future::before { background: var(--cb-mustard); }

.timeline-year {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  color: var(--cb-golden-brown);
  margin-bottom: 8px;
}
.timeline-body h4 { font-size: 1rem; margin-bottom: 8px; }
.timeline-body p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* =========================== Progress gallery =========================== */

.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0 0;
}

.progress-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.progress-card-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}
.progress-card-trigger:focus-visible {
  outline: 2px solid var(--cb-mustard);
  outline-offset: -2px;
}

.progress-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.progress-card-trigger:hover img,
.progress-card-trigger:focus-visible img {
  transform: scale(1.05);
}

.progress-card-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: #fff;
  background: rgba(20, 20, 18, 0.4);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.progress-card-trigger:hover .progress-card-zoom,
.progress-card-trigger:focus-visible .progress-card-zoom {
  opacity: 1;
  transform: scale(1);
}

.progress-card figcaption {
  padding: 12px 14px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* =========================== Progress gallery lightbox =========================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 40px);
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 10, 0.78);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
}

.lightbox-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
}

.lightbox-figure {
  margin: 0;
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(20, 20, 18, 0.3);
  border: 1px solid var(--glass-border);
}

.lightbox-img {
  width: 100%;
  max-height: 78svh;
  object-fit: contain;
  background: #000;
}

.lightbox-caption {
  padding: 12px 18px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(20, 20, 18, 0.55);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--glass-bg-strong); }
.lightbox-close:active,
.lightbox-nav:active { transform: scale(0.94); }

.lightbox-close {
  top: 10px;
  right: 10px;
}

.lightbox-prev { top: 50%; left: 10px; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 10px; transform: translateY(-50%); }
.lightbox-prev:active { transform: translateY(-50%) scale(0.94); }
.lightbox-next:active { transform: translateY(-50%) scale(0.94); }

.lightbox-nav[disabled] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

body.lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next { width: 38px; height: 38px; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
  .lightbox-close { top: 4px; right: 4px; }
  .lightbox-img { max-height: 64svh; }
  .lightbox-caption { font-size: 0.8rem; padding: 10px 14px; }
}

/* =========================== Inquiry =========================== */

.inquiry {
  background: var(--cb-golden-brown);
  color: #fff;
}
.inquiry .section-title { color: #fff; }
.inquiry .section-lead { color: rgba(255,255,255,0.82); }

.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.inquiry-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.inquiry-card:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-3px);
}
.inquiry-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cb-mustard);
  font-weight: 600;
}
.inquiry-value { font-size: 1rem; font-weight: 500; }

/* =========================== Footer =========================== */

.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--glass-border-dark);
  padding: 48px 0 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-areas:
    "brand links"
    "copy   swatches";
  row-gap: 24px;
  align-items: center;
}
.footer-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-brand p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.footer-links {
  grid-area: links;
  display: flex;
  gap: 20px;
  justify-content: flex-end;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.footer-links a:hover { color: var(--cb-golden-brown); }
.footer-copy {
  grid-area: copy;
  margin: 0;
  font-size: 0.78rem;
  color: var(--cb-light-grey);
  max-width: 60ch;
}
.footer-swatches {
  grid-area: swatches;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.footer-swatches span {
  width: 18px;
  height: 8px;
  border-radius: 4px;
  display: block;
}

/* =========================== Reveal-on-scroll =========================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================== Responsive =========================== */

@media (max-width: 880px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .progress-grid { grid-template-columns: repeat(3, 1fr); }
  .inquiry-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .split-reverse { grid-template-columns: 1fr; }
  .split-reverse .split-text, .split-reverse .split-media { order: initial; }
  .press { grid-template-columns: 1fr; margin-top: 4px; }
  .press-aside { position: static; }
  .footer-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "links"
      "copy"
      "swatches";
  }
  .footer-links, .footer-swatches { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .header-inner { padding: 8px 8px 8px 16px; }
  .brand-text strong { font-size: 0.75rem; }
  .stat-grid, .timeline, .inquiry-grid { grid-template-columns: 1fr; }
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
  .scroll-cue span { animation: none; }
}
