/* ===== Tokens ===== */
:root {
  --primary: #0077b6;
  --primary-deep: #023e8a;
  --primary-light: #0096c7;
  --primary-soft: #e0f2fe;
  --orange: #0077b6;
  --orange-deep: #023e8a;
  --orange-soft: #e0f2fe;
  --black: #0b132b;
  --black-soft: #1c2541;
  --ink: #1f2937;
  --gray-line: #e2e8f0;
  --gray-bg: #f8fafc;
  --gray-mid: #64748b;
  --white: #ffffff;
}
/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 116px; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--orange); }
h1, h2, h3, h4, h5 { margin: 0 0 12px; line-height: 1.3; color: var(--black); font-weight: 700; }
h1 { font-size: clamp(2.2rem, 4.5vw + 0.6rem, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 2vw + 0.5rem, 1.8rem); font-weight: 500; color: var(--gray-mid); }
h3 { font-size: 1.7rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 1rem; letter-spacing: 0.04em; }
p { margin: 0 0 14px; }
ul, ol { margin: 0; padding: 0; }

/* ===== Top nav ===== */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--black-soft);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  letter-spacing: 0.02em;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 10px;
  background: var(--orange);
  vertical-align: middle;
  transform: rotate(45deg);
}
.brand:hover { color: var(--orange); }
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 6px 22px;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-block;
  padding: 6px 0;
  font-size: 0.95rem;
  color: #cccccc;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--white); }
.nav-links a.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}
.nav-links .has-subs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.subs {
  font-size: 0.85rem;
  color: #888888;
  letter-spacing: 0.05em;
}
.subs a {
  display: inline-block;
  padding: 0 4px;
  margin: 0 1px;
  color: #aaaaaa;
  font-size: 0.85rem;
  border-bottom: 1px solid transparent;
}
.subs a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%; height: 2px;
  margin: 5px 0;
  background: var(--white);
  transition: transform 0.25s, opacity 0.25s;
}

/* ===== Hero (Full-screen Cover) ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  background: radial-gradient(circle at 80% 20%, #1c2541 0%, #0b132b 70%);
  color: var(--white);
  overflow: hidden;
  box-sizing: border-box;
}
.hero::before {
  content: "";
  position: absolute;
  right: -100px; top: 40%;
  width: 550px; height: 550px;
  background: var(--primary);
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.3;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.hero h1 {
  color: #ffffff !important;
  font-size: clamp(2.6rem, 5.5vw + 0.8rem, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.hero h2 {
  color: #f1f5f9 !important;
  font-size: clamp(1.3rem, 2.2vw + 0.4rem, 1.9rem);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 24px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #38bdf8 !important; /* Vivid Sky Blue */
  margin: 0 0 18px;
  padding-left: 36px;
  position: relative;
  font-weight: 700;
}
.hero-eyebrow::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 24px; height: 3px;
  background: #38bdf8;
}
.hero-meta {
  font-size: 1.05rem;
  color: #cbd5e1 !important;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
  max-width: 800px;
  line-height: 1.85;
}
.hero-meta strong {
  color: #ffffff !important;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
  40% { transform: translateY(-8px) translateX(-50%); }
  60% { transform: translateY(-4px) translateX(-50%); }
}
/* ===== Container ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.page-top { padding-top: 120px; }

/* ===== Section ===== */
.section {
  padding: 72px 0;
}
.section-head {
  margin-bottom: 36px;
}
.section-head h3 {
  display: inline-block;
  position: relative;
  padding: 0 0 10px 18px;
  border-left: 5px solid var(--orange);
}
.section-head h3::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  background: var(--black);
  margin-top: 10px;
  margin-left: -18px;
}

/* ===== Badges / Tags ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
}
.badge-blue { background: var(--orange); color: var(--white); }
.badge-dark { background: var(--black); color: var(--white); }
.badge-soft { background: var(--orange-soft); color: var(--orange-deep); }
.badge-outline { border: 1px solid var(--gray-line); color: var(--gray-mid); }

/* ===== Cards ===== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 4px;
  padding: 24px 28px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  border-color: var(--orange);
  box-shadow: 0 8px 20px rgba(0, 119, 182, 0.08);
}
.card.mini { padding: 18px 20px; }
.card.highlight {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}
.card.highlight h4,
.card.highlight p { color: var(--white); }
.card h4 {
  position: relative;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.card h4::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 24px; height: 2px;
  background: var(--orange);
}
.card.highlight h4::after { background: var(--white); }

.card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}
.card-grid > .card { grid-column: 1; }
.card-grid > .card-row { grid-column: 2; }

.card-row {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.card-row.two { grid-template-columns: 1fr 1fr; }
.card-row.three { grid-template-columns: repeat(3, 1fr); }
.card-row.four { grid-template-columns: repeat(4, 1fr); }

/* ===== Stats Box ===== */
.stat-box {
  background: var(--gray-bg);
  border-top: 3px solid var(--orange);
  padding: 20px;
  text-align: center;
  border-radius: 4px;
}
.stat-num {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--black);
  font-family: "Courier New", monospace;
  line-height: 1.1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.88rem;
  color: var(--gray-mid);
  margin: 0;
}

/* ===== Code & Flow Block ===== */
.code-block {
  background: var(--black);
  color: #00ff66;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.9rem;
  padding: 18px 22px;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.6;
  margin: 16px 0;
  border-left: 4px solid var(--orange);
}
.code-block code {
  color: inherit;
  font-family: inherit;
}
code {
  background: var(--gray-bg);
  color: var(--orange-deep);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: monospace;
}

/* ===== Image / Diagram box ===== */
.image-box {
  margin: 16px 0;
  text-align: center;
}
.image-placeholder {
  background: var(--gray-bg);
  color: var(--gray-mid);
  border: 1px dashed #c4c4c4;
  border-radius: 4px;
  padding: 50px 20px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  position: relative;
}
.image-placeholder::before {
  content: "";
  position: absolute;
  top: 12px; left: 12px;
  width: 24px; height: 24px;
  border-top: 3px solid var(--orange);
  border-left: 3px solid var(--orange);
}
.image-placeholder::after {
  content: "";
  position: absolute;
  bottom: 12px; right: 12px;
  width: 24px; height: 24px;
  border-bottom: 3px solid var(--orange);
  border-right: 3px solid var(--orange);
}
.image-box figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--gray-mid);
}

/* ===== Index list (landing — staircase layout) ===== */
.index-list {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 30px 0;
}
.index-box {
  display: flex;
  align-items: center;
  gap: 40px;
}
.index-box:nth-child(even) {
  margin-left: 18vw;
}
.index-blob {
  position: relative;
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  border-radius: 4px;
  overflow: hidden;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.index-blob::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, var(--orange) 50%);
  opacity: 0.18;
  transition: opacity 0.3s;
}
.index-blob::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 6px;
  background: var(--orange);
}
.index-blob:hover {
  background: var(--orange);
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 119, 182, 0.3);
}
.index-blob:hover::before { opacity: 0; }
.index-blob:hover::after { background: var(--black); }
.index-blob h4 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.45rem;
  color: var(--white);
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0 10px;
}
.index-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.index-text a {
  display: inline-block;
  padding: 6px 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, padding 0.2s;
}
.index-text a::before {
  content: "›";
  margin-right: 10px;
  color: var(--orange);
  font-weight: 700;
}
.index-text a:hover {
  color: var(--orange);
  padding-left: 4px;
}

/* ===== Custom numbered list (work page) ===== */
.custom-list {
  list-style: none;
  position: relative;
  padding-left: 56px;
  max-width: 820px;
  margin: 0 auto;
  counter-reset: custom-counter;
}
.custom-list::before {
  content: "";
  position: absolute;
  left: 18px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--gray-line);
}
.custom-list li {
  counter-increment: custom-counter;
  position: relative;
  margin-bottom: 22px;
  padding: 6px 0 6px 18px;
}
.custom-list li::before {
  content: counter(custom-counter, decimal-leading-zero);
  position: absolute;
  left: -56px; top: 4px;
  width: 38px; height: 38px;
  background: var(--black);
  color: var(--orange);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: "Courier New", monospace;
}

/* ===== Split section (title + body, alternating) ===== */
.section.split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: center;
  min-height: 50vh;
}
.section.split.reverse { grid-template-columns: 2fr 1fr; }
.split-title { display: flex; justify-content: center; }
.title-blob {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  border-radius: 4px;
  color: var(--white);
  overflow: hidden;
  text-align: center;
  padding: 16px;
}
.title-blob::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, var(--orange) 50%);
  opacity: 0.15;
}
.title-blob::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 6px;
  background: var(--orange);
}
.title-blob.alt { background: var(--orange); }
.title-blob.alt::before {
  background: linear-gradient(135deg, transparent 50%, var(--black) 50%);
  opacity: 0.18;
}
.title-blob.alt::after { background: var(--black); }
.title-blob h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: 0.05em;
}
.split-body p { margin-bottom: 16px; }

/* ===== Skill grid (learning page) ===== */
.skill-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.skill-card {
  position: relative;
  border-radius: 4px;
  padding: 26px 26px 26px 30px;
  border: 1px solid var(--gray-line);
  transition: transform 0.2s, box-shadow 0.2s;
}
.skill-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--orange);
}
.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.08);
}
.skill-card.tech {
  background: var(--black);
  border-color: var(--black);
  color: #e0e0e0;
}
.skill-card.tech h4 {
  color: var(--white);
  position: relative;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.skill-card.tech h4::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 24px; height: 2px;
  background: var(--orange);
}
.skill-card.soft {
  background: var(--white);
  color: var(--ink);
}
.skill-card.soft h4 {
  color: var(--black);
  position: relative;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.skill-card.soft h4::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 24px; height: 2px;
  background: var(--orange);
}

/* ===== Tables ===== */
.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
}
table.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}
table.custom-table th,
table.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-line);
}
table.custom-table th {
  background: var(--black);
  color: var(--white);
  font-weight: 600;
}
table.custom-table tr:hover td {
  background: var(--gray-bg);
}

/* ===== Pipeline diagram ===== */
.pipeline-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--gray-bg);
  padding: 24px;
  border-radius: 6px;
  border-left: 4px solid var(--orange);
  margin: 24px 0;
  flex-wrap: wrap;
}
.pipeline-step {
  flex: 1;
  min-width: 160px;
  background: var(--white);
  padding: 16px;
  border-radius: 4px;
  border: 1px solid var(--gray-line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.pipeline-step h5 {
  color: var(--orange);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.pipeline-arrow {
  color: var(--orange);
  font-weight: 700;
  font-size: 1.5rem;
}

/* ===== Scroll-to-top ===== */
.scroll-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 4px;
  background: var(--black);
  color: var(--orange);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
  z-index: 90;
}
.scroll-top.show { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--orange); color: var(--white); }

/* ===== Footer ===== */
.footer {
  margin-top: 72px;
  background: var(--black);
  padding: 48px 24px 32px;
  color: #cccccc;
  border-top: 4px solid var(--orange);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.footer h5 {
  color: var(--orange);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.footer p { margin: 0; color: #cccccc; }
.footer a { color: var(--white); text-decoration: underline; text-decoration-color: var(--orange); }
.footer a:hover { color: var(--orange); }
.footer-bottom {
  max-width: 1100px;
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid #2a2a2a;
  text-align: center;
}
.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: #888888;
  letter-spacing: 0.04em;
}

/* ===== Animations ===== */
.from-bottom { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
.from-bottom.show { opacity: 1; transform: translateY(0); }
.from-left { opacity: 0; transform: translateX(-60px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
.from-left.show { opacity: 1; transform: translateX(0); }
.from-right { opacity: 0; transform: translateX(60px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
.from-right.show { opacity: 1; transform: translateX(0); }
.from-center { opacity: 0; transition: opacity 1.2s ease-out; }
.from-center.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .from-bottom, .from-left, .from-right, .from-center {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-grid > .card,
  .card-grid > .card-row { grid-column: auto; }
  .card-row.three, .card-row.four { grid-template-columns: 1fr 1fr; }
  .section.split,
  .section.split.reverse { grid-template-columns: 1fr; gap: 28px; }
  .section.split.reverse .split-title { order: -1; }
  .index-box:nth-child(even) { margin-left: 8vw; }
  .index-blob { width: 160px; height: 160px; }
  .index-blob h4 { font-size: 1.25rem; }
  .pipeline-box { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); margin: 4px 0; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 12px;
    border-top: 1px solid var(--black-soft);
    margin-top: 10px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 12px 4px;
    border-bottom: 2px solid var(--black-soft);
  }
  .nav-links a.active { border-bottom-color: var(--orange); }
  .nav-links .has-subs { display: block; width: 100%; }
  .nav-links .subs { display: none; }

  .hero { padding: 100px 20px 40px; }
  .section { padding: 56px 0; }
  .card-row.two,
  .card-row.three,
  .card-row.four { grid-template-columns: 1fr; }
  .index-list { gap: 32px; }
  .index-box,
  .index-box:nth-child(even) {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    gap: 16px;
  }
  .index-blob {
    width: 100%;
    height: 90px;
  }
  .index-blob h4 { font-size: 1.2rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .custom-list { padding-left: 48px; }
  .custom-list li::before { left: -48px; width: 32px; height: 32px; }
}

/* ===== Shared page helpers ===== */
main { overflow-x: clip; }
.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 4px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.25); font-weight: 500; }
.btn-ghost:hover { background: rgba(255,255,255,0.2); color: #fff; }
.lead-card { border-left: 6px solid var(--primary-light); padding: 32px; }
.lead-card h4 { color: var(--primary-light) !important; }
.lead-card p { font-size: 1.1rem; line-height: 1.9; }
.lead-card code { background: rgba(255,255,255,0.12); color: #fff; }
.lead-flow {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-family: monospace;
  color: #94a3b8;
  font-size: 0.95rem;
}
.step-text { font-size: 0.9rem; margin: 0; }
.plain-list { padding-left: 22px; margin: 0 0 14px; }
.plain-list li { margin-bottom: 6px; }
.learn-card { margin-bottom: 20px; }
.card-row.two > .card, .card-row.three > .card { height: 100%; }
.card.highlight ul, .card.highlight li { color: var(--white); }

/* ===== Results page ===== */
.stat-box.stat-before { border-top-color: #ef4444; }
.stat-box.stat-after { border-top-color: #16a34a; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chart-head h4::after { display: none; }
.chart-scale { font-size: 0.82rem; color: var(--gray-mid); }
.bar-chart { display: grid; gap: 18px; }
.bar-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
}
.bar-label { line-height: 1.4; }
.bar-label strong { display: block; color: var(--black); }
.bar-label span { font-size: 0.82rem; color: var(--gray-mid); }
.bar-track {
  position: relative;
  height: 14px;
  margin-top: 4px;
  background: var(--gray-bg);
  border-radius: 2px;
  margin-bottom: 24px;
}
.bar {
  position: absolute;
  top: 0; bottom: 0;
}
.bar.ci { background: rgba(0, 119, 182, 0.28); border-radius: 2px; }
.bar.point {
  width: 12px; height: 12px;
  top: 1px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--primary-deep);
  border: 2px solid var(--white);
  box-sizing: border-box;
}
.bar-val {
  position: absolute;
  top: 18px; left: 0;
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
  color: var(--ink);
  white-space: nowrap;
}
.chart-note { font-size: 0.85rem; color: var(--gray-mid); margin: 8px 0 0; }
table.custom-table small { color: var(--gray-mid); }
table.custom-table tr.total-row td { font-weight: 700; background: var(--primary-soft); }
.pipeline-step.step-weak { border-left: 3px solid #f59e0b; }
.pipeline-step.step-weak h5 { color: #b45309; }
.pipeline-step.step-hit { border-left: 3px solid #ef4444; }
.pipeline-step.step-hit h5 { color: #dc2626; }
.card .badge { margin-bottom: 10px; }
.caveat {
  margin-top: 24px;
  padding: 18px 22px;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 4px;
}
.caveat ul { padding-left: 20px; margin-top: 8px; }
.caveat li { margin-bottom: 6px; }
@media (max-width: 720px) {
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar-val { white-space: normal; }
  .table-responsive table.custom-table { min-width: 620px; }
}

/* Keep the fixed nav to at most two rows: drop in-page sub-links on mid widths */
@media (max-width: 1199px) {
  .nav-links .subs { display: none; }
}

/* ===== Attribution page ===== */
.report-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 4px;
}
.report-link p { margin: 4px 0 0; color: var(--gray-mid); font-size: 0.92rem; }
.text-link { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.chart-legend { list-style: none; display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--gray-mid); }
.chart-legend li, .stack-legend li { display: flex; align-items: center; gap: 6px; }
.stack-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.85rem; margin: 12px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.pol, .bar-track.pol .bar.point { background: var(--primary-deep); }
.dot.nopol, .bar-track.nopol .bar.point { background: #d97706; }
.bar-track.pol .bar.ci { background: rgba(2, 62, 138, 0.22); }
.bar-track.nopol .bar.ci { background: rgba(217, 119, 6, 0.22); }
.bar-track.pol, .bar-track.nopol { margin-bottom: 30px; }

.chart-svg { width: 100%; height: auto; display: block; margin: 8px 0; font-family: inherit; }
.chart-svg .grid { stroke: var(--gray-line); stroke-width: 1; }
.chart-svg .mid { stroke: var(--gray-mid); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-svg .tick { font-size: 12px; fill: var(--gray-mid); }
.chart-svg .axis { font-size: 12px; fill: var(--ink); }
.chart-svg .band { fill: var(--primary-soft); }
.chart-svg .band-label { font-size: 12px; fill: var(--primary-deep); font-weight: 700; }
.chart-svg .line { fill: none; stroke-width: 2.5; }
.chart-svg path.ln-a0 { stroke: #dc2626; }
.chart-svg path.ln-a3 { stroke: var(--primary); }
.chart-svg circle.ln-a0 { fill: #dc2626; }
.chart-svg circle.ln-a3 { fill: var(--primary); }
.dot.ln-a0 { background: #dc2626; }
.dot.ln-a3 { background: var(--primary); }
.chart-svg .wf-total { fill: var(--black-soft); }
.chart-svg .wf-up { fill: #dc2626; }
.chart-svg .wf-down { fill: var(--primary); }
.chart-svg .wf-link { stroke: var(--gray-mid); stroke-dasharray: 3 3; }
.chart-svg .wf-val { font-size: 12px; font-weight: 700; fill: var(--ink); font-family: "Courier New", monospace; }

.share-chart { display: grid; gap: 10px; margin: 8px 0; }
.share-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.share-label { font-size: 0.88rem; font-weight: 700; }
.share-bar { display: flex; height: 22px; border-radius: 3px; overflow: hidden; }
.seg-asst { background: var(--black-soft); }
.seg-harness { background: var(--primary); }
.seg-turn2 { background: #7dd3fc; }
.seg-memory { background: #dc2626; }

.db-chart { display: grid; gap: 12px; margin: 8px 0; }
.db-row { display: grid; grid-template-columns: 260px 1fr 120px; gap: 14px; align-items: center; }
.db-label { font-size: 0.88rem; line-height: 1.4; }
.db-track {
  position: relative;
  height: 18px;
  background: linear-gradient(to right, transparent calc(50% - 0.5px), var(--gray-line) calc(50% - 0.5px), var(--gray-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)), var(--gray-bg);
  border-radius: 2px;
}
.db-line { position: absolute; top: 8px; height: 2px; background: var(--gray-mid); }
.db-base, .db-dot {
  position: absolute;
  top: 2px;
  width: 14px; height: 14px;
  margin-left: -7px;
  border-radius: 50%;
}
.db-base, .db-base-key { border: 2px solid var(--gray-mid); background: var(--white); }
.db-base-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.db-dot.case-a0, .dot.case-a0 { background: #dc2626; }
.db-dot.case-a3, .dot.case-a3 { background: var(--primary); }
.db-val { font-size: 0.85rem; font-family: "Courier New", monospace; }

@media (max-width: 720px) {
  .db-row { grid-template-columns: 1fr; gap: 4px; }
  .share-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ===== Print friendly ===== */
@media print {
  .topnav, .scroll-top, .nav-toggle { display: none !important; }
  .hero, .section { min-height: auto; padding: 24px 0; }
  .hero { background: var(--white); color: var(--black); border-bottom: 4px solid var(--orange); }
  .hero h1, .hero h2 { color: var(--black); }
  .hero-meta { color: var(--gray-mid); border-top-color: var(--gray-line); }
  body { background: var(--white); color: var(--black); }
  .from-bottom, .from-left, .from-right, .from-center { opacity: 1 !important; transform: none !important; }
  .footer { background: var(--white); color: var(--black); border-top: 4px solid var(--orange); }
  .footer p, .footer h5 { color: var(--black); }
}
