/* ============================================================================
   thegeekwiththepeak.com — design system  ·  "clear & colourful"
   Bright, high-contrast, lots of white space (Google-clean), with a four-colour
   accent palette used to add life — never gaudy. No web fonts, no build step.
   ============================================================================ */

:root {
  /* neutrals */
  --ink: #1f2430;            /* headings / strong text */
  --text: #3a4250;           /* body text */
  --muted: #6b7480;          /* secondary text */
  --paper: #ffffff;          /* page background */
  --surface: #f5f7fb;        /* tinted sections / footer */
  --card: #ffffff;
  --border: #e5e9f0;

  /* colourful accent palette (used to add life across the site) */
  --blue: #2563eb;           /* primary */
  --blue-deep: #1d4ed8;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #e11d48;
  --teal: #0d9488;           /* a nod to the "peak" brand */
  --blue-wash: #eaf1fe;

  --shadow: 0 1px 2px rgba(20,30,50,.05), 0 4px 14px rgba(20,30,50,.06);
  --shadow-lift: 0 6px 16px rgba(20,30,50,.10), 0 20px 44px rgba(20,30,50,.10);
  --radius: 14px;
  --maxw: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue-deep); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--blue); text-decoration: underline; }

/* ── header: white, clean, prominent ──────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-header img.logo { height: 46px; width: auto; }
.site-header .brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.site-header .wordmark { font-weight: 800; font-size: 1.28rem; letter-spacing: -0.4px; color: var(--ink); }
.site-header .tagline { font-size: .67rem; letter-spacing: 1.3px; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.site-header nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a {
  color: var(--text); font-weight: 600; font-size: .92rem;
  padding: 7px 13px; border-radius: 9px;
  transition: background .15s ease, color .15s ease;
}
.site-header nav a:hover { color: var(--blue-deep); background: var(--blue-wash); text-decoration: none; }
.site-header nav a[aria-current="page"] { color: #fff; background: var(--blue); }
.site-header .lang-pick { color: var(--muted); }

/* ── hero: light, bold headline, colourful underline accent ───────────────── */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.hero::before {  /* a slim four-colour ribbon along the top */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--red) 25% 50%, var(--amber) 50% 75%, var(--green) 75% 100%);
}
.hero .inner { max-width: var(--maxw); margin: 0 auto; padding: 70px 24px 76px; position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 800; letter-spacing: -1px;
  line-height: 1.06; color: var(--ink); margin-bottom: 18px; max-width: 20ch;
}
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); max-width: 62ch; }
.hero .cta-row { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  font-weight: 700; font-size: .98rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.28); }
.btn-primary:hover { background: var(--blue-deep); color: #fff; transform: translateY(-2px); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--blue-deep); border-color: var(--border); }
.btn-ghost:hover { background: var(--blue-wash); color: var(--blue-deep); transform: translateY(-2px); text-decoration: none; }

/* live ticker in the hero — a clean white card */
.ticker {
  margin-top: 30px; display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 12px; padding: 12px 18px; max-width: 72ch;
  text-decoration: none; color: var(--text); transition: box-shadow .15s ease;
}
.ticker:hover { box-shadow: var(--shadow-lift); color: var(--text); text-decoration: none; }
.ticker-tag {
  flex: none; font-size: .68rem; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: #fff; background: var(--blue); padding: 4px 10px; border-radius: 999px;
}
.ticker-text { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.ticker-text strong { font-weight: 700; }
.ticker.fade .ticker-text { animation: tickerin .5s ease; }
@keyframes tickerin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.updated { margin-top: 14px; font-size: .82rem; color: var(--muted); }

/* ── layout ───────────────────────────────────────────────────────────────── */
main { max-width: var(--maxw); margin: 0 auto; padding: 52px 24px 72px; }
main.narrow { max-width: 760px; }
section { margin-bottom: 14px; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); color: var(--ink); letter-spacing: -.5px; margin-bottom: 14px; }
h2 { font-size: 1.5rem; color: var(--ink); margin: 38px 0 14px; letter-spacing: -.3px; }
h3 { font-size: 1.14rem; color: var(--ink); margin: 20px 0 8px; }
p { margin-bottom: 13px; }
.strapline { font-size: 1.2rem; color: var(--muted); margin-bottom: 30px; max-width: 65ch; }

/* eyebrow / section kicker — coloured, with its own spacing (no stuck bars) */
.kicker {
  text-transform: uppercase; letter-spacing: 1.8px; font-size: .74rem; font-weight: 800;
  color: var(--blue-deep); margin-bottom: 6px;
}

/* ── cards — white, with a rotating colour accent for life ────────────────── */
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin: 28px 0; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  position: relative; overflow: hidden;
}
.card::before {  /* top accent strip — colour rotates per card below */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--blue);
}
.card:nth-of-type(4n+2)::before { background: var(--red); }
.card:nth-of-type(4n+3)::before { background: var(--amber); }
.card:nth-of-type(4n+4)::before { background: var(--green); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: #d4dcea; }
.card h3 { margin-top: 6px; }
.card .more { font-weight: 700; font-size: .92rem; color: var(--blue-deep); display: inline-block; margin-top: 6px; }
.card .more::after { content: " →"; }

ul.plain { list-style: none; padding-left: 0; }
ul.plain li { position: relative; padding-left: 20px; margin-bottom: 8px; }
ul.plain li::before { content: "•"; position: absolute; left: 4px; top: 0; color: var(--blue); font-weight: 700; }

/* subtle auth link in the header (Sign in / Admin), injected by site-i18n.js */
.site-header nav a.nav-auth { color: var(--blue-deep); border: 1px solid var(--border); }
.site-header nav a.nav-auth:hover { background: var(--blue-wash); }

/* secondary nav strip for the gated admin tools */
.subnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav .inner { max-width: var(--maxw); margin: 0 auto; padding: 9px 24px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.subnav .label { font-size: .72rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.subnav a { color: var(--text); font-weight: 600; font-size: .9rem; padding: 5px 12px; border-radius: 8px; }
.subnav a:hover { background: var(--blue-wash); color: var(--blue-deep); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--blue); color: #fff; }

/* ── article / blog post ──────────────────────────────────────────────────── */
article { background: var(--card); }
article img { max-width: 100%; height: auto; border-radius: 10px; margin: 16px 0; box-shadow: var(--shadow); }
.post-hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: 14px; margin: 6px 0 22px; box-shadow: var(--shadow); }
pre {
  background: #0f172a; color: #e6edf3; padding: 16px 18px; border-radius: 10px;
  overflow-x: auto; font-size: .88rem; margin: 16px 0; border: 1px solid #1e293b;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
p code, li code { background: var(--blue-wash); color: var(--blue-deep); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
blockquote { border-left: 4px solid var(--blue); padding-left: 16px; margin: 16px 0; color: var(--muted); font-style: italic; }

.origin, .stamp, .source { color: var(--muted); font-size: .85rem; }
.stamp { display: inline-block; background: var(--surface); color: var(--blue-deep); padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: .78rem; border: 1px solid var(--border); }
.attribution { color: var(--muted); font-size: .85rem; font-style: italic; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── blog index: visual gallery with feature images ──────────────────────── */
.year-band { display: flex; align-items: center; gap: 14px; margin: 40px 0 18px; }
.year-band .yr { font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.year-band .rule { flex: 1; height: 2px; background: linear-gradient(90deg, var(--blue), transparent); border-radius: 2px; }
.year-band .count { font-size: .8rem; color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.post-card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease; color: inherit;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); color: inherit; text-decoration: none; }
.post-card .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); display: block; }
.post-card .thumb-fallback {
  width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%); color: #fff;
}
.post-card .thumb-fallback img { height: 54px; width: auto; opacity: .92; margin: 0; box-shadow: none; }
.post-card .body { padding: 16px 20px 20px; }
.post-card .date { font-size: .74rem; font-weight: 700; letter-spacing: .5px; color: var(--blue-deep); text-transform: uppercase; }
.post-card .title { font-size: 1.08rem; font-weight: 700; color: var(--ink); margin-top: 6px; line-height: 1.32; }

/* ── research: ranked items + charts ──────────────────────────────────────── */
.rank-item {
  background: var(--card); border: 1px solid var(--border); border-left: 5px solid var(--blue);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.rank-item.kev { border-left-color: var(--red); }
.rank-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rank-num { font-weight: 800; color: var(--blue-deep); font-size: 1.1rem; }
.rank-cve { font-family: ui-monospace, monospace; font-weight: 700; color: var(--ink); }
.badge { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.badge-kev { background: #fdeede; color: #9a5a12; }
.badge-ransom { background: #fde2e2; color: #a12626; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin: 18px 0; }
.chart-card h3 { margin-top: 0; }
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 720px) { .chart-grid { grid-template-columns: 1fr; } }

/* AI desk + research article cards: keep imagery modest so text leads */
.card img, article .card img { max-height: 200px; width: 100%; object-fit: cover; }

/* toolbar: language picker + podcast player */
.toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 6px 0 22px; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.lang-pick select {
  font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink); cursor: pointer;
}
#podcast-slot { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pod-label { font-weight: 700; color: var(--blue-deep); font-size: .9rem; }
#podcast-slot audio { height: 36px; vertical-align: middle; }

/* ── footer — clean light band ────────────────────────────────────────────── */
.site-footer { background: var(--surface); color: var(--muted); margin-top: 64px; border-top: 1px solid var(--border); }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .88rem; }
.site-footer img { height: 40px; width: auto; }
.site-footer a { color: var(--text); font-weight: 600; }
.site-footer a:hover { color: var(--blue-deep); }
.site-footer .family { margin-left: auto; }

@media print {
  .site-header, .site-footer, .hero .cta-row { display: none; }
  body { color: #000; background: #fff; }
  .card, .rank-item, .post-card { box-shadow: none; border: 1px solid #ccc; }
  a { color: #000; }
}
