/*
 * KubeCrow shared styles: fonts, colours, header, footer, buttons, cards, copy boxes and install steps.
 * The same file is served by kubecrow.com and app.kubecrow.com so the two look like one site. Edit it here
 * (kubecrow-website/public/shared.css), then copy it into kubecrow-app with `node scripts/sync-shared.mjs` there;
 * scripts/check-site.mjs fails while the two copies differ. Each site's styles.css loads after it and holds only
 * that site's own pages. The Ocean palette: dark first, light via media query.
 */

/* Relative to this file, which sits at the root of both sites. */
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: #0d1628;
  --bg-raised: #131f37;
  --bg-sunken: #0a1222;
  --bg-hover: #192842;
  --fg: #e3eaf7;
  --muted: #8e9cb6;
  --border: #22324f;
  --accent: #4d9bff;
  --accent-strong: #1a6fe0;
  --accent-hover: #2a7cf0;
  --accent-fg: #ffffff;
  --danger: #f87171;
  --danger-strong: #dc2626;
  --ok: #34d399;
  --glow: rgb(77 155 255 / 0.18);
  --shadow: 0 24px 60px rgb(0 0 0 / 0.55);
  --radius: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f8fd;
    --bg-raised: #ffffff;
    --bg-sunken: #edf2f9;
    --bg-hover: #e7eef8;
    --fg: #0f1b33;
    --muted: #4f5e77;
    --border: #dbe4f1;
    --accent: #1a6fe0;
    --accent-strong: #1a6fe0;
    --danger: #b91c1c;
    --ok: #047857;
    --glow: rgb(26 111 224 / 0.12);
    --shadow: 0 24px 60px rgb(14 35 82 / 0.18);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Header, main, footer: the footer stays at the bottom of short pages. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.4em; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 0.35em; background: var(--bg-raised); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
form { margin: 0; }
body > main { flex: 1; width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { display: block; margin-bottom: 12px; color: var(--accent); font: 600 13px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Header: logo, the site menu, then Sign in / the account menu and a button ── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand .crow { color: var(--accent); }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--fg); text-decoration: none; }
/* Account (app.kubecrow.com: sign in, or your account if you're signed in). Outside .nav so it stays on small screens. */
.header-account { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.header-account:hover, .header-account[aria-current] { color: var(--fg); text-decoration: none; }
.header-account svg { flex: none; }

/* ── Buttons: secondary (outlined) by default; primary is the accent. .btn-block fills a card's width. ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--fg); font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; background: var(--bg-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent-strong); border-color: transparent; color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 8px 24px rgb(26 111 224 / 0.35); transform: translateY(-1px); }
.btn-danger { background: var(--danger-strong); border-color: transparent; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-lg { padding: 14px 26px; font-size: 17px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; padding: 12px 16px; font-size: 15px; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ── Cards, notes, copy boxes ── */
.card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); min-width: 0; }
.card h3 { font-size: 17px; }
/* :where() keeps these defaults weak, so a paragraph's own class (.small, .lede…) wins. */
:where(.card) > p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.note { margin-top: 20px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-sunken); color: var(--muted); font-size: 14px; }
.note strong { color: var(--fg); }
.cmd { display: flex; align-items: stretch; margin-top: 16px; min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-sunken); overflow: hidden; }
.cmd pre { flex: 1; min-width: 0; margin: 0; padding: 12px 14px; overflow-x: auto; white-space: pre; font-size: 13px; }
.cmd pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.cmd .copy { flex: none; border: 0; border-left: 1px solid var(--border); border-radius: 0; min-width: 92px; }
/* The dmg's checksum: folded away, with the same copy box. */
.sha summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.sha summary:hover { color: var(--fg); }
.sha .cmd { margin-top: 8px; }

/* ── Install steps: numbered circles ── */
/* min-width: 0 lets a long command scroll inside its box instead of widening the list (and its card). */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 20px; min-width: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; min-width: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--glow); color: var(--accent); font-weight: 700; font-size: 15px;
}
.steps strong { display: block; font-weight: 650; }
.steps p { color: var(--muted); font-size: 15px; margin-top: 2px; }

/* ── "Page not found" and other errors: one centred card ── */
.error-card { max-width: 520px; margin: 72px auto; padding: 40px 32px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.error-card h1 { font-size: 26px; }
.error-card .lede { color: var(--muted); }
.error-card .error-icon { color: var(--accent); }
.error-card .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.site-footer .brand { font-size: 15px; }
.site-footer .brand img { width: 24px; height: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }
.site-note { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; }

/* ── Small screens ── */
@media (max-width: 720px) {
  .nav { display: none; }
  .header-account, .site-header .account-slot { margin-left: auto; }
  .site-header .wrap { gap: 16px; }
  .site-footer nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
