:root {
  --bg: #0a0d14;
  --bg-soft: #11151f;
  --card: #151a26;
  --border: #232a3a;
  --text: #e6e9f0;
  --muted: #9aa3b5;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --ok: #38d39f;
  --err: #ff6b6b;
  --radius: 14px;
  --max: 1140px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
code, pre, .mono { font-family: 'SFMono-Regular', Consolas, monospace; }

/* NAV */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,13,20,0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.logo-mark { height: 30px; width: auto; color: #ffffff; flex-shrink: 0; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 0.95rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.lang-switch a { color: var(--muted); padding: 2px 4px; transition: color .2s; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { color: var(--accent); }
.lang-switch a + a { border-left: 1px solid var(--border); padding-left: 10px; }

.btn {
  display: inline-block; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; padding: 11px 22px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; transition: transform .15s, box-shadow .2s; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,140,255,.35); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* HERO */
.hero { padding: 100px 0 60px; text-align: center; position: relative; overflow: hidden;
  background-image: radial-gradient(rgba(79,140,255,0.05) 1px, transparent 1px); background-size: 32px 32px; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::before {
  content: ""; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px; background: radial-gradient(circle, rgba(124,92,255,.18), transparent 60%); z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.eyebrow { display: inline-block; color: var(--accent); font-weight: 600; font-size: 0.8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 18px; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto 30px; }
.gradient-text { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* SEARCH */
.tool-search { max-width: 480px; margin: 0 auto 8px; }
.tool-search input { text-align: center; }

/* SECTIONS */
section { padding: 50px 0; }
.cat-title { font-size: 1.4rem; margin: 10px 0 22px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.cat-title .tag { font-size: 0.7rem; color: var(--muted); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-weight: 500; }

/* GRID + CARDS */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.tool-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, border-color .2s; display: block; height: 100%;
}
.tool-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.tool-card .icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(79,140,255,.2), rgba(124,92,255,.2));
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700;
  margin-bottom: 16px;
}
.tool-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.tool-card p { color: var(--muted); font-size: 0.92rem; }

/* TOOL PAGE */
.tool-header { padding: 70px 0 24px; }
.crumb { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.crumb a:hover { color: var(--text); }
.tool-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); display: flex; align-items: center; gap: 14px; }
.tool-header .ico-lg {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(79,140,255,.2), rgba(124,92,255,.2));
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.tool-header p { color: var(--muted); margin-top: 12px; font-size: 1.05rem; max-width: 640px; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }
.panel h2 { font-size: 1.1rem; margin-bottom: 18px; }

/* FORM ELEMENTS */
.field { margin-bottom: 18px; }
label { font-size: 0.88rem; font-weight: 500; margin-bottom: 7px; display: block; color: var(--text); }
input, textarea, select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 0.97rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 150px; }
textarea.mono, pre.mono { font-size: 0.9rem; line-height: 1.5; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

input[type=file] { padding: 10px; cursor: pointer; }
input[type=file]::file-selector-button {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; margin-right: 12px; cursor: pointer; font-family: inherit;
}

/* RESULTS */
.result { margin-top: 4px; }
.result.empty { color: var(--muted); font-size: 0.92rem; }
pre.out {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-size: 0.9rem; max-height: 460px;
}
.big-result { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; }
.big-result .gradient-text { font-size: inherit; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 14px; }
.stat-box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat-box .v { font-size: 1.5rem; font-weight: 700; }
.stat-box .l { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 600; }
table.data tr:hover td { background: var(--bg-soft); }
.tbl-wrap { overflow-x: auto; }

.pill { display: inline-block; font-size: 0.72rem; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.pill.numeric { background: rgba(79,140,255,.15); color: var(--accent); }
.pill.text { background: rgba(124,92,255,.15); color: var(--accent-2); }

.note { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.banner { padding: 12px 16px; border-radius: 10px; font-size: 0.92rem; margin-bottom: 16px; }
.banner.ok { background: rgba(56,211,159,.12); color: var(--ok); border: 1px solid rgba(56,211,159,.3); }
.banner.err { background: rgba(255,107,107,.12); color: var(--err); border: 1px solid rgba(255,107,107,.3); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.md-preview { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 20px; max-height: 460px; overflow: auto; }
.md-preview h1,.md-preview h2,.md-preview h3 { margin: 14px 0 8px; }
.md-preview p { margin: 8px 0; }
.md-preview ul,.md-preview ol { margin: 8px 0 8px 22px; }
.md-preview code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: 0.88em; }
.md-preview pre { background: var(--bg); padding: 12px; border-radius: 8px; overflow:auto; }
.md-preview table { border-collapse: collapse; }
.md-preview th, .md-preview td { border: 1px solid var(--border); padding: 6px 12px; }

/* CONSULTANT PAGE LAYOUT */
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.page-header { padding: 80px 0 30px; text-align: center; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-header p { color: var(--muted); font-size: 1.1rem; max-width: 580px; margin: 16px auto 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -0.02em; margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, rgba(79,140,255,.2), rgba(124,92,255,.2)); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 18px; }
.card h3 { font-size: 1.22rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.97rem; }

.project-card { display: flex; flex-direction: column; text-align: center; }
.project-logo { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; height: 180px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; padding: 20px; overflow: hidden; }
.project-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.project-card h3 { font-size: 1.35rem; }
.project-link { color: var(--accent); font-weight: 600; font-size: 0.95rem; margin-top: 14px; display: inline-block; }
.project-card:hover .project-link { text-decoration: underline; }

.stats { display: flex; justify-content: center; gap: 56px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .num { font-size: 2.6rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .label { color: var(--muted); font-size: 0.92rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.split h2 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 18px; }
.split p { color: var(--muted); margin-bottom: 16px; }
.media { background: linear-gradient(135deg, var(--bg-soft), var(--card)); border: 1px solid var(--border); border-radius: var(--radius); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.flag { width: 46px; height: auto; border-radius: 5px; border: 1px solid var(--border); display: block; margin-bottom: 16px; }

/* Inline expandable terms */
.prose { margin: 0 0 16px; line-height: 1.7; }
.reveal-term { color: var(--accent); cursor: pointer; border-bottom: 1px dashed var(--accent); white-space: nowrap; user-select: none; }
.reveal-term:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.reveal-term .chev { font-size: 0.7em; margin-left: 3px; display: inline-block; transition: transform .2s; }
.reveal-term.open .chev { transform: rotate(180deg); }
.reveal-panel { display: none; margin: 14px 0; padding: 18px 20px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; }
.reveal-panel.open { display: block; }
.reveal-panel h4 { font-size: 1.02rem; margin-bottom: 8px; }
.reveal-panel p { color: var(--muted); margin: 6px 0; font-size: 0.96rem; }
.reveal-img { width: 100%; max-width: 440px; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--bg), var(--card)); border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; margin-top: 12px; }
.hero-locations { display: flex; gap: 14px 28px; justify-content: center; flex-wrap: wrap; margin-top: 30px; color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.hero-locations span { display: inline-flex; align-items: center; gap: 9px; }
.hero-locations .flag, .contact-info .flag { width: 24px; margin: 0; }
.bio-photo { width: 100%; max-width: 312px; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); display: block; margin: 0 auto; }
.bio-float { float: right; width: 280px; max-width: 42%; margin: 4px 0 20px 32px; }
.newspaper { column-count: 2; column-gap: 38px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); clear: both; }
.newspaper p, .newspaper ul.checks { break-inside: avoid; margin-top: 0; }
.cols-2 { column-count: 2; column-gap: 44px; }
.cols-2 li { break-inside: avoid; }
@media (max-width: 860px) { .cols-2 { column-count: 1; } }
@media (max-width: 860px) {
  .newspaper { column-count: 1; }
  .bio-float { float: none; width: 100%; max-width: 312px; margin: 0 auto 20px; }
}

ul.checks { list-style: none; }
ul.checks li { color: var(--muted); padding: 8px 0 8px 30px; position: relative; }
ul.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
ul.checks li.no::before { content: "✕" !important; color: var(--err) !important; }

.cta-band { background: linear-gradient(135deg, rgba(79,140,255,.12), rgba(124,92,255,.12)); border: 1px solid var(--border); border-radius: 20px; padding: 52px; text-align: center; }
.cta-band h2 { font-size: 1.9rem; margin-bottom: 14px; }
.cta-band p { color: var(--muted); margin-bottom: 26px; }

.form { display: grid; gap: 18px; }
.contact-info { display: grid; gap: 20px; }
.contact-info .item { display: flex; gap: 14px; align-items: flex-start; }
.contact-info .item .ic { font-size: 1.3rem; }
.contact-info .item .label { font-size: 0.85rem; color: var(--muted); }
.contact-info .item .val { font-weight: 600; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 50px; color: var(--muted); font-size: 0.88rem; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a:hover { color: var(--text); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .grid, .grid-2, .grid-3, .split { grid-template-columns: 1fr; }
  .split { gap: 32px; }
  .row, .row-3, .row-4 { grid-template-columns: 1fr; }
  .stats { gap: 32px; }
  .cta-band { padding: 36px 24px; }
}
