/* สีหลักจากโลโก้ Calm Dental Clinic: น้ำเงินคราม + เหลือง + ขาว */
:root {
  --navy: #032c70;
  --navy-deep: #021c48;
  --indigo: #2a4d9b;
  --sky: #eef3fb;
  --sky-2: #dde7f7;
  --yellow: #ffd63d;
  --yellow-soft: #fff4c7;
  --white: #ffffff;
  --ink: #0f1d3a;
  --ink-2: #4a5878;
  --line: #d9e1ef;
  --warn: #b4451f;
  --warn-soft: #fbece4;
  --ok: #1f8a4c;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(3, 44, 112, .06), 0 18px 40px -16px rgba(3, 44, 112, .25);
  --font-head: "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", "Anuphan", Georgia, serif;
  --flow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'%3E%3Cpath d='M-20 140C200 40 360 200 600 120S980 10 1180 90s200 50 280-10' fill='none' stroke='%23ffd63d' stroke-opacity='.55' stroke-width='2'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 17px/1.7 var(--font-body); -webkit-font-smoothing: antialiased; }
img, iframe { max-width: 100%; display: block; }
a { color: var(--indigo); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 .5em; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.4rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 76px; }
.brand { display: block; flex: none; }
.brand img { height: 50px; width: auto; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: var(--navy); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--sky); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; color: var(--navy); cursor: pointer; align-items: center; justify-content: center; }

@media (max-width: 960px) {
  .header-inner { gap: 10px; height: 68px; }
  .brand img { height: 42px; }
  .nav-toggle { display: inline-flex; }
  .header-cta { margin-left: auto; }
  .nav { position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 10px; }
  html { scroll-padding-top: 76px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 999px; font: 600 1rem/1 var(--font-body); text-decoration: none; white-space: nowrap; border: 1.5px solid transparent; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 6px 0 -2px var(--yellow); }
.btn-primary:hover { background: var(--indigo); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--sky-2); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-warn { background: var(--warn); color: #fff; }
.btn-warn:hover { background: #943817; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: .95rem; box-shadow: none; }

.eyebrow { display: inline-flex; align-items: center; font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--indigo); margin-bottom: .5em; }
.eyebrow-th { font-family: var(--font-body); font-size: .88rem; letter-spacing: .02em; text-transform: none; }
.eyebrow::before { content: ""; display: inline-block; width: 26px; height: 2px; border-radius: 2px; background: var(--yellow); margin-right: 12px; }
.center .eyebrow::after { content: ""; display: inline-block; width: 26px; height: 2px; border-radius: 2px; background: var(--yellow); margin-left: 12px; }
.eyebrow-warn { color: var(--warn); }
.eyebrow-warn::before { background: var(--warn); }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(36px, 6vw, 80px) 0 clamp(72px, 8vw, 120px);
  background:
    radial-gradient(55% 65% at 92% 8%, rgba(42, 77, 155, .16), transparent 70%),
    radial-gradient(45% 55% at 0% 100%, rgba(255, 214, 61, .20), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--sky) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(3, 44, 112, .10) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(60% 70% at 85% 30%, #000 0%, transparent 75%);
          mask-image: radial-gradient(60% 70% at 85% 30%, #000 0%, transparent 75%);
}
.hero-flow { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(120px, 16vw, 230px); z-index: -1; pointer-events: none; opacity: .9; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3rem); margin-bottom: .15em; }
.squiggle { width: 180px; height: 22px; color: var(--yellow); margin: 0 0 18px; display: block; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 32em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 16px; }
.hero-note { color: var(--ink-2); font-size: .95rem; }
.hero-note a { font-weight: 600; }

.hero-media { position: relative; padding-bottom: 48px; }
.hero-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); }
.hero-media::before { content: ""; position: absolute; right: -26px; top: -26px; width: 130px; height: 130px; border-radius: 50%; background: var(--yellow); z-index: -1; }
.hero-media::after { content: ""; position: absolute; left: -34px; top: 18%; width: 180px; height: 180px; border-radius: 50%; border: 1.5px solid rgba(3, 44, 112, .18); z-index: -1; }
.hero-media { isolation: isolate; }
.status-card { position: absolute; left: -24px; bottom: 0; width: min(320px, 85%); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.status { display: flex; align-items: center; gap: 10px; font-weight: 600; font-family: var(--font-head); color: var(--navy); margin-bottom: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); flex: none; }
.status.is-open .dot { background: var(--ok); box-shadow: 0 0 0 5px rgba(31, 138, 76, .18); }
.status.is-closed .dot { background: var(--warn); }
.hours { margin: 0; font-size: .95rem; }
.hours div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); }
.hours dt { color: var(--ink-2); }
.hours dd { margin: 0; font-weight: 600; color: var(--navy); text-align: right; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { padding-bottom: 0; }
  .hero-media::before { right: -40px; top: -40px; width: 110px; height: 110px; }
  .status-card { position: relative; left: auto; width: auto; margin: -36px 16px 0; }
}
@media (max-width: 480px) { .cta-row .btn { width: 100%; } }

/* ---------- sections ---------- */
.section { padding: clamp(60px, 8vw, 110px) 0; }
.section { position: relative; isolation: isolate; }
.section-sky { background: linear-gradient(180deg, var(--sky) 0%, #f5f8fd 100%); }
.section-sky::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(3, 44, 112, .09) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(115deg, #000 0%, transparent 45%);
          mask-image: linear-gradient(115deg, #000 0%, transparent 45%);
}
.section-dark {
  color: #dbe4f5;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(64, 110, 210, .45), transparent 70%),
    radial-gradient(40% 40% at 100% 100%, rgba(255, 214, 61, .10), transparent 70%),
    var(--navy-deep);
}
.section-dark::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}
.section-dark::after { content: ""; position: absolute; left: 0; right: 0; bottom: 24px; height: 160px; z-index: -1; background: var(--flow) center / 100% 100% no-repeat; opacity: .5; pointer-events: none; }
.section-dark h2 { color: #fff; }
.section-dark .muted { color: #b9c7e4; }
.section-dark .eyebrow { color: var(--yellow); }
#gallery, #contact { background: radial-gradient(50% 60% at 100% 0%, rgba(255, 214, 61, .10), transparent 70%), var(--white); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.two-col { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 88px); align-items: center; }
.collage { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; aspect-ratio: 1 / 1; }
.collage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.c-main { grid-row: 1 / 3; }
.c-bottom { object-position: center; }
.highlights { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.highlights li { padding: 18px 20px 18px 64px; border-radius: var(--radius-sm); background: var(--sky); position: relative; }
.highlights li::before { content: ""; position: absolute; left: 20px; top: 22px; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23032c70' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.highlights h3 { margin-bottom: 2px; }
.highlights p { margin: 0; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .collage { aspect-ratio: 5 / 4; } }

/* fees */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 32px; max-width: 900px; }
.chips a { text-decoration: none; color: #fff; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .22); padding: 7px 16px; border-radius: 999px; font-size: .92rem; font-weight: 500; transition: background .15s ease, color .15s ease; }
.chips a:hover { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.fee-grid { columns: 2 420px; column-gap: 20px; }
.fee-card { break-inside: avoid; background: var(--white); color: var(--ink); border-radius: var(--radius); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .45); margin: 0 0 20px; overflow: hidden; scroll-margin-top: 96px; }
.fee-card header { background: linear-gradient(90deg, var(--sky) 0%, #ffffff 100%); padding: 18px 22px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--yellow); }
.fee-card h3 { color: var(--navy); margin: 0; font-size: 1.18rem; }
.fee-card header p { margin: 0; color: var(--indigo); font-family: var(--font-serif); font-weight: 600; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase; }
.fee-card table { width: 100%; border-collapse: collapse; }
.fee-card tr + tr { border-top: 1px solid var(--line); }
.fee-card th, .fee-card td { padding: 12px 22px; vertical-align: top; }
.fee-card th { text-align: left; font-weight: 500; }
.fee-card th span { display: block; font-size: .78rem; color: var(--ink-2); font-weight: 400; letter-spacing: .02em; }
.fee-card td { text-align: right; white-space: nowrap; font-family: var(--font-head); font-weight: 600; color: var(--navy); }
.fee-card td small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .75rem; color: var(--ink-2); }
@media (max-width: 480px) { .fee-card th, .fee-card td { padding: 11px 16px; } .fee-card td { white-space: normal; } }

/* gallery */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 240px; gap: 14px; }
.gallery li { border-radius: var(--radius); overflow: hidden; background: var(--sky); }
.gallery li.wide { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery li:hover img { transform: scale(1.03); }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; } }
@media (max-width: 480px) { .gallery { grid-auto-rows: 160px; gap: 10px; } }

/* rights */
.rights { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rights li { background: var(--white); border-radius: var(--radius-sm); padding: 18px 22px; border: 1px solid var(--sky-2); }
.rights-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rights h3 { margin: 0; }
.rights p { margin: 6px 0 0; color: var(--ink-2); font-size: .95rem; }
.tag { background: var(--yellow-soft); color: var(--navy); font-weight: 600; font-size: .85rem; padding: 3px 12px; border-radius: 999px; }

/* urgent */
.urgent { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 4vw, 56px); background: var(--warn-soft); border-radius: 28px; padding: clamp(28px, 4vw, 52px); }
.urgent h2 { color: #5d2412; }
.urgent p { color: #6a3a26; }
.urgent-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.urgent-list li { background: var(--white); border-radius: var(--radius-sm); padding: 14px 18px 14px 48px; position: relative; }
.urgent-list li::before { content: "!"; position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; border-radius: 50%; background: var(--warn); color: #fff; font-weight: 700; font-size: .8rem; display: grid; place-items: center; line-height: 1; }
@media (max-width: 860px) { .urgent { grid-template-columns: 1fr; } }

/* visit */
.visit-grid { display: grid; grid-template-columns: 1.1fr .8fr; grid-template-areas: "info facade" "map map"; gap: 24px clamp(28px, 4vw, 56px); align-items: start; }
.visit-grid > div:first-child { grid-area: info; }
.facade { grid-area: facade; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.facts { margin: 0 0 24px; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--sky-2); }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.facts .line { display: block; }
.map { grid-area: map; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--sky-2); background: var(--white); height: 360px; }
.map iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 860px) { .visit-grid { grid-template-columns: 1fr; grid-template-areas: "info" "facade" "map"; } .map { height: 300px; } }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

/* contact */
.qr-grid { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; background: var(--white); border: 1px solid var(--sky-2); border-radius: var(--radius); padding: 22px 18px; text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.qr:hover { border-color: var(--navy); transform: translateY(-3px); box-shadow: var(--shadow); }
.qr img { width: 100%; max-width: 170px; height: auto; margin-bottom: 12px; }
.qr-name { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; color: var(--navy); }
.qr-id { color: var(--ink-2); font-size: .9rem; overflow-wrap: anywhere; text-align: center; }
@media (max-width: 860px) { .qr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .qr { padding: 16px 12px; } }

.contact-band { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--navy); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.contact-band a { display: flex; flex-direction: column; padding: 20px 24px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.contact-band a + a { border-left: 1px solid rgba(255, 255, 255, .14); }
.contact-band a:hover { background: var(--indigo); }
.contact-band span { font-family: var(--font-body); font-weight: 500; font-size: .8rem; color: var(--yellow); letter-spacing: .04em; }
@media (max-width: 760px) { .contact-band { grid-template-columns: 1fr; } .contact-band a + a { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .14); } }
.fine { color: var(--ink-2); font-size: .9rem; text-align: center; }

/* ---------- footer ---------- */
.site-footer { position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(50% 80% at 0% 0%, rgba(64, 110, 210, .35), transparent 70%), var(--navy-deep); color: #c3cee6; padding: 64px 0 28px; font-size: .95rem; border-top: 4px solid var(--yellow); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; bottom: -40px; height: 150px; z-index: -1; background: var(--flow) center / 100% 100% no-repeat; opacity: .35; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.footer-logo img { height: 64px; width: auto; margin-bottom: 12px; }
.footer-name { color: #fff; font-family: var(--font-head); font-weight: 600; margin-bottom: .6em; }
.footer-legal { color: #93a3c6; font-size: .88rem; }
.footer-h { font-family: var(--font-body); font-size: .82rem; font-weight: 600; letter-spacing: .06em; color: var(--yellow); margin-bottom: 12px; }
.footer-links { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 20px; color: #93a3c6; font-size: .85rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- policy pages ---------- */
.doc { padding: clamp(40px, 6vw, 72px) 0 96px; background: linear-gradient(180deg, var(--sky) 0, var(--white) 320px); }
.doc-wrap { max-width: 780px; }
.doc h2 { font-size: 1.3rem; margin-top: 2em; }
.doc h3 { margin-top: 1.6em; }
.doc .doc-h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem); margin-top: 0; }
.doc-meta { color: var(--ink-2); }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .5em; }
.doc address { font-style: normal; background: var(--sky); border-left: 4px solid var(--yellow); border-radius: var(--radius-sm); padding: 18px 22px; margin-bottom: 1em; }
.doc-split { border: 0; border-top: 1px solid var(--line); margin: 64px 0 40px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- 404 ---------- */
.notfound {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  padding: clamp(64px, 10vw, 128px) 0;
  background:
    radial-gradient(55% 65% at 50% 0%, rgba(42, 77, 155, .14), transparent 70%),
    radial-gradient(40% 50% at 100% 100%, rgba(255, 214, 61, .18), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--sky) 100%);
}
.notfound::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; z-index: -1; background: var(--flow) center / 100% 100% no-repeat; }
.notfound-inner { max-width: 640px; }
.notfound-code { font-family: var(--font-serif); font-size: clamp(6rem, 4rem + 10vw, 10rem); font-weight: 600; line-height: 1; color: var(--navy); margin: 0 0 .1em; letter-spacing: .04em; }
.notfound .cta-row { justify-content: center; }
