/* =========================================================================
   DataAPI — Corporate Registry Intelligence
   Design system: restrained corporate/fintech aesthetic
   ========================================================================= */

:root {
  /* Palette */
  --ink-900: #0b1524;
  --ink-800: #14233a;
  --ink-700: #1f3350;
  --navy-900: #0e1b30;
  --navy-800: #16294a;
  --navy-700: #1e3a63;
  --brand-600: #1857c4;
  --brand-500: #2f6fe0;
  --brand-400: #5b90ee;
  --brand-50: #eef4ff;
  --teal-500: #0f9d8f;
  --amber-500: #d98a1a;
  --red-500: #d8453b;
  --green-600: #12855a;
  --green-50: #e7f6ee;
  --red-50: #fdecea;
  --amber-50: #fdf3e2;
  --slate-50: #f7f9fc;
  --slate-100: #eef2f8;
  --slate-200: #e2e8f2;
  --slate-300: #cdd7e6;
  --slate-400: #9aa8bf;
  --slate-500: #6b7a94;
  --slate-600: #4c5a72;
  --slate-700: #35415a;
  --white: #ffffff;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Roboto Mono", Menlo,
    Consolas, monospace;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, 0.06), 0 1px 3px rgba(16, 30, 54, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 30, 54, 0.08);
  --shadow-lg: 0 18px 48px rgba(13, 27, 51, 0.16);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-700);
  background: var(--slate-50);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--ink-900); font-weight: 650; letter-spacing: -0.01em; margin: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
.muted { color: var(--slate-500); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ Header */
.site-header {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-500), var(--teal-500));
  display: grid; place-items: center; color: white; font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); font-size: 15px;
}
.brand-name { color: white; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-name span { color: var(--brand-400); }
.brand-sub { color: var(--slate-400); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav a {
  color: #c7d3e6; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav a:hover { color: white; background: rgba(255,255,255,.07); text-decoration: none; }
.nav .badge-api {
  border: 1px solid rgba(255,255,255,.16); color: #dbe6f6;
  font-family: var(--font-mono); font-size: 12px; padding: 6px 12px;
}

/* ------------------------------------------------------------------- Hero */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(47,111,224,.28), transparent 60%),
    radial-gradient(900px 360px at 5% 0%, rgba(15,157,143,.20), transparent 55%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: white;
  padding: 62px 0 108px;
  position: relative;
}
.hero h1 { color: white; font-size: 40px; line-height: 1.1; max-width: 720px; letter-spacing: -0.025em; }
.hero p.lead { color: #c3d1e6; font-size: 17px; max-width: 620px; margin: 16px 0 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--brand-400);
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--brand-400); }

/* Search */
.searchbar {
  margin-top: 30px; background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 10px; max-width: 760px;
}
.search-tabs { display: flex; gap: 4px; padding: 4px 4px 10px; }
.search-tabs button {
  border: 0; background: transparent; color: var(--slate-500); font-weight: 600;
  font-size: 13px; padding: 7px 14px; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.search-tabs button.active { background: var(--brand-50); color: var(--brand-600); }
.search-input-row { display: flex; gap: 8px; }
.search-input-row input {
  flex: 1; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 15px 18px; font-size: 16px; color: var(--ink-900); font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-input-row input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-50); }
.btn {
  border: 0; border-radius: var(--radius); cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 15px; padding: 15px 26px; transition: transform .05s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); color: white; }
.btn-primary:hover { background: var(--brand-500); }
.btn-ghost { background: var(--slate-100); color: var(--slate-700); }
.btn-ghost:hover { background: var(--slate-200); }
.hint { padding: 10px 6px 4px; color: var(--slate-400); font-size: 12.5px; }
.hint b { color: var(--slate-600); font-weight: 600; }

/* Stats strip overlapping hero */
.stats-strip {
  margin-top: -56px; position: relative; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: var(--slate-200); border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
}
.stat { background: white; padding: 22px 24px; }
.stat .n { font-size: 28px; font-weight: 750; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--slate-500); font-weight: 500; margin-top: 2px; }
.stat .n small { font-size: 14px; color: var(--teal-500); font-weight: 700; }

/* ---------------------------------------------------------------- Sections */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 22px; }
.section-head p { margin: 4px 0 0; color: var(--slate-500); font-size: 14px; }

/* Domain feature cards */
.domain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.domain-card {
  background: white; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.domain-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--slate-300); }
.domain-ico {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  margin-bottom: 14px; color: white; font-size: 19px;
}
.domain-card h3 { font-size: 16px; margin-bottom: 6px; }
.domain-card p { color: var(--slate-500); font-size: 13.5px; margin: 0; }

/* Company card grid */
.company-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.company-card {
  display: block; background: white; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s;
}
.company-card:hover { text-decoration: none; border-color: var(--brand-400); box-shadow: var(--shadow-md); }
.company-card .cc-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.company-card h4 { font-size: 15.5px; color: var(--ink-900); }
.company-card .cc-cin { font-size: 12.5px; color: var(--slate-500); margin-top: 3px; }
.company-card .cc-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--slate-500); }
.company-card .cc-meta b { color: var(--slate-700); font-weight: 600; }

/* Status pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active { background: var(--green-50); color: var(--green-600); }
.pill-strike { background: var(--red-50); color: var(--red-500); }
.pill-amber { background: var(--amber-50); color: var(--amber-500); }
.pill-neutral { background: var(--slate-100); color: var(--slate-600); }

/* ------------------------------------------------------------- Profile page */
.profile-hero { background: linear-gradient(180deg, var(--navy-900), var(--navy-800)); color: white; padding: 34px 0 0; }
.crumbs { font-size: 13px; color: var(--slate-400); margin-bottom: 16px; }
.crumbs a { color: #b8c6de; }
.profile-title-row { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.profile-logo {
  width: 58px; height: 58px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--brand-500), var(--teal-500));
  display: grid; place-items: center; color: white; font-weight: 750; font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.profile-title h1 { color: white; font-size: 26px; letter-spacing: -0.02em; }
.profile-ids { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; color: #c3d1e6; font-size: 13px; }
.profile-ids .mono { color: white; }
.profile-facts { display: flex; gap: 34px; flex-wrap: wrap; margin: 26px 0 0; padding-bottom: 22px; }
.pf { }
.pf .k { font-size: 11.5px; color: var(--slate-400); text-transform: uppercase; letter-spacing: .07em; }
.pf .v { font-size: 15px; color: white; font-weight: 600; margin-top: 3px; }

/* Tabs */
.tabbar { background: white; border-bottom: 1px solid var(--slate-200); position: sticky; top: 62px; z-index: 20; }
.tabbar .container { display: flex; gap: 4px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 15px 16px; font-size: 14px; font-weight: 600;
  color: var(--slate-500); cursor: pointer; font-family: inherit; border-bottom: 2.5px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--slate-700); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.tab .count { color: var(--slate-400); font-weight: 500; font-size: 12px; margin-left: 4px; }

.panel { display: none; padding: 32px 0 64px; }
.panel.active { display: block; }

/* Cards + data grids */
.card {
  background: white; border: 1px solid var(--slate-200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 20px; overflow: hidden;
}
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--slate-100); display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 8px 22px 20px; }

.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 32px; }
.kv { padding: 12px 0; border-bottom: 1px solid var(--slate-100); }
.kv .k { font-size: 12px; color: var(--slate-500); }
.kv .v { font-size: 14.5px; color: var(--ink-900); font-weight: 550; margin-top: 3px; word-break: break-word; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--slate-500); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50); white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--slate-50); }
table.data td b { color: var(--ink-900); font-weight: 600; }

/* People (directors) */
.person { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: white; font-weight: 650; font-size: 14px;
}

/* Financial metric tiles */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.metric .k { font-size: 12px; color: var(--slate-500); }
.metric .v { font-size: 22px; font-weight: 750; color: var(--ink-900); margin-top: 6px; font-variant-numeric: tabular-nums; }
.metric .d { font-size: 12px; margin-top: 4px; font-weight: 600; }
.d.up { color: var(--green-600); }
.d.down { color: var(--red-500); }

/* Simple bar chart */
.bars { display: flex; align-items: flex-end; gap: 18px; height: 180px; padding: 10px 6px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 60%; max-width: 54px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--brand-400), var(--brand-600)); min-height: 4px; transition: height .5s; }
.bar.alt { background: linear-gradient(180deg, #57c4b4, var(--teal-500)); }
.bar-lbl { font-size: 11.5px; color: var(--slate-500); }
.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--slate-600); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* States */
.empty { text-align: center; padding: 46px 20px; color: var(--slate-500); }
.empty .ico { font-size: 34px; opacity: .5; }
.skeleton { background: linear-gradient(90deg, var(--slate-100), var(--slate-50), var(--slate-100)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 6px; }
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.search-results { position: absolute; left: 0; right: 0; margin-top: 8px; background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--slate-200); overflow: hidden; }
.sr-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; cursor: pointer; border-bottom: 1px solid var(--slate-100); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: var(--brand-50); }
.sr-item h5 { font-size: 14px; color: var(--ink-900); margin: 0; }
.sr-item .m { font-size: 12px; color: var(--slate-500); margin-top: 2px; }

/* Footer */
.site-footer { background: var(--navy-900); color: #9fb0c9; padding: 40px 0; margin-top: 40px; font-size: 13.5px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: #c3d1e6; }
.site-footer .disc { max-width: 560px; color: var(--slate-500); font-size: 12.5px; line-height: 1.5; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink-900); color: white; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; z-index: 100; opacity: 0; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 900px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .domain-grid, .company-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 30px; }
}
@media (max-width: 560px) {
  .stats-strip { grid-template-columns: 1fr; }
  .kv-grid, .metrics { grid-template-columns: 1fr; }
  .nav a:not(.badge-api) { display: none; }
}
