/* =====================================================================
   Ansatzalgo — modern minimal design system
   ===================================================================== */
:root {
  --bg: #ffffff;
  --surface: #f7f8fb;
  --surface-2: #eef1f7;
  --ink: #0b1020;
  --text: #1a2233;
  --muted: #5b6678;
  --border: #e6e9f0;
  --border-strong: #d4d9e4;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-soft: #eef0ff;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow: 0 8px 24px rgba(16,24,40,.08);
  --shadow-lg: 0 24px 60px rgba(16,24,40,.14);
  --container: 1180px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-family: var(--font-head); color: var(--ink); line-height: 1.18; font-weight: 600; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: #3b34c4; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.section { padding: 84px 0; }
.section-sm { padding: 52px 0; }
.bg-surface { background: var(--surface); }
.bg-ink { background: var(--ink); color: #cdd5e6; }

/* ---- Eyebrow + section heads ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  padding: .72rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: all .18s ease; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.28); }
.btn-primary:hover { background: #3f37d6; color: #fff; transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1a2238; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---- Badges / chips ---- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .03em;
  padding: .28rem .6rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-green { background: #e7f6ee; color: var(--success); border-color: transparent; }
.badge-amber { background: #fef3e2; color: var(--warn); border-color: transparent; }
.badge-red { background: #fdecec; color: var(--danger); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---- Cards & grid ---- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-flush { padding: 0; overflow: hidden; }
.card-body { padding: 22px 24px; }
.card h3 { font-size: 1.15rem; }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 1.3rem; margin-bottom: 1rem;
}

/* =====================================================================
   Header
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }
.brand img { height: 30px; width: auto; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--text); font-weight: 500; font-size: .93rem; padding: .5rem .75rem; border-radius: 8px;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--surface); }
.nav-cta { display: flex; align-items: center; gap: .6rem; }

/* dropdown */
.has-menu { position: relative; }
.menu-panel {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px; min-width: 540px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  opacity: 0; visibility: hidden; transition: all .16s ease; z-index: 1100;
}
.has-menu:hover .menu-panel, .has-menu:focus-within .menu-panel { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.menu-col h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .6rem; }
.menu-col a { display: flex; align-items: center; gap: .55rem; padding: .4rem .4rem; border-radius: 8px; font-size: .9rem; color: var(--text); font-weight: 500; }
.menu-col a:hover { background: var(--surface); color: var(--accent); }
.menu-col a i { color: var(--accent); width: 18px; text-align: center; }

.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--ink); cursor: pointer; }

/* avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }

/* =====================================================================
   Hero
   ===================================================================== */
.hero { position: relative; padding: 92px 0 76px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(79,70,229,.10), transparent 60%),
    radial-gradient(50% 50% at 100% 20%, rgba(6,182,212,.10), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero p.lead { max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-visual {
  border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--surface);
}
.hero-stats { display: flex; gap: 2.4rem; margin-top: 2.6rem; flex-wrap: wrap; }
.hero-stats .num { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.hero-stats .lbl { font-size: .82rem; color: var(--muted); }

/* gradient text */
.grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* feature/list items */
.feature { display: flex; gap: 1rem; }
.feature .card-icon { flex-shrink: 0; margin: 0; }
.tick-list { list-style: none; padding: 0; margin: 0; }
.tick-list li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .7rem; }
.tick-list li::before { content: "\2713"; color: var(--accent); font-weight: 700; }

/* page hero (inner pages) */
.page-hero { padding: 64px 0 30px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), transparent); }
.page-hero h1 { margin-bottom: .4rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }

/* meta rows */
.meta-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; color: var(--muted); font-size: .85rem; }

/* CTA band */
.cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 56px; text-align: center; position: relative; overflow: hidden;
}
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% 0%, rgba(79,70,229,.4), transparent 60%); }
.cta-band h2, .cta-band p { color: #fff; position: relative; }
.cta-band .lead { color: #b9c2d8; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
table.tbl th { background: var(--surface); font-family: var(--font-head); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: var(--surface); }

/* forms */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; color: var(--ink); }
.field .help { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.input, input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: .92rem; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; }

/* alerts */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: #e7f6ee; color: #166534; }
.alert-info { background: var(--accent-soft); color: var(--accent); }

/* avatars grid */
.person { text-align: center; scroll-margin-top: 96px; transition: box-shadow .25s ease, border-color .25s ease; }
.person.highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
  animation: highlightPulse 1.8s ease;
}
@keyframes highlightPulse {
  0%   { box-shadow: 0 0 0 0 rgba(79,70,229,.45); }
  70%  { box-shadow: 0 0 0 16px rgba(79,70,229,0); }
  100% { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
}
.person .person-actions { display: flex; gap: .4rem; justify-content: center; margin-top: .6rem; }
.person img, .person .ph {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin: 0 auto .8rem;
  border: 3px solid var(--bg); box-shadow: var(--shadow-sm); background: var(--surface-2);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: var(--accent); font-size: 1.6rem;
}

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer { background: var(--ink); color: #9aa6bd; padding: 64px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; }
.site-footer a { color: #9aa6bd; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; margin-bottom: .8rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .55rem; font-size: .92rem; }
.footer-social { display: flex; gap: .6rem; margin-top: 1rem; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #cdd5e6; }
.footer-social a:hover { background: var(--accent); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .84rem; }
.footer-bottom a { color: #9aa6bd; }

/* =====================================================================
   Admin
   ===================================================================== */
.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.admin-side { background: var(--ink); color: #cdd5e6; padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { color: #fff; margin-bottom: 1.6rem; font-size: 1.1rem; }
.admin-nav { list-style: none; padding: 0; margin: 0; }
.admin-nav .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #66718a; margin: 1.2rem .6rem .5rem; }
.admin-nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 9px; color: #cdd5e6; font-size: .9rem; font-weight: 500; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a i { width: 18px; text-align: center; color: #8b96ad; }
.admin-nav a.active i { color: var(--accent-2); }
.admin-main { padding: 30px 38px; background: var(--surface); }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.8rem; }
.admin-topbar h1 { font-size: 1.6rem; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat .num { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--ink); }
.stat .lbl { color: var(--muted); font-size: .85rem; text-transform: capitalize; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 820px; }
.inline-form { display: inline; }

/* utilities */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap { gap: 1rem; }
.gap-sm { gap: .5rem; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.6rem; } .mt-4 { margin-top: 2.4rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.text-danger { color: var(--danger); }
.w-full { width: 100%; }

/* prose for article/legal bodies */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.2rem; font-size: 1.45rem; }
.prose h3 { margin-top: 1.6rem; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose img { border-radius: var(--radius); margin: 1.4rem 0; }
.prose a { text-decoration: underline; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-links, .nav-cta .desktop-only { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: .2rem;
    position: absolute; top: 68px; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--border); padding: 14px 22px; box-shadow: var(--shadow);
  }
  .nav-links.open .has-menu .menu-panel { position: static; opacity: 1; visibility: visible; transform: none; min-width: 0; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: .4rem 0 .4rem 1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .cta-band { padding: 36px 22px; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-main { padding: 22px 18px; }
}
