:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0d0d0f;
  --panel-2: #151517;
  --panel-3: #202124;
  --line: #2b2c30;
  --text: #f4f4f1;
  --muted: #9a9b9d;
  --soft: #c9c9c3;
  --accent: #e5342c;
  --blue: #0a64b7;
  --green: #6f8f57;
  --gold: #c7a449;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.1;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button,
.primary-button,
.ghost-button,
.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-2);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.ghost-button {
  color: var(--soft);
  background: transparent;
}

.icon-button input {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(480px, 1.7fr) minmax(280px, 0.95fr);
  gap: 1px;
  min-height: calc(100vh - 63px);
  background: var(--line);
}

.source-pane,
.preview-pane,
.editor-pane {
  min-width: 0;
  background: var(--bg);
}

.source-pane,
.editor-pane {
  position: sticky;
  top: 63px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 63px);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.pane-head h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
}

.pane-head span {
  color: var(--muted);
  font-size: 11px;
}

#markdownSource {
  flex: 1;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 16px;
  background: #070708;
  color: var(--soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.preview-tabs {
  position: sticky;
  top: 63px;
  z-index: 8;
  display: flex;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.93);
  overflow-x: auto;
}

.tab {
  color: var(--muted);
  white-space: nowrap;
}

.tab.active {
  color: #fff;
  border-color: var(--accent);
}

.design-preview {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 34px 24px 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
  min-height: 290px;
  padding: 34px;
  border: 1px solid var(--line);
  background: #050505;
}

.hero h2 {
  margin-bottom: 16px;
  font-size: clamp(32px, 5vw, 68px);
  line-height: 0.92;
  text-transform: uppercase;
}

.hero p {
  max-width: 58ch;
  color: var(--soft);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.hero-visual {
  min-height: 230px;
  border: 1px solid #17191b;
  background:
    linear-gradient(130deg, rgba(10, 100, 183, 0.75), transparent 44%),
    linear-gradient(180deg, #18191a, #060606 72%),
    linear-gradient(90deg, transparent 78%, var(--accent) 78%);
}

.section {
  padding: 52px 0;
  border-bottom: 1px solid #1d1d20;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.section h3 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.05;
  text-transform: uppercase;
}

.section p {
  color: var(--soft);
  line-height: 1.55;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.swatch {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  color: #fff;
}

.swatch strong,
.card strong {
  text-transform: uppercase;
}

.swatch span,
.card span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.type-scale {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.type-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px;
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.type-row span {
  color: var(--muted);
  font-size: 12px;
}

.type-row strong {
  text-transform: uppercase;
}

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

.card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 166px;
  padding: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel-3), #090909);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--line);
}

.metric {
  min-height: 80px;
  padding: 13px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
  font-size: 22px;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.cta-band {
  margin-top: 22px;
  padding: 42px 24px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(10, 100, 183, 0.72), transparent 58%),
    linear-gradient(180deg, #17222d, #08264a);
}

.cta-band strong {
  display: block;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.property-editor {
  overflow: auto;
  padding: 16px;
}

.editor-group {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.editor-group h3 {
  margin-bottom: 12px;
  font-size: 12px;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

.color-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.color-row input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 3px;
}

.color-row input + input {
  padding: 10px;
}

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

  .source-pane,
  .editor-pane {
    position: relative;
    top: auto;
    max-height: none;
  }

  #markdownSource {
    min-height: 320px;
  }
}

@media (max-width: 680px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .icon-button,
  .primary-button {
    flex: 1;
  }

  .design-preview {
    padding-inline: 14px;
  }

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

  .swatch-grid,
  .card-grid,
  .metric-row {
    grid-template-columns: 1fr 1fr;
  }
}
