/* =========================================================
   하이라잇코칭 v3 — 벤토 그리드 · 굵은 고딕 · 다크모드 · 스크롤 연출
   ========================================================= */
@layer reset, tokens, base, layout, components, pages, motion, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  img, svg { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  a { color: inherit; }
  address { font-style: normal; }
  table { border-collapse: collapse; }
}

@layer tokens {
  :root {
    color-scheme: light;
    --bg: #F6F5F1;
    --surface: #FFFFFF;
    --surface-2: #FAF9F5;
    --ink: #111111;
    --ink-2: #3A3A38;
    --muted: #6E6B63;
    --line: #E7E4DC;
    --line-2: #D6D2C7;
    --accent: #FFD23F;
    --accent-hover: #FFC514;
    --accent-ink: #111111;
    --accent-soft: #FFF6CC;
    --accent-text: #7A5B00;
    --mark: #FFD23F;
    --tile-dark: #111111;
    --tile-dark-ink: #F6F5F1;
    --tile-dark-muted: #A8A59C;
    --glass: rgb(246 245 241 / .78);
    --shadow: 0 1px 2px rgb(17 17 17 / .04), 0 8px 24px rgb(17 17 17 / .06);
    --ok: #1F7A55;
    --error: #B3261E;

    --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

    --fs-xs: .8125rem;
    --fs-sm: .9375rem;
    --fs-md: 1.0625rem;
    --fs-lg: clamp(1.125rem, 1.05rem + .3vw, 1.3125rem);
    --fs-xl: clamp(1.375rem, 1.2rem + .7vw, 1.75rem);
    --fs-2xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.625rem);
    --fs-hero: clamp(2.75rem, 1.2rem + 6.6vw, 6.25rem);

    --gutter: clamp(1rem, .5rem + 2vw, 2rem);
    --page: 78rem;
    --measure: 42rem;
    --header-h: 64px;
    --r-xs: 8px;
    --r-sm: 14px;
    --r-md: 20px;
    --r-lg: 28px;
    --ease: cubic-bezier(.2, .8, .2, 1);
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0F0F0E;
    --surface: #1A1A18;
    --surface-2: #222220;
    --ink: #F6F5F1;
    --ink-2: #CFCCC3;
    --muted: #9A968C;
    --line: #2C2B28;
    --line-2: #3A3934;
    --accent: #FFD23F;
    --accent-hover: #FFDD66;
    --accent-ink: #111111;
    --accent-soft: #2E2811;
    --accent-text: #FFD23F;
    --mark: rgb(255 210 63 / .55);
    --tile-dark: #FFD23F;
    --tile-dark-ink: #111111;
    --tile-dark-muted: #5C4B12;
    --glass: rgb(15 15 14 / .78);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
    --bg: #0F0F0E;
    --surface: #1A1A18;
    --surface-2: #222220;
    --ink: #F6F5F1;
    --ink-2: #CFCCC3;
    --muted: #9A968C;
    --line: #2C2B28;
    --line-2: #3A3934;
    --accent: #FFD23F;
    --accent-hover: #FFDD66;
    --accent-ink: #111111;
    --accent-soft: #2E2811;
    --accent-text: #FFD23F;
    --mark: rgb(255 210 63 / .55);
    --tile-dark: #FFD23F;
    --tile-dark-ink: #111111;
    --tile-dark-muted: #5C4B12;
    --glass: rgb(15 15 14 / .78);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    }
  }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 72px); interpolate-size: allow-keywords; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--fs-md);
    line-height: 1.7;
    letter-spacing: -.012em;
    word-break: keep-all;
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss06";
  }
  h1, h2, h3 { line-height: 1.25; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
  p { text-wrap: pretty; }
  a { text-decoration-thickness: 1px; text-underline-offset: .2em; }
  :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
  ::selection { background: var(--accent); color: var(--accent-ink); }
}

@layer layout {
  .wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
  .skip { position: absolute; left: var(--gutter); top: -100px; z-index: 100; padding: .6rem 1rem; background: var(--ink); color: var(--bg); border-radius: var(--r-xs); }
  .skip:focus { top: 12px; }

  .hd { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid transparent; transition: border-color .2s; view-transition-name: site-header; }
  .hd.is-scrolled { border-bottom-color: var(--line); }
  .hd__in { display: flex; align-items: center; gap: .75rem; height: var(--header-h); }
  .logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; white-space: nowrap; font-weight: 800; font-size: 1.25rem; letter-spacing: -.04em; }
  .logo__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 15px; letter-spacing: 0; }
  .hd__nav { display: none; gap: .25rem; margin-left: auto; }
  .hd__nav a { padding: .45rem .85rem; border-radius: 999px; text-decoration: none; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
  .hd__nav a:hover { background: var(--surface); color: var(--ink); }
  .hd__tools { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
  .hd__nav + .hd__tools { margin-left: .5rem; }
  .hd__call { display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .hd__call:hover { background: var(--accent); color: var(--accent-ink); }
  @media (max-width: 420px) { .hd__call { padding: 0 .85rem; } .logo { font-size: 1.125rem; } }
  @media (min-width: 900px) { .hd__nav { display: flex; } }

  .crumbs { font-size: var(--fs-xs); color: var(--muted); padding-top: 1.25rem; }
  .crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .4rem; }
  .crumbs li + li::before { content: "›"; margin-right: .4rem; color: var(--line-2); }
  .crumbs a { text-decoration: none; }
  .crumbs a:hover { color: var(--accent-text); text-decoration: underline; }

  .stack-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1rem, .6rem + 1.2vw, 1.5rem); padding-block: 1.25rem 4rem; }
  .panel { background: var(--surface); border-radius: var(--r-lg); padding: clamp(1.5rem, 1rem + 2.4vw, 3rem); content-visibility: auto; contain-intrinsic-size: auto 700px; }
  .panel--flat { background: transparent; padding-inline: 0; }

  .ft { color: var(--muted); font-size: var(--fs-sm); padding-block: 3rem calc(3rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .ft__links { display: flex; gap: 1.25rem; margin-bottom: 1rem; }
  .ft__links a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
  .ft__links a:hover { color: var(--accent-text); }
  .ft p { max-width: var(--measure); }
  .ft__date { margin-top: .5rem; font-size: var(--fs-xs); }
  body.has-bar .ft { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
}

@layer components {
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.125rem; padding: .75rem 1.5rem; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: var(--fs-md); text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
  .btn:active { transform: scale(.98); }
  .btn svg { width: 1.125rem; height: 1.125rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .btn--accent { background: var(--accent); color: var(--accent-ink); }
  .btn--accent:hover { background: var(--accent-hover); }
  .btn--ghost { border-color: var(--line-2); background: var(--surface); color: var(--ink); }
  .btn--ghost:hover { border-color: var(--ink); }
  .btn--light { background: var(--accent); color: #111; }
  .btn--light:hover { background: #FFC514; }
  .btn--glass { border-color: rgb(255 255 255 / .35); color: #fff; background: rgb(255 255 255 / .08); }
  .btn--glass:hover { background: rgb(255 255 255 / .16); }
  .i { width: 1.25rem; height: 1.25rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  .sh { margin-bottom: clamp(1.25rem, 1rem + 1vw, 2rem); max-width: var(--measure); }
  .sh__kicker { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .75rem; padding: .25rem .7rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-xs); font-weight: 700; }
  .sh h2 { font-size: var(--fs-2xl); }
  .sh p { margin-top: .75rem; color: var(--muted); }

  .gist { padding: 1.25rem 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .gist__label { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--accent-text); margin-bottom: .35rem; }
  .gist p { font-size: var(--fs-lg); line-height: 1.65; font-weight: 600; letter-spacing: -.02em; }
  .gist strong { color: var(--accent-text); }
  .prose { max-width: var(--measure); color: var(--ink-2); }
  .prose p + p { margin-top: 1em; }
  .mt { margin-top: 1.5rem; }

  .chips { display: flex; flex-wrap: wrap; gap: .4rem; }
  .chip { display: inline-flex; align-items: baseline; gap: .3rem; padding: .3rem .75rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
  .chip small { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
  .chip--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

  .facts { display: grid; }
  .facts > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding-block: .85rem; border-top: 1px solid var(--line); }
  .facts > div:first-child { border-top: 0; padding-top: 0; }
  .facts dt { color: var(--muted); font-size: var(--fs-sm); }
  .facts dd { font-weight: 600; }

  /* 섹션 내비 (가로 칩, 스크롤 스파이) */
  .secnav { position: sticky; top: var(--header-h); z-index: 40; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
  .secnav ol { display: flex; gap: .25rem; overflow-x: auto; padding-block: .6rem; scrollbar-width: none; scroll-snap-type: x proximity; }
  .secnav ol::-webkit-scrollbar { display: none; }
  .secnav a { display: block; white-space: nowrap; padding: .4rem .9rem; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; scroll-snap-align: start; transition: background-color .2s, color .2s; }
  .secnav a:hover { color: var(--ink); background: var(--surface); }
  .secnav a[aria-current="true"] { background: var(--ink); color: var(--bg); }

  /* 아코디언 */
  .qa { display: grid; gap: .5rem; }
  .qa details { border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
  .qa details[open] { background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow); }
  .qa summary { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; cursor: pointer; list-style: none; font-weight: 700; font-size: var(--fs-md); line-height: 1.5; }
  .qa summary::-webkit-details-marker { display: none; }
  .qa summary::after { content: ""; flex: none; margin-left: auto; width: 28px; height: 28px; border-radius: 999px; background:
      linear-gradient(currentColor, currentColor) center / 11px 1.75px no-repeat,
      linear-gradient(currentColor, currentColor) center / 1.75px 11px no-repeat,
      var(--surface);
    border: 1px solid var(--line-2); transition: transform .3s var(--ease); }
  .qa details[open] summary::after { transform: rotate(45deg); }
  .qa__a { padding: 0 1.25rem 1.25rem; color: var(--ink-2); max-width: 48rem; }
  .qa details::details-content { block-size: 0; overflow: hidden; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
  .qa details[open]::details-content { block-size: auto; }
  @media (prefers-reduced-motion: reduce) { .qa details::details-content { transition: none; } }

  /* 벤토 */
  .bento { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; border-radius: var(--r-md); background: var(--surface); min-width: 0; }
  .tile__label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
  .tile__big { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
  .tile__val { font-weight: 700; line-height: 1.45; }
  .tile__big--md { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
  .tile__sub { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
  .tile--dark .tile__sub { color: var(--tile-dark-muted); }
  .tile--dark { background: var(--tile-dark); color: var(--tile-dark-ink); }
  .tile--dark .tile__label { color: var(--tile-dark-muted); }
  .tile--accent { background: var(--accent); color: var(--accent-ink); text-decoration: none; justify-content: space-between; transition: background-color .2s; }
  .tile--accent:hover { background: var(--accent-hover); }
  .tile--accent .tile__label { color: rgb(17 17 17 / .65); }
  .tile--accent .tile__go { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: var(--fs-lg); }
  .tile--accent .tile__go svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.8; }
  .tile--wide, .tile--mfull { grid-column: span 2; }
  @media (min-width: 640px) { .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tile--tall { grid-row: span 2; } .tile--w2 { grid-column: span 2; } .tile--wide { grid-column: span 4; } }

  /* 학년 카드 */
  .grades { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(16rem, 82%); gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; margin-inline: calc(-1 * clamp(1.5rem, 1rem + 2.4vw, 3rem)); padding-inline: clamp(1.5rem, 1rem + 2.4vw, 3rem); scrollbar-width: thin; }
  @media (min-width: 900px) { .grades { grid-auto-flow: row; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; } }
  .grade { scroll-snap-align: start; display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem 1.25rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .grade__name { display: inline-flex; align-self: flex-start; padding: .25rem .8rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 800; }
  .grade:first-child .grade__name { background: var(--accent); color: var(--accent-ink); }
  .grade__task { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.03em; line-height: 1.35; }
  .grade__q { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
  .grade p { font-size: var(--fs-sm); color: var(--ink-2); }
  .grade__note { padding: .6rem .8rem; border-radius: var(--r-xs); background: var(--accent-soft); color: var(--accent-text) !important; font-weight: 600; }
  .grade__focus { margin-top: auto; padding-top: .75rem; border-top: 1px dashed var(--line-2); color: var(--muted) !important; }
  .grade__focus b { display: block; font-size: var(--fs-xs); color: var(--ink); }

  /* 시험 진행 바 */
  .track { position: relative; display: grid; gap: 1rem; margin-top: 1.75rem; }
  .track li { position: relative; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .track__d { display: grid; place-items: center; height: 2.5rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
  .track li:last-child .track__d { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .track__t { font-weight: 800; line-height: 1.4; }
  .track__t span { display: block; margin-top: .2rem; font-weight: 500; font-size: var(--fs-sm); color: var(--muted); }
  .track__bar { display: none; }
  @media (min-width: 760px) {
    .track { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; padding-top: 1.25rem; }
    .track li { grid-template-columns: none; }
    .track__d { justify-self: start; padding-inline: 1rem; }
    .track__bar { display: block; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
    .track__bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--line-2), var(--accent)); transform-origin: left; }
  }

  /* 과목 */
  .subjects { display: grid; gap: .75rem; }
  @media (min-width: 760px) { .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .subject { padding: 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .subject h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; font-size: var(--fs-xl); margin-bottom: .6rem; }
  .subject h3 small { font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text); }
  .subject p { color: var(--ink-2); }
  .note { margin-top: .75rem; padding: 1.25rem 1.5rem; border-radius: var(--r-md); border: 1px dashed var(--line-2); color: var(--ink-2); }
  .note .chips { margin-top: .75rem; }

  /* 학교 */
  .schools { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
  .school { display: inline-flex; align-items: center; gap: .6rem; padding: .9rem 1.25rem; border-radius: 999px; background: var(--tile-dark); color: var(--tile-dark-ink); font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.03em; }
  .school .i { color: var(--accent); }
  :root[data-theme="dark"] .school .i { color: var(--accent-hover); }

  /* 2단 + 단계 */
  .duo { display: grid; gap: .75rem; }
  @media (min-width: 860px) { .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .duo > div { padding: 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .duo h3 { font-size: var(--fs-xl); margin-bottom: .75rem; }
  .duo .lead { font-weight: 600; color: var(--ink); line-height: 1.65; }
  .duo .lead + p { margin-top: .75rem; color: var(--ink-2); font-size: var(--fs-sm); }
  .steps { display: grid; gap: .5rem; counter-reset: s; margin-top: .75rem; }
  .steps li { counter-increment: s; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .25rem 1rem; align-items: center; padding: 1rem 1.25rem; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
  .steps li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 800; }
  .steps h4 { font-size: var(--fs-md); font-weight: 800; }
  .steps p { color: var(--ink-2); font-size: var(--fs-sm); }
  @media (min-width: 900px) { .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); } .steps li { grid-template-columns: none; align-content: start; } .steps li::before { grid-row: auto; margin-bottom: .5rem; } }
  .subhead { font-size: var(--fs-xl); margin-top: 2rem; }

  /* 정보 · 방문 벤토 */
  .info-bento { display: grid; gap: .75rem; }
  @media (min-width: 900px) { .info-bento { grid-template-columns: 1.1fr 1fr; grid-template-rows: auto auto; } .info-bento .map-tile { grid-row: span 2; } }
  .info-bento > * { padding: 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
  .info-bento h3 { font-size: var(--fs-md); margin-bottom: .75rem; }
  .strengths { display: grid; gap: .4rem; margin-top: 1rem; }
  .strengths li { display: flex; gap: .5rem; align-items: flex-start; font-weight: 600; }
  .strengths .i { color: var(--accent-text); margin-top: .2rem; }
  .legal { margin-top: .75rem; font-size: var(--fs-xs); color: var(--muted); }
  .map { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
  .map__canvas { position: absolute; inset: 0; }
  .map__fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 1.5rem; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
  .map-addr { display: flex; gap: .5rem; margin-block: 1rem; color: var(--ink-2); font-weight: 600; }
  .map-addr .i { color: var(--accent-text); margin-top: .2rem; }

  /* 생활권 링크 */
  .places { display: flex; flex-wrap: wrap; gap: .5rem; }
  .places a { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.25rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.03em; text-decoration: none; transition: border-color .2s, background-color .2s; }
  .places a span { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); letter-spacing: 0; }
  .places a:hover { border-color: var(--accent); background: var(--accent-soft); }

  /* 상담 띠 */
  .cta { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(2rem, 1.2rem + 4vw, 4rem); background: radial-gradient(120% 140% at 100% 0%, #3A3207 0%, #171613 45%, #0B0B0A 100%); color: #fff; }
  .cta h2 { font-size: var(--fs-2xl); max-width: 22ch; }
  .cta p { margin-top: .75rem; color: rgb(255 255 255 / .8); max-width: var(--measure); }
  .cta__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }

  .bar { position: fixed; inset: auto 0 0 0; z-index: 60; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .625rem var(--gutter) calc(.625rem + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .bar .btn { min-height: 2.875rem; font-size: var(--fs-sm); }
  @media (min-width: 900px) { .bar { display: none; } body.has-bar .ft { padding-bottom: 3rem; } }
}

@layer pages {
  /* 생활권 히어로 */
  .hero { padding-block: clamp(1.5rem, 1rem + 3vw, 3.5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
  .hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  @media (min-width: 1040px) { .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: stretch; } }
  .hero__main { display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: clamp(1.5rem, 1rem + 2.4vw, 3rem); border-radius: var(--r-lg); background: var(--surface); }
  .hero__badge { display: inline-flex; align-self: flex-start; align-items: center; gap: .45rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; }
  .hero__badge b { display: grid; place-items: center; height: 1.6rem; padding: 0 .55rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); }
  .hero h1 { margin-top: 1.25rem; font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -.055em; font-weight: 800; }
  .hero h1 .l2 { display: block; margin-top: .12em; font-size: .6em; letter-spacing: -.045em; color: var(--muted); }
  .hero h1.is-long { font-size: clamp(2.25rem, 1rem + 5vw, 4.75rem); }
  .hero__lead { margin-top: 1.25rem; max-width: 36rem; color: var(--ink-2); font-size: var(--fs-lg); }
  .hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
  .hero .bento { align-content: stretch; }

  /* 메인 */
  .home-hero { padding-block: clamp(2rem, 1rem + 5vw, 5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
  .home-hero__box { padding: clamp(1.75rem, 1rem + 4vw, 4.5rem); border-radius: var(--r-lg); background: var(--surface); }
  .home-hero h1 { font-size: clamp(2.75rem, 1.2rem + 6vw, 6rem); line-height: 1.02; letter-spacing: -.055em; max-width: 12ch; }
  .home-hero h1 .l2 { display: block; margin-top: .1em; font-size: .72em; color: var(--muted); }
  .home-hero__lead { margin-top: 1.25rem; max-width: 38rem; color: var(--ink-2); font-size: var(--fs-lg); }
  .finder { margin-top: 2rem; max-width: 46rem; }
  .finder label { display: block; font-weight: 700; margin-bottom: .6rem; font-size: var(--fs-sm); color: var(--ink-2); }
  .finder__box { display: flex; align-items: center; gap: .75rem; height: 4.25rem; padding: 0 .5rem 0 1.5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s; }
  .finder__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); background: var(--surface); }
  .finder__box .i { color: var(--muted); width: 1.5rem; height: 1.5rem; }
  .finder input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: var(--fs-lg); font-weight: 600; }
  .finder input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .finder__go { height: 3.25rem; padding: 0 1.5rem; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 800; }
  .finder__hint { margin-top: .75rem; font-size: var(--fs-sm); color: var(--muted); padding-left: 1.5rem; }
  .finder__count { font-weight: 800; color: var(--ink); }
  .finder__results { display: grid; gap: .5rem; margin-top: 1rem; }
  .finder__results > li { padding: 1rem 1.25rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .finder__results .dir-item__head strong { font-size: var(--fs-lg); }
  .finder__results ul { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .6rem; }
  .finder__results ul a { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
  .finder__results ul a:hover { background: var(--accent); color: var(--accent-ink); }
  .finder__act { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
  .finder__act .btn { min-height: 2.75rem; font-size: var(--fs-sm); }
  .finder__empty { margin-top: 1rem; padding: 1.25rem 1.5rem; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent); }
  .finder__empty p { color: var(--ink-2); }
  .finder__empty.is-near .finder__empty-msg { display: none; }
  .finder__empty.is-near .finder__empty-actions { margin-top: 0; }
  .finder__note { margin-top: 1rem; padding: 1rem 1.25rem; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
  .finder__note strong { color: var(--ink); }
  .finder__empty strong { color: var(--ink); }
  .finder__empty-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
  .home-hero__box:has(.finder__empty:not([hidden])) .home-hero__alt { display: none; }
  .finder__school-tip { margin-top: .5rem; font-size: var(--fs-sm); }
  .finder__school-tip a { color: var(--ink); font-weight: 800; }
  .home-hero__alt { margin-top: 1.25rem; font-size: var(--fs-sm); color: var(--muted); padding-left: 1.5rem; }
  .home-hero__alt a { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .2em; text-underline-offset: .15em; }
  .home-bento .tile--accent { padding: 0; }
  .home-bento .tile--accent > a { display: flex; flex-direction: column; justify-content: space-between; gap: .5rem; height: 100%; padding: 1.25rem; color: inherit; text-decoration: none; }
  .consult__list { display: grid; gap: .5rem; margin-top: 1.25rem; }
  .consult__list li { position: relative; padding-left: 1.75rem; font-weight: 700; color: #fff; }
  .consult__list li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }
  .form__row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .75rem; }
  .form__more summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 700; color: #3B4054; list-style: none; }
  .form__more summary::-webkit-details-marker { display: none; }
  .form__more summary::before { content: "+ "; }
  .form__more[open] summary::before { content: "− "; }
  .form__more textarea { margin-top: .5rem; }
  .form .btn--accent { min-height: 3.5rem; font-size: var(--fs-md); }
  .form__note { font-size: var(--fs-xs); color: #5B6070; }
  .form__note a { color: inherit; }
  .cta--end { text-align: left; }
  .finder__more a { color: var(--accent-text); font-weight: 700; font-size: var(--fs-sm); }

  .home-bento { display: grid; gap: .75rem; margin-top: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (min-width: 900px) { .home-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

  .road { display: grid; gap: .75rem; }
  @media (min-width: 760px) { .road { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .road li { padding: 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .road b { display: inline-flex; padding: .25rem .8rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); margin-bottom: .9rem; }
  .road li:first-child b { background: var(--accent); color: var(--accent-ink); }
  .road p { font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.03em; line-height: 1.35; }
  .road span { display: block; margin-top: .4rem; font-size: var(--fs-sm); color: var(--muted); }

  .brands { display: grid; gap: .75rem; }
  @media (min-width: 760px) { .brands { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .brands > li { display: flex; flex-direction: column; gap: 1.25rem; justify-content: space-between; padding: 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .brands h3 { font-size: var(--fs-lg); }

  .dir-region { border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .dir-region + .dir-region { margin-top: .5rem; }
  .dir-region > summary { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.25rem; cursor: pointer; list-style: none; }
  .dir-region > summary::-webkit-details-marker { display: none; }
  .dir-region > summary h3 { font-size: var(--fs-lg); }
  .dir-region > summary span { padding: .15rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
  .dir-region > summary::after { content: ""; margin-left: auto; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line-2); background:
      linear-gradient(currentColor, currentColor) center / 11px 1.75px no-repeat,
      linear-gradient(currentColor, currentColor) center / 1.75px 11px no-repeat, var(--surface); transition: transform .3s var(--ease); }
  .dir-region[open] > summary::after { transform: rotate(45deg); }
  .dir-region::details-content { block-size: 0; overflow: hidden; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
  .dir-region[open]::details-content { block-size: auto; }
  .dir-list { display: grid; gap: .5rem; padding: 0 1.25rem 1.25rem; }
  @media (min-width: 720px) { .dir-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1100px) { .dir-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .dir-item { padding: 1rem 1.1rem; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
  .dir-item[hidden], .dir-region[hidden] { display: none; }
  .dir-item__head { display: block; text-decoration: none; }
  .dir-item__head strong { display: block; font-weight: 800; letter-spacing: -.02em; }
  .dir-item__head span { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: .15rem; }
  .dir-item__head:hover strong { color: var(--accent-text); }
  .dir-item ul { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
  .dir-item ul a { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); text-decoration: none; }
  .dir-item ul a:hover { border-color: var(--accent); color: var(--accent-text); }
  .dir-empty { padding: 1.5rem; color: var(--muted); }

  .consult { display: grid; gap: 2rem; }
  @media (min-width: 900px) { .consult { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; } }
  .form { display: grid; gap: 1rem; padding: 1.75rem; background: #fff; color: #0D0F1A; border-radius: var(--r-md); }
  .form fieldset { display: grid; gap: .9rem; border: 0; padding: 0; margin: 0; min-width: 0; }
  .form label { display: grid; gap: .35rem; font-size: var(--fs-sm); font-weight: 700; }
  .form input, .form select, .form textarea { width: 100%; padding: .8rem 1rem; border: 1px solid #D3D6DF; border-radius: 12px; background: #fff; color: #0D0F1A; font-size: var(--fs-md); font-weight: 500; }
  .form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid #111; outline-offset: 0; border-color: #111; }
  .form .btn { margin-top: .25rem; }
  .form__honey { position: absolute; left: -9999px; }
  .form__status { padding: 1rem 1.25rem; border-radius: 12px; background: #fff; font-weight: 700; }
  .form__status--ok { color: var(--ok); }
  .form__status--error { color: var(--error); }
  .form__status--pending { color: #3B4054; }

  .policy { padding-block: 2rem 5rem; }
  .policy .panel { max-width: 52rem; }
  .policy h1 { font-size: var(--fs-2xl); margin-bottom: 1.25rem; }
  .policy p { margin-top: 1rem; color: var(--ink-2); }
  .policy table { width: 100%; margin-top: 1.5rem; }
  .policy th, .policy td { text-align: left; vertical-align: top; padding: .9rem .5rem; border-bottom: 1px solid var(--line); }
  .policy th { width: 9rem; color: var(--muted); font-weight: 600; }
}

@layer pages {
  .ctable-wrap { overflow-x: auto; }
  .ctable { width: 100%; min-width: 760px; font-size: var(--fs-sm); }
  .ctable th, .ctable td { text-align: left; vertical-align: top; padding: .9rem .75rem; border-bottom: 1px solid var(--line); }
  .ctable thead th { color: var(--muted); font-weight: 700; font-size: var(--fs-xs); }
  .ctable tbody th a { font-weight: 800; text-decoration: none; }
  .acards { display: grid; gap: .75rem; }
  @media (min-width: 760px) { .acards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1100px) { .acards:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .acard { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
  .acard__brand { align-self: flex-start; }
  .acard h3 { font-size: var(--fs-xl); }
  .acard__addr { display: flex; gap: .4rem; color: var(--ink-2); font-size: var(--fs-sm); }
  .acard__addr .i { color: var(--accent-text); margin-top: .2rem; }
  .acard__kw { font-size: var(--fs-sm); color: var(--muted); }
  .acard__kw a { display: inline-block; margin: .2rem .2rem 0 0; padding: .2rem .65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; text-decoration: none; }
  .acard__legal { font-size: var(--fs-xs); color: var(--muted); }
  .acard__legal a { color: inherit; font-weight: 700; }
  .acard__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
  .acard__actions .btn { min-height: 2.75rem; font-size: var(--fs-sm); }
  .sch-map { display: grid; gap: .6rem; }
  .sch-map li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
  .sch-map a { font-weight: 800; }
}


@layer components {
  .season { display: grid; gap: .35rem; margin-bottom: 1rem; padding: 1rem 1.25rem; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink); }
  .season__tag { font-size: var(--fs-xs); font-weight: 800; color: var(--accent-text); }
  .season p { font-weight: 600; }
  a.school { text-decoration: none; }
  a.school:hover { background: var(--accent); color: var(--accent-ink); }
  a.school:hover .i { color: inherit; }
  .tile__link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); }
  .tile__link:hover { color: var(--accent-text); border-color: currentColor; }
  .sch-map a.school { font-size: var(--fs-md); padding: .6rem 1rem; }
  .school-dir { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 1.25rem 1.25rem; }
  .school-dir a { display: inline-block; padding: .3rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); text-decoration: none; }
  .school-dir a:hover { border-color: var(--accent); color: var(--accent-text); }
}

@layer motion {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
  @media (prefers-reduced-motion: no-preference) {
    .hero h1, .home-hero h1 { animation: rise .8s var(--ease) both; }
    .hero .tile, .home-bento .tile { animation: rise .7s var(--ease) both; }
    .hero .tile:nth-child(2), .home-bento .tile:nth-child(2) { animation-delay: .05s; }
    .hero .tile:nth-child(3), .home-bento .tile:nth-child(3) { animation-delay: .1s; }
    .hero .tile:nth-child(4), .home-bento .tile:nth-child(4) { animation-delay: .15s; }
    .hero .tile:nth-child(5) { animation-delay: .2s; }
    .hero .tile:nth-child(6) { animation-delay: .25s; }
    @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
    /* 스크롤 연동: 지원 브라우저에서만 */
    @supports (animation-timeline: view()) {
      .track__bar i { animation: fill linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
      @keyframes fill { from { transform: scaleX(0); } }
    }
  }
  @media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
}

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

@media print {
  .hd, .secnav, .bar, .cta, .map { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { padding: 1rem 0; }
}

@layer pages {
  .hero h1 .l2, .home-hero h1 .l2 { color: var(--ink); }
  .hero h1 .l2 > span, .home-hero h1 .l2 > span { background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .gist strong { color: inherit; background: linear-gradient(transparent 60%, var(--mark) 60%); }
  .sh__kicker { background: var(--accent); color: #111; }
  .chip--accent { background: var(--accent-soft); color: var(--ink); }
  .logo__mark { background: #111; color: var(--accent); }
  :root[data-theme="dark"] .logo__mark { background: var(--accent); color: #111; }
  .track__bar i { background: linear-gradient(90deg, var(--line-2), var(--accent)); }
  .cta .btn--glass { border-color: rgb(255 255 255 / .3); }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo__mark { background: var(--accent); color: #111; } }
