:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #5b21b6;
  --brand-2: #14b8a6;
  --brand-contrast: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --font: "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #131a30;
    --text: #e8ecf8;
    --muted: #94a3b8;
    --line: #243049;
    --brand: #a78bfa;
    --brand-contrast: #0b1020;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
  .hero-img { opacity: 0.9; filter: brightness(0.85) saturate(1.05); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 4vw + 0.6rem, 2.75rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); font-size: 0.9rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 40em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { background: var(--line); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--brand-contrast); }
.nav .lang { border: 1px solid var(--line); margin-left: 6px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 720px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; inset: 60px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav .lang { margin-left: 0; text-align: center; }
}

/* hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #f1f0ff 0%, var(--bg) 100%); }
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(180deg, #17133a 0%, var(--bg) 100%); } }
.hero-inner { position: relative; z-index: 1; display: grid; align-items: center; min-height: clamp(380px, 52vw, 560px); padding-block: 40px; }
.hero-text { max-width: 520px; }
.hero-img {
  position: absolute; right: 0; top: 0; height: 100%; width: auto; max-width: none; aspect-ratio: 16 / 9; object-fit: cover; object-position: right center;
  /* 이미지 왼쪽 가장자리를 배경에 자연스럽게 녹입니다 */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28%);
  mask-image: linear-gradient(to right, transparent 0, #000 28%);
}
@media (max-width: 800px) {
  .hero-img { opacity: 0.35; right: -30%; }
  .hero-text { max-width: none; }
}
.eyebrow { display: inline-block; font-weight: 700; font-size: 0.85rem; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 4px 12px; border-radius: 999px; margin: 0 0 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-block; background: var(--brand); color: var(--brand-contrast); border: 1px solid var(--brand); padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: 6px 16px; font-size: 0.9rem; }

/* sections & cards */
.section { padding-block: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card .thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 16px 18px 20px; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--brand); }
.card-body p { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; }
.card-body .meta { font-size: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); background: var(--surface); font-size: 0.9rem; }
.chip[aria-current="true"] { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pager a { min-width: 40px; text-align: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--surface); }
.pager a[aria-current="page"] { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

/* article */
.article { max-width: 760px; padding-block: 40px 56px; }
.article .meta, .crumb { color: var(--muted); font-size: 0.9rem; }
.article .cover { width: 100%; border-radius: var(--radius); margin: 20px 0 8px; box-shadow: var(--shadow); }
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose img { border-radius: 10px; margin: 1.2em 0; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 10px; overflow-x: auto; font-size: 0.9rem; line-height: 1.55; }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.9em; }
.prose :not(pre) > code { background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 2px 6px; border-radius: 6px; }
.prose blockquote { margin: 1.4em 0; padding: 4px 18px; border-left: 4px solid var(--brand-2); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

/* form */
.form { display: grid; gap: 18px; margin-top: 24px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form input, .form textarea { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; }
.form [aria-invalid="true"] { border-color: #e11d48; }
.err { color: #e11d48; font-style: normal; font-weight: 500; font-size: 0.9rem; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-top: 20px; }
.notice.ok { border-color: var(--brand-2); }

/* misc */
.notfound { text-align: center; padding-block: 48px; }
.notfound img { margin: 0 auto 16px; max-width: 360px; border-radius: var(--radius); }
.ad { margin: 40px 0 0; text-align: center; }
.ad small { display: block; color: var(--muted); font-size: 0.7rem; margin-bottom: 4px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; margin-top: 40px; color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 4px 0; }
.site-footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) { .card { transition: transform 0.15s, box-shadow 0.15s; } .card:hover { transform: translateY(-3px); } }
