/* ==========================================================================
   RunFastTools — "CLEAN UTILITY" DESIGN SYSTEM · /assets/css/main.css
   --------------------------------------------------------------------------
   Linked once from every page:  <link rel="stylesheet" href="/assets/css/main.css">
   Table of contents
     1. Variables (:root)
     2. Reset & Typography
     3. Layout
     4. Header & Navigation (logo, categories, language switcher)
     5. Breadcrumbs
     6. Tool Card & Controls (card, buttons, badges, text input, select dropdowns, tool shell)
     7. Results Grid (generator cards, favorites)
     8. SEO Content & Tables (prose, tables, idea chips, FAQ)
     9. Internal Linking Silo ("More … Generators" cards)
    10. Home & Category Pages (hero, "coming soon" cards)
    11. Footer
    12. Utilities
    13. Responsive
   ========================================================================== */

/* 1. VARIABLES ------------------------------------------------------------- */
:root {
  /* Colors */
  --bg-page: #F8FAFC;          /* page background */
  --bg-surface: #FFFFFF;       /* tool box + cards */
  --border-color: #E2E8F0;     /* 1px borders */
  --text-primary: #0F172A;     /* headings + generated results */
  --text-secondary: #475569;   /* paragraphs + labels */
  --accent-primary: #4F46E5;   /* primary buttons */
  --accent-hover: #4338CA;     /* primary button hover */
  --accent-soft: #EEF2FF;      /* badges, hover backgrounds */
  --success: #10B981;          /* success + "✓ Copied!" feedback */
  --warn: #F59E0B;             /* favorites star */

  /* Typography */
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: clamp(1.875rem, 4.5vw, 2.5rem);
  --lh-body: 1.7;

  /* Spacing scale */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;   --sp-7: 3rem;    --sp-8: 4rem;

  /* Shape + depth */
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, .35);

  /* Layout */
  --container: 860px;
  --gutter: 1rem;
}

/* 2. RESET & TYPOGRAPHY ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg-page); color: var(--text-secondary);
  font: var(--fs-base)/var(--lh-body) var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--text-primary); line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 var(--sp-4); }
a { color: var(--accent-primary); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
button { font: inherit; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* 3. LAYOUT ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { margin-top: var(--sp-7); }

/* 4. HEADER & NAVIGATION --------------------------------------------------- */
.site-header { background: var(--bg-surface); border-bottom: 1px solid var(--border-color); position: relative; z-index: 30; }
.site-header .container { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); padding-block: var(--sp-3); }
.brand { font-weight: 800; font-size: var(--fs-lg); color: var(--text-primary); text-decoration: none; letter-spacing: -0.02em; }
.brand:hover { color: var(--text-primary); }
.brand .logo { display: block; height: 34px; width: auto; }

/* Main navigation with dropdown menus (native <a> links, works without JS on desktop) */
.main-nav { margin-right: auto; }
.nav-list { display: flex; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; display: flex; align-items: center; border-radius: var(--radius-full); }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-3); border-radius: var(--radius-full) 0 0 var(--radius-full); }
.nav-toggle { background: none; border: 0; color: var(--text-secondary); font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1); border-radius: 0 var(--radius-full) var(--radius-full) 0; line-height: 1.7; }
.nav-item:hover, .nav-item.is-open, .nav-item.is-current { background: var(--accent-soft); }
.nav-item:hover .nav-link, .nav-item:hover .nav-toggle, .nav-item.is-open .nav-link, .nav-item.is-current .nav-link, .nav-item.is-current .nav-toggle { color: var(--accent-primary); }
.nav-menu, .lang-list { display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 270px; margin: 0; padding: var(--sp-2); list-style: none; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.nav-menu a, .lang-list a { display: block; padding: var(--sp-2) var(--sp-3); color: var(--text-secondary); text-decoration: none; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.nav-menu a:hover, .lang-list a:hover { background: var(--accent-soft); color: var(--accent-primary); }
.nav-item.is-open .nav-menu, .nav-item:focus-within .nav-menu, .lang-menu.is-open .lang-list, .lang-menu:focus-within .lang-list { display: block; }
@media (hover: hover) { .nav-item:hover .nav-menu, .lang-menu:hover .lang-list { display: block; } }

/* Language dropdown: 🌐 EN ▾ */
.lang-menu { position: relative; }
.lang-toggle { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-full); color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600; padding: var(--sp-1) var(--sp-3); }
.lang-menu:hover .lang-toggle, .lang-menu.is-open .lang-toggle { border-color: var(--accent-primary); color: var(--accent-primary); }
.lang-list { left: auto; right: 0; min-width: 160px; }
.lang-list a[aria-current="true"] { color: var(--text-primary); font-weight: 700; }

/* 5. BREADCRUMBS ----------------------------------------------------------- */
.breadcrumb { font-size: var(--fs-xs); padding-block: var(--sp-4) var(--sp-2); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: var(--sp-2); color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-primary); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--text-primary); font-weight: 600; }

/* 6. TOOL CARD & CONTROLS -------------------------------------------------- */
/* Page title block above the tool */
.page-title { padding-block: var(--sp-2) var(--sp-4); }
.page-title h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); }
.page-title p { margin: 0; font-size: var(--fs-base); }

/* Card (tool box + generic surface): pure white on the pearl-grey page, thin border */
.card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); border: 1px solid transparent; border-radius: var(--radius-md); padding: .7rem 1.25rem; font-weight: 600; font-size: var(--fs-sm); transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--accent-primary); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: var(--bg-surface); color: var(--text-secondary); border-color: var(--border-color); }
.btn-ghost:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn-sm { padding: .3rem .7rem; font-size: var(--fs-xs); border-radius: var(--radius-sm); }

/* Badges */
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent-primary); font-size: var(--fs-xs); font-weight: 600; padding: 2px var(--sp-3); border-radius: var(--radius-full); }

/* Form controls */
.field > label, .field-label { display: block; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin-bottom: var(--sp-2); }
.input { width: 100%; padding: .7rem var(--sp-4); font: inherit; font-size: var(--fs-base); color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; }
input.input { height: 44px; padding-block: 0; }
.input:focus { outline: none; border-color: var(--accent-primary); box-shadow: var(--focus-ring); }

/* Select (dropdown filters): same look and height as the text input */
.select { width: 100%; height: 44px; padding: 0 2.5rem 0 var(--sp-4); font: inherit; font-size: var(--fs-base); color: var(--text-primary); background-color: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; cursor: pointer; appearance: none; -webkit-appearance: none; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--sp-4) center; transition: border-color .15s; }
.select:hover { border-color: #CBD5E1; }
.select:focus { outline: none; border-color: var(--accent-primary); box-shadow: var(--focus-ring); }
.select-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }   /* 1 column on mobile, 2 on desktop (see Responsive) */

/* Tool shell */
.tool { padding: var(--sp-5); }
.tool-controls { display: grid; gap: var(--sp-4); }
.tool-row { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.tool-hint { font-size: var(--fs-xs); margin: 0; }
.tool-sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Checkbox grid + textarea + range (tool controls) */
.check-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); }
.check { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-secondary); cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent-primary); }
textarea.input { min-height: 4.5rem; resize: vertical; line-height: 1.5; }
.range { width: 100%; accent-color: var(--accent-primary); }
.range-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-2); }
.range-head .field-label { margin: 0; }
.range-value { font-family: var(--font-mono); font-weight: 700; color: var(--text-primary); }

/* Strength / entropy gauge */
.gauge { height: 8px; background: var(--border-color); border-radius: var(--radius-full); overflow: hidden; }
.gauge-bar { height: 100%; width: 0; border-radius: var(--radius-full); background: var(--warn); transition: width .2s, background .2s; }
.gauge-bar[data-level="weak"] { background: #EF4444; }
.gauge-bar[data-level="fair"] { background: var(--warn); }
.gauge-bar[data-level="strong"], .gauge-bar[data-level="very-strong"] { background: var(--success); }
.gauge-text { display: flex; justify-content: space-between; margin-top: var(--sp-2); font-size: var(--fs-xs); }
.gauge-text strong { color: var(--text-primary); }

/* 7. RESULTS GRID (generators) --------------------------------------------- */
.results { list-style: none; margin: var(--sp-5) 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--sp-3); min-height: 330px; align-content: start; }
.result { position: relative; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.result:hover { border-color: var(--accent-primary); box-shadow: 0 8px 18px rgba(79, 70, 229, .14), var(--shadow-sm); transform: translateY(-2px); }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.result-name { font-family: var(--font-mono); font-size: var(--fs-base); white-space: nowrap; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.result-count { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-secondary); }
.result-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.result-actions, .result-meta { display: inline-flex; align-items: center; gap: var(--sp-2); }
.fav-btn { background: none; border: 0; padding: 2px 6px; font-size: 1.15rem; line-height: 1; color: var(--text-secondary); border-radius: var(--radius-sm); }
.fav-btn:hover, .fav-btn[aria-pressed="true"] { color: var(--warn); }
/* Result card variants (core.js RFT.resultList) */
.result-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); }
.result-text { font-size: var(--fs-lg); font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; line-height: 1.4; }
.result-code { font-family: var(--font-mono); font-size: var(--fs-base); font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; word-break: break-all; }
.result-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: calc(var(--sp-1) * -1); }
.results-wide { grid-template-columns: 1fr !important; min-height: 0 !important; }
.results-two { min-height: 0; }
/* "✓ Copied!" feedback: core.js toggles .is-copied on the card and on its Copy button for 1.5 s */
.result.is-copied { border-color: var(--success); }
.btn.is-copied, .btn.is-copied:hover { background: #D1FAE5; border-color: var(--success); color: #047857; white-space: nowrap; }

/* Favorites panel */
.favorites { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border-color); }
.favorites[hidden] { display: none; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { display: inline-flex; align-items: center; gap: var(--sp-1); background: var(--accent-soft); border-radius: var(--radius-full); padding: 2px 4px 2px var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-primary); }
.chip button { background: none; border: 0; color: var(--text-secondary); padding: 0 6px; font-size: 1rem; }
.chip .chip-copy { padding: 0; font-family: inherit; font-size: inherit; color: inherit; font-weight: 600; }
.chip button:hover { color: var(--accent-primary); }

/* 8. SEO CONTENT & TABLES -------------------------------------------------- */
.prose h2 { font-size: var(--fs-xl); margin: var(--sp-7) 0 var(--sp-3); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--fs-lg); margin: var(--sp-5) 0 var(--sp-2); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 var(--sp-4); }
.prose li { margin-bottom: var(--sp-2); }
.prose strong { color: var(--text-primary); }

/* Tables */
.table-wrap { overflow-x: auto; margin: var(--sp-4) 0; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-color); }
th { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Static idea chips (indexable lists) */
.idea-list { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.idea-list li { margin: 0; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 2px var(--sp-3); }

/* FAQ accordion (<details>) */
.faq details { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text-primary); }
.faq details[open] summary { margin-bottom: var(--sp-2); }
.faq details p { margin: 0; }

/* 9. INTERNAL LINKING SILO ------------------------------------------------- */
.silo-title { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); }
a.card { display: flex; flex-direction: column; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-md); }
.card h3 { font-size: var(--fs-base); margin-bottom: var(--sp-1); }
.card p { font-size: var(--fs-sm); margin: 0; color: var(--text-secondary); }
/* Discreet text link at the bottom of a tool card (the whole card is the <a>) */
.card-cta { margin-top: auto; padding-top: var(--sp-3); font-size: var(--fs-xs); font-weight: 600; color: var(--accent-primary); }
a.card:hover .card-cta { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

/* 10. HOME & CATEGORY PAGES ------------------------------------------------ */
.hero { padding-block: var(--sp-6) var(--sp-2); }
.hero h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-3); }
.hero p { max-width: 640px; font-size: var(--fs-lg); }
.category { scroll-margin-top: var(--sp-4); }
.category-note { font-size: var(--fs-sm); }
.silo-title a { color: inherit; text-decoration: none; }
.silo-title a:hover { color: var(--accent-primary); }

/* 11. FOOTER --------------------------------------------------------------- */
.site-footer { margin-top: var(--sp-8); background: var(--bg-surface); border-top: 1px solid var(--border-color); padding-block: var(--sp-6); font-size: var(--fs-sm); }
.footer-silos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-5); margin-bottom: var(--sp-5); }
.footer-silos h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); margin-bottom: var(--sp-2); }
.footer-silos ul, .footer-legal { list-style: none; margin: 0; padding: 0; }
.footer-silos li { margin-bottom: var(--sp-1); }
.footer-silos h2 a { color: inherit; text-decoration: none; }
.footer-silos a, .footer-legal a { color: var(--text-secondary); text-decoration: none; }
.footer-silos a:hover, .footer-legal a:hover { color: var(--accent-primary); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: var(--sp-4); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); }
.footer-legal { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.footer-note { font-size: var(--fs-xs); margin: var(--sp-3) 0 0; }

/* 12. UTILITIES ------------------------------------------------------------ */
.mt-0 { margin-top: 0; } .text-center { text-align: center; }

/* 13. RESPONSIVE ----------------------------------------------------------- */
@media (min-width: 640px) {
  .results { grid-template-columns: repeat(3, 1fr); min-height: 230px; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .results-two { grid-template-columns: repeat(2, 1fr); }
  .tool-row { grid-template-columns: 1fr 1fr; }
  .select-grid { grid-template-columns: 1fr 1fr; }
  :root { --gutter: 1.5rem; }
}
@media (min-width: 440px) and (max-width: 639px) { .results { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .nav-item { position: static; }
  .nav-menu { left: var(--gutter); right: var(--gutter); min-width: 0; }
}
