/* ============================================================
   Rick's OSS portal — shared stylesheet
   ============================================================ */

:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --border: #e5e9f0;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --radius: 16px;
  --maxw: 1120px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 55%, #4f46e5 100%);
  box-shadow: 0 8px 22px rgba(79, 70, 229, .38);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn.ghost:hover { background: var(--bg-soft); }

/* On dark/gradient heroes, ghost buttons go translucent white */
.hero .btn.ghost,
.promo-hero .btn.ghost {
  background: rgba(255, 255, 255, .10);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.hero .btn.ghost:hover,
.promo-hero .btn.ghost:hover { background: rgba(255, 255, 255, .18); }

/* ---------------- Badges ---------------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.badge b { color: var(--text); font-weight: 600; }

.hero .badge,
.promo-hero .badge {
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.hero .badge b,
.promo-hero .badge b { color: #fff; }

/* ---------------- Portal hero (dark) ---------------- */
.hero {
  position: relative;
  text-align: center;
  padding: 104px 20px 92px;
  color: #f8fafc;
  overflow: hidden;
  background:
    radial-gradient(1000px 460px at 50% -90px, rgba(129, 140, 248, .55), transparent 62%),
    linear-gradient(165deg, #0b1020 0%, #12132e 50%, #1c1b4b 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 72%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.avatar {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, .30), 0 22px 44px rgba(0, 0, 0, .42);
  background: #1e293b;
}
.hero h1 { margin: 24px 0 0; font-size: 46px; color: #fff; }
.handle { margin: 6px 0 0; color: #94a3b8; font-size: 15px; }
.bio { margin: 8px 0 0; color: #cbd5e1; font-size: 15px; }
.links { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Portal projects ---------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px 88px; }
.section-head h2 { margin: 0 0 6px; font-size: 28px; }
.section-head p { margin: 0 0 30px; color: var(--muted); font-size: 15.5px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 26px;
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease;
}
.project:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); text-decoration: none; }

.project .cover {
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  color: #fff;
  background: linear-gradient(135deg, var(--c1, #4338ca), var(--c2, #6366f1));
  position: relative;
}
.project .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(160px 80px at 80% 20%, rgba(255, 255, 255, .35), transparent 70%);
  pointer-events: none;
}
.project .body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.project h3 { margin: 0 0 4px; font-size: 22px; }
.project .tag { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.project .desc { margin: 12px 0 20px; color: var(--muted); font-size: 15px; }
.project .go { margin-top: auto; font-weight: 600; font-size: 14.5px; color: var(--accent); }

/* ---------------- Promo hero (branded gradient) ---------------- */
.promo-hero {
  position: relative;
  text-align: center;
  padding: 92px 20px 76px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -70px, rgba(255, 255, 255, .20), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, .12) 0%, rgba(0, 0, 0, .30) 100%),
    var(--accent);
}
.promo-hero > * { position: relative; z-index: 1; }
.promo-hero .kicker {
  color: rgba(255, 255, 255, .8);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.promo-hero h1 { margin: 14px 0 0; font-size: 50px; color: #fff; }
.promo-hero .subtitle {
  margin: 18px auto 0;
  max-width: 760px;
  color: rgba(255, 255, 255, .9);
  font-size: 19px;
}
.promo-hero .subtitle strong { color: #fff; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.promo-hero .actions { margin-top: 30px; justify-content: center; }
.promo-hero .btn.primary { background: #fff; color: var(--accent); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.promo-hero .btn.primary:hover { background: #f1f5f9; }

/* Trust pills inside the promo hero */
.promo-hero .trust { margin: 30px 0 0; }
.trust { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.trust span {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

/* ---------------- Content blocks ---------------- */
.block { padding: 52px 0; border-top: 1px solid var(--border); }
.block:first-of-type { border-top: none; }
.block h2 { font-size: 28px; margin: 0 0 6px; }
.block .lead { color: var(--muted); margin: 0 0 26px; font-size: 15.5px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.feature h3 { margin: 0 0 8px; font-size: 16.5px; color: var(--text); }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------------- Architecture diagram ---------------- */
.arch {
  background: #0b1020;
  color: #c9d1d9;
  border-radius: var(--radius);
  padding: 28px 30px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.arch .row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.arch .arrow { color: #64748b; }
.arch .node {
  background: #161b2e;
  border: 1px solid #2b3352;
  border-radius: 8px;
  padding: 4px 12px;
  color: #e6edf3;
}
.arch .node.hl { border-color: #6366f1; color: #fff; background: #1e1b4b; }
.arch .note { color: #64748b; font-size: 12px; margin-top: 12px; }

/* ---------------- Code ---------------- */
pre.code {
  background: #0b1020;
  color: #e6edf3;
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  box-shadow: var(--shadow);
}
pre.code .c { color: #64748b; }
pre.code .k { color: #f472b6; }
pre.code .s { color: #a5d6ff; }

/* ---------------- Tables ---------------- */
table.cap {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 14px;
}
table.cap th, table.cap td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--border); }
table.cap th { background: var(--bg-soft); font-weight: 600; }
table.cap tr:last-child td { border-bottom: none; }
table.cap .yes { color: #15803d; font-weight: 700; }
table.cap .no { color: #dc2626; font-weight: 700; }

/* ---------------- FAQ ---------------- */
.faq { max-width: 780px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.faq details p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* ---------------- Platforms ---------------- */
.platforms { display: flex; flex-wrap: wrap; gap: 10px; }
.platforms span {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, .22);
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
}

/* ---------------- Callout ---------------- */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  color: var(--text);
  font-size: 14px;
  margin: 18px 0;
}
.callout strong { color: var(--text); }

/* ---------------- Footer ---------------- */
footer {
  text-align: center;
  padding: 32px 20px 48px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
footer a { color: var(--muted); }
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }

@media (max-width: 640px) {
  .hero { padding: 72px 18px 64px; }
  .hero h1 { font-size: 36px; }
  .promo-hero { padding: 68px 18px 56px; }
  .promo-hero h1 { font-size: 34px; }
  .promo-hero .subtitle { font-size: 16.5px; }
  .section { padding: 0 18px 64px; }
  .block { padding: 40px 0; }
}
