/* Keen SME Tech Skill Library — Keen Venture Partners design system.
   Tokens are the single source of truth (see PRD sec 10). */

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #ffffff;
  --soft: #f9fafc;
  --dark: #000000;
  --hairline: #dddddd;
  --hairline-soft: #ececec;
  --ink: #000000;
  --body: #1a1a1a;
  --body-soft: #4a4a4a;
  --muted: #6a6a6a;
  --muted-soft: #9a9a9a;
  --on-dark: #ffffff;
  --on-dark-soft: #bdbdbd;
  --blue: #85c5d6;
  --blue-deep: #5fa6ba;
  --lavender: #9281ad;
  --terracotta: #945941;
  --blush: #ffdede;
  --warning: #e0a52e;
  --success: #2e9e6b;
  --error: #d6453f;
  --font: "Nunito", "Quicksand", "Varela Round", Arial, sans-serif;
  --rc: 2px;
  --pill: 360px;
  --sec: 96px;
  --wide: 1220px;
  --prose: 46rem;
}

* { box-sizing: border-box; }

/* slim, on-brand scrollbars */
* { scrollbar-width: thin; scrollbar-color: #c6ccda transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd3e0; border-radius: 999px; border: 3px solid var(--canvas); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #adb5c8; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { color: var(--ink); margin: 0; }
p { margin: 0; }
a { color: var(--ink); }
svg.logo { fill: currentColor; display: block; }
img, svg { max-width: 100%; }

/* .wide controls width + horizontal inset ONLY. Use padding-inline (longhand) so it
   never resets the vertical section rhythm on elements that are both section + wide. */
.wide { max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.prose { max-width: var(--prose); }

/* Type scale — heavy heads, light body (Nunito) */
.d-xl { font-weight: 700; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.05; letter-spacing: -0.02em; }
.d-lg { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -0.02em; }
.d-md { font-weight: 700; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.01em; }
.lead { font-weight: 300; font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.5; }
.eyebrow { font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.badge { display: inline-block; background: var(--blue); color: var(--on-dark); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; padding: 6px 14px; border-radius: var(--pill); }

/* Buttons — the only fully-rounded elements */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font); font-weight: 700; font-size: 0.95rem; line-height: 1;
  padding: 12px 22px; border-radius: var(--pill); text-decoration: none; cursor: pointer;
  background: var(--blue); color: var(--on-dark); border: 1.5px solid var(--blue);
  transition: background .15s, border-color .15s;
}
.btn:hover, .btn:focus-visible { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn--block { width: 100%; }

/* ---------- top nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 76px; border-bottom: 1px solid var(--hairline-soft); }
.nav .left { display: flex; align-items: center; gap: 0.85rem; color: var(--ink); text-decoration: none; }
.nav .logo { height: 40px; width: auto; }
.nav .kicker { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--hairline); padding-left: 0.85rem; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(3rem, 8vw, 5.5rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.hero h1 { margin: 1.3rem 0 0; max-width: 16ch; }
.hero .lead { margin: 1.5rem 0 0; max-width: 52ch; color: var(--body-soft); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--outline:hover, .btn--outline:focus-visible { background: transparent; color: var(--blue-deep); border-color: var(--blue-deep); }

hr.rule { height: 1px; background: var(--hairline); border: 0; max-width: var(--wide); margin: 0 auto; }

/* ---------- sections ---------- */
section { padding-top: var(--sec); }
.sec-head { margin-bottom: 1.8rem; }
.sec-head .eyebrow { display: block; margin-bottom: 0.6rem; }
.sec-head p { color: var(--body-soft); margin-top: 0.7rem; max-width: 54ch; }

/* ---------- SME Skill of the Month spotlight ---------- */
.spotlight { background: var(--soft); border: 1.5px solid var(--blue); border-radius: var(--rc); padding: clamp(1.6rem, 4vw, 2.8rem); display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 820px) { .spotlight { grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 1fr); gap: 2.8rem; } }
.spotlight-main { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.spotlight-cat { font-weight: 700; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.spotlight-main h2 { max-width: 20ch; }
.spotlight-main .lead { color: var(--body-soft); max-width: 52ch; }
.spotlight-main .cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.4rem; }
.spotlight-main .detail-legal { margin-top: 0.2rem; }
.spotlight-side .panel { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--rc); padding: 1.5rem; }
.spotlight-side .io { border-top: none; padding-top: 0; }
.spotlight-side .dl-count { margin-top: 1.1rem; }

/* ---------- controls ---------- */
.controls { position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--canvas) 74%, rgba(255,255,255,0)); padding: 1.3rem 0 1.1rem; display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font-family: var(--font); font-weight: 700; font-size: 0.82rem; cursor: pointer; padding: 8px 16px; border-radius: var(--pill); border: 1px solid var(--hairline); background: var(--canvas); color: var(--body); transition: color .15s, background .15s, border-color .15s; }
.chip:hover { color: var(--blue-deep); border-color: var(--blue-deep); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-dark); }
.chip:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 2px; }
.sort-wrap { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; }
.sort-label { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sort {
  font-family: var(--font); font-weight: 700; font-size: 0.85rem; color: var(--ink); cursor: pointer;
  background-color: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill);
  padding: 8px 34px 8px 15px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a6a6a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
.sort:hover { border-color: var(--blue-deep); }
.sort:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 2px; }
.count { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.dl-count { font-size: 0.76rem; color: var(--muted); font-weight: 700; }

/* ---------- card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }

.card {
  position: relative;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--rc);
  padding: 1.5rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.8rem;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
/* Flagship "Start here" treatment: soft surface + sky-blue frame. Calm, not black. */
.card.is-featured { background: var(--soft); border: 1.5px solid var(--blue); }
.card.is-featured:hover { border-color: var(--blue-deep); }
.card.hidden { display: none; }

.card .cat { align-self: flex-start; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 4px 11px; }
.card h3 { font-weight: 700; font-size: 1.3rem; line-height: 1.15; letter-spacing: -0.015em; }
.card .desc { font-weight: 300; font-size: 0.98rem; line-height: 1.5; color: var(--body-soft); }

.io { padding-top: 0.85rem; border-top: 1px dashed var(--hairline); display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; }
.io div { display: flex; gap: 0.6rem; }
.io .k { flex: none; width: 3rem; font-weight: 700; color: var(--blue-deep); }
.io .v { color: var(--body-soft); font-weight: 300; }

.legal { display: flex; align-items: baseline; gap: 0.4rem; font-weight: 700; font-size: 0.75rem; color: var(--terracotta); }
.legal::before { content: "\26A0"; font-weight: 400; }

/* Stretched-link: the title covers the whole card, so any click opens the detail
   page. The Download button sits above it and stays separately clickable. */
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-link:focus-visible::after { outline: 2px solid var(--blue-deep); outline-offset: 3px; border-radius: var(--rc); }
.card:hover .card-link { color: var(--blue-deep); }
.card .io, .card .legal, .card .cat, .card .dl-count { position: relative; z-index: 1; pointer-events: none; }
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.7rem; position: relative; z-index: 1; }
.card .btn { position: relative; z-index: 1; }

.empty { display: none; text-align: center; padding: 3rem 1rem; color: var(--muted); font-weight: 700; }
.empty.show { display: block; }

/* ---------- how-to ---------- */
.how { background: var(--soft); border-radius: var(--rc); padding: clamp(1.8rem, 4vw, 3rem); }
.how .lede { color: var(--body-soft); margin-top: 0.7rem; max-width: 60ch; }
.steps { list-style: none; padding: 0; margin: 1.8rem 0 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--rc); padding: 1.4rem; }
.steps .n { counter-increment: step; display: block; font-weight: 700; color: var(--blue-deep); font-size: 1.1rem; margin-bottom: 0.5rem; }
.steps .n::before { content: counter(step, decimal-leading-zero); }
.steps h3 { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.steps p { margin-top: 0.35rem; color: var(--body-soft); font-size: 0.98rem; }

/* ---------- how-to: two paths (A / B) ---------- */
.how-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.8rem; }
@media (max-width: 760px) { .how-paths { grid-template-columns: 1fr; } }
.path { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--rc); padding: 1.6rem; }
.path-tag { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: var(--pill); background: var(--blue); color: var(--on-dark); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.9rem; }
.path-title { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.path-sub { color: var(--muted); font-size: 0.85rem; font-weight: 700; margin-top: 0.2rem; }
.path-steps { margin: 1.1rem 0 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.6rem; color: var(--body-soft); font-size: 0.98rem; }
.path-steps li { padding-left: 0.2rem; }
.path-steps li::marker { color: var(--blue-deep); font-weight: 700; }
.path-steps strong { font-weight: 700; color: var(--ink); }

/* ---------- footer (light) ---------- */
footer.kf { margin-top: var(--sec); padding: 3.5rem 0 3rem; border-top: 1px solid var(--hairline); }
footer.kf .inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.6rem; }
footer.kf .logo { height: 44px; width: auto; color: var(--ink); }
footer.kf .fine { max-width: 34rem; font-size: 0.85rem; color: var(--muted); line-height: 1.55; }

/* ---------- copy button feedback ---------- */
.btn.copied, .btn.copied:hover { background: var(--success); border-color: var(--success); color: var(--on-dark); }

/* secondary "download the file" affordance (cards + spotlight) */
.alt-link { align-self: center; font-weight: 700; font-size: 0.78rem; color: var(--muted); text-decoration: none; position: relative; z-index: 1; }
.alt-link:hover { color: var(--blue-deep); }
.how-note { margin-top: 1.4rem; font-size: 0.92rem; color: var(--muted); max-width: 60ch; }
.panel .btn + .btn { margin-top: 0.6rem; }

/* ---------- the skill window (detail page) ---------- */
.skill-section { padding-top: 2.6rem; }
.skill-box-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }

/* Annotated skill: narrower skill column, expert notes aligned to their section. */
.skill-annotated { display: grid; grid-template-columns: 1fr; gap: 1.6rem; position: relative; }
@media (min-width: 900px) { .skill-annotated { grid-template-columns: minmax(0, 1fr) 13.5rem; gap: 2.75rem; align-items: stretch; } }
.skill-notes { display: flex; flex-direction: column; gap: 0.9rem; }
.notes-head { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.note { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--rc); padding: 0.85rem 1rem 0.9rem; }
.note-label { display: flex; align-items: baseline; gap: 0.4rem; font-weight: 700; font-size: 0.85rem; color: var(--blue-deep); margin-bottom: 0.35rem; }
.note-label::before { content: ""; width: 0.4rem; height: 0.4rem; flex: none; border-radius: 50%; background: var(--blue); transform: translateY(-1px); }
.note p { font-size: 0.88rem; line-height: 1.5; color: var(--body-soft); }
/* Wide screens: notes are permanently shown, each placed level with its section. */
.skill-notes.aligned { position: relative; display: block; }
.skill-notes.aligned .notes-head { position: sticky; top: 1.5rem; }
.skill-notes.aligned .note { position: absolute; left: 0; right: 0; }

.skill-anchor { border-bottom: 1px solid var(--blue); }

/* Connector line from the clicked line to its note box. */
.anno-link { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; opacity: 0; transition: opacity 0.18s ease; }
.anno-link.on { opacity: 1; }
.anno-path { stroke: var(--blue); stroke-width: 1.5; fill: none; }
.anno-dot { fill: var(--blue); }

.anno-hint { margin: 0 0 1rem; font-size: 0.82rem; color: var(--muted); }
@media (max-width: 899px) { .anno-hint { display: none; } }
.skill-box {
  margin: 0; font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.86rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  background: var(--soft); border: 1px solid var(--hairline); border-radius: var(--rc);
  padding: 1.5rem 1.6rem; color: var(--body);
}
.skill-hint { margin-top: 0.8rem; font-size: 0.88rem; color: var(--muted); }
.skill-hint a { color: var(--blue-deep); }

/* ---------- detail page ---------- */
.back { display: inline-block; margin-top: 2rem; font-weight: 700; font-size: 0.9rem; color: var(--blue-deep); text-decoration: none; }
.back:hover { color: var(--ink); }
/* Two-column top: content on the left, a sticky action rail on the right that
   sits beside the title from the start, so the top-right is never dead space. */
.detail-top { display: grid; grid-template-columns: 1fr; gap: 2.6rem; padding-top: 1.8rem; align-items: start; }
@media (min-width: 900px) { .detail-top { grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; } }

.detail-hero { max-width: 60ch; }
.detail-hero .cat { display: inline-block; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 4px 11px; }
.detail-hero h1 { margin-top: 1rem; }
.detail-hero .lead { margin-top: 1.1rem; color: var(--body-soft); }
.detail-legal { margin-top: 1.3rem; max-width: 60ch; font-size: 0.9rem; color: var(--terracotta); font-weight: 700; }

.detail-block { margin-top: 1.8rem; padding-top: 0; }
.detail-block h2 { margin-bottom: 0.6rem; }

.how-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.how-steps li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.2rem 1rem; padding: 0.65rem 0; border-top: 1px solid var(--hairline); }
.how-steps li:last-child { border-bottom: 1px solid var(--hairline); }
.how-steps .n { counter-increment: step; font-weight: 700; color: var(--blue-deep); }
.how-steps .n::before { content: counter(step, decimal-leading-zero); }
.how-steps p { color: var(--body-soft); }

.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.ticks li { position: relative; padding-left: 1.6rem; color: var(--body-soft); }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--blue-deep); font-weight: 700; }

.detail-rail .panel { background: var(--soft); border: 1px solid var(--hairline); border-radius: var(--rc); padding: 1.5rem; }
.detail-rail .skill-notes { margin-top: 1.5rem; }
.panel-h { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.panel .io { border-top: none; padding-top: 0; margin-bottom: 1.1rem; }
.rail-note { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--hairline); font-size: 0.85rem; line-height: 1.5; color: var(--body-soft); }
.rail-note strong { color: var(--ink); font-weight: 700; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card { transition: none; } .card:hover { transform: none; }
}
