/* Organic — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Caprasimo:wght@400&family=Figtree:wght@400;600;700&display=swap');

:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;

  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-heading-weight: 400;
  --font-body: "Figtree", system-ui, sans-serif;

  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.washed{filter:saturate(0.6) contrast(0.85) brightness(1.1) opacity(0.94)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* — rounded frame: everything softens, small controls go pill — */
.card, .dialog { border-radius: calc(var(--radius-lg) * 1.15); }
.btn, .tag, .seg, .input { border-radius: 999px; }
.input { padding-inline: 14px; }


/* ==========================================================
   모바일 최적화

   디자인은 그대로 두고 좁은 화면에서만 보정한다.
   기준 세 가지 — 좌우로 새지 않을 것, 손가락으로 누를 수 있을 것,
   논밭에서 읽힐 것.
   ========================================================== */

/* 어떤 요소도 화면 밖으로 새지 않게 */
html { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

/* 긴 문자열(등록번호·이메일·주소)은 어디서든 줄바꿈 */
.reg-list code, .timeline code, .prod-reg,
a[href^="mailto:"], .foot-info span { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  /* 손가락 기준 최소 44px — 전화·메일 링크가 특히 작았다 */
  a[href^="tel:"], a[href^="mailto:"] {
    display: inline-flex; align-items: center;
    min-height: 44px;
  }
  /* 파일 선택 버튼 */
  input[type="file"] { min-height: 44px; }
  input, textarea, select, button { font-size: max(16px, 1em); }  /* iOS 자동 확대 방지 */
}

@media (max-width: 760px) {
  /* 태그가 줄바꿈 금지라 좁은 화면에서 밀어냈다 */
  [style*="white-space:nowrap"] { white-space: normal !important; }
  /* 단, 전화번호는 붙어 있어야 읽힌다 */
  a[href^="tel:"] { white-space: nowrap !important; }
}

@media (max-width: 430px) {
  /* 히어로 장식 원형이 화면을 밀지 않게 */
  section [style*="position:absolute"][style*="border-radius:50%"] {
    max-width: 78vw; max-height: 78vw;
  }
}

@media (max-width: 380px) {
  /* 좁은 폰 — 헤더의 번호를 짧게 */
  header a[href^="tel:"] { padding-inline: 14px !important; font-size: 15px !important; }
}

/* 가로로 넘치는 표·코드는 그 안에서만 스크롤 */
table, pre { display: block; max-width: 100%; overflow-x: auto; }

/* 화면을 눕혔을 때 히어로가 화면을 다 먹지 않게 */
@media (max-height: 480px) and (orientation: landscape) {
  section > div[style*="border-radius"] { padding-block: 28px !important; }
}

/* 움직임을 줄이도록 설정한 기기 존중 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================
   인라인 스타일 덮어쓰기

   이 디자인은 요소마다 style="" 을 직접 달아 놓았다.
   인라인 스타일은 스타일시트를 이기므로, 좁은 화면 보정은
   반드시 !important 로 눌러야 먹는다.
   (실제로 @media 로 걸어둔 nav 숨김이 인라인 display:flex 에 밀려
    320px 화면에서 문서 폭이 567px 까지 벌어져 있었다)
   ========================================================== */

@media (max-width: 880px) {
  .nav-pills { display: none !important; }

  /* 헤더가 한 줄에 안 들어가면 줄이거나 접는다 */
  header > div {
    gap: 12px !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
  }
  header a[href^="tel:"] {
    min-width: 0 !important;
    padding: 0 16px !important;
    font-size: 16px !important;
    overflow: hidden !important;
  }
  header a[href^="tel:"] svg { flex: none; }
}

@media (max-width: 400px) {
  /* 아주 좁은 폰 — 헤더 번호는 아이콘만 남기고, 로고도 줄인다 */
  header a[href^="tel:"] { padding: 0 13px !important; font-size: 0 !important; gap: 0 !important; }
  header a[href^="tel:"] svg { width: 22px; height: 22px; font-size: 16px; }
  header > div > a:first-child span:last-child { font-size: 19px !important; }
  header > div > a:first-child span:first-child { width: 40px !important; height: 40px !important; }
}

/* 어떤 자식도 부모보다 넓어지지 못하게 (그리드·플렉스 공통 함정) */
@media (max-width: 880px) {
  main *, header *, footer * { min-width: 0; }
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* 파일 선택 칸 높이 */
input[type="file"] { min-height: 44px !important; }

/* ── 320px 급 좁은 화면에서 마지막으로 새는 곳 ──────────── */

@media (max-width: 430px) {
  /* 1) 히어로 장식 원형이 오른쪽으로 삐져나온다 */
  section div[style*="border-radius:50%"][style*="position:absolute"] {
    right: -30% !important;
    width: 74vw !important; height: 74vw !important;
  }

  /* 2) '전화 문의 010-...' 버튼이 한 줄을 고집해 넘친다 */
  a[href^="tel:"][style*="min-height:60px"] {
    width: 100% !important;
    padding-inline: 14px !important;
    font-size: 17px !important;
  }

  /* 3) 섹션 안쪽 여백이 화면보다 커지는 경우 */
  section > div, main > div > div {
    max-width: 100% !important;
  }
  [style*="padding:clamp"] { padding-inline: 18px !important; }
}

/* 어떤 블록도 부모를 넘지 않게 (최후의 안전망) */
main *, header *, footer * { max-width: 100%; }

/* ── 좁은 화면에서 마지막까지 남던 12px ────────────────────
   원인 둘.
   1) 폼이 display:grid 인데 input 은 기본 최소 너비(약 20자)를 갖는다.
      그리드 항목의 min-width 기본값이 auto 라 칸이 그만큼 벌어진다.
   2) 하단 고정 바는 body 바로 아래라 앞서 건 min-width:0 이 닿지 않았다.
   ------------------------------------------------------ */

form, form * { min-width: 0; }
input, textarea, select {
  max-width: 100%;
  box-sizing: border-box;
}

.call-bar { width: 100%; max-width: 100vw; box-sizing: border-box; }
.call-bar > * { min-width: 0; }

/* body 직계 요소도 화면을 넘지 않게 */
body > * { max-width: 100vw; }
