/* ===========================================================================
   Design tokens
   =========================================================================== */
:root {
  color-scheme: light;

  --bg:            #fbfaf8;
  --bg-raised:     #ffffff;
  --bg-sunken:     #f2f0ec;
  --bg-hover:      #edeae4;

  --ink:           #16181c;
  --ink-2:         #4a4f57;
  --ink-3:         #767c85;

  --line:          #e3dfd8;
  --line-strong:   #cfc9c0;

  --accent:        #740504;
  --accent-hover:  #8d0605;
  --accent-soft:   #fbeeed;
  --accent-ink:    #5e0403;

  --warn:          #b45309;
  --warn-soft:     #fdf0e0;
  --danger:        #b42318;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .06), 0 1px 1px rgba(20, 22, 26, .04);
  --shadow:    0 2px 4px rgba(20, 22, 26, .05), 0 8px 20px -8px rgba(20, 22, 26, .12);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1140px;
  --wrap-prose: 720px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #14161a;
    --bg-raised:   #1c1f25;
    --bg-sunken:   #101216;
    --bg-hover:    #262a31;
    --ink:         #f0efec;
    --ink-2:       #b6bac1;
    --ink-3:       #878d97;
    --line:        #2c313a;
    --line-strong: #3d434e;
    --accent:      #e8736c;
    --accent-hover:#f0908a;
    --accent-soft: #341413;
    --accent-ink:  #f6b8b2;
    --warn:        #f0a758;
    --warn-soft:   #33260f;
    --danger:      #f2837a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 2px 4px rgba(0,0,0,.3), 0 10px 24px -10px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #14161a;
  --bg-raised:   #1c1f25;
  --bg-sunken:   #101216;
  --bg-hover:    #262a31;
  --ink:         #f0efec;
  --ink-2:       #b6bac1;
  --ink-3:       #878d97;
  --line:        #2c313a;
  --line-strong: #3d434e;
  --accent:      #e8736c;
  --accent-hover:#f0908a;
  --accent-soft: #341413;
  --accent-ink:  #f6b8b2;
  --warn:        #f0a758;
  --warn-soft:   #33260f;
  --danger:      #f2837a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 2px 4px rgba(0,0,0,.3), 0 10px 24px -10px rgba(0,0,0,.6);
}

/* ===========================================================================
   Reset & base
   =========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* Class rules like .row{display:grid} outrank the UA style for [hidden], which
   left panels visible when JS tried to hide them. This has to win outright. */
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 650; letter-spacing: -0.018em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2.1vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.65rem); }
h3 { font-size: 1.1rem; }
p  { text-wrap: pretty; }

a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===========================================================================
   Header
   =========================================================================== */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.06rem; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #c9563f));
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--ink); background: var(--bg-hover); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-hover); }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--ink); }

@media (max-width: 720px) {
  .nav a.hide-sm { display: none; }
}

/* ===========================================================================
   Search
   =========================================================================== */
.search { position: relative; flex: 1 1 auto; max-width: 320px; }
.search input[type="search"] {
  width: 100%; padding: 8px 12px 8px 34px;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: 999px; font-size: .9rem;
}
.search input[type="search"]::placeholder { color: var(--ink-3); }
.search input[type="search"]:focus { background: var(--bg-raised); border-color: var(--accent); outline: none; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 340px; overflow-y: auto; padding: 5px;
}
.search-results a {
  display: block; padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: .9rem;
}
.search-results a:hover, .search-results a.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.search-results .sr-cat { display: block; font-size: .74rem; color: var(--ink-3); }
.search-results .sr-empty { padding: 12px; color: var(--ink-3); font-size: .88rem; }
@media (max-width: 560px) { .search { max-width: none; } }

/* ===========================================================================
   Layout
   =========================================================================== */
main { flex: 1 0 auto; padding-block: 28px 56px; }
.crumbs { font-size: .84rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 34px; align-items: start; }
@media (max-width: 940px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } }

.page-head { margin-bottom: 22px; }
.page-head p.lede { font-size: 1.06rem; color: var(--ink-2); margin-top: 9px; max-width: 62ch; }

/* ===========================================================================
   Cards & panels
   =========================================================================== */
.panel {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 560px) { .panel { padding: 17px; border-radius: var(--radius); } }

.card-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
.tool-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
  text-decoration: none; color: var(--ink);
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.tool-card:hover {
  border-color: var(--accent); color: var(--ink);
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.tool-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tool-card strong { font-weight: 620; font-size: .97rem; letter-spacing: -.01em; }
.tool-card .tool-body > span { font-size: .84rem; color: var(--ink-3); line-height: 1.45; }

/* Tinted tile so the icon reads as part of the card rather than floating text. */
.tool-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  transition: background .14s, color .14s;
}
.tool-card:hover .tool-icon { background: var(--accent); color: var(--bg-raised); }
.tool-icon .ti { width: 20px; height: 20px; display: block; }
@media (max-width: 420px) {
  .tool-icon { width: 34px; height: 34px; border-radius: 9px; }
  .tool-icon .ti { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-icon { transition: none; }
  .tool-card:hover { transform: none; }
}

/* ===========================================================================
   Forms
   =========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field > label, .field-label { font-size: .875rem; font-weight: 560; color: var(--ink-2); }
.hint { font-size: .8rem; color: var(--ink-3); }

input[type="text"], input[type="number"], input[type="date"], input[type="time"],
input[type="email"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 1rem;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23767c85' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-group select, .input-group .addon { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; width: auto; min-width: 88px; }
.addon {
  display: grid; place-items: center; padding-inline: 12px;
  background: var(--bg-sunken); border: 1px solid var(--line-strong);
  color: var(--ink-3); font-size: .9rem;
}

/* Segmented control */
.seg { display: inline-flex; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 15px; border-radius: 999px; font-size: .875rem; font-weight: 540; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--bg-raised); color: var(--ink); box-shadow: var(--shadow-sm); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; border: 1px solid transparent;
  font-size: .94rem; font-weight: 580; cursor: pointer; text-decoration: none;
  transition: background .12s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }

/* ===========================================================================
   Results
   =========================================================================== */
.result {
  margin-top: 20px; padding: 20px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
}
.result-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 620; color: var(--accent-ink); }
.result-value {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.9rem); font-weight: 700; line-height: 1.1;
  letter-spacing: -.03em; color: var(--accent-ink); font-variant-numeric: tabular-nums;
  margin-top: 4px; overflow-wrap: anywhere;
}
.result-note { font-size: .92rem; color: var(--ink-2); margin-top: 8px; }
.result-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-top: 16px; }
.stat { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat dt { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat dd { font-size: 1.3rem; font-weight: 660; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.notice { padding: 12px 15px; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid; }
.notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }

/* ===========================================================================
   Prose (blog + tool explainer content)
   =========================================================================== */
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 2em; scroll-margin-top: 76px; }
.prose h3 { margin-top: 1.5em; scroll-margin-top: 76px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose code {
  background: var(--bg-sunken); padding: .12em .38em; border-radius: 5px;
  font-family: var(--font-num); font-size: .89em;
}
.prose blockquote {
  border-left: 3px solid var(--accent); padding-left: 16px; color: var(--ink-2); font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 620; background: var(--bg-sunken); }
.prose tbody tr:hover { background: var(--bg-sunken); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* The answer-first block: the paragraph AI engines and featured snippets lift */
.answer {
  border-left: 3px solid var(--accent); background: var(--bg-sunken);
  padding: 15px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.02rem; color: var(--ink);
}

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line); padding: 15px 0;
}
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-weight: 580; list-style: none;
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; flex: none; font-weight: 400;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { margin-top: 9px; color: var(--ink-2); }
.faq details > div > * + * { margin-top: .8em; }

/* ===========================================================================
   Sidebar
   =========================================================================== */
.side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 78px; }
@media (max-width: 940px) { .side { position: static; } }
.side h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 640; margin-bottom: 10px; }
.side-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.side-list a {
  display: block; padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-size: .91rem;
}
.side-list a:hover { background: var(--bg-hover); color: var(--ink); }

/* ===========================================================================
   Ad slots — reserved space so approval does not cause layout shift
   =========================================================================== */
.ad { display: block; margin-block: 26px; text-align: center; overflow: hidden; }
.ad[data-empty="true"] { display: none; }
.ad-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: 5px; }

/* ===========================================================================
   Footer
   =========================================================================== */
.site-foot {
  flex: none; border-top: 1px solid var(--line);
  background: var(--bg-sunken); padding-block: 36px 28px; margin-top: 40px;
  font-size: .9rem; color: var(--ink-2);
}
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(auto-fit, minmax(130px, 1fr)); }
.site-foot h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 640; margin-bottom: 9px; }
.site-foot ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.foot-legal {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; font-size: .84rem; color: var(--ink-3);
}

/* ===========================================================================
   Hero (home)
   =========================================================================== */
.hero { text-align: center; padding-block: 30px 34px; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.1rem); }
.hero p { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; margin: 12px auto 0; }
.hero .search { max-width: 460px; margin: 24px auto 0; }
.hero .search input[type="search"] { padding: 13px 16px 13px 42px; font-size: 1rem; }
.hero .search svg { left: 15px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.pill {
  padding: 6px 13px; border-radius: 999px; background: var(--bg-raised);
  border: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); text-decoration: none;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 15px; flex-wrap: wrap; }
.section-head h2 { letter-spacing: -.025em; }
.section-head p { color: var(--ink-3); font-size: .92rem; }
.section-head a { font-size: .9rem; text-decoration: none; font-weight: 550; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

/* ===========================================================================
   Blog
   =========================================================================== */
.post-list { display: flex; flex-direction: column; gap: 2px; }
.post-item {
  display: block; padding: 17px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink); border: 1px solid transparent;
}
.post-item:hover { background: var(--bg-raised); border-color: var(--line); color: var(--ink); }
.post-item h3 { font-size: 1.1rem; margin-bottom: 4px; }
.post-item p { color: var(--ink-2); font-size: .93rem; }
.post-meta { font-size: .82rem; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 7px; }

.print-only { display: none; }
@media print {
  .site-head, .site-foot, .side, .ad, .no-print { display: none !important; }
  body { background: #fff; }
  .print-only { display: block; }
}


/* ===========================================================================
   Answer pages — one page, one exact question
   =========================================================================== */
.answer-box {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-lg); padding: 24px 26px; margin-bottom: 20px;
}
.answer-label {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 640; color: var(--accent-ink);
}
.answer-value {
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 720;
  line-height: 1.15; letter-spacing: -.03em; color: var(--accent-ink);
  margin-top: 6px; overflow-wrap: anywhere;
}
.answer-note { font-size: .96rem; color: var(--ink-2); margin-top: 10px; }
.answer-cta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 4px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.answer-cta:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow); }
.answer-cta strong { font-weight: 620; font-size: .97rem; display: block; }
.answer-cta .tool-body > span { font-size: .84rem; color: var(--ink-3); line-height: 1.45; }
