:root {
  --bg: #f6f1ea;
  --bg-alt: #ede5da;
  --surface: #fffdf9;
  --ink: #2f2a25;
  --ink-soft: #6b6158;
  --accent: #8a9a7b;      /* sage */
  --accent-dark: #4f7f45;  /* logo green */
  --clay: #c49a7c;
  --line: rgba(47, 42, 37, .12);
  --kakao: #fee500;
  --radius: 20px;
  --serif: "Noto Serif KR", serif;
  --sans: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  word-break: keep-all;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
/* blur on a pseudo-element so the fixed mobile nav isn't trapped by backdrop-filter */
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(246, 241, 234, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.header.scrolled { border-color: var(--line); }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; object-fit: cover; border: 1px solid var(--line);
}
.logo-text { font-weight: 700; letter-spacing: .18em; font-size: 14px; line-height: 1.1; }
.logo-text small { display: block; font-weight: 300; font-size: 10px; letter-spacing: .42em; color: var(--ink-soft); }

.menu-btn {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px;
  z-index: 60;
}
.menu-btn span { width: 22px; height: 1.5px; background: var(--ink); transition: transform .3s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

.nav {
  position: fixed; inset: 0; z-index: 55;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 0 28px;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.nav.open { opacity: 1; visibility: visible; }
.nav a { font-family: var(--serif); font-size: 26px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.nav .nav-cta {
  margin-top: 24px; border: 0; text-align: center;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  background: var(--kakao); border-radius: 999px; padding: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 500; font-size: 15px; transition: transform .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border: 1px solid var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex; flex-direction: column; gap: 28px;
  padding: calc(var(--header-h) + 36px) 20px 32px;
  overflow: hidden;
  background: linear-gradient(180deg, #efe6da 0%, var(--bg) 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.spiral {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(138, 154, 123, .45);
  animation: spin 40s linear infinite;
}
.spiral::after {
  content: ""; position: absolute; top: -5px; left: 50%;
  width: 10px; height: 10px; border-radius: 50%; background: var(--clay);
}
.s1 { width: 520px; height: 520px; top: -120px; right: -260px; }
.s2 { width: 360px; height: 360px; top: -40px; right: -180px; animation-duration: 28s; animation-direction: reverse; border-color: rgba(196, 154, 124, .4); }
.s3 { width: 200px; height: 200px; top: 40px; right: -100px; animation-duration: 18s; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-inner { position: relative; max-width: 560px; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 18px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 9.5vw, 56px); line-height: 1.3; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--accent-dark); }
.hero-lead { margin-top: 20px; color: var(--ink-soft); font-size: 15px; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hero-badges li { font-size: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid var(--line); }

/* ---------- Sections ---------- */
.section { padding: 80px 20px; max-width: 760px; margin: 0 auto; }
.section-tag { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--clay); font-weight: 500; margin-bottom: 10px; }
.section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 7vw, 38px); line-height: 1.4; letter-spacing: -.02em; }
.section-desc { color: var(--ink-soft); font-size: 14px; margin-top: 10px; }
.lead { margin-top: 22px; color: var(--ink-soft); font-size: 15.5px; }
.lead strong { color: var(--ink); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 36px; }
.stats div { background: var(--surface); border-radius: 16px; padding: 18px 10px; text-align: center; border: 1px solid var(--line); }
.stats strong { display: block; font-family: var(--serif); font-size: 22px; color: var(--accent-dark); font-weight: 600; }
.stats span { font-size: 12px; color: var(--ink-soft); }

/* Programs: horizontal swipe on mobile */
.programs { max-width: none; padding-left: 0; padding-right: 0; background: var(--bg-alt); }
.programs > .section-tag, .programs > h2, .programs > .section-desc { padding: 0 20px; max-width: 760px; margin-left: auto; margin-right: auto; }
.programs > .section-tag { margin-bottom: 10px; }
.cards {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 28px 20px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cards::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 82%; scroll-snap-align: center;
  background: var(--surface); border-radius: var(--radius); padding: 18px 20px 24px;
  border: 1px solid var(--line);
}
.card-visual {
  height: 150px; border-radius: 14px; margin-bottom: 18px;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.card-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.card-visual span { font-family: var(--serif); font-size: 44px; color: rgba(255,255,255,.9); letter-spacing: .05em; position: relative; }
.card-visual::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); animation: spin 30s linear infinite;
}
.v1 { background: linear-gradient(135deg, #8a9a7b, #5f6e52); }
.v2 { background: linear-gradient(135deg, #c49a7c, #9c7258); }
.v3 { background: linear-gradient(135deg, #a89a8a, #6f6457); }
.v4 { background: linear-gradient(135deg, #9fb1b5, #6a8287); }
.card-tag { font-size: 11px; letter-spacing: .18em; color: var(--clay); font-weight: 500; }
.card h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 4px 0 10px; }
.card p { font-size: 14px; color: var(--ink-soft); }
.card ul { list-style: none; margin-top: 14px; display: grid; gap: 6px; }
.card li { font-size: 13.5px; padding-left: 18px; position: relative; }
.card li::before { content: ""; position: absolute; left: 0; top: 10px; width: 8px; height: 1.5px; background: var(--accent); }

/* Rehab */
.rehab-list { list-style: none; margin-top: 30px; display: grid; gap: 10px; }
.rehab-list li {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border-radius: 16px; padding: 18px; border: 1px solid var(--line);
}
.rehab-list .ico { font-family: var(--serif); font-size: 15px; color: var(--accent-dark); min-width: 26px; padding-top: 1px; }
.rehab-list h3 { font-size: 16px; font-weight: 500; }
.rehab-list p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin-top: 2px; }
.cert {
  margin-top: 24px; display: flex; gap: 16px; align-items: flex-start;
  background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 22px;
}
.cert-seal {
  flex: 0 0 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--clay); color: var(--clay); display: grid; place-items: center; font-size: 18px;
}
.cert-title { font-weight: 500; }
.cert-desc { font-size: 13.5px; opacity: .75; margin-top: 4px; line-height: 1.6; }

/* Process */
.process { border-top: 1px solid var(--line); }
.steps { list-style: none; margin-top: 30px; position: relative; padding-left: 22px; }
.steps::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.steps li { position: relative; padding-bottom: 28px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; left: -22px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.steps span { font-size: 11px; letter-spacing: .18em; color: var(--clay); font-weight: 500; }
.steps h3 { font-size: 18px; font-weight: 500; margin: 2px 0 4px; }
.steps p { font-size: 14px; color: var(--ink-soft); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq h2 { margin-bottom: 20px; }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 32px 20px 0; position: relative;
  font-weight: 500; font-size: 15.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 300; color: var(--accent-dark); transition: transform .3s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 0 20px; font-size: 14px; color: var(--ink-soft); }

/* Contact */
.contact { background: var(--bg-alt); max-width: none; }
.contact > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.contact-grid { display: grid; gap: 10px; margin-top: 28px; }
.contact-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: 16px; padding: 18px; border: 1px solid var(--line);
  transition: transform .2s;
}
.contact-card:active { transform: scale(.98); }
.contact-card.kakao { background: var(--kakao); border-color: transparent; }
.c-ico { font-size: 22px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.6); }
.contact-card strong { display: block; font-weight: 500; }
.contact-card small { color: var(--ink-soft); font-size: 13px; }
.contact-card .arrow { margin-left: auto; font-size: 18px; }

/* Footer */
.footer { padding: 48px 20px 32px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.footer .logo-text { color: var(--ink); margin-bottom: 14px; display: inline-block; }
.footer .fine { font-size: 11px; opacity: .7; margin-top: 6px; }

/* Sticky CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 241, 234, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .35s ease;
}
.sticky-cta.show { transform: none; }
.sticky-cta a { min-height: 50px; display: grid; place-items: center; border-radius: 14px; font-weight: 500; font-size: 15px; }
.sc-sub { flex: 0 0 34%; border: 1px solid var(--line); background: var(--surface); }
.sc-main { flex: 1; background: var(--kakao); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .spiral, .card-visual::before { animation: none; }
}

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }
  .header { padding: 0 32px; }
  .menu-btn { display: none; }
  .nav {
    position: static; opacity: 1; visibility: visible; background: none;
    flex-direction: row; align-items: center; gap: 26px; padding: 0;
  }
  .nav a { font-family: var(--sans); font-size: 14px; padding: 0; border: 0; }
  .nav .nav-cta { margin: 0; padding: 10px 18px; font-size: 14px; }
  .hero { align-items: center; padding-left: 8vw; }
  .hero-actions { flex-direction: row; }
  .s1 { width: 820px; height: 820px; right: -200px; top: -100px; }
  .s2 { width: 580px; height: 580px; right: -80px; top: 20px; }
  .s3 { width: 340px; height: 340px; right: 40px; top: 140px; }
  .section { padding: 110px 32px; }
  .cards { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; padding: 32px; }
  .programs .section-desc { display: none; }
  .rehab-list { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Mobile-first additions ---------- */
.btn-block { display: flex; width: 100%; margin-top: 24px; min-height: 56px; font-size: 16px; }
.btn-block.btn-primary { background: var(--kakao); color: var(--ink); }
.quick {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 4px 12px; font-size: 12.5px; font-weight: 500;
  transition: transform .15s;
}
.quick a:active { transform: scale(.95); }
.quick span { font-size: 24px; line-height: 1; }
@media (min-width: 768px) {
  .hero { min-height: 88vh; justify-content: center; }
  .btn-block { width: auto; display: inline-flex; padding: 0 36px; }
  .quick { max-width: 560px; }
}
