/* ============================================================
   Grid Maker Pro — shared site stylesheet
   Used by all /tools, /grids, /learn, /for, /compare, /glossary pages
   Design tokens match the homepage hero
   ============================================================ */

:root {
  --c-bg: #fbfbfd;
  --c-surface: #ffffff;
  --c-surface-2: #f5f5f7;
  --c-surface-3: #efeff2;
  --c-border: #e5e5ea;
  --c-border-2: #d8d8de;
  --c-text-1: #0a0a0c;
  --c-text-2: #4a4a52;
  --c-text-3: #86868b;
  --c-text-inv: #ffffff;
  --c-accent: #6b7280;
  --c-accent-h: #4b5563;
  --c-accent-soft: #f3f4f6;
  --c-success: #10b981;
  --c-danger: #ef4444;
  --c-highlight: #fde68a;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(10,10,12,.04), 0 1px 1px rgba(10,10,12,.03);
  --sh-2: 0 4px 12px rgba(10,10,12,.06), 0 1px 2px rgba(10,10,12,.04);
  --sh-3: 0 12px 32px rgba(10,10,12,.08), 0 4px 8px rgba(10,10,12,.04);
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --t-fast: 120ms; --t-base: 200ms; --t-slow: 320ms;
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px;
  --s-8:32px; --s-10:40px; --s-12:48px; --s-16:64px;
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", Monaco, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--f-sans); background: var(--c-bg); color: var(--c-text-1); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--c-text-1); text-decoration: underline; text-decoration-color: var(--c-border-2); text-underline-offset: 3px; transition: text-decoration-color var(--t-base) var(--ease-out); }
a:hover { text-decoration-color: var(--c-text-1); }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-8) 0; }
code, .kbd { font-family: var(--f-mono); font-size: 0.86em; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-sm); padding: 2px 6px; color: var(--c-text-2); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-6); }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--s-6); }
.container-prose { max-width: 720px; margin: 0 auto; padding: 0 var(--s-6); }

/* ---------- Top bar ---------- */
.gm-topbar { position: sticky; top: 0; z-index: 50; background: rgba(251,251,253,.92); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--c-border); }
.gm-topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.gm-brand { font-weight: 700; font-size: 0.96rem; letter-spacing: -0.01em; text-decoration: none; color: var(--c-text-1); }
.gm-nav { display: flex; gap: var(--s-6); }
.gm-nav a { font-size: 0.86rem; color: var(--c-text-2); text-decoration: none; }
.gm-nav a:hover { color: var(--c-text-1); }
.gm-cta-mini { padding: 7px 14px; background: var(--c-text-1); color: var(--c-text-inv); border-radius: var(--r-pill); font-size: 0.82rem; text-decoration: none; }
.gm-cta-mini:hover { background: var(--c-accent-h); }
@media (max-width: 740px) { .gm-nav { display: none; } }

/* ---------- Breadcrumb ---------- */
.gm-crumb { padding: var(--s-4) 0; font-size: 0.82rem; color: var(--c-text-3); }
.gm-crumb a { color: var(--c-text-2); text-decoration: none; }
.gm-crumb a:hover { color: var(--c-text-1); text-decoration: underline; }
.gm-crumb-sep { margin: 0 var(--s-2); color: var(--c-text-3); }

/* ---------- Hero ---------- */
.gm-hero { padding: var(--s-8) 0 var(--s-12); }
.gm-hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-12); align-items: center; }
@media (max-width: 880px) { .gm-hero-grid { grid-template-columns: 1fr; gap: var(--s-8); } }
.gm-eyebrow { display: inline-flex; align-items: center; gap: var(--s-2); padding: 5px 12px; background: var(--c-accent-soft); border: 1px solid var(--c-border); border-radius: var(--r-pill); font-size: 0.74rem; font-weight: 500; color: var(--c-text-2); letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: var(--s-4); }
.gm-hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 var(--s-5); font-weight: 700; }
.gm-hero h1 em { font-style: normal; background: linear-gradient(180deg, transparent 60%, var(--c-highlight) 60%); padding: 0 4px; }
.gm-hero-sub { font-size: 1.12rem; color: var(--c-text-2); margin: 0 0 var(--s-6); max-width: 56ch; }

/* ---------- Buttons ---------- */
.gm-cta-row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.gm-btn { display: inline-flex; align-items: center; gap: var(--s-2); padding: 12px 22px; background: var(--c-text-1); color: var(--c-text-inv); border-radius: var(--r-pill); font-size: 0.92rem; font-weight: 500; text-decoration: none; border: 1px solid var(--c-text-1); transition: transform var(--t-base) var(--ease-out), background var(--t-base) var(--ease-out); cursor: pointer; }
.gm-btn:hover { background: var(--c-accent-h); border-color: var(--c-accent-h); transform: translateY(-1px); }
.gm-btn-ghost { background: transparent; color: var(--c-text-1); border-color: var(--c-border-2); }
.gm-btn-ghost:hover { background: var(--c-surface); border-color: var(--c-text-1); transform: translateY(-1px); }
.gm-btn-sm { padding: 8px 16px; font-size: 0.84rem; }

.gm-trust-row { margin-top: var(--s-5); display: flex; gap: var(--s-6); flex-wrap: wrap; align-items: center; font-size: 0.82rem; color: var(--c-text-3); }
.gm-trust-row strong { color: var(--c-text-1); font-weight: 600; }

/* ---------- Hero preview ---------- */
.gm-hero-preview { position: relative; aspect-ratio: 4 / 5; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--sh-3); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gm-hero-preview-svg { width: 78%; height: auto; }
.gm-hero-preview-label { position: absolute; bottom: 14px; left: 14px; right: 14px; padding: 10px 14px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border: 1px solid var(--c-border); border-radius: var(--r-md); font-size: 0.78rem; color: var(--c-text-2); display: flex; justify-content: space-between; gap: var(--s-3); }

/* ---------- Answer block (AI Overview) ---------- */
.gm-answer { padding: var(--s-8) 0; background: var(--c-surface-2); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.gm-answer p { font-size: 1.06rem; color: var(--c-text-2); margin: 0; max-width: 720px; }
.gm-answer p strong { color: var(--c-text-1); font-weight: 600; }
.gm-speakable { speak: normal; }

/* ---------- Section ---------- */
.gm-section { padding: var(--s-12) 0; }
.gm-section-tight { padding: var(--s-10) 0; }
.gm-section-alt { background: var(--c-surface-2); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.gm-section h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; margin: 0 0 var(--s-3); font-weight: 700; line-height: 1.18; }
.gm-section h3 { font-size: 1.18rem; margin-top: var(--s-6); margin-bottom: var(--s-2); font-weight: 600; }
.gm-section .gm-section-lead { font-size: 1.04rem; color: var(--c-text-2); max-width: 60ch; margin: 0 0 var(--s-8); }

/* ---------- Long-form prose (pillar pages) ---------- */
.gm-prose { font-size: 1.04rem; color: var(--c-text-2); line-height: 1.75; }
.gm-prose h2 { font-size: 1.7rem; color: var(--c-text-1); margin-top: var(--s-12); margin-bottom: var(--s-4); letter-spacing: -0.02em; line-height: 1.18; scroll-margin-top: 80px; }
.gm-prose h3 { font-size: 1.18rem; color: var(--c-text-1); margin-top: var(--s-8); margin-bottom: var(--s-3); font-weight: 600; line-height: 1.3; scroll-margin-top: 80px; }
.gm-prose h4 { font-size: 1.02rem; color: var(--c-text-1); margin-top: var(--s-6); margin-bottom: var(--s-2); font-weight: 600; }
.gm-prose p { margin: 0 0 var(--s-5); }
.gm-prose strong { color: var(--c-text-1); font-weight: 600; }
.gm-prose ul, .gm-prose ol { padding-left: 1.4em; margin: 0 0 var(--s-5); }
.gm-prose ul li, .gm-prose ol li { margin-bottom: var(--s-2); }
.gm-prose figure { margin: var(--s-8) 0; }
.gm-prose figure img, .gm-prose figure svg { width: 100%; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); }
.gm-prose figcaption { font-size: 0.86rem; color: var(--c-text-3); margin-top: var(--s-3); text-align: center; font-style: italic; }
.gm-prose .gm-quote { padding: var(--s-6); background: var(--c-surface); border-left: 3px solid var(--c-text-1); border-radius: var(--r-md); margin: var(--s-8) 0; font-size: 1.04rem; color: var(--c-text-2); }
.gm-prose .gm-quote cite { display: block; margin-top: var(--s-3); font-style: normal; font-size: 0.86rem; color: var(--c-text-3); }
.gm-prose .gm-callout { padding: var(--s-5) var(--s-6); background: var(--c-accent-soft); border: 1px solid var(--c-border); border-radius: var(--r-lg); margin: var(--s-6) 0; font-size: 0.96rem; }
.gm-prose .gm-callout strong { display: inline; }
.gm-prose .gm-callout p { margin: 0; }

/* ---------- Table of contents ---------- */
.gm-toc { padding: var(--s-5) var(--s-6); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); margin-bottom: var(--s-8); }
.gm-toc h2 { font-family: var(--font-sans, "Inter", system-ui, sans-serif) !important; margin: 0 0 var(--s-3) !important; font-size: 0.78rem !important; line-height: 1.3 !important; letter-spacing: 0.06em !important; text-transform: uppercase; color: var(--c-text-3) !important; font-weight: 600 !important; font-style: normal !important; }
.gm-toc ol { list-style: decimal; margin: 0; padding-left: 1.4em; font-size: 0.94rem; line-height: 1.9; }
.gm-toc ol a { color: var(--c-text-2); text-decoration: none; }
.gm-toc ol a:hover { color: var(--c-text-1); text-decoration: underline; }

/* ---------- Steps (HowTo) ---------- */
.gm-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); margin-top: var(--s-6); }
@media (max-width: 880px) { .gm-steps { grid-template-columns: 1fr; } }
.gm-step { padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.gm-step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c-text-1); color: var(--c-text-inv); font-size: 0.78rem; font-weight: 600; margin-bottom: var(--s-3); }
.gm-step h3 { font-size: 1rem; margin: 0 0 var(--s-2); font-weight: 600; }
.gm-step p { margin: 0; color: var(--c-text-2); font-size: 0.92rem; }

/* ---------- Long step list (numbered, vertical) ---------- */
.gm-longsteps { margin: var(--s-6) 0; counter-reset: lstep; }
.gm-longstep { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-5); padding: var(--s-6) 0; border-bottom: 1px solid var(--c-border); }
.gm-longstep:last-child { border-bottom: 0; }
.gm-longstep::before { counter-increment: lstep; content: counter(lstep, decimal-leading-zero); font-family: var(--f-mono); font-size: 1.4rem; color: var(--c-text-1); font-weight: 600; }
.gm-longstep-body h3 { margin-top: 0; font-size: 1.18rem; }
.gm-longstep-body p { margin: var(--s-2) 0 var(--s-3); color: var(--c-text-2); font-size: 0.98rem; }
.gm-longstep-body figure { margin-top: var(--s-4); }

/* ---------- Bento ---------- */
.gm-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-6); }
@media (max-width: 880px) { .gm-bento { grid-template-columns: 1fr; } }
.gm-bento-card { padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.gm-bento-card .icon { font-size: 1.6rem; margin-bottom: var(--s-3); display: block; }
.gm-bento-card h3 { font-size: 1rem; margin: 0 0 var(--s-2); font-weight: 600; }
.gm-bento-card p { margin: 0; color: var(--c-text-2); font-size: 0.9rem; }

/* ---------- Hub category cards ---------- */
.gm-children { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-6); }
@media (max-width: 880px) { .gm-children { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .gm-children { grid-template-columns: 1fr; } }
.gm-child-card { display: block; padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); text-decoration: none; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); }
.gm-child-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--c-text-1); }
.gm-child-thumb { aspect-ratio: 4 / 3; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-md); margin-bottom: var(--s-4); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gm-child-thumb svg { width: 70%; height: auto; }
.gm-child-card h3 { font-size: 1rem; margin: 0 0 var(--s-2); color: var(--c-text-1); font-weight: 600; }
.gm-child-card p { margin: 0; color: var(--c-text-2); font-size: 0.86rem; line-height: 1.55; }
.gm-child-meta { margin-top: var(--s-3); display: flex; gap: var(--s-2); flex-wrap: wrap; }
.gm-child-meta span { font-size: 0.72rem; padding: 2px 8px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-pill); color: var(--c-ink-2, #404040); }

/* ---------- Comparison table ---------- */
.gm-table-wrap { overflow-x: auto; margin: var(--s-6) 0; border-radius: var(--r-lg); border: 1px solid var(--c-border); background: var(--c-surface); }
.gm-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.gm-table th, .gm-table td { padding: var(--s-4); text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.gm-table th { background: var(--c-surface-2); font-weight: 600; color: var(--c-text-1); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.gm-table tr:last-child td { border-bottom: none; }
.gm-table td:first-child { font-weight: 600; color: var(--c-text-1); }

/* ---------- FAQ accordion ---------- */
.gm-faq-list { margin-top: var(--s-6); }
.gm-faq-item { border-bottom: 1px solid var(--c-border); }
.gm-faq-item summary { padding: var(--s-5) 0; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); font-size: 1rem; color: var(--c-text-1); }
.gm-faq-item summary::-webkit-details-marker { display: none; }
.gm-faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--c-text-3); transition: transform var(--t-base) var(--ease-out); flex-shrink: 0; }
.gm-faq-item[open] summary::after { content: "\2212"; }
.gm-faq-item .gm-faq-body { padding: 0 0 var(--s-5); color: var(--c-text-2); font-size: 0.96rem; }
.gm-faq-item .gm-faq-body p:first-child { margin-top: 0; }

/* ---------- Audience badges ---------- */
.gm-aud-row { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); }
.gm-aud { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-pill); font-size: 0.8rem; color: var(--c-text-2); text-decoration: none; }
.gm-aud:hover { border-color: var(--c-text-1); color: var(--c-text-1); }

/* ---------- Related / sibling cards ---------- */
.gm-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-6); }
@media (max-width: 880px) { .gm-related { grid-template-columns: 1fr; } }
.gm-related-card { display: block; padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); text-decoration: none; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); }
.gm-related-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.gm-related-card h3 { font-size: 1rem; margin: 0 0 var(--s-2); color: var(--c-text-1); font-weight: 600; }
.gm-related-card p { margin: 0; color: var(--c-text-2); font-size: 0.88rem; }

/* ---------- Author block ---------- */
.gm-author { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-5); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-lg); margin-top: var(--s-8); }
.gm-author-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--c-accent-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: var(--c-text-2); font-size: 1.1rem; flex-shrink: 0; }
.gm-author-meta { font-size: 0.88rem; color: var(--c-text-2); }
.gm-author-meta strong { display: block; color: var(--c-text-1); margin-bottom: 2px; font-weight: 600; }

/* ---------- Citations ---------- */
.gm-cite-list { margin-top: var(--s-8); padding: var(--s-6); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); font-size: 0.86rem; }
.gm-cite-list h2 { font-family: var(--font-sans, "Inter", system-ui, sans-serif) !important; margin: 0 0 var(--s-3) !important; font-size: 0.82rem !important; line-height: 1.3 !important; letter-spacing: 0.05em !important; text-transform: uppercase; color: var(--c-text-3) !important; font-weight: 600 !important; font-style: normal !important; }
.gm-cite-list ol { margin: 0; padding-left: 1.4em; color: var(--c-text-2); }
.gm-cite-list li { margin-bottom: var(--s-2); line-height: 1.55; }

/* ---------- Pillar CTA strip ---------- */
.gm-cta-strip { padding: var(--s-10) var(--s-8); background: var(--c-text-1); color: var(--c-text-inv); border-radius: var(--r-xl); margin: var(--s-12) 0; text-align: center; }
.gm-cta-strip h2 { color: var(--c-text-inv); font-size: 1.6rem; margin: 0 0 var(--s-3); }
.gm-cta-strip p { color: rgba(255,255,255,.78); margin: 0 0 var(--s-5); font-size: 1rem; }
.gm-cta-strip .gm-btn { background: var(--c-text-inv); color: var(--c-text-1); border-color: var(--c-text-inv); }
.gm-cta-strip .gm-btn:hover { background: var(--c-surface-2); }

/* ---------- Footer ---------- */
.gm-footer { padding: var(--s-12) 0 var(--s-8); background: var(--c-surface); border-top: 1px solid var(--c-border); margin-top: var(--s-12); }
.gm-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-8); }
@media (max-width: 880px) { .gm-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
.gm-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-3); margin: 0 0 var(--s-3); font-weight: 600; }
.gm-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.gm-footer ul a { font-size: 0.88rem; color: var(--c-text-2); text-decoration: none; }
.gm-footer ul a:hover { color: var(--c-text-1); }
.gm-footer-bottom { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--c-border); font-size: 0.82rem; color: var(--c-text-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- Misc ---------- */
.muted { color: var(--c-text-3); }
.last-updated { display: block; margin-top: var(--s-4); font-size: 0.82rem; color: var(--c-text-3); }
.gm-overlay-icon { display: block; }

/* ---------- Visually hidden ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
