/* Sipeng Liu · portfolio v1
   Layout: one centred column. Running text stays near 65 characters wide;
   cards, figures and stats use a wider band. Mobile first: everything
   stacks, and wider screens add columns. System fonts only. */

:root {
  --bg: #f5f6f8;
  --bg-glass: rgb(245 246 248 / 0.82);
  --surface: #ffffff;
  --surface-2: #edf0f4;
  --fg: #14171c;
  --fg-2: #545c68;
  --fg-3: #8a929e;
  --line: #dde2e9;
  --accent: #0a66d6;
  --accent-soft: #e4eefb;
  --btn-bg: #0a66d6;
  --btn-ink: #ffffff;
  --good: #1b7a43;
  --warn: #985a00;
  --bad: #c23a30;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-2: 0 2px 4px rgb(16 24 40 / 0.04), 0 14px 34px rgb(16 24 40 / 0.09);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    "Microsoft YaHei", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --wrap: 1080px;
  --prose: 40rem;
  --gutter: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0f;
    --bg-glass: rgb(11 12 15 / 0.8);
    --surface: #15171c;
    --surface-2: #1d2027;
    --fg: #f2f4f7;
    --fg-2: #a3abb7;
    --fg-3: #6d7581;
    --line: #2a2f38;
    --accent: #4b9bff;
    --accent-soft: #132a47;
    --btn-bg: #1f6fde;
    --btn-ink: #ffffff;
    --good: #3fcb80;
    --warn: #f0a53c;
    --bad: #ff6f66;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 2px 4px rgb(0 0 0 / 0.35), 0 14px 34px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-glass: rgb(11 12 15 / 0.8);
  --surface: #15171c;
  --surface-2: #1d2027;
  --fg: #f2f4f7;
  --fg-2: #a3abb7;
  --fg-3: #6d7581;
  --line: #2a2f38;
  --accent: #4b9bff;
  --accent-soft: #132a47;
  --btn-bg: #1f6fde;
  --btn-ink: #ffffff;
  --good: #3fcb80;
  --warn: #f0a53c;
  --bad: #ff6f66;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 2px 4px rgb(0 0 0 / 0.35), 0 14px 34px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--bg);
}

:lang(zh) body,
body:lang(zh) {
  line-height: 1.8;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--fg);
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

a:hover {
  opacity: 0.78;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 54px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.6rem);
  font-size: 0.9375rem;
}

.nav a {
  color: var(--fg-2);
  white-space: nowrap;
}

.nav a:hover {
  color: var(--fg);
  opacity: 1;
}

.nav a[aria-current] {
  color: var(--fg);
  font-weight: 600;
}

.nav .lang {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.875rem;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(3rem, 10vw, 6.5rem) clamp(2.5rem, 7vw, 4.5rem);
}

.eyebrow {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.eyebrow-node {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.eyebrow-node::before {
  content: "";
  width: 6px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 -3px 0 -1px var(--bg), 0 -8px 0 -1px var(--accent);
  flex: none;
}

.hero h1 {
  margin: 0.75rem 0 1.25rem;
  max-width: 17ch;
  font-size: clamp(2.15rem, 6vw, 3.9rem);
  line-height: 1.07;
  font-weight: 700;
  letter-spacing: -0.028em;
}

:lang(zh) .hero h1,
.hero h1:lang(zh) {
  max-width: 12.5em;
  letter-spacing: -0.01em;
  line-height: 1.18;
}

.lede {
  margin: 0 0 1rem;
  max-width: 36rem;
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  line-height: 1.55;
  color: var(--fg-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
  box-shadow: var(--shadow-1);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--fg);
}

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .rise-2 {
    animation-delay: 0.06s;
  }

  .rise-3 {
    animation-delay: 0.12s;
  }

  @keyframes rise {
    from {
      transform: translateY(10px);
    }

    to {
      transform: none;
    }
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

.band {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.6vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  max-width: var(--prose);
  color: var(--fg-2);
}

/* ---------- Case cards (home) ---------- */

.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84%, 340px);
  gap: 16px;
  margin-inline: calc(-1 * var(--gutter));
  padding: 6px var(--gutter) 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.cards::-webkit-scrollbar {
  display: none;
}

@media (min-width: 880px) {
  .cards {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  color: var(--fg);
  scroll-snap-align: start;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.band .card {
  background: var(--bg);
}

.card:hover {
  opacity: 1;
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.card-art {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  color: var(--fg-3);
}

.card-art svg {
  width: 74%;
  height: auto;
}

/* Small illustrations: colours come from the theme tokens. */
.a-line {
  fill: none;
  stroke: var(--fg-3);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.a-node {
  fill: var(--surface);
  stroke: var(--fg-3);
  stroke-width: 1.5;
}

.a-core {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.a-fill {
  fill: var(--fg-3);
}

.a-accent {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.a-gap {
  fill: none;
  stroke: var(--fg-3);
  stroke-width: 1.3;
  stroke-dasharray: 3 4;
}

.a-dot {
  fill: var(--accent);
}

.a-whale {
  fill: currentColor;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem 1.3rem 1.35rem;
}

.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--fg-2);
}

.card-stat {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.card-more::after,
.arrow-after::after {
  content: "\2192";
  display: inline-block;
  transition: transform 0.25s ease;
}

.card:hover .card-more::after,
.next:hover .arrow-after::after {
  transform: translateX(4px);
}

/* ---------- How I work ---------- */

.points {
  display: grid;
  gap: 2rem;
}

@media (min-width: 760px) {
  .points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.25rem;
  }
}

.point h3 {
  margin: 0 0 0.4rem;
  font-size: 1.125rem;
}

.point p {
  margin: 0;
  color: var(--fg-2);
}

.glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.glyph svg {
  width: 22px;
  height: 22px;
}

/* ---------- About snapshot (home) ---------- */

.split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 820px) {
  .split {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }
}

.kv {
  display: grid;
  gap: 0;
  margin: 0;
}

.kv div {
  display: grid;
  gap: 0.15rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}

.kv div:last-child {
  border-bottom: 1px solid var(--line);
}

.kv dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.kv dd {
  margin: 0;
}

.pending {
  color: var(--fg-2);
  font-style: italic;
}

/* ---------- Case pages ---------- */

.case-hero {
  padding-block: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.5rem);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg-2);
}

.back::before {
  content: "\2190";
}

.back:hover {
  color: var(--fg);
  opacity: 1;
}

.case-hero h1 {
  margin: 0.6rem 0 1.1rem;
  max-width: 19ch;
  font-size: clamp(2rem, 5.2vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.024em;
}

:lang(zh) .case-hero h1,
.case-hero h1:lang(zh) {
  max-width: 14em;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 2rem 0 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.facts div {
  padding: 0.9rem 1rem 1rem;
  background: var(--surface);
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.facts dd {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

@media (min-width: 820px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.toc {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.2rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.toc::-webkit-scrollbar {
  display: none;
}

.toc a {
  flex: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 500;
}

.toc a:hover {
  opacity: 1;
  background: var(--accent-soft);
}

.note {
  display: flex;
  gap: 0.75rem;
  max-width: 44rem;
  margin-top: 1.5rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--fg-2);
  font-size: 0.95rem;
  line-height: 1.55;
}

.note svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  color: var(--fg-2);
}

.note p {
  margin: 0;
}

.case-section {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 64px);
}

.case-section h2 {
  margin: 0 0 1.15rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.016em;
}

.case-section h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.125rem;
}

.prose {
  max-width: var(--prose);
}

.prose p {
  margin: 0 0 1.1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.decisions {
  display: grid;
  max-width: 46rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.decisions li {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.95rem;
  border-top: 1px solid var(--line);
}

.decisions li:last-child {
  border-bottom: 1px solid var(--line);
}

.decisions time,
.decisions .when {
  padding-top: 0.12rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
}

@media (max-width: 520px) {
  .decisions li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
}

.pieces {
  display: grid;
  gap: 1.6rem 2.5rem;
  margin-top: 2rem;
}

@media (min-width: 760px) {
  .pieces {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.piece h3 {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
}

.piece p {
  margin: 0;
  color: var(--fg-2);
}

.list {
  display: grid;
  gap: 0.95rem;
  max-width: 44rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  position: relative;
  padding-left: 1.35rem;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.68em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--fg-3);
}

.list.took li::before {
  background: var(--accent);
}

.list b {
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 2.25rem;
}

@media (min-width: 880px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  min-width: 0;
  padding: 1rem 1.05rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--fg-2);
}

.next-wrap {
  display: grid;
  gap: 12px;
  padding-block: clamp(2rem, 5vw, 3rem) clamp(3rem, 7vw, 4.5rem);
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .next-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.next {
  display: grid;
  gap: 0.3rem;
  padding: 1.3rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--fg);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.next:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

.next small {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.next strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.3;
}

.next strong .arrow-after {
  margin-left: 0.35rem;
}

/* ---------- Figures and diagrams ---------- */

.figure {
  margin: 2rem 0;
  padding: clamp(1rem, 3.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.figure figcaption {
  max-width: 42rem;
  margin-top: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--fg-2);
}

.fig-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.ring {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin-inline: auto;
}

.d-node {
  fill: var(--surface-2);
  stroke: var(--line);
  stroke-width: 1;
}

.d-core {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.d-arc {
  fill: none;
  stroke: var(--fg-3);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.d-head {
  fill: var(--fg-3);
}

.d-text {
  fill: var(--fg);
  font: 600 14px var(--font);
}

.d-small {
  fill: var(--fg-2);
  font: 500 11.5px var(--font);
}

.d-num {
  fill: var(--fg-2);
  font: 600 11px var(--font);
}

.d-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.d-dot {
  fill: var(--accent);
}

.d-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.d-gap {
  stroke: var(--fg-3);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.85rem;
  font-weight: 500;
}

.chips-label {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--fg-2);
  text-align: center;
}

.chips.center {
  justify-content: center;
  margin-top: 0.6rem;
}

/* Flow: vertical on phones, horizontal on wide screens. */
.flow {
  display: grid;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow > li {
  position: relative;
  min-width: 0;
  padding: 0.85rem 1rem 0.95rem;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.flow > li > b {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}

.flow > li > span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--fg-2);
}

.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -24px;
  width: 1.6px;
  height: 18px;
  background: var(--fg-3);
  transform: translateX(-50%);
}

.flow > li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -25px;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--fg-3);
  border-bottom: 1.6px solid var(--fg-3);
  transform: translateX(-50%) rotate(45deg);
}

.flow .key {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.flow .sub {
  display: grid;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.flow .sub li {
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.82rem;
  line-height: 1.4;
}

.flow .sub li i {
  display: block;
  font-style: normal;
  color: var(--fg-2);
  font-size: 0.78rem;
}

@media (min-width: 880px) {
  .flow {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 30px;
  }

  .flow > li:not(:last-child)::after {
    left: auto;
    right: -24px;
    top: 50%;
    bottom: auto;
    width: 18px;
    height: 1.6px;
    transform: translateY(-50%);
  }

  .flow > li:not(:last-child)::before {
    left: auto;
    right: -25px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) rotate(-45deg);
  }
}

.guard {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1.25rem;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--fg-3);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  line-height: 1.5;
}

.guard svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 0.12rem;
  color: var(--fg-2);
}

.states {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .states {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.states li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 0.88rem;
  line-height: 1.3;
}

.dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg-3);
}

.dot.good {
  background: var(--good);
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--bad);
}

.chart {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin-inline: auto;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg);
}

/* Home dashboard mock-up (case 02). Placeholder content only. */
.mock {
  max-width: 560px;
  margin-inline: auto;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
}

.mock-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.mock-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg-3);
  opacity: 0.6;
}

.mock-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 14px 14px 6px;
}

.mock-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.mock-avatar svg {
  width: 26px;
  height: 26px;
}

.mock-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.8rem;
}

.mock-tabs b,
.mock-tabs span {
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

.mock-tabs b {
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-weight: 600;
}

.mock-tabs span {
  color: var(--fg-2);
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 14px 16px;
}

.mock-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.mock-card.wide {
  grid-column: 1 / -1;
}

.mock-card em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.ln {
  display: block;
  height: 7px;
  width: 100%;
  border-radius: 4px;
  background: var(--surface-2);
}

.ln.s {
  width: 62%;
}

.ln.xs {
  width: 40%;
}

.mock-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-row .ln {
  flex: 1;
}

.mock-row .tag {
  flex: none;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--fg-2);
}

.spark {
  width: 100%;
  height: 42px;
}

/* ---------- About page ---------- */

.timeline {
  display: grid;
  max-width: 44rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0 0 1.6rem 1.5rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.5rem;
  bottom: -0.35rem;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}

.timeline li:last-child::before {
  display: none;
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.timeline .when {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
  padding-top: 0.1rem;
}

.timeline p {
  margin: 0;
}

@media (max-width: 520px) {
  .timeline li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2rem 2.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--fg-2);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--fg-2);
}

.site-footer a:hover {
  color: var(--fg);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
