/* ---------------------------------------------------------
   Wilcoe Tools: base design system
   Palettes are applied via [data-palette] on <html> or via
   inline CSS custom properties set by assets/js/theme.js
--------------------------------------------------------- */

:root{
  /* default palette: "Ocean" */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-accent: #0ea5e9;

  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.14);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1160px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: var(--color-primary); text-decoration: none; }
a:hover{ text-decoration: underline; }
h1,h2,h3,h4{ line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
p{ margin: 0 0 1em; }
ul{ margin: 0 0 1em; padding-left: 1.2em; }
code, pre{ font-family: var(--font-mono); }
pre{
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
code:not(pre code){
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .9em;
}

.container{ max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.site-nav{
  position: sticky; top: 0; z-index: 40;
  background: rgba(248,250,252,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-nav .container{ display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand{ display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--color-text); }
.brand:hover{ text-decoration: none; }
.brand-mark{
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: inline-flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:14px;
}
.nav-links{ display:flex; gap: 24px; align-items:center; flex-shrink: 0; }
.nav-links a{ color: var(--color-text-muted); font-weight: 500; font-size: 14px; white-space: nowrap; }

@media (max-width: 640px){
  .nav-links a:not(.btn){ display: none; }
  .nav-links{ gap: 10px; }
  .brand{ font-size: 15px; }
  .brand-mark{ width: 26px; height: 26px; font-size: 12px; }
}
.nav-links a:hover{ color: var(--color-text); text-decoration:none; }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content:center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  background: var(--color-primary); color: #fff;
}
.btn:hover{ background: var(--color-primary-dark); text-decoration:none; }
.btn.secondary{ background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn.secondary:hover{ border-color: var(--color-primary); color: var(--color-primary); background: var(--color-surface); }
.btn.block{ width:100%; }
.btn.sm{ padding: 8px 14px; font-size: 13px; }

/* ---------- Badges ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  background: var(--color-primary-light); color: var(--color-primary-dark);
  font-size: 12px; font-weight: 700; letter-spacing:.02em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
}

/* ---------- Cards ---------- */
.card{
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad{ padding: 24px; }

/* ---------- Hero (tool page) ---------- */
.tool-hero{ padding: 48px 0 32px; }
.tool-hero .cat-link{ font-size: 13px; font-weight: 600; color: var(--color-primary); }
.tool-hero h1{ font-size: clamp(28px, 4vw, 40px); margin-top: 10px; }
.tool-hero .tagline{ font-size: 18px; color: var(--color-text-muted); max-width: 640px; }
.tool-hero .meta-row{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 16px; }

/* ---------- Section layout ---------- */
.section{ padding: 40px 0; }
.section-title{ font-size: 22px; margin-bottom: 18px; }
.two-col{ display:grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items:start; }
.two-col > *{ min-width: 0; }
@media (max-width: 900px){ .two-col{ grid-template-columns: 1fr; } }

.info-grid{ display:grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.info-grid > *{ min-width: 0; }
@media (max-width: 700px){ .info-grid{ grid-template-columns: 1fr; } }

.bullet-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.bullet-list li{ display:flex; gap:10px; align-items:flex-start; color: var(--color-text); }
.bullet-list li::before{
  content:"✓"; flex-shrink:0; width:20px; height:20px; border-radius:50%;
  background: var(--color-primary-light); color: var(--color-primary-dark);
  font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; margin-top:2px;
}

.step-list{ list-style:none; padding:0; margin:0; counter-reset: step; display:flex; flex-direction:column; gap:14px; }
.step-list li{ display:flex; gap:14px; align-items:flex-start; }
.step-list li::before{
  counter-increment: step; content: counter(step);
  flex-shrink:0; width:26px; height:26px; border-radius:50%;
  background: var(--color-primary); color:#fff; font-size:13px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}

.customize-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:14px; }
.customize-list li{ padding: 14px 16px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.customize-list b{ display:block; margin-bottom:4px; font-size: 14px; }
.customize-list span{ color: var(--color-text-muted); font-size: 13.5px; }

/* ---------- Demo panel ---------- */
.demo-panel{
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 28px; position: sticky; top: 84px;
}
.demo-panel .demo-label{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color: var(--color-text-muted); margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.demo-panel .demo-label::before{ content:""; width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.2); }

/* ---------- Home hero ---------- */
.home-hero{ padding: 72px 0 48px; text-align:center; }
.home-hero h1{ font-size: clamp(32px,5vw,52px); max-width: 820px; margin: 14px auto 16px; }
.home-hero p.lead{ font-size: 18px; color: var(--color-text-muted); max-width: 640px; margin: 0 auto 28px; }
.home-hero .hero-actions{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

.stats-row{ display:flex; gap:36px; justify-content:center; margin-top:40px; flex-wrap:wrap; }
.stats-row .stat b{ display:block; font-size:28px; color:var(--color-primary); }
.stats-row .stat span{ font-size:13px; color:var(--color-text-muted); }

/* ---------- Filter bar ---------- */
.filter-bar{ display:flex; gap:10px; flex-wrap:wrap; margin: 28px 0; align-items:center; }
.filter-bar input[type="search"]{
  flex: 1 1 240px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface); font-size:14px; font-family: var(--font-sans); color: var(--color-text);
}
.chip{
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface);
  font-size: 13px; font-weight: 600; color: var(--color-text-muted); cursor: pointer; white-space:nowrap;
}
.chip.active{ background: var(--color-primary); border-color: var(--color-primary); color:#fff; }

/* ---------- Tool grid / cards ---------- */
.tool-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 18px; }
.tool-card{
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 20px; display:flex; flex-direction:column; gap: 10px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--color-primary); text-decoration:none; }
.tool-card .tc-icon{
  width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background: var(--color-primary-light); color: var(--color-primary-dark); font-weight:800; font-size:15px;
}
.tool-card h3{ font-size:16px; color: var(--color-text); }
.tool-card p{ font-size: 13.5px; color: var(--color-text-muted); margin:0; flex:1; }
.tool-card .tc-cat{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color: var(--color-primary); }
.empty-state{ text-align:center; padding: 60px 20px; color: var(--color-text-muted); display:none; }

/* ---------- Related ---------- */
.related-grid{ display:grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap:14px; }

/* ---------- Footer ---------- */
.site-footer{ border-top: 1px solid var(--color-border); padding: 40px 0; margin-top: 60px; }
.site-footer .container{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:16px; }
.site-footer p{ margin:0; font-size:13px; color: var(--color-text-muted); }
.site-footer .foot-links{ display:flex; gap:18px; }
.site-footer .foot-links a{ font-size:13px; color: var(--color-text-muted); }

/* ---------- Category page ---------- */
.cat-header{ padding: 40px 0 8px; }

/* ---------- Theme widget (floating brand customizer) ---------- */
.wt-theme-widget{ position: fixed; right: 20px; bottom: 20px; z-index: 100; }
.wt-theme-toggle{
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: var(--shadow-lg); font-size: 20px; display:flex; align-items:center; justify-content:center;
}
.wt-theme-panel{
  position: absolute; right: 0; bottom: 64px; width: 260px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px; opacity:0; visibility:hidden; transform: translateY(8px);
  transition: all .15s ease;
}
.wt-theme-panel.open{ opacity:1; visibility:visible; transform: translateY(0); }
.wt-panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.wt-panel-head strong{ font-size:14px; }
.wt-mode-toggle{ background:none; border:none; cursor:pointer; font-size:16px; }
.wt-panel-sub{ font-size:12px; color: var(--color-text-muted); margin: 0 0 12px; }
.wt-swatches{ display:grid; grid-template-columns: repeat(4,1fr); gap:8px; margin-bottom: 14px; }
.wt-swatch{
  width: 100%; aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
  background: var(--sw); position: relative;
}
.wt-swatch.active{ border-color: var(--color-text); }
.wt-custom-row{ display:flex; gap:12px; margin-bottom:14px; }
.wt-custom-row label{ flex:1; font-size:11.5px; color: var(--color-text-muted); font-weight:600; display:flex; flex-direction:column; gap:4px; }
.wt-custom-row input[type="color"]{ width:100%; height:32px; border-radius:6px; border:1px solid var(--color-border); cursor:pointer; padding:2px; background: var(--color-surface); }

/* ---------- Utility ---------- */
.text-muted{ color: var(--color-text-muted); }
.mt-0{ margin-top:0; }
.flex{ display:flex; }
.gap-8{ gap:8px; }
.wrap{ flex-wrap:wrap; }
