/* ===========================================================
   Colorectal Surgery Sabah — design tokens & base
   Palette derived from the clinic's real logo gradient
   =========================================================== */
:root {
  --navy: #0E2A4D;
  --navy-2: #163C75;
  --blue: #1B6FA3;
  --cyan: #25AAE1;
  --cyan-light: #E9F6FC;
  --ink: #142033;
  --slate: #55637A;
  --slate-light: #8496AC;
  --white: #FFFFFF;
  --surface: #F4F9FC;
  --border: #E1EAF2;
  --shadow: 0 20px 50px -20px rgba(14, 42, 77, 0.25);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--slate); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap; cursor: pointer;
}
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--navy-2), var(--cyan));
  color: #fff; box-shadow: 0 10px 24px -8px rgba(37, 170, 225, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(37, 170, 225, 0.65); }
.btn-outline { background: transparent; color: var(--navy-2); border-color: var(--border); }
.btn-outline:hover { border-color: var(--cyan); color: var(--blue); }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); }
.btn-ghost-light { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.25); }

/* ---------- eyebrow labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 14px;
}
.eyebrow-dark { color: var(--blue); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14, 42, 77, 0.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; color: #fff; line-height: 1.2; }
.brand-text strong { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.brand-text small { font-size: 0.72rem; color: #B9D3E8; }
.main-nav ul { display: flex; gap: 28px; }
.main-nav a { color: #E7F1F8; font-weight: 500; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.main-nav a:hover, .main-nav a.active { color: #fff; border-color: var(--cyan); }
.header-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; border-radius: 2px; }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 45%, var(--blue) 100%);
  padding: 64px 0 0;
}
.hero-bg-grid {
  position: absolute; inset: 0; opacity: 0.12; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 70% 30%, black, transparent 70%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: stretch; }
.hero-copy h1 { color: #fff; }
.hero-sub { color: #CBE0EF; font-size: 1.05rem; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 22px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-badges span {
  font-size: 0.78rem; font-weight: 600; color: #EAF6FC; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25); padding: 7px 14px; border-radius: 999px;
}
.hero-media { position: relative; height: 100%; min-height: 620px; display: flex; justify-content: center; align-items: flex-end; }
.hero-media-glow {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,170,225,0.55), transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.hero-photo { position: relative; height: 600px; max-height: 100%; width: auto; max-width: none; margin: 0 auto; filter: drop-shadow(0 25px 30px rgba(0,0,0,0.4)); }

/* ---------- trust strip ---------- */
.trust-strip { padding: 48px 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.trust-item { text-align: center; padding: 0 12px; border-left: 1px solid var(--border); }
.trust-item:first-child { border-left: none; }
.trust-item strong { display: block; font-family: 'Space Grotesk', sans-serif; color: var(--navy-2); font-size: 1.15rem; margin-bottom: 4px; }
.trust-item span { font-size: 0.85rem; color: var(--slate); }

/* ---------- robotic section ---------- */
.robotic-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.check-list { margin: 20px 0; }
.check-list li {
  position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--ink); font-weight: 500;
}
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-2), var(--cyan));
}
.check-list li::after {
  content: ""; position: absolute; left: 6px; top: 7px; width: 6px; height: 10px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}
.link-arrow { color: var(--blue); font-weight: 600; }
.link-arrow:hover { color: var(--cyan); }
.robotic-visual { display: flex; justify-content: center; }
.robotic-svg { width: 100%; max-width: 340px; }

/* ---------- services ---------- */
.section-heading { max-width: 640px; margin-bottom: 40px; }
.services-section { background: var(--surface); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 22px; display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.service-index { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--cyan); font-size: 1.4rem; }
.service-card p { font-size: 0.92rem; margin-bottom: 10px; }
.service-link { font-size: 0.85rem; font-weight: 700; color: var(--blue); margin-top: auto; }

/* ---------- about preview ---------- */
.about-preview-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 48px; align-items: center; }
.about-preview-media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- CTA banner ---------- */
.cta-banner { background: linear-gradient(120deg, var(--navy), var(--blue)); }
.cta-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-banner h2 { color: #fff; margin-bottom: 8px; }
.cta-banner p { color: #CBE0EF; margin: 0; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer { background: var(--navy); color: #C9DAE8; padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.9fr 1fr 1fr; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-mark { width: 42px; height: 42px; margin-bottom: 14px; }
.footer-brand p { color: #fff; font-weight: 600; margin-bottom: 10px; }
.footer-brand p span { color: #9FBBD3; font-weight: 400; font-size: 0.85rem; }
.footer-note { color: #9FBBD3 !important; font-size: 0.85rem; font-weight: 400 !important; }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 10px; font-size: 0.88rem; color: #B9D3E8; }
.footer-col a:hover { color: var(--cyan); }
.hours-list li { display: flex; justify-content: space-between; gap: 12px; }
.social-row { display: flex; gap: 10px; margin-top: 16px; }
.social-row a {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #fff;
}
.social-row a:hover { background: var(--cyan); border-color: var(--cyan); }
.footer-bottom { display: flex; justify-content: space-between; padding: 20px 24px; font-size: 0.8rem; color: #8FA9C2; flex-wrap: wrap; gap: 8px; }

/* ===========================================================
   Inner pages — shared
   =========================================================== */
.page-hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 100%);
  padding: 64px 0 56px; color: #fff;
}
.page-hero h1 { color: #fff; }
.page-hero-sub { color: #CBE0EF; max-width: 640px; font-size: 1.05rem; }
.page-hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.page-hero-photo img { max-height: 320px; margin: 0 auto; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.35)); }
.page-hero-service { padding-bottom: 64px; }
.container.narrow { max-width: 780px; }
.container.narrow h2 { margin-top: 2em; }
.container.narrow h2:first-child { margin-top: 0; }

/* timeline (About) */
.timeline { margin: 32px 0; border-left: 2px solid var(--border); padding-left: 28px; display: flex; flex-direction: column; gap: 26px; }
.timeline-item { position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: -34px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--border); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border);
}
.timeline-highlight::before { background: linear-gradient(135deg, var(--navy-2), var(--cyan)); box-shadow: 0 0 0 2px var(--cyan); }
.timeline-year { display: block; font-size: 0.8rem; font-weight: 700; color: var(--cyan); letter-spacing: 0.04em; margin-bottom: 4px; }
.timeline-item h3 { margin-bottom: 4px; }
.timeline-item p { margin-bottom: 0; font-size: 0.92rem; }
.timeline-highlight { background: var(--cyan-light); padding: 16px 18px; border-radius: var(--radius-sm); margin-left: -18px; }

.inline-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }

/* services hub */
.services-grid-hub { grid-template-columns: repeat(2, 1fr); }
.service-card-lg { padding: 34px 28px; }

/* service detail */
.robotic-callout { background: var(--cyan-light); }
.conditions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 28px 0; }
.condition-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 22px; }
.condition-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.condition-card p { font-size: 0.92rem; margin-bottom: 0; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.gallery-item { padding: 0; border: none; background: none; cursor: pointer; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery-item img { width: 100%; height: 260px; object-fit: cover; transition: transform 0.2s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 20, 35, 0.92); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 80vh; max-width: 90vw; border-radius: 8px; }
.lightbox p { color: #fff; margin: 0; }
.lightbox-close { position: absolute; top: 20px; right: 24px; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.contact-card h3 { font-size: 0.95rem; margin: 20px 0 4px; color: var(--blue); }
.contact-card h3:first-child { margin-top: 0; }
.contact-card p { margin-bottom: 0; }
.hours-list-light li { color: var(--ink); padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 0.92rem; }
.contact-map { display: flex; flex-direction: column; gap: 20px; }
.contact-map iframe { width: 100%; height: 320px; border: 0; border-radius: var(--radius); }

/* booking form */
.booking-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.booking-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.booking-form label.full { width: 100%; }
.booking-form input, .booking-form textarea {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-family: inherit;
  font-size: 0.95rem; color: var(--ink); background: #fff;
}
.booking-form input:focus, .booking-form textarea:focus { outline: none; border-color: var(--cyan); }
.hidden-field { position: absolute; left: -9999px; }
.form-note { font-size: 0.82rem; color: var(--slate-light); margin: 0; }
.or-divider { text-align: center; color: var(--slate-light); margin: 28px 0; position: relative; }
.or-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.or-divider span { background: #fff; padding: 0 14px; position: relative; font-size: 0.85rem; }
.booking-alt { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.form-modal { position: fixed; inset: 0; background: rgba(10,20,35,0.6); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; }
.form-modal[hidden] { display: none; }
.form-modal-card { background: #fff; border-radius: var(--radius); padding: 40px 32px; max-width: 380px; width: 100%; text-align: center; position: relative; }
.form-modal-logo { width: 48px; height: 48px; margin: 0 auto 16px; }
.form-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--slate); }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 980px) {
  .hero { padding-bottom: 40px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; min-height: 360px; height: auto; }
  .hero-photo { height: 360px; }
  .robotic-grid { grid-template-columns: 1fr; }
  .robotic-visual { order: -1; margin-bottom: 12px; }
  .about-preview-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .trust-item:nth-child(3) { border-left: none; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav { position: fixed; top: 65px; left: 0; right: 0; background: var(--navy); padding: 20px 24px; transform: translateY(-120%); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; }
  .main-nav.open { transform: translateY(0); opacity: 1; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .header-cta .btn-ghost { display: none; }
  .nav-toggle { display: flex; }
  .section { padding: 56px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .cta-banner-inner { flex-direction: column; align-items: flex-start; }
  .page-hero-grid { grid-template-columns: 1fr; }
  .page-hero-photo { order: -1; }
  .services-grid-hub { grid-template-columns: 1fr; }
  .conditions-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .timeline-highlight { margin-left: 0; }
}
