:root {
  color: #202124;
  background: #f5f7f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #ffffff 0, #f5f7f8 360px),
    #f5f7f8;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.page-header {
  max-width: 820px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  color: #16181a;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  color: #16181a;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.intro {
  margin-bottom: 20px;
  color: #51575d;
  font-size: 1.02rem;
}

.demo-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.demo-nav a {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #c7d0d8;
  border-radius: 6px;
  color: #202124;
  background: #ffffff;
  font-weight: 650;
  text-decoration: none;
}

.demo-nav a:hover,
.demo-nav a:focus-visible,
.demo-nav a[aria-current="page"] {
  border-color: #0f766e;
  color: #0f766e;
}

.guide-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.guide-summary p {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
}

.guide-summary strong {
  color: #16181a;
  font-size: 0.95rem;
}

.guide-summary span {
  color: #596168;
  font-size: 0.86rem;
}

.guide-list {
  display: grid;
  gap: 20px;
}

.guide-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(27, 43, 52, 0.08);
}

.guide-visual {
  min-width: 0;
}

.guide-copy {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(150px, 1fr);
  gap: 8px;
  min-width: 0;
}

.guide-copy p {
  margin-bottom: 0;
  color: #596168;
}

.step-label {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-quality {
  min-height: 24px;
  padding: 7px 9px;
  border: 1px solid #d7e2e0;
  border-radius: 6px;
  background: #f7fbfa;
  color: #334155;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 28 / 17;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  background:
    linear-gradient(#edf1f4 1px, transparent 1px),
    linear-gradient(90deg, #edf1f4 1px, transparent 1px),
    #fbfcfd;
  background-size: 28px 28px;
}

.preview-page {
  overflow: hidden;
  background: #fbfcfd;
}

.preview-stage {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #fbfcfd;
}

.preview-stage canvas {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #fbfcfd;
}

pre {
  overflow: auto;
  min-height: 150px;
  margin: 0;
  padding: 14px;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  background: #101820;
  color: #dbe7ee;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre;
}

.stress-summary {
  margin: -8px 0 22px;
  color: #596168;
  font-weight: 650;
}

.stress-groups {
  display: grid;
  gap: 30px;
}

.stress-group {
  display: grid;
  gap: 12px;
}

.stress-group-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #d9e0e5;
}

.stress-group-header h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.stress-group-header p {
  max-width: 620px;
  margin-bottom: 0;
  color: #596168;
  font-size: 0.86rem;
}

.stress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 16px;
}

.stress-card {
  display: grid;
  grid-template-rows: auto minmax(96px, auto);
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(27, 43, 52, 0.07);
}

.stress-card[data-status="warn"] {
  border-color: #eab308;
}

.stress-card[data-status="fail"] {
  border-color: #e11d48;
}

.stress-card canvas {
  aspect-ratio: 16 / 11;
  height: 180px;
  min-width: 0;
  max-width: 100%;
}

.stress-card h2 {
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.stress-meta,
.stress-quality {
  margin-bottom: 0;
  color: #596168;
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stress-quality {
  margin-top: 6px;
  color: #334155;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

  .guide-summary,
  .guide-card {
    grid-template-columns: 1fr;
  }

  .guide-card {
    padding: 14px;
  }

  .guide-copy {
    grid-template-rows: auto;
  }

  pre {
    font-size: 0.76rem;
  }
}

@media (min-width: 641px) and (max-width: 960px) {
  .guide-card {
    grid-template-columns: 1fr;
  }
}
