:root {
  --bg: #f4ebe5;
  --bg-soft: rgba(255, 249, 245, 0.74);
  --panel: rgba(255, 248, 242, 0.5);
  --panel-strong: rgba(255, 247, 241, 0.72);
  --line: rgba(154, 85, 51, 0.14);
  --line-strong: rgba(154, 85, 51, 0.28);
  --text: #2f241f;
  --muted: #715a4c;
  --accent: #d86f43;
  --accent-deep: #8e3d20;
  --accent-soft: rgba(216, 111, 67, 0.14);
  --warning: #9f3820;
  --shadow: 0 24px 70px rgba(125, 67, 41, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1360px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 20%, rgba(243, 155, 112, 0.32), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(241, 188, 168, 0.34), transparent 26%),
    radial-gradient(circle at 72% 66%, rgba(214, 118, 78, 0.18), transparent 26%),
    linear-gradient(180deg, #faf5f0 0%, #f7ede7 36%, #efe3db 100%);
  line-height: 1.72;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background:
    linear-gradient(90deg, transparent 0, transparent 8%, rgba(210, 145, 119, 0.16) 8.15%, transparent 8.3%, transparent 100%),
    linear-gradient(180deg, transparent 0, transparent 14%, rgba(210, 145, 119, 0.12) 14.15%, transparent 14.3%, transparent 100%);
  background-size: 220px 220px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 92%);
}

body::after {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.36), transparent 34%, rgba(255, 255, 255, 0.18) 72%, transparent 92%);
  z-index: -1;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(0, 0, 0, 0.5) 0.8px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.4) 0.8px, transparent 1px);
  background-size: 16px 16px;
  mix-blend-mode: multiply;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.glass-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 250, 246, 0.76), rgba(255, 244, 238, 0.46));
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topbar {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 20px auto 0;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(201, 40, 55, 0.18));
}

.eyebrow,
.section-kicker,
.toc-title,
.feature-index,
.metric-label,
.pill {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
}

.eyebrow,
.section-kicker,
.toc-title,
.metric-label {
  color: var(--muted);
}

.brand h1,
.hero h2,
.section-heading h2,
.footer h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
}

.brand h1 {
  font-size: clamp(1.5rem, 2.1vw, 2rem);
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.top-links a {
  color: var(--muted);
  font-weight: 600;
}

.layout {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 26px auto 48px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
}

.toc {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 22px;
}

.toc nav {
  display: grid;
  gap: 10px;
}

.toc a {
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  transition: 160ms ease;
}

.toc a.active,
.toc a:hover {
  background: rgba(216, 111, 67, 0.12);
  color: var(--accent-deep);
  text-decoration: none;
}

.content {
  display: grid;
  gap: 24px;
}

.hero {
  padding: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 26px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: calc(var(--radius-xl) - 10px);
  border: 1px solid rgba(216, 111, 67, 0.12);
  pointer-events: none;
}

.hero h2 {
  font-size: clamp(3rem, 5vw, 4.8rem);
  margin-top: 14px;
  margin-bottom: 18px;
}

.hero-text {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-actions {
  margin-top: 28px;
}

.button {
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff8f4;
  box-shadow: 0 16px 28px rgba(141, 60, 32, 0.22);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(216, 111, 67, 0.18);
  color: var(--accent-deep);
}

.tag-row {
  margin-top: 22px;
}

.tag-row span,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(216, 111, 67, 0.14);
  color: var(--accent-deep);
  font-weight: 700;
}

.hero-metrics {
  display: grid;
  gap: 16px;
}

.metric-card,
.feature-card,
.info-card,
.stack-card,
.resource-card,
.flow-card,
.tip-card,
.substep-card,
.note-card,
.faq-item,
.nested-panel,
.callout,
.mini-note {
  background: linear-gradient(180deg, rgba(255, 251, 248, 0.78), rgba(255, 243, 238, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.metric-card {
  padding: 22px;
}

.metric-value {
  margin: 10px 0 6px;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 800;
}

.metric-note,
.section-heading p,
.callout p,
.micro-copy,
.note-card p,
.faq-item p,
.feature-card p,
.resource-card p,
.flow-card p,
.stack-card p,
.info-card p {
  color: var(--muted);
}

.overview-grid,
.checklist-grid,
.stack-grid,
.resource-grid,
.tips-grid,
.notes-grid {
  display: grid;
  gap: 18px;
}

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

.feature-card {
  padding: 26px;
}

.feature-index {
  color: var(--accent);
  font-weight: 800;
  margin: 0 0 10px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(2.3rem, 4vw, 3.7rem);
  margin: 10px 0 12px;
}

.section-heading.compact h3 {
  margin: 8px 0 10px;
  font-size: 1.65rem;
}

section.glass-panel,
.step-section.glass-panel,
.footer.glass-panel {
  padding: 34px;
}

.checklist-grid,
.stack-grid,
.resource-grid,
.tips-grid,
.notes-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.stack-card,
.resource-card,
.tip-card,
.note-card {
  padding: 22px;
}

.callout {
  padding: 22px 24px;
  margin-top: 22px;
}

.callout-title {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--accent-deep);
}

.callout.tip {
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.86), rgba(255, 242, 236, 0.56));
}

.callout.warning,
.critical {
  border-color: rgba(159, 56, 32, 0.24);
}

.callout.warning {
  background: linear-gradient(180deg, rgba(255, 242, 239, 0.88), rgba(255, 232, 225, 0.6));
}

.critical {
  box-shadow:
    0 24px 70px rgba(125, 67, 41, 0.12),
    inset 0 0 0 1px rgba(159, 56, 32, 0.1);
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-index,
.substep-index {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(216, 111, 67, 0.9), rgba(142, 61, 32, 0.9));
  color: #fff9f6;
  font-weight: 800;
}

.info-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.mini-note {
  padding: 18px;
}

.code-block {
  position: relative;
  margin-top: 22px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(54, 35, 29, 0.94), rgba(42, 28, 23, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 36px rgba(33, 18, 13, 0.25);
}

.code-block::before {
  content: attr(data-env);
  position: absolute;
  top: 12px;
  left: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 240, 230, 0.82);
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.code-block pre {
  margin: 0;
  padding: 56px 18px 18px;
  overflow-x: auto;
}

.code-block code {
  color: #fbe7d9;
  white-space: pre;
  font-size: 0.95rem;
}

.code-block button {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff4ec;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  transition: 160ms ease;
}

.code-block button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.compact-block {
  margin-top: 10px;
}

.terminal-flow,
.faq-list {
  display: grid;
  gap: 18px;
}

.flow-card,
.faq-item,
.substep-card {
  padding: 22px;
}

.flow-card h3,
.substep-card h3,
.faq-item h3,
.info-card h3,
.stack-card h3,
.tip-card h3,
.note-card h3,
.resource-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.prompt-example {
  margin-top: 18px;
}

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

.substep-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.nested-panel {
  padding: 24px;
  margin-top: 24px;
}

.code-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.footer-note {
  max-width: 28ch;
  color: var(--muted);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 250, 246, 0.86), rgba(255, 242, 236, 0.58));
  color: var(--accent-deep);
  box-shadow:
    0 18px 34px rgba(125, 67, 41, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease, background 180ms ease;
  z-index: 20;
}

.back-to-top:hover {
  background: linear-gradient(180deg, rgba(255, 248, 243, 0.96), rgba(255, 238, 229, 0.72));
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top span {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    order: -1;
    overflow-x: auto;
  }

  .toc nav {
    display: flex;
    flex-wrap: nowrap;
  }

  .toc a {
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .overview-grid,
  .checklist-grid,
  .stack-grid,
  .resource-grid,
  .tips-grid,
  .notes-grid,
  .step-columns,
  .code-pair {
    grid-template-columns: 1fr 1fr;
  }

  .info-split {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .topbar,
  .layout {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .topbar {
    margin-top: 10px;
    padding: 16px;
    flex-direction: column;
    align-items: start;
  }

  .hero,
  section.glass-panel,
  .step-section.glass-panel,
  .footer.glass-panel {
    padding: 22px;
  }

  .overview-grid,
  .checklist-grid,
  .stack-grid,
  .resource-grid,
  .tips-grid,
  .notes-grid,
  .step-columns,
  .code-pair {
    grid-template-columns: 1fr;
  }

  .hero h2,
  .section-heading h2 {
    line-height: 0.96;
  }

  .code-block pre {
    padding-inline: 14px;
  }

  .code-block code {
    font-size: 0.88rem;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
}
