/* 공통 바탕 — 리셋, 레이아웃, 머리말·꼬리말, 버튼, 칩, 입력, 상담 시트, 등장 모션 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  letter-spacing: -0.015em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.28;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cta) 70%, var(--brand));
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 스팸 봇만 채우는 숨은 칸 — 사람에게는 보이지도, 탭으로 가지도 않는다 */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 이 덩어리 안에서는 줄을 바꾸지 않는다 (긴 배지 문구가 단어 중간에서 끊기지 않게) */
.nw {
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 레이아웃 ---------- */
.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.container.narrow {
  width: min(100% - var(--gutter) * 2, var(--container-narrow));
}

.section {
  padding-block: var(--space-section);
}

.section.tight {
  padding-block: calc(var(--space-section) * 0.6);
}

.section-head {
  margin-bottom: clamp(2.25rem, 1.6rem + 2.4vw, 3.75rem);
}

.section-head.center {
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--brand);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-title {
  font-size: var(--text-h2);
}

.section-sub {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--text-lead);
  line-height: 1.6;
}

.section-head.center .section-sub {
  margin-inline: auto;
  max-width: 34em;
}

/* ---------- 머리말 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  transition: box-shadow var(--duration-normal) ease;
}

.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.logo .mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--cta);
  font-size: 0.9375rem;
  font-weight: 800;
}

.logo small {
  color: var(--ink-3);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0;
}

.logo img {
  width: 30px;
  height: 30px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a:not(.btn) {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: var(--text-small);
  font-weight: 600;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.nav a:not(.btn):hover {
  background: var(--gray-100);
  color: var(--ink);
}

.nav .ext::after {
  content: '↗';
  margin-left: 3px;
  font-size: 0.8em;
  color: var(--ink-3);
}

@media (max-width: 860px) {
  .nav a:not(.btn) {
    display: none;
  }
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform var(--duration-fast) ease, background var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--cta);
  color: var(--cta-ink);
}

.btn-primary:hover {
  background: var(--cta-hover);
}

.btn-dark {
  background: var(--brand);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--brand-deep);
}

.btn-soft {
  background: var(--gray-100);
  color: var(--ink);
}

.btn-soft:hover {
  background: var(--gray-200);
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  backdrop-filter: blur(8px);
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
}

.btn-lg {
  min-height: 60px;
  padding: 0 32px;
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
}

.btn .arrow {
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- 칩 (체크·라디오) ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  color: var(--ink-2);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.chip span:hover {
  background: var(--gray-200);
}

.chip input:checked + span {
  background: var(--brand);
  color: var(--white);
}

.chip input:checked + span::before {
  content: '';
  width: 5px;
  height: 9px;
  margin: -3px 2px 0 0;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.chip input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--cta) 70%, var(--brand));
  outline-offset: 2px;
}

.chip input:active + span {
  transform: scale(0.96);
}

/* ---------- 입력 ---------- */
.field {
  display: block;
  margin-top: 22px;
}

fieldset.field {
  min-width: 0;
  margin-inline: 0;
  margin-bottom: 0;
  padding: 0;
  border: 0;
}

legend.label {
  padding: 0;
}

.field > .label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 700;
}

.field > .label small {
  margin-left: 4px;
  color: var(--ink-3);
  font-weight: 500;
}

.input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  font-size: 1.0625rem;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.input::placeholder {
  color: var(--ink-3);
}

.input:focus {
  border-color: var(--brand);
  background: var(--white);
}

.input[aria-invalid='true'] {
  border-color: #f04452;
  background: #fff5f6;
}

textarea.input {
  min-height: 110px;
  resize: vertical;
}

.field-error {
  display: none;
  margin-top: 6px;
  color: #e42939;
  font-size: var(--text-xs);
  font-weight: 600;
}

.field.has-error .field-error {
  display: block;
}

.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  color: var(--ink-2);
  font-size: var(--text-small);
  line-height: 1.5;
  cursor: pointer;
}

.agree input {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--brand);
}

.form-note {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: var(--text-xs);
  text-align: center;
}

/* 알림 영역은 항상 그려 두고(화면 낭독기가 바뀐 내용을 읽도록) 내용이 있을 때만 보인다 */
.form-status:not(.is-error):not(.is-info) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1.5;
}

.form-status.is-error {
  background: #fff1f2;
  color: #c71f2f;
}

.form-status.is-info {
  background: var(--brand-tint);
  color: var(--brand);
}

.form-done {
  display: none;
  padding: 24px 0 8px;
  text-align: center;
}

.form-done .check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  animation: pop var(--duration-slow) var(--ease-spring) both;
}

.form-done:focus {
  outline: none;
}

.form-done h3 {
  font-size: 1.375rem;
  margin-bottom: 8px;
}

.form-done p {
  color: var(--ink-2);
}

form.is-done > :not(.form-done) {
  display: none;
}

form.is-done .form-done {
  display: block;
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- 상담 시트 (모바일은 아래에서 올라오고, 넓은 화면은 가운데) ---------- */
.sheet {
  width: min(100%, 560px);
  max-width: 100%;
  max-height: min(92dvh, 860px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-up var(--duration-normal) var(--ease-out-expo);
}

.sheet::backdrop {
  background: rgba(13, 19, 28, 0.48);
  animation: fade-in var(--duration-normal) ease;
}

.sheet .sheet-head {
  position: relative;
  padding: 28px 24px 8px;
}

.sheet .sheet-head h2 {
  font-size: 1.5rem;
}

.sheet .sheet-head p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: var(--text-small);
}

.sheet .close {
  position: absolute;
  right: 16px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background var(--duration-fast) ease;
}

.sheet .close:hover {
  background: var(--gray-100);
}

.sheet .sheet-body {
  padding: 4px 24px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet .sheet-body .btn-block {
  margin-top: 26px;
}

@media (min-width: 640px) {
  .sheet {
    margin: auto;
    border-radius: var(--radius-xl);
  }

  .sheet[open] {
    animation: sheet-in var(--duration-normal) var(--ease-out-expo);
  }

  .sheet .sheet-head {
    padding: 32px 32px 8px;
  }

  .sheet .sheet-body {
    padding: 4px 32px 32px;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(24px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.has-sheet {
  overflow: hidden;
}

/* ---------- 꼬리말 ---------- */
.site-footer {
  padding: 56px 0 120px;
  background: var(--gray-100);
  color: var(--ink-3);
  font-size: var(--text-xs);
  line-height: 1.7;
}

.site-footer .top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--gray-200);
}

.site-footer .brand-line {
  color: var(--ink-2);
  font-size: var(--text-small);
  font-weight: 700;
}

.site-footer .family {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.site-footer .family a {
  color: var(--ink-2);
  font-weight: 600;
}

.site-footer .family a:hover {
  color: var(--ink);
}

.site-footer a[href^='tel:'] {
  white-space: nowrap;
}

.site-footer .bottom {
  padding-top: 24px;
}

.site-footer .bottom p + p {
  margin-top: 6px;
}

/* ---------- 등장 모션 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
