:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: #10151f;
  --panel-2: #161d28;
  --panel-3: #0b1018;
  --text: #f6f8fb;
  --muted: #c3cbd8;
  --muted-2: #97a3b5;
  --line: rgba(178, 193, 214, 0.2);
  --line-strong: rgba(216, 226, 240, 0.34);
  --gold: #f5b24b;
  --green: #3ddc97;
  --blue: #8fb3ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(12, 16, 23, 0.98), rgba(5, 7, 13, 1) 42%),
    #05070d;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0;
}

body,
button,
input,
textarea {
  letter-spacing: 0;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.mst-page-nav {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 14, 21, 0.86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 12px;
  z-index: 20;
}

.mst-page-brand,
.mst-page-links a {
  text-decoration: none;
  font-weight: 800;
}

.mst-page-brand {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
}

.mst-page-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mst-page-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(178, 193, 214, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.mst-page-links a:hover,
.mst-page-links a[aria-current="page"] {
  color: var(--text);
  border-color: var(--line-strong);
}

.page-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
}

.hero {
  min-height: min(640px, 72vh);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-color: #080b12;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.96), rgba(3, 5, 10, 0.68) 44%, rgba(3, 5, 10, 0.22)),
    linear-gradient(180deg, rgba(3, 5, 10, 0.08), rgba(3, 5, 10, 0.86));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: clamp(26px, 5vw, 58px);
}

.eyebrow,
.section-kicker,
.meta-chip {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #d9e4f5;
}

.eyebrow {
  margin: 0 0 12px;
}

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

h1 {
  margin-bottom: 14px;
  font-size: 3.8rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 2.25rem;
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.06rem;
  line-height: 1.25;
}

.hero p,
.section-head p,
.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.actions,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn,
.text-link,
.mini-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-weight: 900;
}

.btn {
  padding: 0 18px;
}

.btn.primary {
  background: linear-gradient(180deg, #f7c873, #e09a32);
  color: #110b04;
  border-color: rgba(255, 219, 148, 0.74);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn.green {
  background: linear-gradient(180deg, #72edb9, #28b97a);
  color: #04140d;
  border-color: rgba(128, 247, 193, 0.62);
}

.section {
  padding: 50px 0 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.48fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head p {
  margin-bottom: 0;
}

.prompt-formula,
.layout-steps,
.notes-grid,
.example-grid,
.related-grid {
  display: grid;
  gap: 14px;
}

.prompt-formula {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.formula-item,
.layout-item,
.note,
.related-card,
.example-card,
.prompt-box,
.spec-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 29, 40, 0.95), rgba(10, 15, 23, 0.96));
}

.formula-item,
.layout-item,
.note,
.related-card,
.spec-panel {
  padding: 18px;
}

.formula-item strong,
.layout-item strong,
.note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.formula-item span,
.layout-item span,
.note span,
.related-card p,
.example-card p {
  color: var(--muted);
}

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

.example-card {
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.example-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 178, 75, 0.64);
}

.example-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center;
  border-bottom: 1px solid var(--line);
}

.example-card.wide img {
  height: 320px;
  object-position: center;
}

.example-body {
  padding: 18px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.example-body p {
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(178, 193, 214, 0.24);
  border-radius: 999px;
  color: #dce7f8;
  font-size: 0.78rem;
  font-weight: 900;
}

.layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.layout-shot {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-3);
}

.layout-shot img {
  width: 100%;
  height: 540px;
  object-fit: cover;
  object-position: 50% 10%;
}

.layout-steps {
  grid-template-columns: 1fr;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 0.42fr);
  gap: 18px;
  align-items: start;
  margin-top: 28px;
}

.prompt-box {
  padding: 20px;
}

.prompt-box pre {
  margin: 0;
  padding: 18px;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(178, 193, 214, 0.18);
  border-radius: 8px;
  background: #070b12;
  color: #eef4ff;
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.prompt-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.prompt-label span {
  color: var(--muted-2);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

.spec-panel {
  position: sticky;
  top: 94px;
}

.spec-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(178, 193, 214, 0.12);
}

.spec-list li:last-child {
  border-bottom: 0;
}

.spec-list span {
  color: var(--muted-2);
  font-weight: 800;
}

.detail-image {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-3);
}

.detail-image img {
  width: 100%;
  object-fit: cover;
}

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

.related-card {
  color: var(--text);
  text-decoration: none;
}

.related-card:hover {
  border-color: var(--line-strong);
}

.related-card p {
  margin-bottom: 0;
}

.mst-unified-footer {
  margin: 58px auto 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.92);
  color: #dce7f7;
}

.mst-unified-footer,
.mst-unified-footer * {
  box-sizing: border-box;
}

.mst-unified-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mst-unified-footer-brand {
  color: var(--text);
  font-weight: 900;
}

.mst-unified-footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  gap: 12px;
  margin-top: 12px;
}

.mst-unified-footer-group {
  padding: 12px;
  border: 1px solid rgba(178, 193, 214, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.mst-unified-footer-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.mst-unified-footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
}

.mst-unified-footer a,
.mst-unified-footer button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #dce7f7;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.mst-unified-footer a:hover,
.mst-unified-footer button:hover {
  color: var(--text);
  text-decoration: underline;
}

.mst-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mst-footer-badge {
  display: inline-flex;
  align-items: center;
  max-width: 172px;
  min-height: 32px;
  overflow: hidden;
  border: 1px solid rgba(178, 193, 214, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.mst-footer-badge img {
  width: 100%;
  height: auto;
}

.mst-unified-footer-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  .section-head,
  .layout-shell,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .prompt-formula,
  .example-grid,
  .related-grid,
  .mst-unified-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-panel {
    position: static;
  }

  .example-card img,
  .example-card.wide img {
    height: 280px;
  }

  .layout-shot img {
    height: 480px;
  }
}

@media (max-width: 640px) {
  .mst-page-nav,
  .page-wrap {
    width: min(100% - 20px, 1180px);
  }

  .mst-page-nav,
  .mst-page-links,
  .mst-unified-footer-top {
    align-items: stretch;
    flex-direction: column;
  }

  .mst-page-links a,
  .btn {
    width: 100%;
  }

  .hero {
    min-height: 66vh;
  }

  .hero::before {
    background: linear-gradient(180deg, rgba(3, 5, 10, 0.48), rgba(3, 5, 10, 0.94));
  }

  .hero-content {
    padding: 24px;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .prompt-formula,
  .example-grid,
  .related-grid,
  .mst-unified-footer-grid,
  .mst-unified-footer-links {
    grid-template-columns: 1fr;
  }

  .example-card img,
  .example-card.wide img {
    height: 230px;
  }

  .layout-shot img {
    height: 360px;
  }

  .spec-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
