/* ============================================================
   AI Base Knowledge for Software Engineers — shared styles
   Apple-inspired, desktop-only, animated.
   ============================================================ */

:root {
  --bg: #fbfbfd;
  --bg-2: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #e3e3e8;
  --blue: #0071e3;

  /* AI accent gradient palette */
  --g1: #5e5ce6; /* indigo */
  --g2: #8a5cf6; /* violet */
  --g3: #c44bf0; /* magenta */
  --g4: #ff7a59; /* warm */

  --grad: linear-gradient(120deg, var(--g1), var(--g2) 45%, var(--g3));
  --grad-soft: linear-gradient(120deg, rgba(94,92,230,.10), rgba(196,75,240,.10));

  --radius: 22px;
  --radius-lg: 32px;
  --shadow-1: 0 2px 10px rgba(0,0,0,.04);
  --shadow-2: 0 18px 50px rgba(40,30,90,.14);
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  min-width: 1080px; /* desktop only */
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- Sticky glass nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251,251,253,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 56px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav-brand .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 16px rgba(138,92,246,.6);
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.nav-links a {
  font-size: 13.5px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  transition: color .25s var(--ease), background .25s var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.nav-links a.active {
  color: #fff;
  background: var(--ink);
}

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
section { position: relative; }

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1, h2, h3 { letter-spacing: -.03em; line-height: 1.05; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 120px 0 90px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 720px;
  background:
    radial-gradient(60% 60% at 30% 20%, rgba(94,92,230,.22), transparent 60%),
    radial-gradient(55% 55% at 75% 10%, rgba(196,75,240,.20), transparent 60%),
    radial-gradient(50% 50% at 60% 50%, rgba(255,122,89,.12), transparent 60%);
  filter: blur(10px);
  z-index: 0;
  animation: float 14s ease-in-out infinite alternate;
}
@keyframes float {
  to { transform: translate3d(0, 26px, 0) scale(1.05); }
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: 72px;
  font-weight: 700;
  margin: 18px 0 22px;
}
.hero .lead {
  font-size: 22px;
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 36px;
  line-height: 1.4;
}
.hero-cta {
  display: inline-flex;
  gap: 14px;
  align-items: center;
}

/* page sub-hero (interior pages) */
.page-hero { padding: 96px 0 56px; text-align: center; overflow: hidden; }
.page-hero h1 { font-size: 60px; font-weight: 700; margin: 16px 0 18px; }
.page-hero .lead { font-size: 20px; color: var(--muted); max-width: 700px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.22); }
.btn-ghost { color: var(--blue); }
.btn-ghost:hover { transform: translateX(3px); }
.btn-grad {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 26px rgba(138,92,246,.35);
}
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(138,92,246,.5); }

/* ---------- Section header ---------- */
.section { padding: 80px 0; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: 46px; font-weight: 700; margin: 14px 0 16px; }
.section-head p { font-size: 19px; color: var(--muted); line-height: 1.45; }

.alt-bg { background: var(--bg-2); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-1);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  position: relative;
  overflow: hidden;
}
.card::after {
  /* gradient sheen revealed on hover */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2);
  border-color: transparent;
}
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card .icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--grad-soft);
  margin-bottom: 18px;
  transition: transform .4s var(--ease);
}
.card:hover .icon { transform: scale(1.12) rotate(-4deg); }
.card h3 { font-size: 21px; font-weight: 650; margin-bottom: 9px; }
.card p { font-size: 15.5px; color: var(--muted); line-height: 1.5; }
.card .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--g2);
  background: rgba(138,92,246,.10);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* feature row (icon + text) */
.feature {
  display: flex;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.feature:hover { background: var(--surface); transform: translateX(6px); box-shadow: var(--shadow-1); }
.feature .fi { font-size: 28px; flex: none; }
.feature h4 { font-size: 18px; margin-bottom: 5px; }
.feature p { color: var(--muted); font-size: 15px; }

/* ---------- Stat tiles ---------- */
.stat {
  text-align: center;
  padding: 34px 18px;
}
.stat .num {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -.04em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .label { font-size: 15px; color: var(--muted); margin-top: 6px; }

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--faint);
  padding: 16px 22px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 16px 22px; font-size: 15.5px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .25s var(--ease); }
tbody tr:hover { background: var(--grad-soft); }
td .pill {
  font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 7px;
  background: rgba(0,113,227,.10); color: var(--blue);
}
td strong { font-weight: 650; }

/* ---------- Bar chart (CSS only) ---------- */
.chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: var(--shadow-1);
}
.chart h4 { font-size: 18px; margin-bottom: 4px; }
.chart .cap { font-size: 13.5px; color: var(--faint); margin-bottom: 26px; }
.bar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.bar-label { width: 140px; flex: none; font-size: 14.5px; font-weight: 550; }
.bar-track { flex: 1; height: 26px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  width: 0;
  transition: width 1.1s var(--ease);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 12px;
  color: #fff; font-size: 12.5px; font-weight: 600;
}
.bar-fill.alt { background: linear-gradient(120deg,#0071e3,#5e5ce6); }
.bar-fill.warm { background: linear-gradient(120deg,#ff7a59,#c44bf0); }

/* ---------- Pipeline / loop steps ---------- */
.flow { display: flex; align-items: stretch; gap: 0; }
.flow .step {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.flow .step:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: transparent; }
.flow .step .n {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center; margin: 0 auto 14px;
}
.flow .step h4 { font-size: 16.5px; margin-bottom: 6px; }
.flow .step p { font-size: 13.5px; color: var(--muted); }
.flow .arrow { flex: none; align-self: center; color: var(--faint); font-size: 22px; padding: 0 10px; }

/* ---------- Callout ---------- */
.callout {
  border-radius: var(--radius);
  padding: 40px 44px;
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.callout::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 120% at 80% 0%, rgba(138,92,246,.5), transparent 60%);
}
.callout > * { position: relative; z-index: 1; }
.callout .q { font-size: 26px; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.callout .by { margin-top: 16px; color: #b9b9c4; font-size: 15px; }

/* ---------- Pills row ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pills .chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 550;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.pills .chip:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: var(--shadow-2);
  border-color: transparent;
  color: var(--g2);
}

/* ---------- Big page links (hub) ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.hub-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 34px 30px;
  box-shadow: var(--shadow-1);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  position: relative; overflow: hidden;
}
.hub-card::after {
  content: ""; position: absolute; inset: 0; background: var(--grad-soft);
  opacity: 0; transition: opacity .4s var(--ease);
}
.hub-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-2); border-color: transparent; }
.hub-card:hover::after { opacity: 1; }
.hub-card > * { position: relative; z-index: 1; }
.hub-card .area-no {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--faint);
}
.hub-card h3 { font-size: 27px; font-weight: 680; margin: 8px 0 12px; }
.hub-card p { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.hub-card .go { font-size: 15px; font-weight: 600; color: var(--blue); display: inline-flex; gap: 7px; transition: gap .3s var(--ease); }
.hub-card:hover .go { gap: 14px; }
.hub-card .emoji { font-size: 34px; margin-bottom: 14px; display: block; }

/* ---------- Inline tag list ---------- */
.kv { display: grid; grid-template-columns: 1fr; gap: 14px; }
.kv-item {
  display: flex; gap: 14px; align-items: baseline;
  padding: 16px 20px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.kv-item:hover { transform: translateX(6px); box-shadow: var(--shadow-1); }
.kv-item .k { font-weight: 650; min-width: 180px; flex: none; }
.kv-item .v { color: var(--muted); font-size: 15.5px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 50px 0 60px;
  color: var(--faint);
  font-size: 13.5px;
}
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.footer .fnav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer .fnav a:hover { color: var(--ink); }
.footer .disc { max-width: 560px; line-height: 1.5; }

/* ---------- Page-edge prev/next ---------- */
.pager { display: flex; justify-content: space-between; gap: 20px; padding: 30px 0 10px; }
.pager a {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 22px 26px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.pager a:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: transparent; }
.pager .dir { font-size: 13px; color: var(--faint); }
.pager .ttl { font-size: 18px; font-weight: 600; margin-top: 4px; }
.pager a.next { text-align: right; }

/* ---------- Scroll-reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* utility */
.mt-s { margin-top: 18px; }
.mt-m { margin-top: 34px; }
.mt-l { margin-top: 56px; }
.center { text-align: center; }
.lead-note { font-size: 14px; color: var(--faint); }
