/* Shared stylesheet for every tool site. Each site's build appends its own accent colours.
   Layout: sticky top bar, two-column hero (pitch left, tool right) that stacks on phones,
   then content sections in one reading column. */

@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/familjen-grotesk.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("fonts/figtree.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("fonts/martian-mono.woff2") format("woff2"); }

:root {
  --bg: #eef0f3; --surface: #fafbfc; --ink: #161b22; --muted: #5a6370; --line: #d5dae1;
  --accent: #0b7363; --accent-ink: #ffffff;
  --good: #1d7a3a; --warn: #b5470f; --danger: #a3262a;
  --font-display: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-code: "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171b21; --ink: #e4e8ee; --muted: #98a2b0; --line: #2a313b;
    --good: #6fd38c; --warn: #f0894c; --danger: #f07a7d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #171b21; --ink: #e4e8ee; --muted: #98a2b0; --line: #2a313b;
  --good: #6fd38c; --warn: #f0894c; --danger: #f07a7d;
  color-scheme: dark;
}
:root { --accent-soft: color-mix(in srgb, var(--accent) 15%, var(--surface)); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
code { font-family: var(--font-code); font-size: 0.85em; }

.container { max-width: var(--max); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; inset-inline-start: 16px; top: 16px; z-index: 50; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; background: var(--surface); padding: 8px 12px; border-radius: 6px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 18px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
}
@media (max-width: 640px) { .nav { display: none; } .icon-btn { margin-left: auto; } }

/* Hero + tool */
.hero { padding-block: 48px 56px; }
.hero .container { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.eyebrow { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }
.hero-copy .lede { font-size: 1.1rem; color: var(--muted); max-width: 44ch; }
.trust { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem; }
.trust li { display: flex; gap: 10px; align-items: baseline; }
.trust li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: translateY(-1px); }
@media (max-width: 880px) {
  .hero { padding-block: 28px 40px; }
  .hero .container { display: flex; flex-direction: column; gap: 18px; }
  .hero-copy { display: contents; }
  .hero .tool { order: 1; margin-block: 6px 10px; }
  .hero-copy .lede, .hero .trust { order: 2; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
}

.tool { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 0 var(--line), 0 12px 32px -20px rgba(10, 20, 40, 0.35); min-width: 0; }
label.cap, .cap { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
textarea, .field {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--font-code); font-size: 0.84rem; line-height: 1.6;
}
textarea { min-height: 120px; resize: vertical; }
.field.text { font-family: var(--font-body); font-size: 0.95rem; }
textarea[readonly] { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
select.field { font-family: var(--font-body); font-size: 0.9rem; cursor: pointer; }
.hint { font-size: 0.84rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.range-row { display: flex; gap: 12px; align-items: center; }
.range-row input[type="number"] { width: 5.5em; flex: none; }
.inline { display: inline-flex; gap: 8px; align-items: center; font-size: 0.88rem; }
.inline .field { width: auto; padding: 6px 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.btn, .filebtn {
  font: 600 0.9rem var(--font-body); border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover, .filebtn:hover { border-color: var(--accent); }
.btn.primary, .filebtn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 5px 11px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.filebtn { position: relative; }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.88rem; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
.msg { font-size: 0.86rem; min-height: 1.3em; color: var(--muted); }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--good); }

/* Segmented control (tabs / modes) */
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); flex-wrap: wrap; }
.seg button { font: 600 0.86rem var(--font-body); border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* Output with copy */
.out { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 8px 12px; min-width: 0; }
.out .val { flex: 1; min-width: 0; font-family: var(--font-code); font-size: 0.86rem; overflow-wrap: anywhere; }
.out.big .val { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
.out .btn { flex: none; }

/* Strength meter */
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; background: var(--danger); border-radius: 4px; transition: width 0.2s ease; }
.meter[data-level="2"] .meter-bar span { background: var(--warn); }
.meter[data-level="3"] .meter-bar span, .meter[data-level="4"] .meter-bar span { background: var(--good); }
.meter-text { display: flex; justify-content: space-between; gap: 10px; font-size: 0.84rem; color: var(--muted); flex-wrap: wrap; }
.meter-text strong { color: var(--ink); }

/* Result box */
.result { border-radius: 10px; padding: 14px 16px; border: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.result h3 { font-size: 1.15rem; }
.result.good { border-color: var(--good); }
.result.good h3 { color: var(--good); }
.result.bad { border-color: var(--danger); }
.result.bad h3 { color: var(--danger); }
.result p { font-size: 0.9rem; color: var(--muted); }
.result code { overflow-wrap: anywhere; }

/* Content sections */
.section { padding-block: 64px; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; max-width: 62ch; }
.section-head p { color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { display: flex; flex-direction: column; gap: 8px; counter-increment: step; }
.steps li::before { content: counter(step); font-family: var(--font-code); font-weight: 600; font-size: 0.85rem; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.steps h3, .features h3 { font-size: 1.12rem; }
.steps p, .features p { color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.features > div { background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 22px; } .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.faq { display: flex; flex-direction: column; max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; font-size: 1.04rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-family: var(--font-code); font-size: 1.2rem; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 18px; color: var(--muted); max-width: 68ch; }

/* Other tools */
.tools { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tools a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; height: 100%; }
.tools a:hover { border-color: var(--accent); }
.tools svg { width: 30px; height: 30px; flex: none; }
.tools span { display: flex; flex-direction: column; }
.tools strong { font-family: var(--font-display); font-size: 1.02rem; }
.tools small { color: var(--muted); font-size: 0.82rem; }
@media (max-width: 760px) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tools { grid-template-columns: 1fr; } }

/* Prose pages */
.prose { max-width: 70ch; padding-block: 48px 72px; display: flex; flex-direction: column; gap: 16px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.prose h2 { font-size: 1.3rem; margin-top: 16px; }
.prose ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.prose .muted, .muted { color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.88rem; }
.footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.footer nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .meter-bar span { transition: none; } }

/* Site accent */
:root { --accent: #1f6fb2; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #7cbcff; --accent-ink: #04213b; } }
:root[data-theme="dark"] { --accent: #7cbcff; --accent-ink: #04213b; }
