/* GlintKit v2 — "porcelain workbench"
   Display: Bricolage Grotesque · Body: Instrument Sans · Mono: IBM Plex Mono */

:root {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #5D6B82;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --accent: #4C4DDC;
  --accent-ink: #FFFFFF;
  --accent-soft: #EEEEFF;
  --ok: #0E9F6E;
  --warn: #D97706;
  --err: #DC2626;
  --glint: linear-gradient(100deg, #7DE2FF 0%, #A78BFA 45%, #FFD166 100%);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.12);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #111A2E;
  --surface-2: #16213A;
  --ink: #EDF1F7;
  --ink-2: #C4CFDF;
  --muted: #8696AD;
  --line: #1F2C47;
  --line-2: #2C3B5C;
  --accent: #8587FF;
  --accent-ink: #0B1120;
  --accent-soft: #1B2347;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--ink-2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
code, .mono { font-family: var(--font-mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--ink); position: relative; overflow: hidden; padding: 2px 4px;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
/* the glint sweep — signature */
.brand::after {
  content: ""; position: absolute; inset: 0;
  background: var(--glint); opacity: 0;
  transform: translateX(-110%) skewX(-18deg);
  mix-blend-mode: overlay;
}
.brand:hover::after { animation: glint 0.9s ease; }
@keyframes glint {
  0% { opacity: .9; transform: translateX(-110%) skewX(-18deg); }
  100% { opacity: 0; transform: translateX(110%) skewX(-18deg); }
}
.nav-links { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.icon-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--line-2); }
#auth-slot .btn { padding: 8px 14px; font-size: .9rem; }
.menu-toggle { display: none; }
@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; padding: 16px 20px; gap: 14px;
  }
  .nav-links.open { display: flex; }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); filter: none; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 6px; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], input[type="color"], select, textarea {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: var(--font-body); font-size: .95rem;
}
textarea { font-family: var(--font-mono); font-size: .88rem; min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.field { margin-bottom: 14px; }
.row { display: grid; gap: 14px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; text-align: center; }
.hero .kicker {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.hero h1 .accent { color: var(--accent); }
.hero p.lede { max-width: 560px; margin: 0 auto 28px; font-size: 1.1rem; }
.search-box { position: relative; max-width: 620px; margin: 0 auto; }
.search-box input {
  height: 56px; font-size: 1.05rem; padding-left: 48px;
  border-radius: 16px; box-shadow: var(--shadow);
}
.search-box .search-ico { position: absolute; left: 16px; top: 16px; color: var(--muted); }
.search-box kbd {
  position: absolute; right: 14px; top: 16px; font-family: var(--font-mono);
  font-size: .75rem; color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 2px 7px; background: var(--surface-2);
}
.spec-line {
  margin-top: 22px; font-family: var(--font-mono); font-size: .8rem;
  color: var(--muted); letter-spacing: .05em;
}
.spec-line b { color: var(--ink); font-weight: 600; }

/* ---------- cards / grids ---------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-head a { font-size: .92rem; font-weight: 600; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .grid { grid-template-columns: 1fr; } }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); overflow: hidden;
  display: block; color: inherit;
}
.card:hover { text-decoration: none; border-color: var(--line-2); }
/* glint hairline on top of every panel */
.card::before, .panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--glint); opacity: 0; transition: opacity .25s ease;
}
.card:hover::before, .panel::before { opacity: 1; }
.card h3 { margin-bottom: 6px; }
.card p { font-size: .92rem; margin: 0; color: var(--muted); }
.card .cat {
  display: inline-block; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 5px; padding: 2px 7px; margin-bottom: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.chip {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: 99px; padding: 7px 15px; font-size: .88rem; font-weight: 500; cursor: pointer;
}
.chip:hover, .chip.active { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- tool page ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin: 22px 0 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.tool-head { margin-bottom: 22px; }
.tool-head p { max-width: 680px; }
.panel {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); overflow: hidden;
}
.panel-spec {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.panel-spec .ok { color: var(--ok); }
.result {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; font-family: var(--font-mono); font-size: .95rem; margin-top: 14px;
  word-break: break-word; white-space: pre-wrap; min-height: 24px;
}
.result strong { color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); }
.stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tool-body { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; margin: 34px 0 50px; }
@media (max-width: 900px) { .tool-body { grid-template-columns: 1fr; } }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { color: var(--ink-2); padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: 2px 0 2px 16px; color: var(--muted); }
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.aside-box h3 { font-size: .95rem; margin-bottom: 12px; }
.aside-box ul { list-style: none; margin: 0; padding: 0; }
.aside-box li { margin-bottom: 9px; font-size: .92rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 10px; background: var(--surface); }
.faq summary { font-weight: 600; cursor: pointer; color: var(--ink); }
.faq p { margin: 10px 0 2px; font-size: .94rem; }
.fav-btn { position: absolute; top: 16px; right: 16px; font-size: 1.2rem; background: none; border: none; cursor: pointer; color: var(--line-2); }
.fav-btn.faved { color: var(--err); }
.copy-btn { margin-top: 10px; }
.notice { border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; margin: 12px 0; }
.notice-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.notice-err { background: color-mix(in srgb, var(--err) 12%, var(--surface)); color: var(--err); }

/* ---------- blog & reviews ---------- */
.post-meta { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.sources { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 18px; }
.sources ol { padding-left: 20px; }
.sources li { font-size: .9rem; margin-bottom: 8px; word-break: break-word; }
.review {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
}
.review .stars { color: #F59E0B; letter-spacing: 2px; }
.review .who { font-weight: 600; font-size: .92rem; margin-top: 8px; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 44px 0 30px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--ink-2); font-size: .92rem; }
.site-footer a:hover { color: var(--accent); }
.footer-base { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: none; padding: 10px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: .95rem; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.badge { font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 2px 9px; text-transform: uppercase; letter-spacing: .04em; }
.badge-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.swatch-row { display: flex; gap: 0; border-radius: var(--radius-sm); overflow: hidden; height: 84px; margin-top: 14px; }
.swatch-row div { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-family: var(--font-mono); font-size: .72rem; cursor: pointer; }
.preview-box { border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 120px; display: flex; align-items: center; justify-content: center; margin-top: 14px; background: var(--surface-2); }
