/* OBZDN AI Tools for aitools.obzdn.co
   Same design system as obzdn.co (obsidian + brushed steel). Zero dependencies, no external requests. */

:root {
  --bg: #0a0b0d;
  --bg-soft: #101216;
  --bg-card: #121419;
  --text: #f3f1ec;
  --muted: #9aa1ab;
  --muted-2: #6c727c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #c9ced6;
  --accent-soft: rgba(201, 206, 214, 0.08);
  --accent-line: rgba(201, 206, 214, 0.30);
  --steel: linear-gradient(180deg, #f4f5f7 0%, #c3c8cf 46%, #8d939c 54%, #d9dce1 100%);
  --max: 1120px;
  --pad: clamp(16px, 5vw, 40px);
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg-card); padding: 8px 12px; z-index: 60; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--accent-line); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  background: rgba(10, 11, 13, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.brand .mark { width: 40px; height: 40px; flex: none; }
.brand .wordmark { display: inline-flex; flex-direction: column; line-height: 1; }
.brand .wordmark b {
  font-size: 19px; font-weight: 800; letter-spacing: 0.12em; color: #e6e8eb;
  background: var(--steel); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand .wordmark small { font-size: 8.5px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; transition: color 0.18s ease, background 0.18s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ---------- Buttons & pills ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-primary {
  background: linear-gradient(180deg, #2a2e35 0%, #16181c 100%);
  color: #eef0f2;
  border-color: rgba(214, 218, 224, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.02em;
}
.btn-primary:hover { transform: translateY(-1px); background: linear-gradient(180deg, #343941 0%, #1c1f24 100%); border-color: #dfe3e8; }
.pill {
  display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap;
}
.pill.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- Hero ---------- */
.crumbs { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--muted-2); margin-top: 28px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.hero { position: relative; padding: clamp(56px, 10vw, 120px) 0 clamp(36px, 6vw, 64px); }
.hero-home { margin: 0 calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); border-bottom: 1px solid var(--border); }
.hero-home::before {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw);
  background: url("/brand/hero-pattern.jpg") center / cover no-repeat; opacity: 0.5;
  mask-image: radial-gradient(120% 95% at 50% 0%, #000 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(120% 95% at 50% 0%, #000 40%, transparent 85%);
  pointer-events: none; z-index: -1;
}
.hero-home::after {
  content: ""; position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: min(760px, 100vw); height: 620px;
  background: radial-gradient(closest-side, rgba(214, 218, 224, 0.07), transparent 72%);
  pointer-events: none; z-index: -1;
}
main { position: relative; z-index: 0; overflow-x: clip; }
.hero.small { padding: clamp(32px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); }
h1 { font-size: clamp(40px, 7.4vw, 84px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 24px; max-width: 14ch; text-wrap: balance; }
.hero.small h1 { font-size: clamp(32px, 5.4vw, 56px); line-height: 1.04; max-width: 20ch; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 24px; text-wrap: balance; }
h3 { font-size: 18px; letter-spacing: -0.01em; margin: 0; }
.lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; color: var(--muted); max-width: 52ch; margin: 0; }
.lede strong { color: var(--text); font-weight: 600; }
main > section { padding-top: clamp(48px, 7vw, 88px); }
main > section.hero, main > section.hero.small, main > .crumbs + section { padding-top: clamp(32px, 6vw, 64px); }
.hero-home { padding-top: clamp(64px, 11vw, 130px) !important; }

.search { display: block; margin-top: 36px; max-width: 580px; }
.search input {
  width: 100%; font: inherit; font-size: 17px; padding: 15px 20px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: rgba(18, 20, 25, 0.85); color: var(--text);
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#results { padding-top: 28px; }

/* ---------- Cards ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cat, .tool, .setup, .facts div {
  position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-card);
}
.cat::before, .tool.is-featured::before, .setup::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}
.cat { display: flex; flex-direction: column; padding: 24px; text-decoration: none; transition: border-color 0.18s ease, transform 0.18s ease; }
.cat:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.cat p { color: var(--muted); font-size: 15.5px; line-height: 1.55; margin: 10px 0 18px; }
.cat span { margin-top: auto; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.tools[hidden] { display: none; }
.tool { padding: 22px; display: flex; flex-direction: column; transition: border-color 0.18s ease; }
.tool:hover { border-color: var(--accent-line); }
.tool.is-featured { border-color: var(--accent-line); background: linear-gradient(180deg, #171a20, var(--bg-card) 55%); }
.tool-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.tool h3 a { text-decoration: none; }
.tool h3 a::after { content: ""; position: absolute; inset: 0; }
.tool p { margin: 10px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.tool .meta { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted-2); border-top: 1px solid var(--border); }
.tool p.meta { margin-top: 18px; }
.tool .meta span:first-child { color: var(--text); font-weight: 600; }
.empty { color: var(--muted); }

.setup { margin: clamp(56px, 8vw, 96px) 0 0; padding: clamp(28px, 4.5vw, 52px); }
.setup p:not(.eyebrow) { color: var(--muted); max-width: 58ch; margin: 0 0 28px; font-size: 18px; }
.setup h2 { margin-bottom: 14px; }

/* ---------- Tool page ---------- */
.toolpage .tp-head { padding: clamp(28px, 5vw, 56px) 0 0; }
.toolpage h1 { font-size: clamp(36px, 6vw, 64px); max-width: 18ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin: clamp(40px, 6vw, 64px) 0 20px; }
.facts div { padding: 22px; }
.facts dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.facts dd { margin: 10px 0 0; line-height: 1.55; }
.checked, .disclosure { font-size: 14.5px; color: var(--muted); }
.sources { font-size: 14px; color: var(--muted-2); margin-top: 10px; }
.sources summary { cursor: pointer; color: var(--muted); }
.sources a { color: var(--muted); word-break: break-all; }
.related h2 { font-size: clamp(24px, 3vw, 30px); }

/* ---------- Prose pages ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(22px, 3vw, 28px); margin: 40px 0 12px; }
.prose p, .prose li { color: var(--muted); }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--text); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: clamp(64px, 9vw, 110px); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; margin-bottom: 40px; }
.footer .brand { margin-bottom: 14px; }
.footer .entity { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.footer .loc { color: var(--muted); font-size: 15px; margin: 0; }
.footer .foot-note { margin-top: 12px; max-width: 42ch; font-size: 14px; color: var(--muted-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; max-width: 520px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color 0.18s ease; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 26px;
  border-top: 1px solid var(--border); color: var(--muted-2); font-size: 14px;
}
.footer-bottom .mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-row { height: 64px; }
  .nav .btn { padding: 8px 14px; font-size: 14px; }
  .brand .mark { width: 34px; height: 34px; }
  .footer-top { flex-direction: column; }
  .tools, .cats, .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
