:root {
  --bg: #0a0c10;
  --bg-card: #12151c;
  --bg-card-hover: #181c26;
  --bg-input: #1a1e28;
  --border: #2a2f3a;
  --border-focus: #4f8cff;
  --text: #e8eaf0;
  --text-muted: #8b93a7;
  --text-dim: #5a6275;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --accent-glow: rgba(79,140,255,0.15);
  --green: #34d399;
  --orange: #fb923c;
  --red: #f87171;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 1140px;
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,12,16,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 700; font-size: 1.25rem; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.logo span { color: var(--accent); }
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.mobile-close { display: none; }

@media (max-width: 768px) {
  .nav-links { 
    display: flex; 
    position: fixed; 
    top: 0; 
    left: -100%; 
    width: 280px; 
    height: 100vh;
    background: #000000 !important; 
    flex-direction: column; 
    padding: 80px 24px; 
    gap: 20px; 
    z-index: 1000; 
    transition: left 0.3s ease;
    border-right: 1px solid var(--border);
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
  }
  .nav-links.open { left: 0; }
  .nav-links a { color: #ffffff !important; font-size: 1.1rem; width: 100%; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .mobile-toggle { display: block; z-index: 1001; }
  
  .mobile-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff !important;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
  }
  .nav-links.open .mobile-close { display: block; }
}

/* ── HERO ── */
.hero {
  max-width: var(--max-w); margin: 0 auto; padding: 80px 24px 60px;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero h1 .accent { color: var(--accent); }
.hero p { color: #ffffff; font-size: 1.1rem; max-width: 640px; margin: 0 auto; }

/* ── CONVERTER TOOL ── */
.converter-section {
  max-width: 720px; margin: 0 auto 60px; padding: 0 24px;
}
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.converter-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent));
}
.converter-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: end;
}
@media (max-width: 600px) {
  .converter-row { grid-template-columns: 1fr; }
}
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.input-group input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  color: var(--text); font-family: var(--font-mono); font-size: 1.2rem;
  outline: none; transition: border-color 0.2s;
  width: 100%;
}
.input-group input:focus { border-color: var(--border-focus); }
.input-group .unit-label {
  font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-top: 4px;
  font-family: var(--font-mono);
}
.swap-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; transition: transform 0.3s, background 0.2s;
  flex-shrink: 0; align-self: center;
}
.swap-btn:hover { background: var(--accent-hover); transform: rotate(180deg); }

.formula-box {
  margin-top: 20px; padding: 16px;
  background: var(--accent-glow); border-radius: var(--radius-sm);
  border: 1px solid rgba(79,140,255,0.2);
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent);
  text-align: center;
}

.conversion-table {
  margin-top: 24px;
}
.conversion-table h3 {
  font-size: 1rem; margin-bottom: 12px; color: var(--text-muted);
}
.conversion-table table {
  width: 100%; border-collapse: collapse;
}
.conversion-table th, .conversion-table td {
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.85rem;
}
.conversion-table th { color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.conversion-table td { color: var(--text); }
.conversion-table tr:hover td { background: var(--bg-card-hover); }

/* ── CONTENT SECTION ── */
.content-section {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px 80px;
}
.content-body {
  max-width: 780px; margin: 0 auto;
}
.content-body h2 {
  font-size: 1.6rem; font-weight: 700; margin: 48px 0 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.content-body h3 {
  font-size: 1.2rem; font-weight: 600; margin: 32px 0 12px; color: var(--accent);
}
.content-body p {
  color: #ffffff; margin-bottom: 16px; font-size: 1rem;
}
.content-body ul, .content-body ol {
  color: var(--text-muted); margin: 0 0 16px 24px;
}
.content-body li { margin-bottom: 8px; }
.content-body strong { color: var(--text); }
.content-body code {
  font-family: var(--font-mono); background: var(--bg-input);
  padding: 2px 6px; border-radius: 4px; font-size: 0.9em;
}

/* ── FAQ SCHEMA ── */
.faq-section { margin-top: 48px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 12px; overflow: hidden;
}
.faq-q {
  width: 100%; padding: 16px 20px; background: var(--bg-card);
  border: none; color: var(--text); font-family: var(--font-body);
  font-size: 1rem; font-weight: 600; text-align: left;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s; }
.faq-q.open::after { transform: rotate(45deg); }
.faq-a {
  padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s;
  color: var(--text-muted); font-size: 0.95rem;
}
.faq-a.open { max-height: 500px; padding: 0 20px 16px; }

/* ── INTERNAL LINKS GRID ── */
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-top: 32px;
}
.related-link {
  display: block; padding: 16px 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-weight: 500; font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}
.related-link:hover { border-color: var(--accent); background: var(--bg-card-hover); color: var(--text); }
.related-link .arrow { color: var(--accent); margin-left: 8px; }

/* ── HOMEPAGE GRID ── */
.tools-grid {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px 80px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  display: flex; flex-direction: column; gap: 8px;
}
.tool-card:hover { border-color: var(--accent); background: var(--bg-card-hover); transform: translateY(-2px); }
.tool-card h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
.tool-card p { font-size: 0.85rem; color: var(--text-muted); }
.tool-card .tag {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  background: var(--accent-glow); color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.05em;
  width: fit-content;
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  max-width: var(--max-w); margin: 0 auto;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand p { color: #ffffff; font-size: 0.85rem; margin-top: 12px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #ffffff; margin-bottom: 12px; opacity: 0.8; }
.footer-col a { display: block; color: #ffffff; font-size: 0.85rem; margin-bottom: 8px; opacity: 0.9; }
.footer-col a:hover { opacity: 1; color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: #ffffff; font-size: 0.8rem; opacity: 0.7; }

/* ── STATIC PAGES ── */
.static-page {
  max-width: 780px; margin: 0 auto; padding: 60px 24px 80px;
}
.static-page h1 { font-size: 2rem; margin-bottom: 8px; }
.static-page .subtitle { color: var(--text-muted); margin-bottom: 40px; font-size: 0.95rem; }
.static-page h2 { font-size: 1.3rem; margin: 36px 0 12px; color: var(--text); }
.static-page p, .static-page li { color: #ffffff; font-size: 0.95rem; margin-bottom: 12px; }
.static-page ul { margin-left: 20px; margin-bottom: 16px; }
.static-page a { color: var(--accent); }

.contact-form { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.contact-form input, .contact-form textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  outline: none; width: 100%;
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--border-focus); }
.contact-form button {
  background: var(--accent); border: none; color: #fff;
  padding: 14px 32px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s; width: fit-content;
}
.contact-form button:hover { background: var(--accent-hover); }

/* ── BREADCRUMB ── */
.breadcrumb {
  max-width: var(--max-w); margin: 0 auto; padding: 16px 24px 0;
  font-size: 0.8rem; color: var(--text-dim);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span { margin: 0 6px; }

/* ── SCHEMA HIDDEN ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── LANGUAGE SWITCHER ── */
.lang-switcher {
  max-width: 720px; margin: 24px auto 0; 
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.lang-switcher a {
  display: inline-block; padding: 6px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.8rem; color: var(--text-muted);
  font-weight: 500; transition: all 0.2s; white-space: nowrap;
}
.lang-switcher a:hover { border-color: var(--accent); color: var(--text); background: var(--bg-card-hover); }
.lang-switcher a.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); font-weight: 600; }

/* ── VISUALIZATION ── */
.viz-container {
  margin: 24px auto 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 460px;
}

.footer-heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #ffffff; margin-bottom: 12px; opacity: 0.8; }
