/* 다해 (Dahae) website. Dark theme by default, light on toggle; brand colour comes from the console
   business profile: the server writes it into each page as --brand (Caddy include).
   Palette: teal #1E9EBA, dark teal #187A8F, check yellow #FFD95A, ink #17232C.
   --brand carries white text (buttons, band), so it is the dark teal: white on #187A8F = 4.98:1, on teal only 3.16:1.
   Yellow is a fill or a highlight on dark surfaces, never text on a light one (1.37:1). */
:root {
  --brand: #187A8F;
  /* The brand hue at other lightness levels, so a licensee colour carries through every gradient; with the built-in
     --brand these give the Dahae teals. Browsers without relative colours keep the literal before each. */
  --brand-deep: #12606F;
  --brand-deep: hsl(from var(--brand) h s calc(l - 8));
  --teal: #1E9EBA;
  --teal: hsl(from var(--brand) h s calc(l + 9));
  --sun: #FFD95A;
  --grad-a: #5CC8DE;
  --grad-a: hsl(from var(--brand) h s calc(l + 29));
  --grad-b: #FFD95A;
  --focus: #FFD95A;
  --bg: #0B1217;
  --bg2: #121D24;
  --card: rgba(255, 255, 255, 0.06);
  --card-solid: #1A2830;
  --line: rgba(255, 255, 255, 0.10);
  --ink: #EEF4F7;
  --ink-soft: #C3CFD6;
  --ink-muted: #93A3AD;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 22px;
  --max: 1160px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --grad-a: var(--brand);
  --grad-b: var(--teal);
  --focus: #187A8F;
  --bg: #F7FAFB;
  --bg2: #FFFFFF;
  --card: rgba(255, 255, 255, 0.75);
  --card-solid: #FFFFFF;
  --line: rgba(23, 35, 44, 0.12);
  --ink: #17232C;
  --ink-soft: #3A4A55;
  --ink-muted: #5A6B76;
  --shadow: 0 30px 60px -24px rgba(23, 35, 44, 0.22);
  color-scheme: light;
}

/* Self-hosted subset of Pretendard (scripts/build_fonts.py; fonts/NOTICE). Missing glyphs fall back per character. */
@font-face { font-family: "Dahae Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/DahaeSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Dahae Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/DahaeSans-Bold.woff2") format("woff2"); }
@font-face { font-family: "Dahae Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/DahaeSans-ExtraBold.woff2") format("woff2"); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Dahae Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sun); color: #17232C; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* Aurora background */
.aurora { position: fixed; inset: -20vmax; z-index: -1; pointer-events: none; filter: blur(70px); opacity: 0.55; }
.aurora i { position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: var(--brand); left: 5%; top: 0; }
.aurora i:nth-child(2) { background: var(--teal); right: 0; top: 20%; animation-delay: -7s; opacity: 0.7; }
.aurora i:nth-child(3) { background: #5CC8DE; left: 30%; bottom: 0; animation-delay: -14s; opacity: 0.45; }
:root[data-theme="light"] .aurora { opacity: 0.28; }
@keyframes drift { to { transform: translate(8vmax, -6vmax) scale(1.15); } }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }
/* House with a check inside: the Dahae mark. An owner logo from /v1/brand replaces it (site.js). */
.logo-mark { width: 38px; height: 38px; border-radius: 11px; background: url(icons3d/logo_3d.webp) center / contain no-repeat; display: grid; place-items: center; overflow: hidden; }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
/* The server puts the owner's logo inside the mark; the built-in art shows only without one. */
.logo-mark:has(img) { background: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--ink-soft); padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--ink); background: var(--card); }
.icon-btn, select.lang { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
select.lang { padding: 0 10px; }
@media (max-width: 760px) { .nav-links { display: none; } .nav .tools { margin-left: auto; } }
.tools { display: flex; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; box-shadow: 0 14px 30px -10px var(--brand); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 18px; border-radius: 16px; background: #000; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.18); }
.store small { display: block; font-size: 0.68rem; opacity: 0.8; line-height: 1; }
.store b { display: block; font-size: 1.05rem; line-height: 1.2; }
/* Not yet published: no href (so not focusable or clickable) until site.js sets the store link. */
.store[aria-disabled="true"] { cursor: default; opacity: 0.75; }
.btn-web { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 56px; padding: 0 22px; border-radius: 16px; background: var(--sun); color: #17232C; text-decoration: none; font-weight: 800; font-size: 1.05rem; box-shadow: 0 14px 30px -12px rgba(0,0,0,0.35); }
.btn-web small { font-size: 0.72rem; font-weight: 500; color: #3A4A55; }

/* Hero */
.hero { position: relative; padding: clamp(32px, 6vw, 80px) 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600; font-size: 0.88rem; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 30%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px transparent; } }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); line-height: 1.08; letter-spacing: -0.035em; margin: 18px 0 16px; font-weight: 850; }
h1 .grad { background: linear-gradient(100deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stage { position: relative; aspect-ratio: 1 / 1; max-height: 560px; width: 100%; }
#hero-3d { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero-fallback { position: absolute; inset: 12%; background: url(icons3d/logo_3d_hero.webp) center / contain no-repeat; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.35)); animation: bob 6s ease-in-out infinite; }
.hero.has-3d .hero-fallback { display: none; }
.float-chip { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); font-weight: 700; font-size: 0.92rem; animation: bob 5s ease-in-out infinite; }
.float-chip.a { left: 0; top: 14%; }
.float-chip.b { right: 2%; bottom: 16%; animation-delay: -2.5s; }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* Sections */
section { padding: clamp(56px, 8vw, 110px) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* Service cards with 3D tilt */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 16px; }
  .card .glyph { width: 56px; height: 56px; border-radius: 16px; }
  .card p { display: none; }
  .card h3 { font-size: 1.05rem; margin-top: 12px; }
}
.card { position: relative; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transform-style: preserve-3d; transition: transform 0.25s ease, border-color 0.25s ease; will-change: transform; }
.card:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
/* 3D clay art on a soft tinted plate; the art lifts and tilts while the card is hovered or focused. */
.card .glyph { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; transform: translateZ(40px); background: color-mix(in srgb, var(--hue) 18%, transparent); }
.icon3d { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.22)); transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1); }
.card:hover .icon3d, .item:hover .icon3d { transform: translateY(-5px) scale(1.12) rotate(-5deg); }
.card:active .icon3d { transform: scale(0.92); }
.card h3 { margin: 18px 0 6px; font-size: 1.2rem; transform: translateZ(24px); }
.card p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; transform: translateZ(16px); }
.card .price { margin-top: 16px; font-weight: 800; font-size: 1.15rem; transform: translateZ(30px); }
.card .price small { color: var(--ink-muted); font-weight: 600; font-size: 0.85rem; }
.card .shine { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,0.18), transparent 45%); opacity: 0; transition: opacity 0.3s; }
.card:hover .shine { opacity: 1; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); margin-bottom: 14px; }
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: var(--ink-muted); }

/* Before / after */
.ba { position: relative; max-width: 860px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); user-select: none; touch-action: pan-y; }
.ba .layer { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: clamp(1.2rem, 3vw, 2rem); }
.ba .before { background: repeating-linear-gradient(35deg, #6B5B4B 0 14px, #7A6A58 14px 28px), #6B5B4B; color: #F1E6D8; }
.ba .after { background: radial-gradient(circle at 70% 30%, #fff, #E3F4F8 40%, #BFE6EF); color: #136B7E; clip-path: inset(0 0 0 var(--split, 50%)); }
.ba .handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 4px; background: #fff; transform: translateX(-2px); box-shadow: 0 0 20px rgba(0,0,0,0.3); }
.ba .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #17232C; display: grid; place-items: center; font-size: 1.3rem; box-shadow: var(--shadow); }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* Trust */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } }
.trust .item { padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.trust .item b { display: block; font-size: 1.15rem; margin: 10px 0 4px; }
.trust .item p { margin: 0; color: var(--ink-muted); }
.trust .emoji { display: block; width: 64px; height: 64px; font-size: 2rem; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { border-radius: 18px; background: var(--card); border: 1px solid var(--line); padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; min-height: 48px; align-items: center; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--grad-a); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); }

/* CTA band */
.band { border-radius: 32px; padding: clamp(32px, 6vw, 64px); background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; box-shadow: 0 40px 80px -30px var(--brand); position: relative; overflow: hidden; }
.band h2 { color: #fff; }
.band p { color: #fff; margin: 0; }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; } }

/* Footer */
footer { padding: 48px 0 64px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 0.9rem; background: var(--bg); } /* opaque: the aurora behind would drop small text below 4.5:1 */
footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr; } }
footer a { color: var(--ink-soft); text-decoration: none; display: inline-block; padding: 6px 0; }
footer a:hover { color: var(--ink); }
footer .company span { display: inline-block; margin-right: 12px; }
footer .company a { text-decoration: underline; }
footer .credit { font-size: 0.8rem; margin-top: 4px; }

/* Legal pages */
.doc { max-width: 820px; margin: 0 auto; padding: 48px 0 80px; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.doc h2 { font-size: 1.3rem; margin-top: 36px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
.doc .note { padding: 14px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Chat buttons: shown only when the owner configured them (hidden attribute otherwise). */
.chat-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.chat-fab .fab { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; background: var(--brand, #187A8F); color: #fff; box-shadow: 0 6px 18px rgb(0 0 0 / .25); }
.chat-fab .fab[hidden] { display: none; }
