/* Utopiajoy — data science learning reference.
   Identity: light data notebook — graph-paper grid, tabular data, chart-colour accents. */

:root {
  --paper: #f7f9fc;
  --sheet: #ffffff;
  --ink: #1f2a44;
  --muted: #64748b;
  --line: #d8e0ee;
  --line-soft: #e8edf6;
  --indigo: #3b5bdb;
  --teal: #0ca678;
  --amber: #f08c00;
  --red: #e8590c;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 8px 24px rgba(31, 42, 68, .07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(59, 91, 219, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 91, 219, .045) 1px, transparent 1px);
  background-size: 26px 26px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }

/* ---- header ---- */
.site-head {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.brand-mark i { display: block; width: 5px; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 11px; background: var(--indigo); }
.brand-mark i:nth-child(2) { height: 18px; background: var(--teal); }
.brand-mark i:nth-child(3) { height: 22px; background: var(--amber); }
.brand-word { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); padding: 6px 12px; border-radius: 7px;
  font-size: 14.5px; font-weight: 600;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav a.is-on { background: var(--ink); color: #fff; }

/* ---- hero ---- */
.hero {
  margin: 40px 0 44px; padding: 34px 36px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--indigo) 0 20%, var(--teal) 20% 40%, var(--amber) 40% 60%, var(--red) 60% 80%, var(--indigo) 80% 100%);
}
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--indigo); margin: 0 0 12px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.02em; }
.hero-sub { color: #475569; font-size: 18px; max-width: 66ch; margin: 0; }

/* ---- chapters ---- */
.chapter { margin: 46px 0; }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.chapter-title { display: flex; align-items: baseline; gap: 12px; font-size: 24px; margin: 0 0 6px; letter-spacing: -.01em; }
.chapter-no {
  font-size: 13px; font-weight: 800; color: var(--indigo);
  background: rgba(59, 91, 219, .1); border: 1px solid rgba(59, 91, 219, .25);
  padding: 4px 8px; border-radius: 6px;
}
.chapter-link { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.chapter-blurb { color: var(--muted); max-width: 78ch; margin: 4px 0 18px; }
.chapter-blurb.big { font-size: 19px; color: #475569; }

/* ---- dataset table ---- */
.dataset {
  width: 100%; border-collapse: collapse; background: var(--sheet);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow);
}
.dataset thead th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  background: #eef2fa; padding: 11px 16px; border-bottom: 1px solid var(--line);
}
.dataset tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.dataset tbody tr:last-child td { border-bottom: 0; }
.dataset tbody tr:hover { background: #f4f7fd; }
.col-no { width: 54px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-name a { font-weight: 700; font-size: 16.5px; }
.col-level { width: 130px; }
.col-area { width: 130px; color: var(--muted); }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(12, 166, 120, .12); color: #087f5b; border: 1px solid rgba(12, 166, 120, .28);
}

/* ---- article ---- */
.article { max-width: 860px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 26px 0 12px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 8px; color: #c3cddf; }
.article h1 { font-size: clamp(27px, 4.4vw, 39px); line-height: 1.14; margin: 6px 0 20px; letter-spacing: -.02em; }
.zh { display: block; font-size: 15px; color: var(--muted); font-weight: 500; margin-top: 9px; letter-spacing: 0; }

.card-sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 36px; }
.sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 18px; background: #eef2fa; border-bottom: 1px solid var(--line);
}
.sheet-label { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--indigo); }
.sheet-row { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.schema { width: 100%; border-collapse: collapse; }
.schema th {
  text-align: left; width: 32%; font-weight: 600; color: var(--muted); font-size: 14px;
  padding: 11px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.schema td { padding: 11px 18px; border-bottom: 1px solid var(--line-soft); font-weight: 600; }
.schema tr:last-child th, .schema tr:last-child td { border-bottom: 0; }

.sections { counter-reset: none; }
.sec { margin: 30px 0; }
.sec h2 { display: flex; align-items: baseline; gap: 12px; font-size: 22px; margin: 0 0 12px; line-height: 1.28; letter-spacing: -.01em; }
.sec-no {
  font-size: 13px; font-weight: 800; color: #fff; background: var(--indigo);
  padding: 5px 8px; border-radius: 6px; flex: none; font-variant-numeric: tabular-nums;
}
.sec p { margin: 0 0 15px; color: #33415c; }
.sec p:last-child { margin-bottom: 0; }

.related-nav { margin: 44px 0 10px; padding-top: 24px; border-top: 2px solid var(--line); }
.related-nav h2 { font-size: 15px; letter-spacing: .02em; color: var(--muted); font-weight: 700; margin: 0 0 14px; }
.related { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 11px; }
.related li {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 15px;
  background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 8px;
}
.related a { font-weight: 700; }
.related-soon { color: var(--muted); font-weight: 600; }
.related-meta { font-size: 12px; color: var(--muted); }

/* ---- legal / 404 ---- */
.legal { max-width: 800px; }
.legal h1 { font-size: clamp(26px, 4vw, 36px); margin: 8px 0 20px; letter-spacing: -.02em; }
.legal-body { background: var(--sheet); border: 1px solid var(--line); border-radius: 13px; padding: 8px 30px 26px; box-shadow: var(--shadow); }
.legal-body h2 { font-size: 19px; margin: 28px 0 10px; color: var(--indigo); }
.legal-body p { margin: 0 0 14px; color: #33415c; }
.notfound { max-width: 640px; padding: 70px 22px; }
.notfound h1 { font-size: 31px; margin: 8px 0 12px; }
.back { margin: 34px 0; font-size: 14.5px; font-weight: 600; }

/* ---- footer ---- */
.site-foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 30px 0 50px; background: rgba(255, 255, 255, .55); }
.site-foot p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.foot-links { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14.5px; font-weight: 600; }
.foot-links span { color: #c3cddf; }
.foot-fine { font-size: 13px; color: #9aa7bd; margin-top: 14px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 26px 20px; }
  .col-level, .col-area { width: auto; }
  .schema th { width: 40%; padding: 10px 12px; }
  .schema td { padding: 10px 12px; }
  .legal-body { padding: 6px 18px 20px; }
}
