/*
 * SPDX-License-Identifier: Apache-2.0
 * Copyright 2026 CLSOFTLAB (씨엘소프트랩), Dr. Lee Il-guk (이일국)
 * styles.css — 모바일 우선, 라이트/다크(prefers-color-scheme)
 */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1a1d24;
  --muted: #5c6672;
  --border: #e2e6ec;
  --brand: #ff5a2c;
  --brand-2: #ff8a3d;
  --accent: #2b6cff;
  --ok: #17a674;
  --shadow: 0 4px 18px rgba(20, 25, 40, 0.08);
  --radius: 14px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-2: #1d232c;
    --text: #e8ecf2;
    --muted: #9aa5b2;
    --border: #2a313b;
    --brand: #ff6a3d;
    --brand-2: #ff9c5b;
    --accent: #5b8bff;
    --ok: #2bd39a;
    --shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Pretendard", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.3em; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: .98rem; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: .5em .95em; font-size: .86rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: .55em; font-weight: 800; text-decoration: none; letter-spacing: .3px; }
.brand-mark svg { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: #fff; }
.brand-text { font-size: 1.02rem; }

.nav { display: flex; gap: .3em; }
.nav a { padding: .5em .7em; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a:hover { color: var(--text); background: var(--surface-2); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav.open { max-height: 60vh; overflow-y: auto; }
  .nav a { padding: .9em 16px; border-top: 1px solid var(--border); border-radius: 0; }
}

/* ---------- 히어로 ---------- */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0; }
.hero-inner { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
.eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: .8rem; margin: 0 0 .6em; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 900; letter-spacing: -1px; }
.hero .hl { color: var(--brand); }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.4rem 0; }
.hero-stats { display: flex; gap: 1.6rem; margin: 0; padding-top: .6rem; border-top: 1px dashed var(--border); }
.hero-stats dt { color: var(--muted); font-size: .8rem; }
.hero-stats dd { margin: 0; font-size: 1.5rem; font-weight: 800; }
.hero-art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.1fr 1fr; }
}

/* ---------- 섹션 ---------- */
.section { padding: clamp(2.4rem, 6vw, 4rem) 0; }
.section-alt { background: var(--surface-2); }
.section-head { margin-bottom: 1.6rem; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; }
.section-head p { color: var(--muted); margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem;
}
.empty { color: var(--muted); padding: 1rem 0; }
.muted { color: var(--muted); }
.load-error { background: #ffecec; color: #a11; padding: 1rem; text-align: center; }

/* ---------- 필터 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 1.4rem; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.filter-label { font-weight: 700; font-size: .85rem; color: var(--muted); margin-right: .2rem; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: .35em .8em; border-radius: 999px;
  font-size: .85rem; cursor: pointer; font-weight: 600;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 갤러리 ---------- */
.gallery { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.pf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pf-thumb { position: relative; border: 0; padding: 0; cursor: pointer; background: none; display: block; }
.pf-thumb svg { aspect-ratio: 16/9; width: 100%; }
.pf-thumb:hover .mock, .pf-thumb:focus-visible { outline: 2px solid var(--brand); }
.pf-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: .72rem; padding: 2px 6px; border-radius: 5px; }
.pf-body { padding: .9rem 1rem 1.1rem; }
.pf-body h3 { font-size: 1.02rem; }
.pf-sub { color: var(--muted); font-size: .85rem; margin: .1em 0 .6em; }
.pf-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.tag { font-size: .74rem; padding: .2em .6em; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.tag-sport { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); }
.pf-meta { color: var(--muted); font-size: .78rem; margin: 0; }

/* ---------- 패키지 ---------- */
.package-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin-bottom: 2.4rem; }
@media (min-width: 760px) { .package-grid { grid-template-columns: repeat(3, 1fr); } }
.pkg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); border-top: 4px solid hsl(var(--pkg-hue) 75% 50%); display: flex; flex-direction: column; }
.pkg-tag { color: var(--muted); font-size: .88rem; margin: 0 0 .8rem; }
.pkg-price { font-size: 1.7rem; font-weight: 800; margin: 0 0 .6rem; }
.pkg-price span { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: .3em; }
.pkg-desc { font-size: .9rem; color: var(--muted); }
.pkg-feat { list-style: none; padding: 0; margin: .8rem 0; display: flex; flex-direction: column; gap: .35rem; }
.pkg-feat li { font-size: .88rem; padding-left: 1.4em; position: relative; }
.pkg-feat li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.pkg-days { font-size: .82rem; color: var(--muted); margin: .3rem 0 1rem; }
.pkg-card .btn { margin-top: auto; }

/* ---------- 계산기 ---------- */
.calculator { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.calc-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .calc-grid { grid-template-columns: 1.1fr 1fr; } }
.calc-form label, .form-grid label, .contact-form label, .request-form > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 1rem; }
.calc-form input[type=range] { width: 100%; accent-color: var(--brand); }
select, input[type=text], input[type=url], input[type=date], textarea {
  width: 100%; margin-top: .35em; padding: .6em .7em; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; }
.calc-extras { border: 1px solid var(--border); border-radius: 10px; padding: .8rem; margin: 0 0 1rem; }
.calc-extras legend { font-weight: 700; font-size: .85rem; padding: 0 .4em; }
.check { display: flex; gap: .5em; align-items: flex-start; margin-bottom: .5rem; font-weight: 500; cursor: pointer; }
.check input { margin-top: .3em; accent-color: var(--brand); }
.check em { color: var(--brand); font-style: normal; font-weight: 700; }
.check small { display: block; color: var(--muted); font-size: .78rem; }

.calc-result, .request-quote { background: var(--surface-2); border-radius: 10px; padding: 1.1rem; }
.request-quote { margin: 1rem 0; }
.quote-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.quote-table th { text-align: left; font-weight: 500; color: var(--muted); padding: .35em 0; }
.quote-table td { text-align: right; font-weight: 600; padding: .35em 0; }
.quote-table tfoot th, .quote-table tfoot td { border-top: 1px solid var(--border); padding-top: .6em; }
.quote-total th, .quote-total td { font-size: 1.2rem; font-weight: 800; color: var(--brand); }

/* ---------- 폼 ---------- */
.form-grid { display: grid; gap: 0 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 680px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.request-form input[type=range] { accent-color: var(--brand); }
.form-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .6rem; }
.note { font-size: .8rem; color: var(--muted); margin-top: .8rem; }

/* ---------- 내 의뢰 ---------- */
.my-actions { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.request-list { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .request-list { grid-template-columns: repeat(2, 1fr); } }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.req-top h3 { font-size: 1.05rem; margin: 0; }
.req-sub { color: var(--muted); font-size: .85rem; margin: .2em 0 0; }
.req-id { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: .2em .55em; border-radius: 6px; white-space: nowrap; }
.status-bar { list-style: none; display: flex; padding: 0; margin: 1rem 0; counter-reset: s; }
.status-bar li { flex: 1; text-align: center; font-size: .75rem; color: var(--muted); position: relative; padding-top: 1.4rem; }
.status-bar li::before { counter-increment: s; content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--border); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1; }
.status-bar li::after { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.status-bar li:first-child::after { display: none; }
.status-bar li.done { color: var(--text); font-weight: 700; }
.status-bar li.done::before { background: var(--ok); }
.status-bar li.done::after { background: var(--ok); }
.status-bar li.current::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 30%, transparent); }
.req-detail { display: grid; gap: .3rem; margin: .6rem 0; }
.req-detail div { display: flex; gap: .6em; font-size: .85rem; }
.req-detail dt { color: var(--muted); min-width: 5em; }
.req-detail dd { margin: 0; font-weight: 600; }
.ellip { overflow-wrap: anywhere; }
.req-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }

/* ---------- 후기 ---------- */
.review-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .review-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .review-grid { grid-template-columns: repeat(4, 1fr); } }
.review-card { margin: 0; }
.review-stars { color: #ffb400; letter-spacing: 2px; margin-bottom: .5rem; }
.review-card blockquote { margin: 0 0 .8rem; font-size: .9rem; }
.review-card figcaption { color: var(--muted); font-size: .8rem; }

/* ---------- 문의 ---------- */
.contact-form { margin-bottom: 1.4rem; }
.inquiry-list { display: grid; gap: .8rem; }
.inq-head { font-size: 1rem; }
.inq-card { padding: .9rem 1.1rem; }
.inq-name { font-weight: 700; margin: 0 0 .3em; }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0; margin-top: 2rem; }
.footer-inner p { margin: .2em 0; font-size: .85rem; }

/* ---------- 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); }
.modal-panel { position: relative; background: var(--surface); border-radius: var(--radius); max-width: 720px; width: 100%; padding: 1.4rem; box-shadow: var(--shadow); z-index: 1; }
.modal-close { position: absolute; top: .6rem; right: .8rem; border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-video { border-radius: 10px; overflow: hidden; }
.mock-play-btn { cursor: pointer; }
.modal-meta { color: var(--muted); font-size: .85rem; margin: .8rem 0 0; }

/* ---------- 토스트 ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: .8em 1.3em; border-radius: 999px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 90; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- AI 도우미 ---------- */
.ai-badge { display: inline-block; vertical-align: middle; margin-left: .5rem; padding: .15em .7em; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #fff; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; align-items: start; }
.ai-card { display: flex; flex-direction: column; gap: .7rem; }
.ai-card h3 { margin: 0; }
.ai-desc { color: var(--muted); font-size: .9rem; margin: 0; }
.ai-out { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; min-height: 2.5rem; font-size: .9rem; line-height: 1.6; overflow-x: auto; }
.ai-out:empty::before { content: "여기에 AI 제안이 표시됩니다."; color: var(--muted); }
.ai-out.streaming::after { content: "▍"; color: var(--brand); animation: ai-blink 1s steps(2, start) infinite; }
@keyframes ai-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .ai-out.streaming::after { animation: none; } }

/* ---------- 온로드 자동 추천(무인 기능) ---------- */
.digest-section { padding-top: 0; }
.auto-digest { border-left: 4px solid var(--brand); }
.auto-digest-head { display: flex; align-items: center; gap: .3rem; margin: 0 0 .6rem; font-size: clamp(1.05rem, 3vw, 1.25rem); font-weight: 800; }
.auto-digest-out { white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.65; color: var(--text); }
.auto-digest-out.streaming::after { content: "▍"; color: var(--brand); animation: ai-blink 1s steps(2, start) infinite; }
@media (prefers-reduced-motion: reduce) { .auto-digest-out.streaming::after { animation: none; } }
