/* OpenKey — shared design system. Bento palette: indigo/violet primary,
   emerald/cyan secondary, clean WHITE backgrounds, near-black ink. Token-driven,
   mobile-first, WCAG-AA contrast. The whole site recolours from these tokens —
   legacy variable NAMES are kept as aliases so existing markup keeps working. */
:root {
  /* ---- Bento brand palette (exact hexes) ---- */
  --indigo-base: #4f46e5;       /* primary accent / CTAs / highlights */
  --indigo-2: #6366f1;          /* lighter indigo */
  --violet-base: #8b5cf6;       /* secondary accent */
  --violet-2: #a78bfa;
  --cyan-base: #22d3ee;
  --emerald-base: #10b981;      /* green that reads as text on white */
  --emerald-2: #34d399;
  --ink-base: #0a0b14;          /* near-black ink / dark blocks */
  --ink-2-base: #11131f;

  /* ---- Clean neutrals (white-led) ---- */
  --paper-0: #ffffff;       /* page background */
  --paper-1: #f6f7fb;       /* surface tint */
  --paper-2: #eef0f6;       /* deeper tint */
  --cream: #ffffff;         /* card background */
  --ink-text: #1a1c2b;      /* body text */
  --ink-text-2: #2a2d3d;    /* softer ink */
  --muted: #5b5f73;         /* muted text */
  --muted-d: #9aa0b8;       /* faint text */
  --line: #e7e9f2;          /* hairline */
  --line-soft: #f0f1f8;

  /* ---- SINGLE page-background switch ----
     Flip the whole site to a tinted surface by setting:  --page-bg: var(--paper-1);  */
  --page-bg: var(--paper-0);

  /* ---- Brand aliases the existing markup references (DO NOT rename) ---- */
  --bg: var(--page-bg);
  --bg-tint: var(--paper-1);
  --paper: var(--cream);
  --ink: var(--ink-text);
  --ink-mid: var(--ink-text-2);
  --ink-soft: var(--muted);

  --indigo: var(--indigo-base);
  --indigo-dark: var(--indigo-base);
  --indigo-deep: #4338ca;
  --indigo-soft: #eef0ff;
  --violet: var(--violet-base);
  --aqua: var(--cyan-base);
  --aqua-soft: #d6f7fd;
  --coral: var(--indigo-base);
  --coral-dark: var(--indigo-base);
  --coral-soft: #eef0ff;
  --amber: #f59e0b;
  --amber-soft: #fef3da;
  --navy: var(--ink-base);

  --primary: var(--indigo-base);
  --primary-dark: #4338ca;
  --teal: var(--emerald-base);
  --teal-dark: #0d9488;
  --teal-soft: #e7faf2;
  --gold: var(--amber);
  --gold-soft: var(--amber-soft);

  /* Legacy pink/mint/forest aliases — repointed at Bento values so old markup keeps working */
  --pink: var(--indigo-base);
  --pink-dark: #4338ca;
  --pink-deep: #3730a3;
  --pink-soft: #eef0ff;
  --mint: var(--emerald-2);
  --mint-dark: var(--emerald-base);
  --mint-soft: #e7faf2;
  --forest: #0a0b14;
  --forest-2: #1b1d2e;

  /* Signature gradients — indigo-led with violet/cyan accents */
  --grad-hero: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #8b5cf6 100%);
  --grad-brand: linear-gradient(120deg, var(--indigo-base) 0%, var(--violet-base) 100%);
  --grad-accent: linear-gradient(120deg, var(--emerald-2) 0%, var(--emerald-base) 100%);
  --grad-aqua: linear-gradient(120deg, var(--cyan-base) 0%, var(--indigo-base) 130%);
  --grad-forest: linear-gradient(135deg, var(--ink-2-base) 0%, var(--ink-base) 100%);

  /* RAG status (white friendly) */
  --green: #0e8a5f; --green-bg: #e7faf2;
  --amber-rag: #b45309; --amber-bg: #fef3da;
  --red: #dc2626;   --red-bg: #fee2e2;
  --grey: #5b5f73;  --grey-bg: #eef0f6;

  /* Cool, layered shadows */
  --shadow-sm: 0 1px 2px rgba(10,11,20,.04), 0 2px 6px rgba(10,11,20,.06);
  --shadow-md: 0 6px 18px rgba(10,11,20,.08), 0 2px 8px rgba(10,11,20,.05);
  --shadow-lg: 0 24px 60px rgba(10,11,20,.16), 0 8px 24px rgba(10,11,20,.09);
  --shadow-primary: 0 10px 26px rgba(79,70,229,.32);
  --shadow-accent: 0 10px 26px rgba(16,185,129,.30);

  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 11px;
  --maxw: 1140px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page-bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.6;
}
a { color: var(--indigo-base); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.025em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.22rem; font-weight: 700; }
p { margin: 0 0 1rem; color: var(--ink-mid); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }

/* Gradient text accents */
.gradient-text {
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.6em; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(79,70,229,.42); }
.btn-accent { background: var(--grad-accent); color: #04120c; box-shadow: var(--shadow-accent); }
.btn-accent:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16,185,129,.40); }
.btn-ghost { background: var(--paper-1); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--indigo-base); color: var(--indigo-base); text-decoration: none; transform: translateY(-2px); }
.btn-sm { padding: .5em 1em; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Header / nav */
.nav {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: .55em; font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .key { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--ink-mid); font-weight: 600; }
.nav-links a:hover { color: var(--indigo-base); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* Cards & panels */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--indigo-soft); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }

/* Pills / RAG badges */
.pill { display: inline-flex; align-items: center; gap: .35em; padding: .22em .75em; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber-rag); }
.pill.red   { background: var(--red-bg);   color: var(--red); }
.pill.grey  { background: var(--grey-bg);  color: var(--grey); }
.pill.teal  { background: var(--teal-soft); color: var(--teal-dark); }
.pill.gold  { background: var(--amber-soft); color: #92580c; }

/* Forms */
label { display: block; font-weight: 700; font-size: .9rem; margin: 0 0 .35em; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: .78em .9em; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo-base); box-shadow: 0 0 0 4px var(--indigo-soft); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 40px 0; color: var(--ink-soft); font-size: .9rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between; align-items: center; }
.footer a { color: var(--ink-mid); }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink-base); color: #fff; padding: .85em 1.4em; border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* Subtle entrance motion */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .6s cubic-bezier(.2,.7,.3,1) both; }
.reveal.d1 { animation-delay: .08s; }
.reveal.d2 { animation-delay: .16s; }
.reveal.d3 { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.d1, .reveal.d2, .reveal.d3 { animation: none; }
  * { scroll-behavior: auto; }
}

/* Utility */
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
