/* OIL KNOWLEDGE BASE — aipulled.com/oil */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:#0b0f1a;
  color:#e2e8f0;
  min-height:100vh;display:flex;flex-direction:column;
  line-height:1.65;-webkit-font-smoothing:antialiased;
}
a{color:#fbbf24}
a:hover{color:#fde68a}

/* NAV */
#topnav{
  position:sticky;top:0;z-index:100;
  background:rgba(11,15,26,0.92);
  backdrop-filter:blur(12px);
  border-bottom:1px solid #1f2937;
  padding:0 1rem;
}
.nav-inner{
  max-width:1200px;margin:0 auto;
  display:flex;align-items:center;justify-content:space-between;
  height:58px;
}
.nav-brand{
  font-size:1rem;font-weight:800;color:#fbbf24;text-decoration:none;
  letter-spacing:-0.01em;display:flex;align-items:center;gap:0.5rem;
}
.nav-brand:hover{color:#fde68a}
.nav-right{display:flex;align-items:center;gap:1.25rem}
.nav-link{font-size:0.8rem;color:#94a3b8;text-decoration:none;font-weight:500}
.nav-link:hover{color:#fbbf24}
.mode-toggle{display:flex;align-items:center;gap:0.5rem;cursor:pointer;user-select:none;font-size:0.8rem}
.mode-toggle input{display:none}
.toggle-slider{
  width:36px;height:20px;background:#334155;border-radius:10px;
  position:relative;transition:background 0.2s;flex-shrink:0;
}
.toggle-slider::after{
  content:'';position:absolute;top:2px;left:2px;
  width:16px;height:16px;background:#fff;border-radius:50%;
  transition:transform 0.2s;box-shadow:0 1px 2px rgba(0,0,0,0.3);
}
.mode-toggle input:checked+.toggle-slider{background:#f59e0b}
.mode-toggle input:checked+.toggle-slider::after{transform:translateX(16px)}

/* HERO */
.hero{
  background:linear-gradient(135deg,#1a1a2e 0%,#2d1e12 50%,#1f1307 100%);
  padding:3rem 1.5rem 2.5rem;
  text-align:center;
  border-bottom:1px solid #1f2937;
}
.hero h1{
  font-size:2.6rem;font-weight:800;letter-spacing:-0.02em;
  background:linear-gradient(135deg,#fde68a,#fbbf24,#f97316);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
  background-clip:text;margin-bottom:0.7rem;
}
.hero p{color:#cbd5e1;max-width:700px;margin:0 auto;font-size:1.05rem}
.hero .hero-stats{
  display:flex;justify-content:center;flex-wrap:wrap;gap:1.5rem;
  margin-top:1.6rem;
}
.hero .stat{text-align:center}
.hero .stat b{display:block;font-size:1.4rem;color:#fbbf24;font-weight:800}
.hero .stat span{font-size:0.75rem;color:#94a3b8;text-transform:uppercase;letter-spacing:0.05em}

/* TABS */
.tabs{
  position:sticky;top:58px;z-index:90;
  background:rgba(11,15,26,0.96);
  backdrop-filter:blur(12px);
  border-bottom:1px solid #1f2937;
  overflow-x:auto;
  scrollbar-width:thin;
}
.tabs-inner{
  display:flex;gap:0.25rem;max-width:1200px;margin:0 auto;padding:0 1rem;
  min-width:max-content;
}
.tab-btn{
  background:none;border:none;color:#94a3b8;font-weight:600;
  padding:0.85rem 1rem;cursor:pointer;font-size:0.85rem;
  border-bottom:2px solid transparent;
  transition:color 0.15s, border-color 0.15s;
  white-space:nowrap;font-family:inherit;
}
.tab-btn:hover{color:#fde68a}
.tab-btn.active{color:#fbbf24;border-bottom-color:#fbbf24}

/* MAIN */
main{flex:1;max-width:1100px;margin:0 auto;padding:2rem 1.5rem 4rem;width:100%}
section.tab-content{display:none}
section.tab-content.active{display:block;animation:fadeIn 0.25s ease-out}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

h2.section-h{
  font-size:1.9rem;font-weight:800;margin-bottom:0.4rem;color:#fbbf24;letter-spacing:-0.01em;
}
.section-lede{color:#cbd5e1;margin-bottom:2rem;font-size:1rem;max-width:820px}

h3{
  font-size:1.3rem;font-weight:700;color:#fde68a;
  margin:2rem 0 0.7rem;letter-spacing:-0.01em;
  padding-bottom:0.4rem;border-bottom:1px solid #1f2937;
}
h3:first-child{margin-top:0}
h4{
  font-size:1.05rem;font-weight:700;color:#f1f5f9;
  margin:1.3rem 0 0.4rem;
}
p{margin:0.6rem 0;color:#d1d5db}
ul,ol{margin:0.6rem 0 0.6rem 1.4rem;color:#d1d5db}
li{margin:0.25rem 0}
strong{color:#fde68a;font-weight:700}
em{color:#cbd5e1;font-style:italic}

/* BOXES */
.card-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:1rem;margin:1rem 0;
}
.card{
  background:#111827;border:1px solid #1f2937;border-radius:10px;
  padding:1rem 1.1rem;transition:transform 0.2s,border-color 0.2s;
}
.card:hover{transform:translateY(-2px);border-color:#f59e0b}
.card .c-ico{font-size:1.4rem;margin-bottom:0.3rem;display:block}
.card h4{margin:0 0 0.3rem 0;color:#fbbf24;font-size:0.95rem}
.card p{font-size:0.85rem;margin:0;color:#cbd5e1}

.stat-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:0.75rem;margin:1rem 0;
}
.stat-card{
  background:linear-gradient(135deg,#1f2937,#111827);
  border:1px solid #374151;border-radius:8px;padding:0.9rem;text-align:center;
}
.stat-card b{display:block;font-size:1.5rem;color:#fbbf24;font-weight:800;margin-bottom:0.15rem}
.stat-card span{font-size:0.75rem;color:#94a3b8;text-transform:uppercase;letter-spacing:0.05em}

.info-box{
  background:#172132;border-left:3px solid #f59e0b;
  padding:0.9rem 1.1rem;margin:1rem 0;border-radius:0 6px 6px 0;
  font-size:0.9rem;color:#d1d5db;
}
.info-box strong{color:#fde68a}
.warn-box{
  background:#1a1308;border-left:3px solid #dc2626;
  padding:0.9rem 1.1rem;margin:1rem 0;border-radius:0 6px 6px 0;
  font-size:0.9rem;color:#fecaca;
}
.pro-box{
  background:#0c1a28;border-left:3px solid #06b6d4;
  padding:0.9rem 1.1rem;margin:1rem 0;border-radius:0 6px 6px 0;
  font-size:0.9rem;color:#cbd5e1;
  display:none;
}
body.pro-mode .pro-box{display:block}

/* TABLE */
.oil-table{
  width:100%;border-collapse:collapse;margin:1rem 0;
  font-size:0.85rem;background:#111827;border-radius:8px;overflow:hidden;
}
.oil-table th{
  background:#1f2937;color:#fbbf24;text-align:left;padding:0.6rem 0.8rem;
  font-weight:700;border-bottom:1px solid #374151;font-size:0.78rem;
  text-transform:uppercase;letter-spacing:0.04em;
}
.oil-table td{padding:0.55rem 0.8rem;border-bottom:1px solid #1f2937;color:#d1d5db}
.oil-table tr:last-child td{border-bottom:none}
.oil-table tr:hover{background:rgba(251,191,36,0.04)}
.oil-table .num{text-align:right;font-variant-numeric:tabular-nums;color:#fde68a}
.oil-table td.rank{color:#64748b;font-weight:700;width:3rem;text-align:center}

/* BAR CHART (HTML) */
.bar-chart{margin:1rem 0}
.bar-row{display:flex;align-items:center;gap:0.6rem;margin:0.3rem 0;font-size:0.82rem}
.bar-label{width:140px;color:#d1d5db;text-align:right;flex-shrink:0}
.bar-track{flex:1;background:#1f2937;height:18px;border-radius:3px;overflow:hidden;position:relative}
.bar-fill{height:100%;background:linear-gradient(90deg,#f59e0b,#fbbf24);border-radius:3px}
.bar-value{color:#fde68a;width:70px;font-variant-numeric:tabular-nums;font-weight:600}

/* PROCESS DIAGRAM (ASCII-style for refining) */
.flow-diagram{
  background:#0c1222;border:1px solid #1f2937;border-radius:10px;
  padding:1rem 1.2rem;margin:1.2rem 0;font-family:'Courier New',monospace;
  font-size:0.82rem;color:#cbd5e1;white-space:pre-wrap;line-height:1.5;
  overflow-x:auto;
}

/* FOOTER */
footer{
  border-top:1px solid #1f2937;background:#070a12;
  padding:2rem 1.5rem;text-align:center;color:#64748b;font-size:0.82rem;
}
footer a{color:#fbbf24;text-decoration:none}
footer a:hover{text-decoration:underline}
.disclaimer{color:#94a3b8;max-width:720px;margin:0 auto 0.75rem;font-size:0.8rem}

/* RESPONSIVE */
@media (max-width:768px){
  .hero h1{font-size:1.9rem}
  .hero p{font-size:0.95rem}
  main{padding:1.5rem 1rem 3rem}
  h2.section-h{font-size:1.5rem}
  h3{font-size:1.15rem}
  .oil-table{font-size:0.78rem}
  .oil-table th,.oil-table td{padding:0.45rem 0.55rem}
  .bar-label{width:100px;font-size:0.75rem}
  .bar-value{width:60px;font-size:0.75rem}
  .nav-right{gap:0.75rem}
  .mode-toggle .toggle-label{display:none}
}

/* SEARCH */
.search-bar{
  background:#111827;border:1px solid #1f2937;border-radius:8px;
  padding:0.75rem 1rem;color:#e2e8f0;width:100%;font-size:0.9rem;
  font-family:inherit;margin-bottom:1rem;
}
.search-bar:focus{outline:none;border-color:#f59e0b}

/* FIELD / PRODUCT DETAIL */
.detail-card{
  background:#111827;border:1px solid #1f2937;border-radius:10px;
  padding:1rem 1.2rem;margin:0.75rem 0;
}
.detail-card .d-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:0.75rem;flex-wrap:wrap;margin-bottom:0.35rem;
}
.detail-card .d-head h4{margin:0;color:#fbbf24;font-size:1rem}
.detail-card .d-meta{color:#94a3b8;font-size:0.78rem}
.detail-card .d-body{color:#d1d5db;font-size:0.88rem;margin-top:0.4rem}
.pill{
  display:inline-block;padding:0.15rem 0.55rem;border-radius:999px;
  font-size:0.7rem;font-weight:600;background:#1f2937;color:#fde68a;
  border:1px solid #374151;margin-right:0.25rem;
}
.pill.api{background:#422006;color:#fbbf24;border-color:#78350f}
.pill.sour{background:#450a0a;color:#fca5a5;border-color:#7f1d1d}
.pill.sweet{background:#052e1b;color:#6ee7b7;border-color:#065f46}
