/* =========================================================================
   Valentin Industries — Executive Holding & Advisory (Production-ready)
   - 4 themes (navy, onyx-gold, light, slate)
   - Accessible contrast, subtle motion, charts using CSS + SVG
   - No external dependencies
   ========================================================================= */
:root {
  /* base tokens */
  --radius: 16px;
  --shadow-lg: 0 30px 100px rgba(0,0,0,.45);
  --shadow-md: 0 18px 60px rgba(0,0,0,.35);
  --line: rgba(148,163,184,.18);

  /* default theme (navy) */
  --bg-0:#05060a; --bg-1:#0b1020; --bg-2:#0e172a;
  --ink:#e7ecf5; --muted:#a6b0c5;
  --brand-1:#67b3ff; --brand-2:#4cc9f0; --brand-3:#99f6ff;
  --accent-1:#6ee7ff; --accent-2:#60a5fa; --accent-3:#38bdf8;
  --card: linear-gradient(180deg, rgba(16,23,42,.65), rgba(16,23,42,.35));
  color-scheme: dark;
}

/* THEME: onyx-gold (black & gold) */
body[data-theme="onyx-gold"] {
  --bg-0:#050505; --bg-1:#0a0a0a; --bg-2:#0f0f10;
  --ink:#f4f1e6; --muted:#c8c0a8;
  --brand-1:#ffd166; --brand-2:#f4c430; --brand-3:#ffe6a1;
  --accent-1:#ffd166; --accent-2:#eab308; --accent-3:#f59e0b;
  --card: linear-gradient(180deg, rgba(25,22,9,.55), rgba(25,22,9,.35));
  color-scheme: dark;
}

/* THEME: light (white background) */
body[data-theme="light"] {
  --bg-0:#f6f7fb; --bg-1:#ffffff; --bg-2:#f8fafc;
  --ink:#0c1224; --muted:#4b5566;
  --brand-1:#0ea5e9; --brand-2:#6366f1; --brand-3:#60a5fa;
  --accent-1:#0ea5e9; --accent-2:#10b981; --accent-3:#ef4444;
  --card: #ffffff;
  --line: rgba(15,23,42,.12);
  color-scheme: light;
}

/* THEME: slate (neutral executive) */
body[data-theme="slate"] {
  --bg-0:#07090d; --bg-1:#0e131c; --bg-2:#121a26;
  --ink:#e6e8ec; --muted:#9aa4b5;
  --brand-1:#a78bfa; --brand-2:#60a5fa; --brand-3:#34d399;
  --accent-1:#a78bfa; --accent-2:#60a5fa; --accent-3:#34d399;
  --card: linear-gradient(180deg, rgba(12,18,28,.6), rgba(12,18,28,.35));
  color-scheme: dark;
}

/* Base layout */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -20%, color-mix(in oklab, var(--brand-2) 16%, transparent), transparent 60%),
    radial-gradient(900px 380px at 90% 0%, color-mix(in oklab, var(--brand-1) 16%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2) 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrapper { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container { max-width: 1300px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(120%) blur(10px);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg-0) 85%, transparent), color-mix(in oklab, var(--bg-0) 55%, transparent));
  border-bottom: 1px solid var(--line);
}
.nav {
  min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: grid; grid-auto-flow: column; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .2px; }
.brand .mark {
  width: 12px; height: 12px; border-radius: 4px;
  background: conic-gradient(from 0turn, var(--brand-1), var(--brand-2), var(--brand-1));
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--brand-1) 20%, transparent), 0 0 40px color-mix(in oklab, var(--brand-2) 35%, transparent);
}
.nav a, .nav button.theme-toggle {
  color: var(--ink); text-decoration: none; opacity: .92; font-weight: 650;
  border: 1px solid transparent; padding: 9px 12px; border-radius: 12px; background: transparent; cursor: pointer;
}
.nav a:hover, .nav button.theme-toggle:hover { opacity: 1; border-color: var(--line); }
.nav .cta { border-color: var(--line); }
.nav .cta.primary { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #031018; border: 0; }

/* Theme palette switcher */
.theme-switcher {
  display: inline-flex; gap: 6px; align-items: center; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: color-mix(in oklab, var(--bg-1) 70%, transparent);
}
.theme-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; display: inline-block; }
.theme-dot[data-theme="navy"] { background: linear-gradient(135deg, #67b3ff, #4cc9f0); }
.theme-dot[data-theme="onyx-gold"] { background: linear-gradient(135deg, #ffd166, #f4c430); }
.theme-dot[data-theme="light"] { background: linear-gradient(135deg, #ffffff, #e5e7eb); }
.theme-dot[data-theme="slate"] { background: linear-gradient(135deg, #a78bfa, #60a5fa); }

/* Hero */
.hero { padding: 84px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.kicker .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--brand-2); box-shadow: 0 0 10px color-mix(in oklab, var(--brand-2) 80%, transparent); }
h1 { margin: .2rem 0 1rem; font-size: clamp(2rem, 4.8vw, 3.8rem); line-height: 1.05; letter-spacing: -.01em; }
.lead { font-size: clamp(1.05rem,1.6vw,1.2rem); color: var(--muted); max-width: 75ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.button { display: inline-block; padding: 12px 16px; border-radius: 12px; font-weight: 800; letter-spacing: .2px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.button.primary { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #031018; border: 0; }
.button.ghost { background: transparent; }
.small { font-size: .92rem; color: var(--muted); }

/* Hero identity art */
.hero-identity { position: relative; display: grid; gap: 8px; align-content: center; padding: 26px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-lg); min-height: 320px; }
.hero-identity::before, .hero-identity::after { content: ""; position: absolute; inset: -15%; filter: blur(40px); opacity: .6; }
.hero-identity::before { background: radial-gradient(700px 300px at 85% 10%, color-mix(in oklab, var(--brand-1) 18%, transparent), transparent 60%); }
.hero-identity::after { background: radial-gradient(600px 260px at 15% 85%, color-mix(in oklab, var(--brand-2) 15%, transparent), transparent 60%); }
.hero-identity .domain { color: var(--muted); letter-spacing: .3px; }
.hero-identity .wordmark { font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: .3px; }
.hero-identity .signal { color: var(--muted); }

/* Sections & grid */
section.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 28px; margin: 40px auto; }
h2 { margin: 0 0 10px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h3 { margin: 16px 0 6px; font-size: 1.05rem; color: var(--brand-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px) { .grid-3 { grid-template-columns: 1fr; } }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
ul.clean { margin: 10px 0 0; padding: 0 0 0 18px; }
li + li { margin-top: 6px; }

/* Stats */
.stats .stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .stats .stat-grid { grid-template-columns: 1fr; } }
.stat { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; background: color-mix(in oklab, var(--bg-1) 55%, transparent); }
.stat-value { display: block; font-weight: 900; font-size: 1.2rem; }
.stat-label { display: block; color: var(--muted); font-size: .95rem; }

/* Data visuals */
.figure { display: grid; gap: 10px; }
.fig-title { font-weight: 800; }
.chart { width: 100%; height: 220px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in oklab, var(--bg-1) 55%, transparent); position: relative; overflow: hidden; }
.chart .y-grid { position: absolute; inset: 0; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 44px; opacity: .6; }
.chart .bar { position: absolute; bottom: 0; width: 36px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--accent-1), var(--accent-2)); box-shadow: 0 6px 20px color-mix(in oklab, var(--accent-1) 25%, transparent); }
.chart .bar .label { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px); font-size: .85rem; color: var(--ink); background: rgba(0,0,0,.25); padding: 2px 6px; border-radius: 8px; border: 1px solid var(--line); }
.chart .x-labels { position: absolute; left: 0; right: 0; bottom: -2px; display: flex; justify-content: space-around; color: var(--muted); font-size: .85rem; }

/* Donut */
.donut { width: 160px; height: 160px; display: grid; place-items: center; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; text-align: center; }
.donut .center .big { font-weight: 900; font-size: 1.1rem; }
.donut .center .small { color: var(--muted); font-size: .85rem; }
.arc-bg { stroke: color-mix(in oklab, var(--muted) 35%, transparent); stroke-width: 14; fill: none; }
.arc { stroke: var(--accent-2); stroke-width: 14; stroke-linecap: round; fill: none; }

/* Marquee */
.marquee { overflow: hidden; border: 1px dashed var(--line); border-radius: 12px; padding: 8px; opacity: .95; }
.track { display: flex; gap: 36px; align-items: center; animation: scroll 34s linear infinite; }
.logo-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in oklab, var(--bg-1) 55%, transparent); white-space: nowrap; font-weight: 700; letter-spacing: .3px; }
.logo-pill .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--brand-2); }
.logo-qbic .dot { background: #0ea5e9; } .logo-www .dot { background: #3b82f6; } .logo-bulwark .dot { background: #a3b72f; } .logo-hoorizon .dot { background: #6366f1; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Company cards */
.card.company { display: grid; gap: 10px; padding: 22px; transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.card.company:hover { transform: translateY(-2px); background: color-mix(in oklab, var(--bg-1) 65%, transparent); border-color: color-mix(in oklab, var(--brand-1) 35%, var(--line)); }
.company .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.company .name { font-weight: 800; letter-spacing: .3px; }
.company .ext { font-size: .9rem; color: var(--muted); text-decoration: none; }
.company .ext:hover { text-decoration: underline; }
.company .desc { color: var(--muted); }
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .8rem; padding: .2rem .55rem; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--brand-3); font-weight: 700; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; background: color-mix(in oklab, var(--bg-1) 70%, transparent); border: 1px solid var(--line); padding: .15rem .35rem; border-radius: 6px; }

/* Contact form */
.contact-form { display: grid; gap: 16px; max-width: 600px; margin-top: 20px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-weight: 700; font-size: .9rem; color: var(--muted); }
.form-group input, .form-group textarea { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in oklab, var(--bg-1) 70%, transparent); color: var(--ink); font-family: inherit; font-size: 1rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-1) 20%, transparent); }
.form-group textarea { resize: vertical; min-height: 120px; }

/* Footer */
footer { color: var(--muted); font-size: .94rem; padding: 60px 0 90px; text-align: center; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.reveal-in { opacity: 1; transform: none; transition: opacity .6s ease .05s, transform .6s ease .05s; }

/* 404/500 */
.error-wrap { min-height: 70vh; display: grid; place-items: center; }
.error-card { max-width: 720px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-md); text-align: center; }
.error-code { font-size: 5rem; font-weight: 900; letter-spacing: .02em; margin: 0; }
.error-msg { color: var(--muted); }


/* --- Inline SVG logo styles --- */
.brand .logo-vi{ width:32px; height:32px; display:inline-block; vertical-align:middle }
.brand .brand-text{ font-weight:900; letter-spacing:.3px }
.hero-identity .hero-logo{ width:min(42vw, 280px); height:auto; display:block; filter: drop-shadow(0 18px 60px rgba(0,0,0,.45)); margin-bottom:8px }
.logo-vi .v, .logo-vi .i,
.hero-logo .v, .hero-logo .i{ stroke-linecap:round; stroke-linejoin:round; fill:none }
@media (prefers-reduced-motion: no-preference){
  .logo-vi .v, .logo-vi .i{ stroke-dasharray:140; stroke-dashoffset:140; animation:vi-draw 1s var(--ease) .05s both }
  .hero-logo .v, .hero-logo .i{ stroke-dasharray:260; stroke-dashoffset:260; animation:vi-draw 1.2s var(--ease) .1s both }
  @keyframes vi-draw { to { stroke-dashoffset: 0 } }
}


/* ===== Inline SVG Logo ===== */
.vi-logo { width: 28px; height: 28px; display:inline-block; vertical-align:-6px }
.vi-logo path, .vi-logo line, .vi-logo circle { vector-effect: non-scaling-stroke; }

/* Hero generated mark */
.logo-hero{
  display:grid; place-items:center; border-radius:24px; border:1px solid var(--line);
  padding:26px; min-height:340px; box-shadow:var(--shadow); background:var(--card-bg);
}
.logo-hero svg{ width:min(62vw,560px); height:auto; display:block; }

/* KPI cards */
.kpis { display:grid; grid-template-columns: repeat(4, 1fr); gap:16px }
@media (max-width: 1100px){ .kpis{ grid-template-columns:1fr; } }
.kpi { padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--card-bg) }
.kpi-label { color: var(--muted); font-size:.92rem; margin-bottom:6px }
.kpi-value { font-weight:900; font-size:1.6rem; letter-spacing:.3px }
.kpi .unit { font-weight:700; font-size:.95rem; color:var(--muted) }
.kpi-delta { font-weight:700; font-size:.92rem; margin-top:4px }
.kpi-delta.up { color: color-mix(in oklab, var(--brand-1) 80%, white) }
.kpi-delta.down { color: #ef4444 }
.mini-bar { height:8px; border-radius:999px; background:color-mix(in oklab, var(--bg-0) 70%, transparent); border:1px solid var(--line); margin-top:10px; overflow:hidden }
.mini-bar > i { display:block; height:100%; width:0%; background:linear-gradient(90deg, var(--brand-1), var(--brand-2)); border-radius:999px; transition: width 1.2s var(--ease) }

/* Mobile responsiveness */
@media (max-width: 768px) {
  .wrapper, .container { padding: 0 16px; }
  .hero { padding: 64px 0 20px; }
  .hero-grid { gap: 32px; }
  .nav { min-height: 64px; gap: 12px; }
  .nav-links { gap: 6px; }
  .nav a, .nav button.theme-toggle { padding: 8px 10px; font-size: .9rem; }
  .brand { font-size: .95rem; }
  .cta-row { gap: 8px; }
  .button { padding: 10px 14px; }
  .grid-3 { gap: 14px; }
  .stats .stat-grid { gap: 12px; }
  .kpis { gap: 12px; }
  .kpi { padding: 14px; }
  .marquee { padding: 6px; }
  .track { gap: 24px; }
  .logo-pill { padding: 8px 12px; font-size: .9rem; }
  section.card { padding: 20px; margin: 32px auto; }
  .table th, .table td { padding: 8px 4px; }
  footer { padding: 40px 0 60px; }
}

@media (max-width: 480px) {
  .wrapper, .container { padding: 0 12px; }
  .hero { padding: 48px 0 16px; }
  .hero-grid { gap: 24px; }
  .nav { min-height: 56px; flex-wrap: wrap; }
  .nav-links { justify-content: center; width: 100%; margin-top: 8px; }
  .brand { font-size: .9rem; }
  .nav a, .nav button.theme-toggle { padding: 6px 8px; font-size: .85rem; min-height: 44px; display: flex; align-items: center; }
  .theme-switcher { padding: 4px 6px; }
  .theme-dot { width: 14px; height: 14px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .button { padding: 12px 16px; font-size: .95rem; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .grid-3 { gap: 12px; }
  .stats .stat-grid { gap: 10px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px; }
  .stat { padding: 12px; }
  .marquee { padding: 4px; }
  .track { gap: 16px; animation-duration: 20s; }
  .logo-pill { padding: 6px 10px; font-size: .85rem; }
  section.card { padding: 16px; margin: 24px auto; }
  .table th, .table td { padding: 6px 3px; font-size: .9rem; }
  footer { padding: 30px 0 40px; font-size: .9rem; }
  .error-card { padding: 20px; }
  .error-code { font-size: 3rem; }
}

/* Print / PDF rules */
@media print {
  /* Force a paper-like theme */
  :root{
    --bg-0:#ffffff; --bg-1:#ffffff; --bg-2:#ffffff;
    --ink:#0b1020; --muted:#475168; --line:rgba(10,20,40,.2);
    --brand-1:#2256f3; --brand-2:#7aa7ff; --brand-3:#163cc2;
    --card-bg:#ffffff;
  }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header, .hero, .stats, #advisory, #thesis, #portfolio, #bio, #contact, footer { display:none !important; }
  .printable-board { display:block !important; }
  .chart-card { break-inside: avoid; page-break-inside: avoid; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* Appendix / Classified */
.classified { border:1px dashed var(--line); border-radius:12px; padding:12px; background: repeating-linear-gradient(45deg, rgba(148,163,184,.08), rgba(148,163,184,.08) 12px, transparent 12px, transparent 24px); }
.classified .stamp { display:inline-block; font-weight:900; letter-spacing:.2px; padding:2px 8px; border-radius:6px; border:1px solid var(--line); color:var(--muted); margin-bottom:8px; }
