/* ============================================================
   Kimi K3 @ michaelleung.info — shared stylesheet
   Brand palette sampled from michaelleung.info
   ============================================================ */
:root {
  --teal-900: #0d2836;
  --teal-800: #1a3a42;   /* header */
  --teal-700: #1d4049;   /* hero gradient top */
  --teal-600: #264f5a;   /* hero gradient bottom */
  --accent:   #7dc1d1;
  --accent-d: #5aa7b8;
  --ink:      #16303a;
  --muted:    #5b7078;
  --line:     #dce8ec;
  --bg-soft:  #f4f9fa;
  --white:    #ffffff;
  --radius:   14px;
  --maxw:     960px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header (matches michaelleung.info) ---------- */
.site-header {
  background: var(--teal-800);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 34px; width: auto; display: block; }
.brand .sub {
  color: var(--accent);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-left: 1px solid rgba(255,255,255,.25);
  padding-left: 12px;
  white-space: nowrap;
}
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: #eaf3f5;
  font-size: .95rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
  text-decoration: none;
}
.main-nav a:hover { background: rgba(125,193,209,.18); color: var(--accent); text-decoration: none; }
.main-nav a.active { background: rgba(125,193,209,.22); color: var(--accent); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(125,193,209,.16), transparent 60%),
    linear-gradient(180deg, var(--teal-700) 0%, var(--teal-600) 100%);
  color: var(--white);
  text-align: center;
  padding: 110px 24px 100px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(125,193,209,.35) 1px, transparent 1.6px);
  background-size: 90px 90px;
  opacity: .25;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .kicker {
  display: inline-block;
  border: 1px solid rgba(125,193,209,.55);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: .9rem;
  margin-bottom: 26px;
  background: rgba(13,40,54,.35);
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 18px;
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  font-size: 1.2rem;
  color: #cfe4e9;
  max-width: 760px;
  margin: 0 auto 30px;
  font-weight: 300;
}
.pill-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 38px; }
.pill {
  border: 1px solid rgba(125,193,209,.5);
  color: #dff1f5;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: .92rem;
  background: rgba(13,40,54,.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pill b { color: var(--accent); font-weight: 700; }
.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  text-decoration: none !important;
}
.btn-accent { background: var(--accent); color: #0d2836; }
.btn-accent:hover { background: #93d0dd; box-shadow: 0 8px 24px rgba(125,193,209,.35); transform: translateY(-2px); }
.btn-ghost { background: var(--white); color: var(--teal-700); border-color: var(--white); }
.btn-ghost:hover { background: #e9f4f6; transform: translateY(-2px); }
.btn-outline { border-color: rgba(255,255,255,.45); color: var(--white); background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.hero .based { margin-top: 46px; color: #9dc2cb; font-size: .9rem; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section.soft { background: var(--bg-soft); }
.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.section-sub { color: var(--muted); margin-bottom: 40px; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: 0 10px 30px rgba(26,58,66,.10); transform: translateY(-3px); border-color: var(--accent); }
.card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(125,193,209,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 16px;
}
.card h3 { font-size: 1.18rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .97rem; }
.card .stat { font-size: 2rem; font-weight: 800; color: var(--teal-700); line-height: 1.1; }
.card .stat small { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: 6px; letter-spacing: .02em; }

/* ---------- Article (news-style pages, like /latest-news/*) ---------- */
.article { padding: 56px 0 80px; }
.article .back { display: inline-block; margin-bottom: 28px; font-size: .95rem; }
.article h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 800;
  margin-bottom: 14px;
}
.article .byline { color: var(--muted); font-size: .95rem; margin-bottom: 34px; }
.article .byline time { color: var(--muted); }
.article .hero-img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 40px;
  display: block;
  width: 100%;
}
.article h2 {
  font-size: 1.55rem;
  margin: 48px 0 16px;
  letter-spacing: -.01em;
  scroll-margin-top: 90px;
}
.article h3 { font-size: 1.2rem; margin: 32px 0 12px; }
.article p { margin-bottom: 18px; color: #2a424b; }
.article ul, .article ol { margin: 0 0 20px 24px; color: #2a424b; }
.article li { margin-bottom: 8px; }
.article a { font-weight: 500; }
.lead { font-size: 1.15rem; color: var(--ink) !important; }
.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  margin: 26px 0;
  color: #2a424b;
}
.callout.warning { border-left-color: #e0a23c; background: #fdf6ea; }

/* ---------- Code blocks ---------- */
pre {
  background: var(--teal-900);
  color: #d9edf2;
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.65;
  margin: 18px 0 26px;
  border: 1px solid #12333f;
}
pre code { font-family: inherit; background: none; padding: 0; color: inherit; }
code {
  font-family: var(--mono);
  background: rgba(125,193,209,.16);
  color: #136068;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .88em;
}
.code-label {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: -8px;
  font-weight: 600;
}

/* ---------- Table of contents ---------- */
.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  background: var(--bg-soft);
  margin: 30px 0 40px;
}
.toc strong { display: block; margin-bottom: 10px; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-700); }
.toc ul { list-style: none; margin: 0; columns: 2; }
.toc li { margin-bottom: 6px; }
.toc a { color: #2a424b; font-size: .95rem; }
.toc a:hover { color: var(--accent-d); }

/* ---------- References ---------- */
.refs { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 34px; }
.refs h2 { font-size: 1.3rem; margin-bottom: 16px; }
.refs ol { margin-left: 22px; }
.refs li { margin-bottom: 10px; color: #2a424b; }
.refs .src { color: var(--muted); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-800);
  color: #b9d2d9;
  padding: 46px 24px 30px;
  font-size: .92rem;
}
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; }
.footer-inner img { height: 30px; opacity: .95; margin-bottom: 12px; }
.site-footer a { color: var(--accent); }
.footer-bottom { max-width: 1180px; margin: 28px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: #8fb0b9; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ---------- Misc ---------- */
.tag { display: inline-block; background: rgba(125,193,209,.18); color: #136068; border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 600; margin-right: 6px; }
.note { color: var(--muted); font-size: .88rem; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .toc ul { columns: 1; }
  .brand .sub { display: none; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero { padding: 80px 20px 70px; }
}
