/* Lean 学习工作台 — visual system inspired by Open Design / Atelier Zero
   (https://github.com/nexu-io/open-design, design-systems/atelier-zero) */

:root {
  color-scheme: light;
  --paper: #efe7d2;
  --paper-warm: #ece4cf;
  --paper-dark: #ddd2b6;
  --bone: #f7f1de;
  --ink: #15140f;
  --ink-soft: #2a2620;
  --ink-mute: #5a5448;
  --ink-faint: #8b8676;
  --coral: #ed6f5c;
  --coral-soft: #f08e7c;
  --mustard: #e9b94a;
  --olive: #6e7448;
  --line: rgba(21, 20, 15, 0.16);
  --line-soft: rgba(21, 20, 15, 0.08);
  --line-faint: rgba(21, 20, 15, 0.05);
  --shadow: 0 30px 60px -30px rgba(21, 20, 15, 0.18);
  --shadow-sm: 0 14px 26px -16px rgba(21, 20, 15, 0.14);
  --sans: "Inter Tight", "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: "Noto Serif SC", "Playfair Display", Georgia, serif;
  --body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: min(1180px, calc(100vw - 2rem));
  --rail-width: 36px;
}

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

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

body {
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  background: var(--paper);
  overflow-x: clip;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(106, 92, 56, 0.07) 0, transparent 28%),
    radial-gradient(circle at 88% 72%, rgba(106, 92, 56, 0.06) 0, transparent 32%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: auto, auto, 240px 240px;
  mix-blend-mode: multiply;
  opacity: 0.88;
}

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

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

code,
pre {
  font-family: var(--mono);
}

.shell {
  position: relative;
  z-index: 2;
}

.container {
  width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* Side rails */
.side-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--rail-width);
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-rail.right {
  right: 0;
  border-left: 1px solid var(--line-faint);
}

.side-rail.left {
  left: 0;
  border-right: 1px solid var(--line-faint);
}

.side-rail .rail-text {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-faint);
  writing-mode: vertical-rl;
  white-space: nowrap;
}

.side-rail.right .rail-text {
  transform: rotate(180deg);
}

/* Topbar */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar {
  border-bottom: 1px solid var(--line-faint);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.55rem 0;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.topbar-inner b {
  color: var(--ink);
  font-weight: 600;
}

.topbar-inner a {
  color: var(--coral);
  font-weight: 600;
  transition: opacity 160ms ease;
}

.topbar-inner a:hover {
  opacity: 0.8;
}

.topbar-inner .accent {
  color: var(--coral);
}

.topbar .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}

.nav-links a {
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  color: var(--ink-mute);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 160ms ease, background 160ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
  background: rgba(21, 20, 15, 0.05);
}

/* Typography */
.label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--coral);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.label::before,
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--coral);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.12rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead,
.section-heading p,
.card p,
.proof-card p,
.lesson-card p {
  color: var(--ink-mute);
  line-height: 1.75;
}

.lead {
  max-width: 42rem;
  font-size: 1.05rem;
}

/* Buttons */
.hero-actions,
.card .actions,
.book-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  border-radius: 999px;
  padding: 0 1.2rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.button.primary,
.btn-primary {
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow-sm);
}

.button.primary:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--ink-soft);
}

.button.secondary,
.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: rgba(21, 20, 15, 0.2);
}

.button.secondary:hover,
.btn-ghost:hover {
  background: rgba(21, 20, 15, 0.04);
}

/* Hero */
.hero {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: start;
  gap: clamp(2rem, 4vw, 3.5rem);
}

.hero-copy .hero-title-frame {
  position: relative;
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 1.5rem 2rem;
  border: 1px solid var(--coral);
}

.hero-title-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--coral);
}

.hero-title-corner.tl {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
}

.hero-title-corner.tr {
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
}

.hero-title-corner.bl {
  bottom: 0;
  left: 0;
  transform: translate(-50%, 50%);
}

.hero-title-corner.br {
  bottom: 0;
  right: 0;
  transform: translate(50%, 50%);
}

.hero-copy h1 {
  margin-bottom: 0;
  font-family: var(--sans);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.25;
}

.hero-copy .tagline {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-mute);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 500;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
}

.stat-item strong {
  display: block;
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-item span {
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  background: var(--bone);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(21, 20, 15, 0.04);
}

.status-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-card dl {
  display: grid;
  gap: 0.55rem;
}

.status-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.35);
}

.status-card dt {
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-weight: 500;
}

.status-card dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
}

/* Workflow steps */
.workflow {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-bottom: 1px solid var(--line-soft);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.workflow-step {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem 1.1rem 1.35rem;
  background: var(--bone);
  box-shadow: inset 0 0 0 1px rgba(21, 20, 15, 0.04);
  transition: transform 200ms ease;
}

.workflow-step:hover {
  transform: translateY(-2px);
}

.workflow-step .step-num {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--coral);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.workflow-step h3 {
  margin-bottom: 0.45rem;
}

.workflow-step p {
  color: var(--ink-mute);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Sections */
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section + .section {
  border-top: 1px solid var(--line-faint);
}

.section-heading {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section-heading h2 {
  margin-bottom: 0.75rem;
}

.roman {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.cards {
  display: grid;
  gap: 1rem;
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.lesson-card,
.proof-card,
.resource-list a,
.deploy-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bone);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(21, 20, 15, 0.04);
}

.card {
  padding: 1.35rem 1.25rem 1.5rem;
  transition: transform 200ms ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card pre,
.proof-card pre,
.deploy-panel pre,
.lesson-card pre {
  margin: 1rem 0 0;
  overflow-x: auto;
  border: 1px solid rgba(21, 20, 15, 0.12);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: #e8e4dc;
  background: var(--ink);
}

.card pre code,
.proof-card pre code,
.deploy-panel pre code,
.lesson-card pre code {
  display: block;
  font-size: 0.84rem;
  line-height: 1.65;
}

p code,
li code {
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: var(--ink-soft);
  background: rgba(21, 20, 15, 0.06);
  font-size: 0.9em;
}

.section.split .split-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 3rem;
  align-items: start;
}

.sticky {
  position: sticky;
  top: 7rem;
}

.lesson-stack {
  display: grid;
  gap: 1rem;
}

.lesson-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1.15rem;
}

.lesson-card > div {
  min-width: 0;
}

.lesson-card.active {
  outline: 2px solid rgba(237, 111, 92, 0.35);
}

.lesson-number {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 10px;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 800;
}

.result {
  margin: 0.8rem 0 0;
  color: var(--olive);
  font-weight: 600;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.proof-card {
  padding: 1.15rem;
}

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

.proof-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--sans);
  font-weight: 700;
}

.copy {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: var(--ink-mute);
  background: rgba(255, 255, 255, 0.4);
  font: 600 0.78rem var(--sans);
  transition: background 160ms ease;
}

.copy:hover {
  background: rgba(21, 20, 15, 0.05);
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.resource-list a {
  display: grid;
  gap: 0.4rem;
  padding: 1.15rem 1.2rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.resource-list a:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 111, 92, 0.35);
}

.resource-list strong {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.resource-list span {
  color: var(--ink-mute);
  font-size: 0.9rem;
  line-height: 1.55;
}

.deploy-panel {
  border-radius: 18px;
  padding: 1.25rem;
}

.deploy-panel ol {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-mute);
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.footer a {
  color: var(--coral);
  font-family: var(--sans);
  font-weight: 600;
}

.footer p {
  margin: 0;
}

.footer-credit {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 1100px) {
  .side-rail {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .section.split .split-inner,
  .cards.three,
  .proof-grid,
  .resource-list,
  .workflow-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .sticky {
    position: static;
  }

  .proof-card.wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .status-card dl div {
    flex-direction: column;
  }

  .status-card dd {
    text-align: left;
  }

  .topbar-inner {
    font-size: 9.5px;
  }
}