*{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#0c0c14;--bg2:#12121f;--bg3:#1a1a2e;--surface:#16162a;
  --text:#e8e8f0;--text2:#a0a0b8;--text3:#6a6a82;
  --accent:#7c5cfc;--accent2:#5c9cfc;--accent3:#fc5c8c;
  --ok:#34d399;--warn:#fbbf24;
  --radius:12px;--radius-sm:8px;
  --font:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}
html{scroll-behavior:smooth;background:var(--bg);color:var(--text);font-family:var(--font)}
body{min-height:100vh;display:flex;flex-direction:column}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

/* Header */
.site-header{background:var(--bg2);border-bottom:1px solid #1e1e36;padding:0 1.5rem;position:sticky;top:0;z-index:100}
.header-inner{max-width:1400px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;height:56px}
.logo{display:flex;align-items:center;gap:.5rem;text-decoration:none;color:var(--text);font-weight:700;font-size:.95rem}
.logo-mark{width:32px;height:32px;background:var(--accent);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:1.1rem;font-weight:800;color:#fff}
.site-nav{display:flex;gap:.25rem}
.site-nav a{color:var(--text2);text-decoration:none;padding:.4rem .75rem;border-radius:var(--radius-sm);font-size:.85rem;transition:color .15s,background .15s}
.site-nav a:hover{color:var(--text);background:var(--bg3)}
.nav-toggle{display:none;background:none;border:none;color:var(--text);font-size:1.25rem;cursor:pointer;padding:.25rem}

/* Classifier */
.classifier-section{padding:2rem 1.5rem;max-width:1400px;margin:0 auto;width:100%}
.classifier-layout{display:grid;grid-template-columns:260px 1fr 280px;gap:1.5rem;align-items:start}

.typeface-picker{background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.25rem;position:sticky;top:72px;max-height:calc(100vh - 88px);overflow-y:auto}
.typeface-picker h2{font-size:.85rem;text-transform:uppercase;letter-spacing:.05em;color:var(--text2);margin-bottom:.75rem}
.picker-search input{width:100%;padding:.5rem .75rem;background:var(--bg3);border:1px solid #2a2a4a;border-radius:var(--radius-sm);color:var(--text);font-size:.85rem;outline:none}
.picker-search input:focus{border-color:var(--accent)}
.picker-categories{display:flex;flex-wrap:wrap;gap:.35rem;margin:.75rem 0}
.cat-btn{padding:.3rem .65rem;border-radius:20px;border:1px solid #2a2a4a;background:none;color:var(--text2);font-size:.75rem;cursor:pointer;transition:all .15s}
.cat-btn.active,.cat-btn:hover{background:var(--accent);color:#fff;border-color:var(--accent)}
.font-list{list-style:none;display:flex;flex-direction:column;gap:2px}
.font-list li{padding:.5rem .65rem;border-radius:var(--radius-sm);cursor:pointer;font-size:.85rem;color:var(--text2);transition:background .15s}
.font-list li:hover{background:var(--bg3);color:var(--text)}
.font-list li.selected{background:var(--accent);color:#fff}

.classifier-main{display:flex;flex-direction:column;gap:1.5rem}
.selected-typeface{background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.25rem}
.selected-label{font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text3);display:block;margin-bottom:.25rem}
.selected-name{font-size:1.5rem;font-weight:700;display:block;margin-bottom:.5rem}
.selected-preview{font-size:1.75rem;color:var(--text2);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.mood-wheel-wrap{display:flex;justify-content:center}
.mood-wheel{width:100%;max-width:400px;height:auto}

.axis-sliders{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem;background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.25rem}
.axis-slider{display:flex;flex-direction:column;gap:.35rem}
.axis-slider label{font-size:.75rem;color:var(--text2);display:flex;justify-content:space-between}
.axis-slider label span:last-child{color:var(--accent);font-weight:600}
.axis-slider input[type=range]{-webkit-appearance:none;width:100%;height:6px;background:var(--bg3);border-radius:3px;outline:none}
.axis-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:var(--accent);cursor:pointer}

.classifier-actions{display:flex;flex-wrap:wrap;gap:.5rem}
.btn{padding:.6rem 1.25rem;border-radius:var(--radius-sm);font-size:.85rem;font-weight:600;cursor:pointer;border:1px solid transparent;transition:all .15s}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:#6a4cf0}
.btn-secondary{background:var(--bg3);color:var(--text);border-color:#2a2a4a}
.btn-secondary:hover{background:#2a2a4a}
.btn-ghost{background:none;color:var(--text2);border-color:#2a2a4a}
.btn-ghost:hover{color:var(--text);border-color:var(--text2)}

.suggestions-panel{background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.25rem;position:sticky;top:72px;max-height:calc(100vh - 88px);overflow-y:auto}
.suggestions-panel h2,.suggestions-panel h3{font-size:.85rem;text-transform:uppercase;letter-spacing:.05em;color:var(--text2);margin-bottom:.75rem}
.sug-item{display:flex;justify-content:space-between;align-items:center;padding:.5rem .65rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .15s;margin-bottom:2px}
.sug-item:hover{background:var(--bg3)}
.sug-name{font-size:.85rem}
.sug-score{font-size:.75rem;padding:.15rem .5rem;border-radius:10px;background:var(--bg3);color:var(--text2)}
.sug-score.high{background:#064e3b;color:var(--ok)}
.sug-score.mid{background:#422006;color:var(--warn)}

/* Info sections */
.info-section{padding:3rem 1.5rem;max-width:1100px;margin:0 auto;width:100%}
.info-section h2{font-size:1.5rem;margin-bottom:1rem}
.info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1.5rem}
.info-block{background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.5rem}
.info-block h2{font-size:1.1rem;margin-bottom:.75rem}
.info-block p{font-size:.9rem;color:var(--text2);line-height:1.7}
.axis-defs dt{font-weight:700;font-size:.85rem;margin-top:.75rem}
.axis-defs dd{font-size:.83rem;color:var(--text2);line-height:1.6;margin-left:0}

/* Examples */
.examples-section{padding:3rem 1.5rem;max-width:1100px;margin:0 auto;width:100%}
.examples-section h2{font-size:1.5rem;margin-bottom:1.5rem}
.example-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}
.example-card{background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.25rem}
.example-card h3{font-size:1rem;margin-bottom:.5rem;color:var(--accent2)}
.example-card p{font-size:.85rem;color:var(--text2);line-height:1.7}

/* Reference */
.reference-section{padding:3rem 1.5rem;max-width:800px;margin:0 auto;width:100%}
.reference-section h2{font-size:1.5rem;margin-bottom:.5rem}
.ref-intr{color:var(--text2);font-size:.9rem;line-height:1.7;margin-bottom:1.5rem}
.spectrum-explorer{display:flex;align-items:center;gap:1rem;background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1rem 1.25rem;margin-bottom:1rem;flex-wrap:wrap}
.spectrum-explorer label{font-size:.85rem;color:var(--text2)}
.spectrum-explorer select{background:var(--bg3);border:1px solid #2a2a4a;border-radius:var(--radius-sm);color:var(--text);padding:.4rem .6rem;font-size:.85rem}
.spectrum-val{color:var(--accent);font-weight:700;min-width:2ch;text-align:center}
.spectrum-result{background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius);padding:1.25rem;min-height:80px}
.spectrum-result .match{font-size:.95rem;margin-bottom:.25rem}
.spectrum-result .match-score{font-size:.8rem;color:var(--text2)}
.mistakes-list,.tips-list{list-style:none;display:flex;flex-direction:column;gap:.75rem;margin-top:.75rem}
.mistakes-list li,.tips-list li{font-size:.875rem;color:var(--text2);line-height:1.7;padding-left:1.25rem;position:relative}
.mistakes-list li::before{content:'✕';position:absolute;left:0;color:var(--accent3);font-weight:700}
.tips-list li::before{content:'→';position:absolute;left:0;color:var(--ok);font-weight:700}

/* History */
.history-section{padding:3rem 1.5rem;max-width:800px;margin:0 auto;width:100%}
.history-section h2{font-size:1.5rem;margin-bottom:1rem}
.history-empty{color:var(--text3);font-style:italic;font-size:.9rem}
.history-list{display:flex;flex-direction:column;gap:.5rem}
.history-item{display:flex;justify-content:space-between;align-items:center;background:var(--bg2);border:1px solid #1e1e36;border-radius:var(--radius-sm);padding:.75rem 1rem;cursor:pointer;transition:background .15s}
.history-item:hover{background:var(--bg3)}
.history-item .h-name{font-weight:600;font-size:.9rem}
.history-item .h-date{font-size:.75rem;color:var(--text3)}
.history-item .h-delete{background:none;border:none;color:var(--text3);cursor:pointer;font-size:1rem;padding:.25rem;margin-left:.5rem}
.history-item .h-delete:hover{color:var(--accent3)}

/* Compare overlay */
.compare-overlay{position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:200;display:none;align-items:center;justify-content:center;padding:2rem}
.compare-overlay.open{display:flex}
.compare-box{background:var(--bg2);border:1px solid #2a2a4a;border-radius:var(--radius);padding:2rem;max-width:700px;width:100%;max-height:80vh;overflow-y:auto}
.compare-box h2{margin-bottom:1rem}
.compare-row{display:flex;justify-content:space-between;align-items:center;padding:.5rem 0;border-bottom:1px solid #1e1e36;font-size:.85rem}
.compare-row .c-axis{color:var(--text2);width:120px}
.compare-row .c-val{width:60px;text-align:center}
.compare-row .c-bar{flex:1;height:6px;background:var(--bg3);border-radius:3px;margin:0 .75rem;position:relative;overflow:hidden}
.compare-row .c-bar-fill{height:100%;border-radius:3px}

/* Toast */
.toast{position:fixed;bottom:2rem;left:50%;transform:translateX(-50%) translateY(100px);background:var(--bg3);color:var(--text);padding:.75rem 1.5rem;border-radius:var(--radius-sm);font-size:.85rem;opacity:0;transition:all .3s;z-index:300;border:1px solid #2a2a4a}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* Footer */
.site-footer{margin:auto auto 0;background:var(--bg2);border-top:1px solid #1e1e36;padding:2rem 1.5rem}
.footer-inner{max-width:1100px;margin:0 auto;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1rem;font-size:.8rem;color:var(--text3)}
.footer-inner a{color:var(--text2);text-decoration:none}
.footer-inner a:hover{color:var(--text)}
.footer-links{display:flex;gap:1rem}
.footer-note{font-size:.75rem}

/* Responsive */
@media(max-width:1024px){
  .classifier-layout{grid-template-columns:1fr}
  .typeface-picker{position:static;max-height:none}
  .suggestions-panel{position:static;max-height:none}
}
@media(max-width:768px){
  .site-nav{display:none;position:absolute;top:56px;left:0;right:0;background:var(--bg2);flex-direction:column;padding:.75rem;border-bottom:1px solid #1e1e36}
  .site-nav.open{display:flex}
  .nav-toggle{display:block}
  .axis-sliders{grid-template-columns:1fr 1fr}
  .selected-preview{font-size:1.25rem}
}
@media(max-width:480px){
  .axis-sliders{grid-template-columns:1fr}
  .classifier-actions{flex-direction:column}
  .btn{text-align:center}
}

/* Scrollbar */
::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:#2a2a4a;border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:#3a3a5a}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
