/* ToolPeasy design system.
   Paper white with a breath of green, deep pod-green ink, one pea-green accent.
   Bricolage Grotesque for headings, Figtree for reading. Self-hosted fonts. */

@font-face { font-family: "Bricolage"; src: url("/shared/fonts/bricolage.woff") format("woff"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/shared/fonts/figtree.woff") format("woff"); font-weight: 300 900; font-display: swap; }

:root {
  --paper: #fbfcf9;        /* page */
  --pod: #eef4e8;          /* soft green surface: tool panels, highlights */
  --pod-2: #e1ebd8;        /* pressed / hover on pod */
  --line: #dbe3d4;         /* hairlines */
  --ink: #17261c;          /* text */
  --ink-2: #536257;        /* secondary text */
  --pea: #3c8a23;          /* brand + primary actions (AA on paper) */
  --pea-deep: #2e6d1a;     /* hover / pressed */
  --pea-ink: #ffffff;
  --sprout: #b8e08f;       /* small highlights only */
  --good: #2e7d32; --good-bg: #e6f3e3;
  --warn: #8a5a00; --warn-bg: #fbf0d9;
  --bad: #b3261e;  --bad-bg: #fbe9e7;
  --radius-lg: 22px; --radius: 14px; --radius-sm: 9px;
  --lift: 0 1px 1px rgba(23, 38, 28, .04), 0 10px 30px -12px rgba(23, 38, 28, .16);
  --display: "Bricolage", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
  color-scheme: light;
  /* legacy aliases used by tool scripts and older components */
  --bg: var(--paper); --surface: var(--pod); --surface-2: var(--pod-2); --border: var(--line);
  --text: var(--ink); --muted: var(--ink-2); --accent: var(--pea); --accent-ink: var(--pea-ink);
  --shadow: var(--lift); --font: var(--sans);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1712; --pod: #17231b; --pod-2: #203027; --line: #2a3a2f;
    --ink: #e7efe4; --ink-2: #a3b2a6; --pea: #7cc657; --pea-deep: #93d771; --pea-ink: #0d1a0f; --sprout: #3e6b2a;
    --good: #7cc657; --good-bg: #183020; --warn: #e5b04a; --warn-bg: #2e2513; --bad: #f2877e; --bad-bg: #351a18;
    --lift: 0 1px 1px rgba(0,0,0,.3), 0 12px 30px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, canvas, svg { max-width: 100%; display: block; }
img, canvas { height: auto; }
a { color: var(--pea); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pea-deep); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0 0 .45em; line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-top: 1.7em; }
h3 { font-size: 1.12rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--pod); padding: .1em .35em; border-radius: 5px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--pea) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font: 800 1.32rem/1 var(--display); letter-spacing: -.03em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a, .nav > details > summary { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; padding: 9px 12px; border-radius: 10px; cursor: pointer; list-style: none; }
.nav > a:hover, .nav > details > summary:hover, .nav > details[open] > summary { background: var(--pod); }
.nav > a[aria-current="page"] { color: var(--pea); }
.nav summary::-webkit-details-marker { display: none; }
.nav summary .caret { display: inline-block; margin-left: 4px; transition: transform .15s; }
.nav details[open] summary .caret { transform: rotate(180deg); }
.menu { position: absolute; left: 50%; transform: translateX(-50%); top: 64px; width: min(880px, calc(100vw - 32px));
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--lift); padding: 22px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 26px; }
.menu h3 { font-size: .95rem; color: var(--ink-2); font-weight: 600; margin: 0 0 8px; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li a { display: flex; gap: 10px; align-items: center; padding: 7px 8px; margin: 0 -8px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; }
.menu li a:hover { background: var(--pod); }
.menu li a .ico { width: 30px; height: 30px; flex: none; }
.menu li .soon { color: var(--ink-2); font-weight: 500; padding: 7px 0; display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 10px; border-radius: 10px; color: var(--ink); cursor: pointer; }
.menu-btn:hover { background: var(--pod); }
.menu-btn svg { width: 26px; height: 26px; }
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 18px; gap: 2px; max-height: calc(100vh - 66px); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav > details > summary { display: none; }
  .nav > details { order: -1; }
  .nav > details > .menu { display: grid !important; position: static; transform: none; width: auto; box-shadow: none; border: 0; padding: 4px 0 10px; grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 96px; background: var(--pod); border-top: 1px solid var(--line); padding: 48px 0 36px; color: var(--ink-2); font-size: .95rem; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.foot-grid h3 { font-size: .98rem; color: var(--ink); margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: 650 .97rem/1 var(--sans); cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--pod); border-color: var(--pod-2); color: var(--ink); }
.btn-primary { background: var(--pea); border-color: var(--pea); color: var(--pea-ink); }
.btn-primary:hover { background: var(--pea-deep); border-color: var(--pea-deep); color: var(--pea-ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  min-height: 48px; padding: 10px 14px; width: 100%; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-2) 75%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--pea); outline: 3px solid color-mix(in srgb, var(--pea) 22%, transparent); outline-offset: 0; }
label { font-weight: 600; font-size: .95rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--pea); width: 18px; height: 18px; }

/* ---------- Page scaffolding ---------- */
.hero { padding: 56px 0 18px; }
.hero p.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 640px; }
.crumbs { font-size: .9rem; color: var(--ink-2); margin: 26px 0 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.tool-head { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0 8px; }
.tool-head .ico { width: 58px; height: 58px; flex: none; margin-top: 6px; }
.tool-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); margin-bottom: .25em; }
.tool-head p { color: var(--ink-2); font-size: 1.1rem; margin: 0; max-width: 680px; }
@media (max-width: 560px) { .tool-head .ico { width: 44px; height: 44px; } }
.panel { background: var(--pod); border-radius: var(--radius-lg); padding: 22px; margin-top: 22px; }
.content { max-width: 740px; }
.content li + li { margin-top: 6px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--pod); color: var(--ink-2); white-space: nowrap; }
.status-pass { color: var(--good); background: var(--good-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-fail { color: var(--bad); background: var(--bad-bg); }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--pod); }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 650; list-style-position: inside; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; }
.table-scroll { overflow-x: auto; }
pre.code, .output { background: var(--pod); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; }
.linklike { background: none; border: 0; padding: 0; color: var(--pea); text-decoration: underline; font: inherit; cursor: pointer; }

/* Related tools strip on tool pages */
.related { margin-top: 56px; }
.related ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.related a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.related a:hover { border-color: var(--pea); }
.related .ico { width: 34px; height: 34px; flex: none; }

/* Tool glyphs: drawn in currentColor on a pod tile */
.ico { border-radius: 12px; background: var(--pod); color: var(--pea); display: grid; place-items: center; }
.ico svg { width: 62%; height: 62%; }

/* ---------- Monetization components ---------- */
.ad-slot { margin: 32px 0; text-align: center; }
.ad-label { display: block; font-size: .75rem; color: var(--ink-2); margin-bottom: 4px; }
.offer-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--paper); margin: 14px 0; }
.offer-box .offer-tag { display: inline-block; font-size: .75rem; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); margin-right: 8px; vertical-align: 2px; }
.offer-box h3 { display: inline; font-size: 1.02rem; }
.offer-box p { margin: 8px 0 12px; color: var(--ink-2); }
.capture { margin: 28px 0; }
.capture form { display: grid; gap: 10px; grid-template-columns: 1fr auto; }
.capture .consent { grid-column: 1 / -1; font-weight: 400; font-size: .88rem; color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.capture .msg { grid-column: 1 / -1; font-size: .92rem; }
@media (max-width: 560px) { .capture form { grid-template-columns: 1fr; } }

/* Pricing */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 18px 0 8px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.plan.featured { border: 2px solid var(--pea); background: color-mix(in srgb, var(--pod) 55%, var(--paper)); }
.plan h3 { margin: 0; }
.plan .price { font: 800 2.1rem/1 var(--display); letter-spacing: -.03em; }
.plan .price small { font: 500 .92rem var(--sans); color: var(--ink-2); letter-spacing: 0; }
.plan ul { padding-left: 18px; margin: 0; color: var(--ink-2); flex: 1; }
.plan .fine { font-size: .82rem; color: var(--ink-2); margin: 0; }

/* Paywall dialog */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 18, .5); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { background: var(--paper); color: var(--ink); border-radius: var(--radius-lg); max-width: 470px; width: 100%; padding: 26px; box-shadow: var(--lift); }
.modal h2 { margin-top: 0; }

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