/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #0e1b2c;
  --muted: #5b6472;
  --border: #e4e4df;
  --accent: #0e1b2c;
  --accent-ink: #ffffff;
  --accent-soft: #e6eaf0;
  --north: #d93a2f;
  --danger: #d93a2f;
  --radius-sm: 8px;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .04);
  --max: 1040px;
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1420;
    --surface: #121d2b;
    --surface-2: #1a2636;
    --text: #edf1f6;
    --muted: #9fb0c6;
    --border: #243245;
    --accent: #e9eef5;
    --accent-ink: #0e1b2c;
    --accent-soft: #1c2636;
    --north: #ff6a5e;
    --danger: #ff6a5e;
    --shadow: none;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.icon { width: 1em; height: 1em; flex: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

/* ---------- Header / footer ---------- */
header.site {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo {
  display: inline-flex; align-items: center;
  gap: 9px; font-size: 1.2rem; letter-spacing: -.025em; text-decoration: none; color: var(--text);
}
.logo .mark { width: 30px; height: 30px; flex: none; display: block; }
.logo .wm-a { font-weight: 500; color: var(--muted); }
.logo .wm-b { font-weight: 800; }
nav.main a { white-space: nowrap; }
nav.main { display: flex; gap: 4px; }
nav.main a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 500;
}
nav.main a:hover { color: var(--text); background: var(--surface-2); }
nav.main a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

footer.site { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
footer.site a { color: var(--muted); }
footer.site .copy { margin-left: auto; }

/* ---------- Layout & type ---------- */
main { padding: 28px 0 56px; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: 1.35rem; line-height: 1.3; letter-spacing: -.01em; margin: 44px 0 12px; }
h3 { font-size: 1.05rem; margin: 24px 0 6px; }
.lead { color: var(--muted); font-size: 1.125rem; margin: 0 0 24px; max-width: 60ch; }
.eyebrow { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }

.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb ol { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Hero (home) ---------- */
.hero { padding: 24px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0 0 36px; list-style: none; color: var(--muted); font-size: .95rem; }
.chips li { display: inline-flex; align-items: center; gap: 6px; }
.chips .icon { color: var(--accent); }

/* ---------- Tool cards ---------- */
.tools-featured { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tool-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start;
  padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card .tile {
  grid-row: span 3; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 26px;
}
.tool-card h3 { margin: 2px 0 0; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool-card .cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 600; color: var(--accent); font-size: .95rem; }
.tool-card:hover .cta .icon { transform: translateX(3px); }
.cta .icon { transition: transform .15s ease; }

.tools-soon { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 0; list-style: none; margin: 0; }
.tools-soon li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border); color: var(--muted); font-size: .95rem;
}
.tools-soon .icon { font-size: 20px; }
.badge {
  margin-left: auto; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted);
}

/* ---------- Tool panels & controls ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.btn, button, select {
  font: inherit; font-size: .95rem; font-weight: 500; min-height: var(--tap); padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--surface-2); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; }
.seg button { border: 0; min-height: 38px; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

.readout { font-size: clamp(1.8rem, 6vw, 2.4rem); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 0; line-height: 1.2; }
.readout small { display: block; font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.hint.ok { color: var(--accent); }

/* Ad slots stay collapsed until real ad code is added (add class "is-live"). */
.ad-slot { display: none; }
.ad-slot.is-live { display: block; margin: 32px 0; min-height: 250px; }

/* ---------- Article content ---------- */
article.content { max-width: 70ch; }
article.content li { margin-bottom: 6px; }
.related { margin-top: 48px; }
.related .tools-featured { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  nav.main a { padding: 0 10px; font-size: .9rem; }
  nav.main a.hide-sm { display: none; }
  .logo { font-size: 1.1rem; }
  .tool-card { padding: 16px; }
  .tool-card .tile { width: 44px; height: 44px; font-size: 22px; }
  .panel { padding: 16px; }
  footer.site .copy { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Brand mark ---------- */
:root { --mark-bg: #0e1b2c; }
@media (prefers-color-scheme: dark) { :root { --mark-bg: #1d3150; } }
.mark .bg { fill: var(--mark-bg); }
