:root {
  color-scheme: light;
  --ink: #1e2329;
  --muted: #69717d;
  --subtle: #8c95a1;
  --line: #dbe1e8;
  --panel: #ffffff;
  --paper: #f7f9fc;
  --soft-blue: #eaf2ff;
  --blue: #1f62e0;
  --green: #16855b;
  --soft-green: #e7f7ef;
  --amber: #b06a00;
  --soft-amber: #fff5d6;
  --danger: #ba2f2f;
  --shadow: 0 18px 45px rgba(30, 35, 41, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.outline {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 24px 20px;
  background: #111820;
  color: #eef4fb;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid #0b1016;
}

.brand,
.outline-status,
.project-list article,
.browser-bar,
.doc-title-row,
.section-heading,
.button-row,
.doc-kicker,
.choice,
.log-stack div {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark,
.project-icon,
.source-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: var(--blue);
  color: white;
  font-family: Georgia, serif;
  font-size: 24px;
}

.brand span,
.outline-status small {
  display: block;
  color: #aeb8c4;
  font-size: 12px;
  margin-top: 2px;
}

.outline-nav {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.outline-nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}

.outline-nav a:hover,
.outline-nav a.active {
  background: #202a35;
  border-color: #334252;
  color: white;
}

.outline-status {
  margin-top: auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid #354251;
  border-radius: 12px;
  background: #1a222c;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-amber {
  background: #ffcb45;
}

.document {
  min-width: 0;
  padding: 28px clamp(20px, 4vw, 54px) 64px;
}

.doc-header,
.doc-section {
  max-width: 1160px;
  margin: 0 auto 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.doc-header {
  padding: clamp(22px, 4vw, 36px);
}

.doc-section {
  padding: clamp(20px, 3vw, 30px);
  scroll-margin-top: 18px;
}

.doc-kicker {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.state-green {
  background: var(--soft-green);
  color: var(--green);
}

.state-blue {
  background: var(--soft-blue);
  color: var(--blue);
}

.state-amber {
  background: var(--soft-amber);
  color: var(--amber);
}

.doc-title-row,
.section-heading {
  justify-content: space-between;
  gap: 24px;
}

.doc-title-row {
  align-items: flex-start;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  margin: 0 0 8px;
}

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

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
  margin-bottom: 16px;
  max-width: 800px;
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
  margin-bottom: 0;
}

h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin-bottom: 0;
}

.header-actions,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.icon-button,
.chip-row button,
.chip-row a,
.filter-row button,
.file-tree button,
.blueprint-list button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  text-decoration: none;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 750;
}

.button.ghost {
  background: white;
  color: var(--blue);
}

.button.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.button.blue {
  background: #3854e9;
}

.button.danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 900;
}

.live-strip {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fdfefe;
}

.browser-bar {
  gap: 12px;
  padding: 12px;
  background: #20272f;
}

.path-field {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #bac4cf;
  font-size: 13px;
}

.path-field input,
label input,
label select,
.search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

.browser-bar .path-field input {
  background: #313b46;
  border-color: #44515e;
  color: white;
}

.preview-card {
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: center;
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
}

.preview-copy strong {
  display: block;
  font-size: 20px;
  margin-bottom: 42px;
}

.preview-copy h2 {
  max-width: 520px;
  color: #3153f4;
  font-family: Georgia, serif;
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1.18;
  margin-bottom: 18px;
}

.preview-copy p {
  max-width: 500px;
  font-size: 18px;
  line-height: 1.5;
}

.preview-art {
  position: relative;
  min-height: 280px;
  display: grid;
  place-items: center;
}

.preview-art::before,
.preview-art::after {
  content: "";
  position: absolute;
  border: 34px solid #28df74;
  border-radius: 50%;
  width: 360px;
  height: 180px;
  transform: rotate(4deg);
}

.preview-art::after {
  width: 290px;
  height: 100px;
  transform: translateY(80px) rotate(-3deg);
}

.preview-art span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border: 14px solid #17191d;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 118px;
  font-weight: 800;
  background: white;
}

.source-grid,
.settings-grid,
.gallery-grid {
  display: grid;
  gap: 14px;
}

.source-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.source-card,
.card,
.inline-panel,
.project-list article,
.file-workspace,
.blueprint-grid,
.gallery-grid article {
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
}

.source-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.source-card.active {
  border-color: #9bbcff;
  background: #f7fbff;
}

.source-card p,
.gallery-grid p,
.muted {
  color: var(--muted);
  line-height: 1.45;
}

.source-card label,
.settings-grid label,
.card label,
.search {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.source-icon {
  width: 42px;
  height: 42px;
  background: #e9eef6;
  color: #253142;
}

.inline-panel {
  margin-top: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  background: #fbfcfe;
}

.inline-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.chip-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button,
.chip-row a,
.filter-row button {
  padding: 7px 11px;
  color: var(--muted);
  background: #f4f6f9;
}

.chip-row a,
.filter-row .active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.card {
  padding: 20px;
}

.choice-stack {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.choice {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 750;
}

.choice span {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

.choice.selected {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.progress {
  height: 9px;
  background: #e6ebf1;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

dl {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

dl div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.project-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.project-list article {
  gap: 14px;
  padding: 14px;
}

.project-list article > div {
  flex: 1;
  min-width: 0;
}

.project-list p {
  margin: 3px 0 0;
  color: var(--muted);
}

.project-list .selected {
  background: #eff5ff;
  border-color: #9bbcff;
}

.project-icon {
  width: 38px;
  height: 38px;
  background: #172032;
  color: white;
  font-family: Georgia, serif;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.toggle {
  min-height: 48px;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fbfcfe;
}

.notice {
  margin-top: 16px;
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  line-height: 1.45;
}

.notice.amber {
  background: var(--soft-amber);
  color: #6f4300;
}

.notice.blue {
  margin: 0 0 16px;
  background: var(--soft-blue);
  color: #174084;
}

.file-workspace,
.blueprint-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
}

.file-tree,
.blueprint-list {
  padding: 16px;
  background: #f7f9fc;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 8px;
}

.file-tree button,
.blueprint-list button {
  text-align: left;
  min-height: 36px;
  padding: 0 10px;
}

.file-tree button.active,
.blueprint-list button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: white;
}

.code-card {
  min-width: 0;
  background: #ffffff;
}

.code-header {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.code-header span {
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #9d2d00;
  background: #fffdfb;
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.blueprint-list {
  gap: 10px;
}

.log-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.log-stack div {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.log-stack span {
  color: var(--green);
}

.filter-row {
  margin: 20px 0;
}

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

.gallery-grid article {
  padding: 0 0 16px;
  overflow: hidden;
}

.gallery-grid h3,
.gallery-grid p,
.gallery-grid span {
  margin-left: 16px;
  margin-right: 16px;
}

.gallery-grid span {
  display: inline-flex;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}

.thumb {
  height: 150px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #806329, #e8c885 45%, #8c244e);
}

.thumb.coffee {
  background: linear-gradient(135deg, #5e2b88, #f0a24a 58%, #74362b);
}

.thumb.feed {
  background: linear-gradient(135deg, #edf3ff, #ffffff 45%, #7892df);
}

.thumb.gaming {
  background: linear-gradient(135deg, #0b0b0c, #ffffff 45%, #d24b24);
}

.thumb.nonprofit {
  background: linear-gradient(135deg, #26180f, #a4673d 52%, #ec4e63);
}

.thumb.blog {
  background: linear-gradient(135deg, #5d0f35, #8e164a 60%, #e8d7e1);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .outline {
    position: static;
    height: auto;
    padding: 16px;
  }

  .outline-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    max-width: 100%;
  }

  .outline-nav a {
    flex: 0 0 auto;
  }

  .outline-status {
    margin-top: 0;
  }

  .doc-title-row,
  .section-heading,
  .inline-panel,
  .preview-card,
  .two-column,
  .file-workspace,
  .blueprint-grid {
    grid-template-columns: 1fr;
  }

  .source-grid,
  .settings-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .file-tree,
  .blueprint-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .document {
    padding: 14px 12px 36px;
  }

  .doc-header,
  .doc-section {
    border-radius: 12px;
  }

  .source-grid,
  .settings-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .browser-bar,
  .doc-title-row,
  .section-heading,
  .project-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .path-field {
    grid-template-columns: 1fr;
  }

  .preview-art {
    min-height: 170px;
  }

  .preview-art::before,
  .preview-art::after {
    width: 220px;
    height: 100px;
    border-width: 22px;
  }

  .preview-art span {
    width: 120px;
    height: 120px;
    font-size: 74px;
    border-width: 10px;
  }

  dl div,
  .notice {
    grid-template-columns: 1fr;
  }

  .choice {
    align-items: flex-start;
  }

  .choice span {
    margin-left: 0;
  }
}
