/* ═══════════════════════════════════════════════════════════
   라이프에세이 · 공개 사이트 디자인 시스템
   색상/모서리/글꼴은 관리자 > 디자인에서 CSS 변수로 바뀝니다.
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* 기본 색 (관리자 > 디자인에서 변경) */
  --primary: #0fa595;
  --accent: #ff7a59;
  --bg: #f5faf9;
  --surface: #ffffff;
  --text: #1f2a37;
  --radius: 16px;
  --font: system-ui, sans-serif;

  /* 파생 색 */
  --sky: #4cb8f5;
  --sun: #ffc94d;
  --muted: color-mix(in srgb, var(--text) 62%, var(--bg));
  --subtle: color-mix(in srgb, var(--text) 42%, var(--bg));
  --line: color-mix(in srgb, var(--primary) 9%, color-mix(in srgb, var(--text) 6%, var(--surface)));
  --line-strong: color-mix(in srgb, var(--primary) 14%, color-mix(in srgb, var(--text) 11%, var(--surface)));
  --soft: color-mix(in srgb, var(--primary) 8%, var(--surface));
  --soft-2: color-mix(in srgb, var(--primary) 15%, var(--surface));
  --soft-sky: color-mix(in srgb, var(--sky) 12%, var(--surface));
  --soft-accent: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --link: color-mix(in srgb, var(--primary) 82%, #063b35);
  --primary-2: color-mix(in srgb, var(--primary) 40%, var(--sky));
  --r-sm: calc(var(--radius) * .6);
  --r-md: calc(var(--radius) * .8);
  --r-lg: calc(var(--radius) + 4px);
  --sh-xs: 0 1px 2px rgba(16, 60, 56, .05);
  --sh-sm: 0 1px 2px rgba(16, 60, 56, .04), 0 4px 12px -4px rgba(16, 60, 56, .08);
  --sh-md: 0 2px 4px rgba(16, 60, 56, .04), 0 14px 30px -10px rgba(16, 60, 56, .14);
  --sh-lg: 0 4px 8px rgba(16, 60, 56, .04), 0 26px 56px -18px rgba(16, 60, 56, .22);
  --ring: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* 다크 모드: 헤더의 달 버튼을 눌렀을 때만 (기본은 항상 밝은 화면) */
:root[data-theme="dark"] {
  --bg: #0f1b1e; --surface: #16262a; --text: #e5f1ef;
  --link: color-mix(in srgb, var(--primary) 55%, #fff);
  --soft: color-mix(in srgb, var(--primary) 14%, var(--surface));
  --soft-2: color-mix(in srgb, var(--primary) 22%, var(--surface));
  --soft-sky: color-mix(in srgb, var(--sky) 14%, var(--surface));
  --soft-accent: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --line: color-mix(in srgb, var(--text) 10%, var(--surface));
  --line-strong: color-mix(in srgb, var(--text) 17%, var(--surface));
  --sh-xs: none; --sh-sm: 0 1px 2px rgba(0, 0, 0, .25); --sh-md: 0 12px 28px -8px rgba(0, 0, 0, .45); --sh-lg: 0 24px 56px -16px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -.011em;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 100% -10%, color-mix(in srgb, var(--sky) 9%, transparent), transparent 70%),
    radial-gradient(900px 480px at -10% 10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.035em; font-weight: 800; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; font: 600 12px/1 ui-monospace, monospace; color: var(--muted); background: var(--surface); }

.container { width: min(1200px, 100%); margin-inline: auto; padding-inline: 24px; }
.container.narrow { width: min(840px, 100%); }
.center { text-align: center; justify-content: center; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
@media (max-width: 640px) { .container { padding-inline: 18px; } .hide-sm { display: none !important; } }

/* ───────── 헤더 ───────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.8) blur(16px);
  -webkit-backdrop-filter: saturate(1.8) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -.04em; }
.brand-mark {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent);
}
.brand-logo { display: block; height: 34px; width: auto; }
.site-nav { display: flex; gap: 2px; }
.site-nav a { position: relative; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; transition: color .15s, background .15s; }
.site-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.site-nav a.active { color: var(--text); }
.site-nav a.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 2px; border-radius: 2px; background: var(--primary); }
.site-nav .nav-admin { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, box-shadow .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); box-shadow: var(--sh-xs); }
.icon-btn .ic { width: 18px; height: 18px; }
.nav-toggle { display: none; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    display: none; position: absolute; top: 70px; left: 12px; right: 12px; flex-direction: column; gap: 2px;
    padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  }
  .site-nav.open { display: flex; animation: drop .18s var(--ease); }
  .site-nav a { padding: 13px 14px; }
  .site-nav a.active { background: var(--soft); color: var(--link); }
  .site-nav a.active::after { display: none; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

.site-main { min-height: 62vh; padding-bottom: 56px; }

/* ───────── 공통 요소 ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--primary); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(15, 23, 42, .12), 0 6px 16px -6px color-mix(in srgb, var(--primary) 60%, transparent);
  transition: transform .15s var(--ease), box-shadow .15s, background .15s, filter .15s;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 2px 4px rgba(15, 23, 42, .12), 0 10px 22px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--sh-xs); }
.btn.ghost:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line-strong)); color: var(--link); filter: none; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--link); font-size: 12px; font-weight: 700; letter-spacing: 0; vertical-align: middle; }
.badge.draft { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: color-mix(in srgb, var(--accent) 80%, var(--text)); }
.eyebrow { display: inline-block; margin-bottom: 6px; color: var(--link); font-weight: 800; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-hero { margin: 64px 0; text-align: center; }
.empty-hero h1 { font-size: clamp(24px, 4vw, 34px); margin: 8px 0 10px; }
.empty-hero p { color: var(--muted); margin: 0 0 26px; }
.empty-code { font-size: clamp(64px, 12vw, 120px); font-weight: 900; letter-spacing: -.06em; line-height: 1; background: linear-gradient(140deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 26px 0 6px; font-size: 14px; color: var(--subtle); }
.breadcrumb a { color: var(--muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--link); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.link-arrow .ic { transition: transform .2s var(--ease); }
.link-arrow:hover .ic { transform: translateX(3px); }

/* ───────── 히어로 ───────── */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 10vw, 112px) 0 clamp(48px, 7vw, 76px); text-align: center; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.orb-a { width: 560px; height: 420px; left: 50%; top: -190px; transform: translateX(-78%); background: color-mix(in srgb, var(--primary) 42%, transparent); }
.orb-b { width: 460px; height: 340px; left: 50%; top: -120px; transform: translateX(8%); background: color-mix(in srgb, var(--sky) 40%, transparent); opacity: .45; }
.orb-c { width: 300px; height: 240px; left: 50%; top: 60px; transform: translateX(70%); background: color-mix(in srgb, var(--accent) 30%, transparent); opacity: .32; }
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 80%);
  opacity: .7;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px 7px 12px; margin-bottom: 26px;
  border: 1px solid var(--line-strong); border-radius: 99px; background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(8px); font-size: 13.5px; font-weight: 600; color: var(--muted); box-shadow: var(--sh-xs);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #12b886; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #12b886; opacity: 0; animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.hero h1 { margin: 0 auto 20px; max-width: 880px; font-size: clamp(36px, 6.4vw, 66px); line-height: 1.12; letter-spacing: -.055em; font-weight: 800; }
.grad { font-style: normal; background: linear-gradient(110deg, var(--primary) 5%, var(--sky) 65%, #7b8cf6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin: 0 auto 36px; max-width: 600px; color: var(--muted); font-size: clamp(16px, 2vw, 18.5px); line-height: 1.7; }
.hero-search {
  display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto 26px; padding: 8px 8px 8px 20px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: calc(var(--radius) + 8px); box-shadow: var(--sh-lg);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); box-shadow: var(--sh-lg), var(--ring); }
.hero-search > .ic { width: 20px; height: 20px; color: var(--subtle); }
.hero-search input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; font-size: 16.5px; }
.hero-search input::placeholder { color: var(--subtle); }
.hero-search .btn { min-height: 48px; padding: 0 24px; border-radius: calc(var(--radius) + 2px); }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin: 40px auto 0; padding: 0; list-style: none; }
.hero-stats li { display: grid; gap: 2px; padding: 0 30px; text-align: center; }
.hero-stats li + li { border-left: 1px solid var(--line-strong); }
.hero-stats strong { font-size: 26px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 560px) {
  .hero-stats li { padding: 0 14px; }
  .hero-stats strong { font-size: 21px; }
  .hero-search { padding-left: 14px; }
  .hero-search .btn { padding: 0 16px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px 8px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: var(--sh-xs);
  transition: border-color .15s, color .15s, transform .15s var(--ease), box-shadow .15s;
}
.chip small { min-width: 20px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: center; }
.chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.chip.active small { background: rgba(255, 255, 255, .25); color: #fff; }

/* ───────── 섹션 ───────── */
.section { margin: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.page-hero { position: relative; padding: clamp(44px, 7vw, 72px) 0 30px; text-align: center; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0 0 auto; height: 100%; z-index: -1; background: radial-gradient(ellipse 60% 70% at 50% -10%, var(--soft-2), transparent 70%); }
.page-hero h1 { margin: 0 0 10px; font-size: clamp(30px, 4.6vw, 44px); letter-spacing: -.05em; }
.page-hero p { margin: 0 auto 26px; max-width: 560px; color: var(--muted); font-size: 16.5px; }
.search-field {
  display: flex; align-items: center; gap: 10px; width: min(520px, 100%); height: 54px; margin: 0 auto; padding: 0 12px 0 18px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--sh-md); transition: border-color .2s, box-shadow .2s;
}
.search-field:focus-within { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); box-shadow: var(--sh-md), var(--ring); }
.search-field .ic { color: var(--subtle); width: 19px; height: 19px; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }

/* ───────── 도구 카드 ───────── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; }
.tool-grid.compact { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tool-grid.featured { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); box-shadow: var(--sh-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.tool-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px 160px at 0% 0%, var(--soft), transparent 70%);
}
.tool-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 32%, var(--line)); box-shadow: var(--sh-lg); }
.tool-card:hover::before { opacity: 1; }
.tool-card > * { position: relative; }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tool-card-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; font-size: 26px;
  background: linear-gradient(145deg, var(--soft-2), var(--soft)); border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 60%, transparent);
}
.tool-card-cat { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tool-card-title { font-size: 17.5px; font-weight: 750; letter-spacing: -.03em; }
.tool-card-desc { color: var(--muted); font-size: 14.5px; line-height: 1.6; flex: 1; }
.tool-card-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--link); font-size: 13.5px; font-weight: 700; opacity: .85; }
.tool-card-go .ic { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.tool-card:hover .tool-card-go { opacity: 1; }
.tool-card:hover .tool-card-go .ic { transform: translateX(4px); }
.tool-card.large { padding: 26px; }
.tool-card.large .tool-card-icon { width: 60px; height: 60px; font-size: 30px; border-radius: 17px; }
.tool-card.large .tool-card-title { font-size: 20px; }
.search-empty { text-align: center; color: var(--muted); padding: 32px; }

/* 카드 아이콘 색을 번갈아 (민트 · 하늘 · 코랄 · 햇살) */
.tool-grid > .tool-card:nth-child(4n+2) .tool-card-icon { background: linear-gradient(145deg, color-mix(in srgb, var(--sky) 20%, var(--surface)), var(--soft-sky)); border-color: color-mix(in srgb, var(--sky) 18%, var(--line)); }
.tool-grid > .tool-card:nth-child(4n+3) .tool-card-icon { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--soft-accent)); border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); }
.tool-grid > .tool-card:nth-child(4n+4) .tool-card-icon { background: linear-gradient(145deg, color-mix(in srgb, var(--sun) 28%, var(--surface)), color-mix(in srgb, var(--sun) 12%, var(--surface))); border-color: color-mix(in srgb, var(--sun) 30%, var(--line)); }
.tool-card.game .tool-card-go { color: color-mix(in srgb, var(--accent) 85%, #5a1d0e); }
:root[data-theme="dark"] .tool-card.game .tool-card-go { color: var(--accent); }

/* 게임 섹션 띠 */
.games-band {
  position: relative; overflow: hidden; padding: clamp(24px, 4vw, 40px); border-radius: calc(var(--r-lg) + 8px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--sun) 14%, var(--surface)) 55%, color-mix(in srgb, var(--sky) 12%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
}
.games-band .eyebrow { color: color-mix(in srgb, var(--accent) 85%, #5a1d0e); }
:root[data-theme="dark"] .games-band .eyebrow { color: var(--accent); }

/* 가치 소개 */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 30px; border: 1px solid var(--line); border-radius: calc(var(--r-lg) + 6px); background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 60%, var(--bg))); }
.value { padding: 8px 10px; }
.value-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--soft); color: var(--link); margin-bottom: 14px; }
.value:nth-child(2) .value-icon { background: var(--soft-sky); color: color-mix(in srgb, var(--sky) 70%, #0b3a5c); }
.value:nth-child(3) .value-icon { background: var(--soft-accent); color: color-mix(in srgb, var(--accent) 80%, #5a1d0e); }
:root[data-theme="dark"] .value:nth-child(2) .value-icon { color: var(--sky); }
:root[data-theme="dark"] .value:nth-child(3) .value-icon { color: var(--accent); }
.value-icon .ic { width: 22px; height: 22px; }
.value h3 { margin: 0 0 6px; font-size: 17px; }
.value p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }

/* 새 소식 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.news-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
.news-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--subtle); }
.news-meta b { color: var(--link); font-weight: 700; }
.news-card strong { font-size: 16.5px; letter-spacing: -.03em; line-height: 1.45; }
.news-ex { color: var(--muted); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ───────── 게시판 ───────── */
.post-list { overflow: hidden; }
.post-row { display: flex; gap: 16px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); color: var(--text); transition: background .15s; }
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: color-mix(in srgb, var(--soft) 60%, transparent); }
.post-row-main { flex: 1; display: grid; gap: 3px; min-width: 0; }
.post-row-main small { color: var(--link); font-weight: 700; font-size: 12.5px; }
.post-row-main strong { font-size: 16.5px; letter-spacing: -.025em; }
.post-ex { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-row time { color: var(--subtle); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.pagination { display: flex; justify-content: center; gap: 6px; margin: 26px 0; }
.pagination a { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; transition: border-color .15s; }
.pagination a:hover { border-color: var(--line-strong); }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ───────── 본문 ───────── */
.article { padding: clamp(26px, 5vw, 56px); margin: 16px 0 24px; }
.article-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 30px; }
.article-head h1 { margin: 4px 0 14px; font-size: clamp(26px, 4.2vw, 38px); letter-spacing: -.05em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--subtle); font-size: 14px; }
.prose { font-size: 17px; line-height: 1.9; letter-spacing: -.012em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: 23px; margin: 2em 0 .7em; padding-top: .2em; }
.prose h3 { font-size: 19px; margin: 1.7em 0 .5em; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--link); font-weight: 700; }
.prose img { border-radius: var(--r-md); }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.4em 0; font-size: 15px; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.prose th, .prose td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--soft); font-weight: 700; font-size: 14px; }
.prose blockquote { margin: 1.4em 0; padding: 16px 22px; border-left: 3px solid var(--primary); background: var(--soft); border-radius: 0 var(--r-md) var(--r-md) 0; }
.prose code { background: color-mix(in srgb, var(--text) 6%, transparent); padding: 2px 7px; border-radius: 6px; font-size: .88em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose img.img-center { display: block; margin: 1.2em auto; }
.prose img.img-left { float: left; margin: .3em 1.4em .8em 0; max-width: 50%; }
.prose img.img-right { float: right; margin: .3em 0 .8em 1.4em; max-width: 50%; }
.prose::after { content: ''; display: block; clear: both; }
.prose pre { margin: 1.4em 0; padding: 18px 20px; border-radius: var(--r-md); background: #0f172a; color: #e2e8f0; font: 14px/1.7 ui-monospace, 'Cascadia Code', Consolas, monospace; white-space: pre-wrap; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose mark { background: color-mix(in srgb, #ffe066 70%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.prose .callout { margin: 1.4em 0; padding: 18px 22px; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.prose .callout > :last-child { margin-bottom: 0; }
.prose .video-embed { position: relative; aspect-ratio: 16 / 9; margin: 1.4em 0; border-radius: var(--r-md); overflow: hidden; background: #000; box-shadow: var(--sh-md); }
.prose .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 600px) { .prose img.img-left, .prose img.img-right { float: none; max-width: 100%; margin: 1em 0; } }

/* ═════════ 도구 페이지 ═════════ */
.tool-page { padding-bottom: 24px; }
.tool-header {
  position: relative; display: flex; gap: 22px; align-items: flex-start; margin: 8px 0 22px; padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line); border-radius: calc(var(--r-lg) + 4px); overflow: hidden; isolation: isolate;
  background: var(--surface); box-shadow: var(--sh-sm);
}
.tool-header::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 220px at 0% 0%, var(--soft-2), transparent 70%), radial-gradient(400px 200px at 100% 0%, color-mix(in srgb, var(--primary-2) 10%, transparent), transparent 70%); }
.tool-header h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.05em; }
.tool-header p { margin: 0; color: var(--muted); font-size: 16.5px; max-width: 720px; }
.tool-header-text { min-width: 0; }
.tool-icon {
  flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; font-size: 40px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tool-meta li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.tool-meta .ic { width: 14px; height: 14px; color: var(--link); }
.tool-edit-link { margin-left: auto; }
@media (max-width: 600px) { .tool-header { flex-direction: column; gap: 14px; } .tool-icon { width: 60px; height: 60px; font-size: 32px; border-radius: 18px; } .tool-edit-link { position: absolute; top: 16px; right: 16px; } }

.tool-app { margin: 0 0 24px; }
.tool-panel, .tool-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3.4vw, 32px); box-shadow: var(--sh-sm); }
.tool-result { position: relative; margin-top: 16px; overflow: hidden; border-color: color-mix(in srgb, var(--primary) 26%, var(--line)); }
.tool-result::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.result-main { font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label, .field-label { font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 48px; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); outline: none; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.65; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--text) 26%, var(--surface)); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.hint { color: var(--muted); font-size: 13.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.stat { padding: 15px 17px; border-radius: var(--r-md); background: color-mix(in srgb, var(--text) 3.5%, var(--surface)); border: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { display: block; margin-top: 2px; font-size: 24px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat.main { background: linear-gradient(140deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--primary) 70%, transparent); }
.stat.main span { color: rgba(255, 255, 255, .78); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; background: color-mix(in srgb, var(--text) 5%, var(--surface)); border: 1px solid var(--line); border-radius: var(--r-md); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 15px; border-radius: calc(var(--r-md) - 4px); font-size: 14px; font-weight: 650; cursor: pointer; color: var(--muted); transition: color .15s, background .15s; }
.segmented span:hover { color: var(--text); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); }
.toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px); background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 99px; font-size: 14px; font-weight: 600; z-index: 90; opacity: 0; transition: opacity .2s, transform .2s var(--ease); pointer-events: none; box-shadow: var(--sh-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tool-doc { padding: clamp(26px, 5vw, 52px); margin: 28px 0; }
.related { margin: 48px 0 10px; }

/* ───────── 광고 ───────── */
.ad-wrap { margin: 28px auto; text-align: center; overflow: hidden; clear: both; }
.ad-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--subtle); letter-spacing: .12em; }
.ad-wrap ins.adsbygoogle { margin-inline: auto; }
/* 고정 크기 광고: 자리를 미리 잡아 화면 밀림(CLS) 방지 */
.ad-fixed > div[data-slot] { min-height: var(--ad-h, 0); }
/* 본문 중간 광고: 문단과 구분되도록 위아래 여백 + 얇은 구분선 */
.prose .ad-wrap { margin: 32px 0; padding: 14px 0; border-block: 1px solid var(--line, rgba(0, 0, 0, .08)); }
/* 채워지지 않은 광고는 빈 상자를 남기지 않음 (애드센스 권장 방식) */
.ad-wrap:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.ad-preview {
  display: grid; place-items: center; min-height: 96px; padding: 12px; border-radius: var(--r-lg);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, var(--text)); font-size: 13px; font-weight: 700;
}
.ad-preview.off { opacity: .5; border-style: dotted; min-height: 52px; }

/* ───────── 푸터 (밝은 톤) ───────── */
.site-footer {
  margin-top: 64px; padding: 56px 0 30px; color: var(--muted); font-size: 14.5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 6%, var(--surface)), color-mix(in srgb, var(--sky) 7%, var(--surface)));
  border-top: 1px solid var(--line);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-about p { max-width: 440px; margin: 16px 0 0; line-height: 1.75; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h2 { margin: 0 0 4px; color: var(--text); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.footer-col a { color: var(--muted); transition: color .15s; }
.footer-col a:hover { color: var(--link); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--subtle); }
.footer-note { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--link); font-weight: 600; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* 등장 애니메이션 */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > *, .page-hero .container > * { animation: rise .7s var(--ease) both; }
  .hero-inner > :nth-child(2) { animation-delay: .06s; }
  .hero-inner > :nth-child(3) { animation-delay: .12s; }
  .hero-inner > :nth-child(4) { animation-delay: .18s; }
  .hero-inner > :nth-child(5) { animation-delay: .24s; }
  .hero-inner > :nth-child(6) { animation-delay: .3s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  .site-header, .site-footer, .ad-wrap, .related, .breadcrumb, .tool-actions, .header-actions { display: none !important; }
  body { background: #fff; }
  .tool-panel, .tool-result, .card, .tool-header { box-shadow: none; }
}

/* ═════════ 게임 공통 UI (games/* 에서 재사용) ═════════ */
.game-page .tool-header { padding: clamp(18px, 3vw, 26px); }
.game-page .tool-header h1 { font-size: clamp(24px, 3.4vw, 32px); }
.game-page .tool-icon { width: 64px; height: 64px; font-size: 34px; border-radius: 19px; }
.game-shell { position: relative; max-width: 760px; margin: 0 auto; padding: clamp(12px, 2.4vw, 20px); background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--r-lg) + 4px); box-shadow: var(--sh-md); }
.game-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.game-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px; border-radius: 99px; background: var(--soft); font-size: 13px; font-weight: 700; color: var(--muted); }
.game-stat b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.game-stat.best { background: color-mix(in srgb, var(--sun) 22%, var(--surface)); }
.game-bar .spacer { flex: 1; }
.game-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.game-btn:hover { color: var(--text); border-color: var(--line-strong); }
.game-btn .ic { width: 18px; height: 18px; }
.game-stage { position: relative; border-radius: var(--r-lg); overflow: hidden; background: color-mix(in srgb, var(--primary) 5%, var(--surface)); touch-action: none; user-select: none; -webkit-user-select: none; }
.game-stage canvas { display: block; width: 100%; height: auto; }
.game-overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 20px; text-align: center; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.game-overlay h2 { margin: 0; font-size: clamp(22px, 4vw, 30px); }
.game-overlay p { margin: 0; color: var(--muted); }
.game-overlay .btn { justify-self: center; }
.game-help { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 12px 0 0; color: var(--subtle); font-size: 13px; }
.game-pad { display: none; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 56px); gap: 8px; justify-content: center; margin-top: 14px; }
.game-pad button { border: 1px solid var(--line); border-radius: 14px; background: var(--soft); color: var(--text); font-size: 20px; cursor: pointer; touch-action: manipulation; }
.game-pad button:active { background: var(--soft-2); }
.game-pad [data-dir="up"] { grid-column: 2; }
.game-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.game-pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.game-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .game-pad { display: grid; } }
.game-shell:fullscreen { display: flex; flex-direction: column; justify-content: center; max-width: none; border-radius: 0; background: var(--bg); }
.game-shell:fullscreen .game-stage { width: min(100%, calc((100vh - 140px) * var(--game-ratio, 1))); margin: 0 auto; }

/* ═════════ 내 브라우저 데이터 ═════════ */
.data-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.data-list { overflow: hidden; }
.data-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }
.data-row-main { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.data-row-main strong { font-size: 15.5px; }
.data-row-main code { font-size: 12.5px; color: var(--subtle); word-break: break-all; }
.data-row-size { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.notice-box { display: flex; gap: 14px; padding: 18px 22px; margin: 0 0 18px; border-radius: var(--r-lg); background: var(--soft); border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line)); color: var(--text); }
.notice-box .ic { width: 22px; height: 22px; color: var(--link); margin-top: 2px; }
.notice-box p { margin: 0; color: var(--muted); font-size: 14.5px; }
