/*
Theme Name: Moment Note
Theme URI: https://blog.int4.io
Author: Moment Note
Author URI: https://blog.int4.io
Description: 서버·CI/CD·AI 개발 최적화 실전 노트를 위한 커스텀 테마. 개발자 필드 노트 컨셉의 고가독성 디자인 — 터미널 스타일 코드블록, 카테고리 컬러 시스템, 리딩 프로그레스, 다크모드 지원.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: moment-note
Tags: blog, technology, custom-colors, translation-ready, threaded-comments, featured-images
*/

/* ============================================================
   Moment Note — Design System
   ============================================================ */

:root {
  /* Palette (light) */
  --bg:          #fbfbfa;
  --bg-tint:     #f4f3f1;
  --surface:     #ffffff;
  --ink:         #17171c;
  --ink-soft:    #38383f;
  --muted:       #6a6a76;
  --faint:       #9a9aa6;
  --line:        #ececec;
  --line-strong: #dcdce0;

  /* Brand */
  --brand:    #6d5efc;
  --brand-2:  #a855f7;
  --brand-ink:#4f46e5;
  --warm:     #f59e0b;
  --grad: linear-gradient(120deg, #6d5efc 0%, #a855f7 55%, #ec4899 100%);

  /* Category accents */
  --cat-cicd:  #6d5efc;
  --cat-ai:    #db2777;
  --cat-infra: #0ea5a4;

  /* Code panel (always dark for contrast) */
  --code-bg:   #0f1117;
  --code-bg-2: #171a23;
  --code-line: #262a35;
  --code-ink:  #e6e7ee;
  --code-mute: #8b90a3;

  /* Type */
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          system-ui, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  --display: "Space Grotesk", "Pretendard", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
          Consolas, "Liberation Mono", monospace;

  /* Rhythm */
  --measure: 42rem;      /* ~680px reading column */
  --wide:    72rem;
  --radius:  16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20,20,30,.04), 0 1px 3px rgba(20,20,30,.05);
  --shadow-md: 0 4px 12px rgba(20,20,30,.06), 0 10px 30px rgba(20,20,30,.06);
  --shadow-lg: 0 8px 24px rgba(70,50,180,.10), 0 20px 50px rgba(20,20,30,.10);
  --ease: cubic-bezier(.22,.61,.36,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0e0e12;
    --bg-tint:     #16161d;
    --surface:     #16161d;
    --ink:         #f2f2f5;
    --ink-soft:    #d3d3da;
    --muted:       #9a9aa8;
    --faint:       #6f6f7d;
    --line:        #262630;
    --line-strong: #33333f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  }
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  font-feature-settings: "ss01", "cv01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--brand-2); }
::selection { background: rgba(109,94,252,.22); }

/* Layout helpers */
.container { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
.reading   { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Reading progress
   ============================================================ */
.reading-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200;
  background: transparent; pointer-events: none;
}
.reading-progress > span {
  display: block; height: 100%; width: 0;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(109,94,252,.6);
  transition: width .1s linear;
}

/* ============================================================
   Site header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1.25rem;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; font-family: var(--mono); font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 14px rgba(109,94,252,.4);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name {
  font-family: var(--display); font-weight: 700; font-size: 1.08rem;
  letter-spacing: -.01em; color: var(--ink);
}
.brand__tag { font-family: var(--mono); font-size: .64rem; color: var(--muted); letter-spacing: .04em; }

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  color: var(--ink-soft); font-weight: 500; font-size: .95rem;
  padding: .5rem .8rem; border-radius: 9px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a:hover, .nav .current-menu-item > a { background: var(--bg-tint); color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  transition: border-color .18s, color .18s, transform .1s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn:active { transform: scale(.94); }
.nav-toggle { display: none; }

/* Mobile nav */
@media (max-width: 820px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 66px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: .1rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .8rem 1.25rem 1.25rem;
    transform: translateY(-140%); transition: transform .32s var(--ease);
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { transform: translateY(0); }
  .nav a { padding: .8rem .6rem; font-size: 1.05rem; }
}

/* ============================================================
   Hero (front page)
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--line-strong) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 100%);
  opacity: .6;
}
.hero::after {
  content: ""; position: absolute; z-index: 0;
  width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  top: -30%; right: -12%;
  background: radial-gradient(circle, rgba(168,85,247,.16), transparent 62%);
  filter: blur(6px);
}
.hero__inner { position: relative; z-index: 1; }
.hero__kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .78rem; color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  padding: .35rem .75rem; border-radius: 999px; margin-bottom: 1.3rem;
}
.hero__kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.08;
  letter-spacing: -.025em; margin: 0 0 1.1rem; max-width: 20ch;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { font-size: 1.18rem; color: var(--muted); max-width: 52ch; margin: 0 0 1.8rem; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 2rem; }
.hero__stat b { font-family: var(--display); font-size: 1.5rem; display: block; letter-spacing: -.02em; }
.hero__stat span { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ============================================================
   Section headings
   ============================================================ */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem;
}
.section__head h2 {
  font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -.02em; margin: .25rem 0 0;
}
.section__more { font-family: var(--mono); font-size: .82rem; white-space: nowrap; }
.section__more::after { content: " →"; }

/* ============================================================
   Post cards / grid
   ============================================================ */
.grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--cat, var(--brand)); opacity: 0; transition: opacity .28s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--cat, var(--brand)) 40%, var(--line)); }
.card:hover::before { opacity: 1; }
.card__meta { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.card__date { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.card h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.2rem;
  line-height: 1.32; letter-spacing: -.01em; margin: 0 0 .6rem;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand-ink); }
.card__excerpt { color: var(--muted); font-size: .95rem; margin: 0 0 1.1rem; flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; }
.card__read { font-family: var(--mono); font-size: .72rem; color: var(--faint); }

/* Category pill */
.pill {
  --c: var(--brand);
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
  padding: .28rem .6rem; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cat-cicd  { --c: var(--cat-cicd); }
.cat-ai    { --c: var(--cat-ai); }
.cat-infra { --c: var(--cat-infra); }

/* Featured (first card spans) */
.grid--featured .card:first-child { grid-column: 1 / -1; }
@media (min-width: 800px) {
  .grid--featured .card:first-child {
    flex-direction: row; align-items: center; gap: 2.5rem; padding: 2.5rem;
  }
  .grid--featured .card:first-child .card__body { flex: 1; }
  .grid--featured .card:first-child h3 { font-size: 1.9rem; }
  .grid--featured .card:first-child .card__excerpt { font-size: 1.05rem; }
  .grid--featured .card:first-child .card__glyph {
    flex: 0 0 200px; height: 180px; border-radius: 14px;
    background: var(--grad); display: grid; place-items: center;
    font-family: var(--mono); color: rgba(255,255,255,.9); font-size: 3rem;
    box-shadow: var(--shadow-md);
  }
}
.card__glyph { display: none; }

/* ============================================================
   Single article
   ============================================================ */
.article-head {
  padding: clamp(3rem, 7vw, 5rem) 0 2rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.article-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, color-mix(in srgb, var(--cat, var(--brand)) 8%, transparent), transparent 70%);
}
.article-head .eyebrow-row { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.article-head h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.14;
  letter-spacing: -.02em; margin: 0 0 1.2rem;
}
.article-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.article-meta .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}
.article-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: .74rem; color: var(--muted);
  margin-bottom: 1.2rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-ink); }
.breadcrumb .sep { color: var(--faint); }
.breadcrumb .current { color: var(--ink-soft); }

/* Social share */
.share-row { display: flex; align-items: center; gap: .55rem; margin: 2.5rem 0 0; flex-wrap: wrap; }
.share-label { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-right: .2rem; }
.share-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  transition: border-color .18s, color .18s, transform .1s, background .18s;
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.share-btn:active { transform: scale(.94); }
.share-btn.copied { border-color: #28c840; color: #28c840; }

/* Related posts */
.related { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 3rem; padding-bottom: 1rem; }

/* Article body — the reading experience */
.article-body {
  font-size: 1.12rem; line-height: 1.9; color: var(--ink-soft);
  padding-block: 2.5rem;
}
.article-body > * { margin-block: 0 1.5rem; }
.article-body p { margin: 0 0 1.5rem; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--brand); }

.article-body h2 {
  font-family: var(--display); font-weight: 700; color: var(--ink);
  font-size: 1.6rem; line-height: 1.3; letter-spacing: -.01em;
  margin: 3rem 0 1.1rem; padding-top: .4rem; scroll-margin-top: 90px;
  position: relative;
}
.article-body h2::before {
  content: ""; position: absolute; left: -1.2rem; top: 1.1rem;
  width: .5rem; height: .5rem; border-radius: 2px; background: var(--grad);
}
.article-body h3 {
  font-family: var(--display); font-weight: 600; color: var(--ink);
  font-size: 1.28rem; margin: 2.2rem 0 .9rem; scroll-margin-top: 90px;
}
.article-body ul, .article-body ol { padding-left: 1.4rem; margin: 0 0 1.5rem; }
.article-body li { margin-bottom: .6rem; }
.article-body li::marker { color: var(--brand); }

.article-body blockquote {
  margin: 2rem 0; padding: 1.1rem 1.4rem;
  border-left: 3px solid var(--brand);
  background: var(--bg-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft); font-size: 1.05rem;
}
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body img { border-radius: var(--radius-sm); margin: 2rem auto; box-shadow: var(--shadow-md); }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 3rem 0; }

/* Inline code */
.article-body :not(pre) > code {
  font-family: var(--mono); font-size: .88em;
  background: color-mix(in srgb, var(--brand) 12%, var(--bg-tint));
  color: var(--brand-ink);
  padding: .12em .42em; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}

/* Code blocks — terminal panel */
.article-body pre, .code-block pre {
  position: relative; margin: 2rem 0; padding: 0;
  background: var(--code-bg); border: 1px solid var(--code-line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code-block { margin: 2rem 0; }
.code-block pre { margin: 0; }
.code-toolbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1rem; background: var(--code-bg-2);
  border-bottom: 1px solid var(--code-line);
}
.code-dots { display: flex; gap: .4rem; }
.code-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-lang { font-family: var(--mono); font-size: .68rem; color: var(--code-mute); text-transform: uppercase; letter-spacing: .1em; margin-left: .4rem; }
.code-copy {
  margin-left: auto; font-family: var(--mono); font-size: .7rem;
  color: var(--code-mute); background: transparent; border: 1px solid var(--code-line);
  padding: .3rem .6rem; border-radius: 7px; cursor: pointer; transition: all .16s;
}
.code-copy:hover { color: var(--code-ink); border-color: var(--code-mute); }
.code-copy.copied { color: #28c840; border-color: #28c840; }
.article-body pre code, .code-block pre code {
  display: block; font-family: var(--mono); font-size: .86rem; line-height: 1.7;
  color: var(--code-ink); padding: 1.15rem 1.25rem; overflow-x: auto;
  background: none; border: none; border-radius: 0;
  white-space: pre; word-break: normal;
}

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0; }
.tag {
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
  background: var(--bg-tint); border: 1px solid var(--line);
  padding: .32rem .7rem; border-radius: 8px; transition: all .16s;
}
.tag::before { content: "#"; color: var(--brand); margin-right: .1rem; }
.tag:hover { border-color: var(--brand); color: var(--ink); }

/* Ad slot */
.ad-slot {
  margin: 2.5rem 0; padding: 0; text-align: center;
  min-height: 90px; display: grid; place-items: center;
}
.ad-slot::before {
  content: "advertisement"; font-family: var(--mono); font-size: .62rem;
  color: var(--faint); letter-spacing: .16em; text-transform: uppercase;
}
.ad-slot ins { display: block; }

/* Prev / next */
.post-nav { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin: 3rem 0 0; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }
.post-nav a {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.1rem 1.25rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  transition: border-color .2s, transform .2s;
}
.post-nav a:hover { border-color: var(--brand); transform: translateY(-2px); }
.post-nav .dir { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.post-nav .t { color: var(--ink); font-weight: 600; font-size: .96rem; line-height: 1.4; }
.post-nav .next { text-align: right; }

/* ============================================================
   Pages / prose blocks
   ============================================================ */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--display); font-size: clamp(1.8rem,4vw,2.6rem); letter-spacing: -.02em; margin: .6rem 0 0; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination { display: flex; justify-content: center; gap: .5rem; margin: 3rem 0 0; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 .7rem;
  font-family: var(--mono); font-size: .85rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-soft);
  transition: all .18s;
}
.pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pagination .page-numbers.current { background: var(--grad); color: #fff; border-color: transparent; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-tint); margin-top: 4rem; }
.footer-grid {
  display: grid; gap: 2.5rem; padding: 3.5rem 0 2.5rem;
  grid-template-columns: 1.6fr 1fr 1fr;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand-col { grid-column: 1 / -1; } }
.footer-brand-col p { color: var(--muted); font-size: .92rem; max-width: 34ch; margin: 1rem 0 0; }
.footer-col h4 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin: 0 0 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer-col a { color: var(--ink-soft); font-size: .95rem; }
.footer-col a:hover { color: var(--brand-ink); }
.footer-legal {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .75rem;
  padding: 1.25rem 0; border-top: 1px solid var(--line);
  font-size: .82rem;
}
.footer-legal a { color: var(--ink-soft); font-weight: 500; }
.footer-legal a:hover { color: var(--brand-ink); }
.footer-legal .sep { color: var(--faint); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem 0; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
}
.footer-bottom .prompt { color: var(--faint); }

/* Back to top */
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 90;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(12px) scale(.9);
  transition: opacity .3s var(--ease), transform .3s var(--ease), border-color .2s;
  pointer-events: none;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--brand); color: var(--brand); }

/* ============================================================
   Misc
   ============================================================ */
.empty-state { text-align: center; padding: 5rem 1rem; color: var(--muted); }
.empty-state h1 { font-family: var(--display); font-size: 3rem; margin: 0 0 .5rem; }
.search-form { display: flex; gap: .5rem; }
.search-form input[type=search] {
  flex: 1; padding: .7rem .9rem; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--surface); color: var(--ink); font-family: var(--sans);
}
.search-form input[type=search]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: .92rem;
  padding: .7rem 1.2rem; border-radius: 10px; border: 1px solid transparent;
  background: var(--grad); color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(109,94,252,.3); transition: transform .12s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 6px 20px rgba(109,94,252,.4); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px;
}
