/* ===== 문결 정신건강의학과 — base styles ===== */

:root {
  --bg: #FAF8F4;
  --bg-alt: #F2EFE8;
  --ink: #2B2A26;
  --ink-soft: #6B6A62;
  --line: #E6E1D6;
  --accent: #5C7A6A;
  --accent-dark: #43604F;
  --accent-soft: #E7EDE6;
  --accent-contrast: #FBFAF7;
  --dark: #232821;
  --radius: 18px;
  --maxw: 1160px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 12px;
}
.center { text-align: center; }
.eyebrow.center { }

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 120px 0; }
.section h2 { font-size: clamp(24px, 3vw, 34px); }
.section > .section-inner > h2 { margin-bottom: 56px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 18px rgba(0,0,0,0.03);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.logo-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.main-nav {
  display: flex;
  gap: 36px;
}
.main-nav a {
  font-size: 15px;
  color: var(--ink);
  opacity: .78;
  transition: opacity .2s ease;
}
.main-nav a:hover { opacity: 1; }

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

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 100%; height: 2px;
  background: var(--ink);
  transition: transform .25s ease, opacity .25s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: all .2s ease;
  border: 1px solid transparent;
}
.btn-small { padding: 9px 20px; font-size: 14px; }
.btn-large { padding: 17px 40px; font-size: 16px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline-light {
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 28px 80px;
  position: relative;
  background:
    radial-gradient(60% 50% at 50% 0%, #F0F3EE 0%, transparent 70%),
    var(--bg);
}
.hero-inner { max-width: 760px; }
.hero-title {
  font-size: clamp(34px, 5.4vw, 56px);
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.hero-lead {
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 34px;
}
.hero-note {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 46px;
}
.hero-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 0;
  margin: 0;
}
.hero-tags li {
  font-size: 13px;
  color: var(--accent-dark);
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
}

/* ---------- Wave visual (Hero) ---------- */
.wave-visual {
  position: relative;
  height: 96px;
  margin: 40px 0 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.wave-layer {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-position: 0 bottom;
}
.wave-back {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100' preserveAspectRatio='none'%3E%3Cpath d='M0,50 C50,50 50,72 100,72 C150,72 150,50 200,50 C250,50 250,28 300,28 C350,28 350,50 400,50 L400,100 L0,100 Z' fill='%23D7E0D1'/%3E%3C/svg%3E");
  background-size: 400px 100%;
  opacity: 0.8;
  animation: wave-drift-back 22s linear infinite;
}
.wave-front {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100' preserveAspectRatio='none'%3E%3Cpath d='M0,62 C37.5,62 37.5,78 75,78 C112.5,78 112.5,62 150,62 C187.5,62 187.5,46 225,46 C262.5,46 262.5,62 300,62 L300,100 L0,100 Z' fill='%235C7A6A' fill-opacity='0.35'/%3E%3C/svg%3E");
  background-size: 300px 100%;
  opacity: 0.9;
  animation: wave-drift-front 14s linear infinite reverse;
}
@keyframes wave-drift-back {
  from { background-position-x: 0; }
  to { background-position-x: -400px; }
}
@keyframes wave-drift-front {
  from { background-position-x: 0; }
  to { background-position-x: -300px; }
}
@media (prefers-reduced-motion: reduce) {
  .wave-layer { animation: none; }
}
@media (max-width: 640px) {
  .wave-visual { height: 64px; margin-top: 28px; }
}

/* ---------- About ---------- */
.two-col {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 72px;
  align-items: center;
}
.lead-text { font-size: 18px; color: var(--ink); font-weight: 500; }
.signature { margin-top: 28px; font-size: 14px; color: var(--ink-soft); }

/* ---------- Placeholder blocks ---------- */
.ph {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #E9EDE5 0%, #DCE3D7 55%, #CBD6C5 100%);
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  left: 18px;
  bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  background: rgba(255,255,255,0.65);
  padding: 5px 12px;
  border-radius: 999px;
}
.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.25) 0 2px, transparent 2px 22px);
}
.ph-portrait { aspect-ratio: 4/5; width: 100%; }
.ph-square { aspect-ratio: 1/1; width: 100%; margin-bottom: 20px; }
.ph-wide { aspect-ratio: 16/10; width: 100%; margin-bottom: 20px; }
.ph-space { aspect-ratio: 4/3; width: 100%; }

/* ---------- Care cards ---------- */
.card-grid {
  display: grid;
  gap: 22px;
}
.card-grid-5 { grid-template-columns: repeat(5, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

.care-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.care-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(60,70,55,0.08); }
.care-card h3 { font-size: 17px; margin-bottom: 8px; }
.care-card p { font-size: 14px; margin: 0; }

.assess-card, .treat-card { text-align: left; }
.assess-card h3, .treat-card h3 { font-size: 17px; margin-bottom: 6px; }
.assess-card p, .treat-card p { font-size: 14px; margin: 0; }

.assessment { background: var(--bg-alt); }

/* ---------- System flow ---------- */
.system-flow {
  display: flex;
  align-items: stretch;
  gap: 18px;
}
.system-step {
  flex: 1;
  background: var(--accent-contrast);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 26px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}
.system-step h3 { font-size: 17px; margin-bottom: 6px; }
.step-title { color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.system-step p:last-child { font-size: 14px; margin: 0; }
.system-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 18px;
}

/* ---------- Sleep & Stress banner ---------- */
.sleep-stress {
  background: linear-gradient(135deg, var(--dark) 0%, #2E3A31 100%);
  color: #fff;
}
.sleep-stress .eyebrow { color: #C9D8C3; }
.sleep-stress h2 { color: #fff; }
.sleep-stress .banner-text { color: rgba(255,255,255,0.82); }
.sleep-stress .method-list {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 34px;
}

/* ---------- Space gallery ---------- */
.space-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.space-item { margin: 0; }
.space-item:nth-child(1) { grid-column: span 4; }
.space-item:nth-child(2) { grid-column: span 2; }
.space-item:nth-child(3) { grid-column: span 2; }
.space-item:nth-child(4) { grid-column: span 2; }
.space-item:nth-child(5) { grid-column: span 2; }
.space-item figcaption { padding-top: 14px; }
.space-item h3 { font-size: 16px; margin-bottom: 4px; }
.space-item p { font-size: 13px; margin: 0; }

/* ---------- CTA ---------- */
.cta {
  padding: 150px 28px;
  text-align: center;
  background: var(--bg-alt);
}
.cta-inner { max-width: 620px; margin: 0 auto; }
.cta h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 22px; }
.cta p { font-size: 16px; color: var(--ink); margin-bottom: 38px; }
.cta-note { font-size: 12px; color: var(--ink-soft); margin-top: 16px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 64px 28px 28px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-logo { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; margin: 0 0 6px; color: rgba(255,255,255,0.55); }
.footer-links { display: flex; gap: 24px; align-items: flex-start; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,0.7); }
.footer-links a:hover { color: #fff; }
.footer-copy {
  max-width: var(--maxw);
  margin: 20px auto 0;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Responsive ================= */
@media (max-width: 980px) {
  .card-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 44px; }
  .system-flow { flex-direction: column; }
  .system-arrow { transform: rotate(90deg); padding: 4px 0; }
  .space-gallery { grid-template-columns: repeat(2, 1fr); }
  .space-item:nth-child(1) { grid-column: span 2; }
  .space-item:nth-child(n) { grid-column: span 1; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px 28px 24px;
    gap: 4px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: none; }
  .hamburger { display: flex; }
  .header-actions .btn-small { display: none; }
  .section { padding: 84px 0; }
  .card-grid-5, .card-grid-4 { grid-template-columns: 1fr 1fr; }
  .cta { padding: 100px 28px; }
}

@media (max-width: 480px) {
  .card-grid-5, .card-grid-4 { grid-template-columns: 1fr; }
  .space-gallery { grid-template-columns: 1fr; }
}
