:root {
  color-scheme: dark;
  --ink: #0b0e13;
  --deep: #121821;
  --panel: rgba(240, 244, 240, 0.07);
  --line: rgba(240, 244, 240, 0.15);
  --text: #f2efe8;
  --muted: #bdc7c6;
  --gold: #e0b760;
  --cyan: #66d9e8;
  --green: #4f8a6a;
  --red: #a6464f;
  --shadow: 0 24px 88px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(130deg, rgba(102, 217, 232, 0.11), transparent 34%),
    linear-gradient(250deg, rgba(224, 183, 96, 0.11), transparent 44%),
    var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

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

button,
textarea,
input {
  font: inherit;
}

button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(240, 244, 240, 0.07);
  cursor: pointer;
}

button:hover,
button:focus-visible,
a:focus-visible {
  border-color: rgba(102, 217, 232, 0.66);
  outline: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(11, 14, 19, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(224, 183, 96, 0.7);
  border-radius: 50%;
  color: var(--gold);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.nav-links a {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
  border-color: var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: clamp(26px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.hero-art {
  width: 100%;
  aspect-ratio: 14 / 9;
  object-fit: cover;
  border: 1px solid rgba(240, 244, 240, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  font-weight: 600;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.98;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

p {
  line-height: 1.68;
}

.hero-copy p:last-child,
.section-heading p,
.principles p,
.deploy-grid p {
  color: var(--muted);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principles article {
  min-height: 160px;
  padding: clamp(22px, 4vw, 42px);
  background: #101720;
  border-right: 1px solid var(--line);
}

.principles article:nth-child(2) {
  background: #171511;
}

.principles article:nth-child(3) {
  background: #111a16;
  border-right: 0;
}

.principles h2 {
  color: var(--gold);
  font-size: 2rem;
}

.workspace,
.files-section,
.deploy-section {
  padding: clamp(64px, 9vw, 108px) clamp(18px, 5vw, 72px);
}

.workspace {
  background: #0d1118;
}

.section-heading {
  width: min(980px, 100%);
  margin-bottom: 32px;
}

.section-heading.narrow {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading.narrow p {
  margin-right: auto;
  margin-left: auto;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.chat-panel,
.preview-panel,
.files-section,
.deploy-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chat-panel,
.preview-panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-title,
.file-toolbar,
.form-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title h3 {
  margin: 0;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 320px;
  overflow: auto;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.message {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(240, 244, 240, 0.08);
}

.message.user {
  align-self: flex-end;
  color: #081014;
  background: var(--cyan);
}

.message.assistant {
  align-self: flex-start;
}

textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  font-family: Arial, sans-serif;
  line-height: 1.55;
}

textarea:focus {
  border-color: rgba(102, 217, 232, 0.68);
  outline: none;
}

.form-actions {
  margin-top: 12px;
}

#generateButton,
#downloadZip {
  color: #071014;
  background: var(--cyan);
}

.status {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
}

.status.good {
  color: #c9f0d8;
}

.status.bad {
  color: #ffd6dc;
}

.segmented {
  display: flex;
  gap: 6px;
}

.segmented button {
  min-height: 36px;
  padding: 8px 12px;
}

.segmented button.active {
  color: #071014;
  background: var(--gold);
}

.preview-shell {
  display: grid;
  place-items: center;
  height: 566px;
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05070a;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.preview-shell.mobile iframe {
  width: 390px;
  max-width: 100%;
  height: 100%;
}

.files-section {
  background: #11151c;
}

.file-toolbar {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.file-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-tabs button.active {
  color: #071014;
  background: var(--gold);
}

.toolbar-actions {
  flex-wrap: wrap;
}

#codeEditor {
  min-height: 480px;
  font: 0.95rem/1.55 Consolas, "Courier New", monospace;
}

.deploy-section {
  background: #101612;
}

.deploy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.deploy-grid article {
  min-height: 180px;
  padding: 24px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: #06080c;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.app-footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 1120px) {
  .hero,
  .builder-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-header,
  .panel-title,
  .file-toolbar,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .principles,
  .deploy-grid {
    grid-template-columns: 1fr;
  }

  .principles article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  h1 {
    font-size: 3.4rem;
  }
}
