/* NoirKit — dark-first, mobile-first */
:root[data-theme="dark"] {
  --bg: #0b0b12;
  --bg-alt: #101019;
  --card: #15151f;
  --card-2: #1b1b28;
  --text: #eceaf4;
  --muted: #9a97ad;
  --border: #262637;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --bad: #f87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
:root[data-theme="light"] {
  --bg: #faf9fd;
  --bg-alt: #f1eff8;
  --card: #ffffff;
  --card-2: #f4f2fb;
  --text: #17151f;
  --muted: #5d5a70;
  --border: #e2dff0;
  --accent: #6d3ff0;
  --accent-2: #0891b2;
  --ok: #059669;
  --bad: #dc2626;
  --shadow: 0 10px 30px rgba(30, 20, 70, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--card-2);
  padding: .1em .35em;
  border-radius: 5px;
  font-size: .92em;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 14px; z-index: 50;
}
.skip-link:focus { left: 8px; top: 8px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }

/* hero */
.hero { padding: 56px 0 30px; background: radial-gradient(1100px 400px at 50% -80px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.5px; }
.lede { color: var(--muted); font-size: 17px; max-width: 720px; margin: 0 0 30px; }

/* form */
.gen-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.grow { flex: 1 1 320px; }
.field.narrow { flex: 0 1 110px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
label, legend { font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 0; }
.hint { font-weight: 400; opacity: .8; }
input[type="text"], select {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15.5px;
  width: 100%;
}
input[type="text"]:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type="text"]::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.style-chip input { position: absolute; opacity: 0; pointer-events: none; }
.style-chip span {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.style-chip input:checked + span {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
  border-color: transparent;
  color: #fff;
}
.style-chip input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.style-chip:hover span { border-color: var(--accent); color: var(--text); }
.style-chip input:checked + span:hover { color: #fff; }

.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center;
  padding: 9px 10px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-2); color: var(--muted); cursor: pointer;
}
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-2)));
  border-color: transparent; color: #fff;
}
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 13px; font-size: 13.5px; }

/* results */
.results-panel { margin-top: 26px; }
.results-meta { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; }
.results-empty { color: var(--muted); background: var(--card); border: 1px dashed var(--border); padding: 18px; border-radius: 12px; }
.results {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.nk-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 15px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color .15s ease;
}
.nk-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.nk-name { font-size: 17px; font-weight: 600; background: transparent; padding: 0; word-break: break-all; color: var(--text); }
.nk-badges { display: flex; gap: 6px; }
.nk-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .3px; }
.nk-badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.nk-badge.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.nk-actions { display: flex; gap: 8px; margin-top: auto; }
.nk-btn {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.nk-btn:hover { border-color: var(--accent); }
.nk-btn.done { background: color-mix(in srgb, var(--ok) 20%, transparent); border-color: var(--ok); color: var(--ok); }
.nk-btn.fav[aria-pressed="true"] { color: #f472b6; border-color: #f472b6; }
.fineprint { color: var(--muted); font-size: 13px; margin-top: 14px; max-width: 760px; }

.h-sub { font-size: 20px; }

/* sections */
.section { padding: 54px 0; border-top: 1px solid var(--border); }
.section.alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 10px; letter-spacing: -.3px; }
.section > .wrap > p { color: var(--muted); margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 22px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.tile h3 { margin: 0 0 8px; font-size: 16.5px; }
.tile .ex { font-family: ui-monospace, Menlo, monospace; color: var(--accent-2); font-size: 14px; margin: 0 0 8px; word-break: break-word; }
.tile p:last-child { color: var(--muted); font-size: 14.5px; margin: 0; }

.prose { max-width: 760px; }
.prose li { margin-bottom: 9px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }

details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 15px 0; list-style: none; position: relative; padding-right: 28px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 2px; color: var(--accent); font-size: 20px; font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { margin: 0 0 16px; color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0 40px; background: var(--bg-alt); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.brand-line { font-weight: 700; margin: 0 0 6px; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.site-footer nav a { color: var(--muted); font-size: 14px; }
.site-footer nav a:hover { color: var(--text); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--accent);
  padding: 11px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  z-index: 60; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .site-nav a { display: none; }
  .site-nav a[href="#faq"] { display: inline; }
  .gen-panel { padding: 16px; }
  .btn { flex: 1 1 auto; }
  .results { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto; }
}
