/* =============================================================================
 * 낚시친구 v2 - styles.css
 * 디자인 언어: '새벽 해도(dawn nautical chart)'. 단일 액센트 = buoy orange.
 * 폰트: Gothic A1(본문/UI) + IBM Plex Mono(데이터 숫자). 아이콘: Phosphor(strokeWidth 1.5).
 * Shape Lock: 카드 16px / 소형 컨트롤 12px / 버튼·칩·뱃지 pill. em-dash 미사용.
 * ========================================================================== */

/* ---------- 토큰 (Light = 새벽 안개 위 해도) --------------------------------- */
:root {
  --surface:        #EEF3F6;
  --surface-raised: #FBFDFE;
  --surface-sunken: #E4ECF0;
  --ink:            #0E2233;
  --ink-2:          #46617A;
  --ink-3:          #7C93A5;
  --line:           #D3DEE5;
  --buoy:           #BC4A00;
  --buoy-ink:       #B4470A;

  /* semantic (판단·물때·금어기) */
  --good:   #0E7A63;
  --good-ink: #0A5D4B; --fair-ink: #9F3F00; --rough-ink: #B23434;
  --fair:   #BC4A00;
  --rough:  #D64545;
  --closed: #C0392B;

  /* 타이포 */
  --font-sans: 'Gothic A1', system-ui, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --fs-display: clamp(2rem, 6vw, 2.75rem);
  --fs-h1: 1.75rem;
  --fs-h2: 1.375rem;
  --fs-h3: 1.125rem;
  --fs-body: 1rem;
  --fs-body-2: 0.9375rem;
  --fs-cap: 0.8125rem;
  --fs-label: 0.75rem;

  /* spacing (4px 베이스) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px;

  /* radius (Shape Lock) */
  --r-card: 16px;
  --r-ctrl: 12px;
  --r-pill: 999px;

  /* shadow (네이비 틴트) */
  --sh-sm:   0 1px 2px rgba(14,34,51,.06);
  --sh-card: 0 4px 16px rgba(14,34,51,.08);
  --sh-pop:  0 12px 32px rgba(14,34,51,.12);

  /* motion */
  --ease: cubic-bezier(0.16,1,0.3,1);
  --ease-out: cubic-bezier(0.22,1,0.36,1);
  --dur-fast: 150ms; --dur: 250ms; --dur-slow: 400ms;

  --content: 720px;   /* 읽기 폭 */
  --wide: 1120px;     /* 매트릭스·표 */
  --appbar-h: 56px;
  --tabbar-h: 64px;

  color-scheme: light;
}

/* Dark = 여명의 어두운 해도 (system 기본 + 수동 토글이 이김) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface:#0A1826; --surface-raised:#12293E; --surface-sunken:#0E1F30;
    --ink:#E8EEF2; --ink-2:#9DB2C2; --ink-3:#6C8399; --line:#23405A;
    --buoy:#FF7A2E; --buoy-ink:#FF8A44;
    --good:#35C4AB; --fair:#FF7A2E; --rough:#FF6B6B; --closed:#FF5A47;
    --good-ink:#35C4AB; --fair-ink:#FF8A44; --rough-ink:#FF6B6B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface:#0A1826; --surface-raised:#12293E; --surface-sunken:#0E1F30;
  --ink:#E8EEF2; --ink-2:#9DB2C2; --ink-3:#6C8399; --line:#23405A;
  --buoy:#FF7A2E; --buoy-ink:#FF8A44;
  --good:#35C4AB; --fair:#FF7A2E; --rough:#FF6B6B; --closed:#FF5A47;
  --good-ink:#35C4AB; --fair-ink:#FF8A44; --rough-ink:#FF6B6B;
  color-scheme: dark;
}

/* ---------- 리셋 / 기본 ------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

h1, h2, h3, p, ul, ol { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--buoy-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- 레이아웃 컨테이너 ----------------------------------------------- */
.wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding-inline: var(--s4); }
.wrap-wide { width: 100%; max-width: var(--wide); margin: 0 auto; padding-inline: var(--s4); }
.section { padding-block: var(--s10); }
@media (min-width: 768px) { .section { padding-block: var(--s16); } }
.prose { max-width: 34em; }
.prose p + p { margin-top: var(--s4); }
.prose p { color: var(--ink-2); }

/* ---------- 타이포 유틸 ------------------------------------------------------ */
.display { font-size: var(--fs-display); font-weight: 900; letter-spacing: -0.02em; line-height: 1.12; }
.h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.3; }
.h3 { font-size: var(--fs-h3); font-weight: 700; }
.body-2 { font-size: var(--fs-body-2); color: var(--ink-2); }
.cap { font-size: var(--fs-cap); font-weight: 500; color: var(--ink-3); }
.eyebrow { /* 배급제: 3섹션당 1개 이하 */
  font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--buoy-ink); display: inline-block;
}

/* ---------- 상단 앱바 ------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 40; height: var(--appbar-h);
  display: flex; align-items: center; gap: var(--s3);
  padding-inline: var(--s4);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.brand .dot { color: var(--buoy); }
.appbar .spacer { flex: 1; }
.selector { /* 지역·포인트 pill */
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 6px var(--s3); border-radius: var(--r-pill);
  background: var(--surface-sunken); border: 1px solid var(--line);
  color: var(--ink); font-size: var(--fs-body-2); font-weight: 600; max-width: 60vw;
}
.selector span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-pill); background: transparent; border: none; color: var(--ink-2);
}
.iconbtn:hover { background: var(--surface-sunken); }

/* 데스크톱 내비 (단일 라인) */
.topnav { display: none; }
@media (min-width: 768px) {
  .topnav { display: flex; gap: var(--s5); align-items: center; margin-left: var(--s6); }
  .topnav a { color: var(--ink-2); font-weight: 600; font-size: var(--fs-body-2); }
  .topnav a.active, .topnav a:hover { color: var(--ink); text-decoration: none; }
  .topnav a.active { color: var(--buoy-ink); }
}

/* ---------- 하단 탭바 (모바일) ---------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface-raised); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 0.6875rem; font-weight: 600; text-decoration: none;
}
.tabbar a .ico { width: 24px; height: 24px; }
.tabbar a.active { color: var(--buoy-ink); }
.tabbar a.active .ico { color: var(--buoy); }
@media (min-width: 768px) { .tabbar { display: none; } }

/* ---------- 카드 ------------------------------------------------------------ */
.card {
  background: var(--surface-raised); border-radius: var(--r-card);
  box-shadow: var(--sh-card); padding: var(--s5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card {
    box-shadow: none; border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }
}
:root[data-theme="dark"] .card {
  box-shadow: none; border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.card + .card { margin-top: var(--s4); }

/* 리스트 카드 (썸네일 + 제목 + 요약 + chevron) */
.listcard {
  display: flex; align-items: center; gap: var(--s4);
  background: var(--surface-raised); border-radius: var(--r-card);
  box-shadow: var(--sh-card); padding: var(--s3); text-decoration: none; color: var(--ink);
}
.listcard:hover { text-decoration: none; box-shadow: var(--sh-pop); }
.listcard .thumb { width: 72px; height: 72px; border-radius: var(--r-ctrl); object-fit: cover; background: var(--surface-sunken); flex: none; }
.listcard .meta { flex: 1; min-width: 0; }
.listcard .meta .h3 { margin-bottom: 2px; }
.listcard .meta p { color: var(--ink-2); font-size: var(--fs-body-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listcard .chev { color: var(--ink-3); flex: none; }

/* 정보 카드 (좌측 4px semantic 인디케이터 바) */
.infocard {
  position: relative; background: var(--surface-raised); border-radius: var(--r-card);
  box-shadow: var(--sh-card); padding: var(--s4) var(--s4) var(--s4) var(--s5); overflow: hidden;
}
.infocard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ink-3); }
.infocard.is-good::before { background: var(--good); }
.infocard.is-fair::before { background: var(--fair); }
.infocard.is-rough::before { background: var(--rough); }
.infocard .lbl { display: flex; align-items: center; gap: var(--s2); color: var(--ink-2); font-size: var(--fs-cap); font-weight: 600; }
.infocard .val { font-size: 1.25rem; font-weight: 700; margin-top: 2px; }

/* ---------- 버튼 / CTA ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 12px var(--s5); border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-body); border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast);
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }
/* 1차 = buoy 채움 + 네이비 잉크 텍스트 (대비 ~6:1) */
.btn-primary { background: var(--buoy); color: #0E2233; }
.btn-primary:hover { background: color-mix(in srgb, var(--buoy) 90%, #000); }
/* 2차 = 네이비 채움 + 흰 텍스트 */
.btn-secondary { background: var(--ink); color: var(--surface-raised); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-block { display: flex; width: 100%; }
/* 쿠팡 연계 버튼 */
.cp-link {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 10px var(--s4); border-radius: var(--r-pill);
  background: var(--surface-sunken); border: 1px solid var(--line);
  color: var(--buoy-ink); font-weight: 700; font-size: var(--fs-body-2); text-decoration: none;
}
.cp-link:hover { text-decoration: none; border-color: var(--buoy); }

/* ---------- 칩 / 뱃지 (pill) ------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 6px var(--s3); border-radius: var(--r-pill);
  background: var(--surface-sunken); border: 1px solid var(--line);
  font-size: var(--fs-cap); font-weight: 600; color: var(--ink-2);
}
.chip .ico { width: 16px; height: 16px; }
.chip.on { background: var(--buoy); border-color: var(--buoy); color: #0E2233; }
.badge {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-cap); font-weight: 700;
}
.badge-good  { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-ink, var(--good)); }
.badge-fair  { background: color-mix(in srgb, var(--fair) 16%, transparent); color: var(--fair-ink, var(--buoy-ink)); }
.badge-rough { background: color-mix(in srgb, var(--rough) 16%, transparent); color: var(--rough-ink, var(--rough)); }
.badge-season { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-ink, var(--good)); }
/* 금어기 뱃지: 색 + lock 아이콘 삼중 인코딩 */
.badge-closed { background: color-mix(in srgb, var(--closed) 18%, transparent); color: var(--closed); }

/* mono 물때 뱃지 */
.mul-badge {
  display: inline-flex; align-items: baseline; gap: 2px;
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--surface-raised);
  font-family: var(--font-mono); font-weight: 600; font-size: 1.25rem;
}

/* ---------- 물때 게이지 / 세그먼트 바 -------------------------------------- */
.gauge-track {
  height: 12px; border-radius: var(--r-pill); background: var(--surface-sunken);
  overflow: hidden; position: relative;
}
.gauge-fill {
  height: 100%; border-radius: var(--r-pill); background: var(--buoy);
  width: 0; transition: width 600ms var(--ease-out);
}
.gauge-fill.is-good { background: var(--good); }
.gauge-fill.is-fair { background: var(--fair); }
.gauge-fill.is-rough { background: var(--rough); }
/* 15칸 세그먼트 바 (조금↔사리) */
.segbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.segbar .seg { height: 28px; border-radius: 4px; background: var(--surface-sunken); }
.segbar .seg.weak   { background: color-mix(in srgb, var(--buoy) 25%, var(--surface-sunken)); }
.segbar .seg.strong { background: color-mix(in srgb, var(--buoy) 55%, var(--surface-sunken)); }
.segbar .seg.now    { background: var(--buoy); box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 3px var(--buoy); }

/* 조석 곡선 SVG */
.tide-chart { width: 100%; height: auto; display: block; }
.tide-chart .curve { fill: none; stroke: var(--buoy); stroke-width: 2.5; stroke-linecap: round; }
.tide-chart .area { fill: color-mix(in srgb, var(--good) 8%, transparent); stroke: none; }
.tide-chart .axis { stroke: var(--line); stroke-width: 1; }
.tide-chart .nowline { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.tide-chart .nowdot { fill: var(--buoy); }
.tide-chart text { fill: var(--ink-2); font-family: var(--font-mono); font-size: 11px; }

/* ---------- 표 (물때표·스펙) ------------------------------------------------ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-body-2); }
table.data thead th {
  background: var(--surface-sunken); color: var(--ink-2); font-weight: 700;
  text-align: left; padding: var(--s3) var(--s4); position: sticky; top: 0;
  font-size: var(--fs-cap);
}
table.data tbody td { padding: var(--s3) var(--s4); }
table.data tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-sunken) 45%, transparent); }
table.data td.num { text-align: right; }
table.data th.stickyc, table.data td.stickyc {
  position: sticky; left: 0; background: var(--surface-raised); z-index: 1;
}
table.data thead th.stickyc { background: var(--surface-sunken); z-index: 2; }
.tide-up { color: var(--good); font-weight: 700; }
.tide-down { color: var(--ink); font-weight: 700; }

/* ---------- 시즌 매트릭스 미니 스트립 --------------------------------------- */
.month-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.month-strip .m { height: 20px; border-radius: 3px; background: var(--surface-sunken); position: relative; }
.month-strip .m.avail { background: color-mix(in srgb, var(--good) 20%, transparent); }
.month-strip .m.peak  { background: var(--good); }
/* 금어기: 색 + 대각 해칭 + lock (색 단독 금지) */
.month-strip .m.closed {
  background: var(--closed);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 5px);
}
.month-strip .m.closed::after {
  content: ""; position: absolute; inset: 0; background: currentColor; color: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='9' rx='2' fill='black'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='9' rx='2' fill='black'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/12px no-repeat;
  opacity: .9;
}
.legend { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }
.legend .item { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-cap); color: var(--ink-2); }
.legend .sw { width: 16px; height: 16px; border-radius: 4px; }
.legend .sw.avail { background: color-mix(in srgb, var(--good) 20%, transparent); }
.legend .sw.peak { background: var(--good); }
.legend .sw.closed { background: var(--closed); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 5px); }
.legend .sw.off { background: var(--surface-sunken); }

/* ---------- 가로 scroll-snap 카드 ------------------------------------------ */
.hscroll { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s2); -webkit-overflow-scrolling: touch; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.snapcard { width: 150px; background: var(--surface-raised); border-radius: var(--r-card); box-shadow: var(--sh-card); overflow: hidden; }
.snapcard img { width: 100%; height: 110px; object-fit: cover; background: var(--surface-sunken); }
.snapcard .body { padding: var(--s3); }

/* ---------- FAQ / 아코디언 (grid-rows 기법) -------------------------------- */
.acc { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-item.open { position: relative; }
.acc-item.open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--buoy); }
.acc-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  background: transparent; border: none; padding: var(--s4) var(--s2); text-align: left;
  font-size: var(--fs-h3); font-weight: 700; color: var(--ink);
}
.acc-q .chev { transition: transform var(--dur) var(--ease); color: var(--ink-3); flex: none; }
.acc-item.open .acc-q .chev { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur) var(--ease); }
.acc-item.open .acc-body { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; }
.acc-body .inner { padding: 0 var(--s2) var(--s4); color: var(--ink-2); }

/* ---------- 폼 컨트롤 ------------------------------------------------------- */
.field { display: block; margin-bottom: var(--s4); }
.field > label { display: block; font-size: var(--fs-cap); font-weight: 700; color: var(--ink-2); margin-bottom: var(--s2); }
input[type="text"], input[type="search"], input[type="date"], select {
  width: 100%; padding: 12px var(--s4); border-radius: var(--r-ctrl);
  background: var(--surface-raised); border: 1px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: var(--fs-body);
}
input:focus, select:focus { outline: 2px solid var(--buoy); outline-offset: 1px; }
/* 세그먼트 토글 (서해/남해, 예산 탭) */
.segmented { display: inline-flex; background: var(--surface-sunken); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.segmented button { border: none; background: transparent; padding: 8px var(--s4); border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-body-2); color: var(--ink-2); }
.segmented button.on { background: var(--surface-raised); color: var(--ink); box-shadow: var(--sh-sm); }

/* ---------- 배너 (안전) ----------------------------------------------------- */
.banner {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s4); border-radius: var(--r-card);
  background: color-mix(in srgb, var(--rough) 10%, var(--surface-raised));
  border: 1px solid color-mix(in srgb, var(--rough) 35%, transparent);
}
.banner .ico { color: var(--rough); flex: none; }
.banner p { font-size: var(--fs-body-2); color: var(--ink); }

/* 면책/출처 노트 */
.note { font-size: var(--fs-cap); color: var(--ink-3); line-height: 1.6; }

/* ---------- 히어로 (홈 판단) ----------------------------------------------- */
.hero { padding-block: var(--s8) var(--s6); }
.hero .verdict-row { display: flex; align-items: center; gap: var(--s3); }
.hero .verdict-ico { width: 44px; height: 44px; flex: none; }
.hero .verdict-ico.is-good { color: var(--good); }
.hero .verdict-ico.is-fair { color: var(--fair); }
.hero .verdict-ico.is-rough { color: var(--rough); }
.hero .reason { color: var(--ink-2); margin-top: var(--s3); }
.factor-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s5); }
.hero .cta-row { display: flex; gap: var(--s3); margin-top: var(--s6); flex-wrap: wrap; }

/* ---------- 비대칭 진입 그리드 (온보딩) ------------------------------------ */
.journey { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .journey { grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; }
  .journey .big { grid-row: span 2; }
}
.journey-card {
  display: block; background: var(--surface-raised); border-radius: var(--r-card);
  box-shadow: var(--sh-card); padding: var(--s5); text-decoration: none; color: var(--ink);
  border: 1px solid transparent;
}
.journey-card:hover { text-decoration: none; border-color: var(--buoy); }
.journey-card .step { font-family: var(--font-mono); font-size: var(--fs-cap); color: var(--buoy-ink); font-weight: 600; }
.journey-card .big-title { font-size: var(--fs-h2); font-weight: 800; margin: var(--s2) 0; }

/* ---------- 스켈레톤 시머 --------------------------------------------------- */
.skel { background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--surface-raised) 50%, var(--surface-sunken) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-ctrl); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 스크롤 리빌 ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 푸터 ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-raised); margin-top: var(--s16); }
.site-footer .wrap { padding-block: var(--s10); }
.footer-cta { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-radius: var(--r-card); background: var(--surface-sunken); margin-bottom: var(--s8); }
.footer-cta .ico { color: var(--buoy); flex: none; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s4); }
.footer-grid h4 { font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--s3); }
.footer-grid a { display: block; color: var(--ink-2); font-size: var(--fs-body-2); padding: 3px 0; }
.footer-grid a:hover { color: var(--ink); text-decoration: none; }
.footer-meta { margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--line); }
.footer-meta .brand { font-size: 1rem; }

/* ---------- 유틸 ------------------------------------------------------------ */
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.stack-lg > * + * { margin-top: var(--s8); }
.row { display: flex; align-items: center; gap: var(--s2); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.wrap-gap { display: flex; flex-wrap: wrap; gap: var(--s2); }
.mt2 { margin-top: var(--s2); } .mt4 { margin-top: var(--s4); } .mt6 { margin-top: var(--s6); } .mt8 { margin-top: var(--s8); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }

/* ---------- 해도 지도 (map.js) --------------------------------------------- */
.nf-map-card {
  background: var(--surface-raised); border-radius: var(--r-card);
  box-shadow: var(--sh-card); padding: var(--s3); overflow: hidden;
}
.nf-map-card--compact { max-width: 460px; margin-inline: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nf-map-card { box-shadow: none; border: 1px solid var(--line); }
}
:root[data-theme="dark"] .nf-map-card { box-shadow: none; border: 1px solid var(--line); }
.nf-map { width: 100%; height: auto; display: block; touch-action: manipulation; }

.nf-sea { fill: var(--surface-sunken); }
.nf-graticule { stroke: var(--line); stroke-width: .75; opacity: .55; }
.nf-grid-label { fill: var(--ink-3); font-family: var(--font-mono); font-size: 10px; opacity: .7; }
.nf-shore { fill: none; stroke: color-mix(in srgb, var(--good) 22%, transparent); stroke-width: 9; stroke-linejoin: round; }
.nf-land, .nf-island {
  fill: var(--surface-raised); stroke: var(--ink-3); stroke-width: 1.25;
  stroke-linejoin: round; stroke-linecap: round;
}
.nf-compass { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: .55; }
.nf-compass-n { fill: var(--buoy); }

.nf-mk { cursor: pointer; }
.nf-mk-dot { fill: var(--buoy); stroke: var(--surface-raised); stroke-width: 1.5; transition: r var(--dur-fast) var(--ease); }
.nf-mk[data-beginner="false"] .nf-mk-dot { fill: var(--surface-raised); stroke: var(--buoy); stroke-width: 2; }
.nf-mk-halo { fill: none; stroke: var(--buoy); stroke-width: 2; opacity: 0; transition: opacity var(--dur-fast); }
.nf-mk:hover .nf-mk-halo,
.nf-mk:focus-visible .nf-mk-halo,
.nf-mk.is-sel .nf-mk-halo { opacity: .9; }
.nf-mk.is-sel .nf-mk-dot { r: 7.5; fill: var(--buoy); }
.nf-mk:focus { outline: none; }
.nf-map.is-filtered .nf-mk.is-dim { opacity: .2; }

.nf-legend { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); }
.nf-legend .item { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-cap); color: var(--ink-2); }
.nf-legend .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.nf-legend .dot.full { background: var(--buoy); }
.nf-legend .dot.hollow { background: var(--surface-raised); border: 2px solid var(--buoy); }

/* 지도 상세 카드 */
.nf-detail .nf-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.nf-detail .cta-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }

/* ---------- 포인트 선택 시트 (map.js mountSelector) ------------------------- */
.selector[aria-expanded="true"] { border-color: var(--buoy); color: var(--buoy-ink); }
.nf-sheet { position: fixed; inset: 0; z-index: 60; display: flex; }
.nf-sheet[hidden] { display: none; }
.nf-sheet-backdrop { position: absolute; inset: 0; background: rgba(14,34,51,.45); backdrop-filter: blur(2px); }
.nf-sheet-panel {
  position: relative; margin-top: auto; width: 100%; max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--surface-raised); border-radius: var(--r-card) var(--r-card) 0 0;
  box-shadow: var(--sh-pop); animation: nf-sheet-up var(--dur) var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes nf-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 768px) {
  .nf-sheet { justify-content: flex-end; align-items: flex-start; }
  .nf-sheet-backdrop { background: rgba(14,34,51,.25); }
  .nf-sheet-panel {
    margin: calc(var(--appbar-h) + var(--s2)) var(--s4) 0 auto;
    width: 360px; max-height: 74vh; border-radius: var(--r-card);
    animation: nf-sheet-drop var(--dur) var(--ease-out);
  }
  @keyframes nf-sheet-drop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.nf-sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line);
  background: var(--surface-raised); border-radius: inherit;
}
.nf-sheet-x { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--surface-sunken); border: none; color: var(--ink-2); }
.nf-sheet-x:hover { color: var(--ink); }
.nf-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--s4) var(--s5) var(--s8); }
.nf-grp + .nf-grp { margin-top: var(--s5); }
.nf-grp-h { text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--s2); }
.nf-grp-items { display: flex; flex-direction: column; gap: var(--s2); }
.nf-opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  width: 100%; text-align: left; padding: var(--s3) var(--s4);
  border-radius: var(--r-ctrl); border: 1px solid var(--line);
  background: var(--surface-raised); color: var(--ink);
}
.nf-opt:hover { border-color: var(--buoy); }
.nf-opt:focus-visible { outline: 2px solid var(--buoy); outline-offset: 1px; }
.nf-opt[aria-selected="true"] { border-color: var(--buoy); background: color-mix(in srgb, var(--buoy) 10%, var(--surface-raised)); }
.nf-opt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nf-opt-name { font-weight: 700; }
.nf-opt-right { display: inline-flex; align-items: center; gap: var(--s2); flex: none; }
.nf-opt .nf-check { color: var(--buoy); opacity: 0; }
.nf-opt[aria-selected="true"] .nf-check { opacity: 1; }

/* ---------- 모션 저감 ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .gauge-fill { transition: none; }
}
