:root {
  --ink: #15120e;
  --ink-soft: #5f5548;
  --paper: #f4efe6;
  --paper-strong: #fffaf2;
  --line: rgba(21, 18, 14, 0.1);
  --accent: #cb6130;
  --accent-deep: #8e3112;
  --accent-soft: rgba(203, 97, 48, 0.16);
  --success: #0d7a55;
  --danger: #a23434;
  --shadow: 0 24px 80px rgba(32, 22, 12, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    "Avenir Next",
    "Segoe UI",
    "Helvetica Neue",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(247, 212, 186, 0.7), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 232, 189, 0.6), transparent 28%),
    linear-gradient(160deg, #f3ecdf 0%, #f8f3eb 45%, #f1e8db 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.45;
}

.page-glow-one {
  width: 32rem;
  height: 32rem;
  top: -8rem;
  right: -6rem;
  background: rgba(203, 97, 48, 0.35);
}

.page-glow-two {
  width: 28rem;
  height: 28rem;
  bottom: -10rem;
  left: -6rem;
  background: rgba(255, 214, 140, 0.45);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background:
    linear-gradient(160deg, var(--accent) 0%, #f1b65d 48%, var(--accent-deep) 100%);
  box-shadow: 0 0 0 6px rgba(203, 97, 48, 0.12);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink-soft);
  background: transparent;
}

.topnav-link.is-current,
.topnav-link:hover,
.ghost-button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.hero,
.dashboard-hero,
.project-hero,
.auth-shell,
.dashboard-grid,
.project-grid,
.history-card,
.account-card,
.error-card {
  animation: rise 320ms ease-out both;
}

.hero,
.dashboard-hero,
.project-hero {
  display: grid;
  gap: 24px;
  margin-bottom: 28px;
}

.hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.composer-card,
.customer-preview-card,
.list-card,
.history-card,
.account-card,
.error-card,
.auth-card,
.auth-panel,
.project-card,
.build-card,
.metric-card,
.stat-card,
.empty-card,
.preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.94) 0%, rgba(255, 247, 237, 0.88) 100%);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 56px 52px;
}

.hero-copy h1,
.dashboard-hero h1,
.project-hero h1,
.auth-panel h1,
.account-card h1,
.error-card h1 {
  margin: 10px 0 14px;
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    serif;
  font-size: clamp(2.3rem, 4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-copy p,
.dashboard-hero p,
.project-hero p,
.auth-panel p,
.account-card p,
.error-card p,
.section-header p,
.meta-copy,
.project-description,
.build-prompt {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-actions,
.project-hero-meta,
.stats-grid,
.project-list,
.build-list,
.topnav,
.auth-shell,
.dashboard-grid,
.project-grid,
.build-stats,
.project-metrics {
  display: flex;
  flex-wrap: wrap;
}

.hero-actions {
  gap: 12px;
  margin-top: 28px;
}

.hero-shared-auth {
  margin-top: 18px;
  max-width: 58ch;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.button.primary {
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff9f0;
  box-shadow: 0 18px 30px rgba(142, 49, 18, 0.22);
}

.button.secondary {
  background: rgba(255, 250, 242, 0.88);
  color: var(--ink);
  border-color: var(--line);
}

.button.stretch {
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.metric-card,
.stat-card,
.empty-card {
  padding: 18px 20px;
}

.metric-card strong,
.stat-card strong,
.project-title {
  display: block;
  font-size: 1.06rem;
}

.metric-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
}

.dashboard-grid,
.project-grid {
  gap: 24px;
  align-items: start;
}

.project-primary-column {
  display: grid;
  gap: 24px;
}

.dashboard-grid {
  flex-wrap: nowrap;
}

.dashboard-grid > *:first-child,
.project-grid > *:first-child {
  flex: 1 1 420px;
}

.dashboard-grid > *:last-child,
.project-grid > *:last-child {
  flex: 1 1 520px;
}

.stats-grid {
  gap: 12px;
  align-items: stretch;
}

.stat-card {
  min-width: 120px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 122px;
}

.stat-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  margin-top: 0;
  font-size: 2rem;
  line-height: 1;
}

.composer-card,
.customer-preview-card,
.list-card,
.history-card,
.account-card,
.error-card,
.auth-card,
.auth-panel {
  padding: 24px;
}

.section-header {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(21, 18, 14, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(203, 97, 48, 0.44);
  box-shadow: 0 0 0 4px rgba(203, 97, 48, 0.13);
}

.project-list,
.build-list {
  gap: 14px;
  flex-direction: column;
}

.project-card,
.build-card {
  padding: 18px 20px;
}

.project-card-top,
.build-card-head,
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.project-title-row {
  margin: 0;
}

.project-title {
  font-size: 1.2rem;
}

.project-description.large {
  max-width: 60ch;
}

.project-metrics,
.build-stats {
  gap: 14px;
  margin-top: 16px;
}

.project-metrics div,
.build-stats div {
  min-width: 140px;
}

.project-metrics dt,
.build-stats dt {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-metrics dd,
.build-stats dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill.is-success {
  color: var(--success);
  background: rgba(13, 122, 85, 0.12);
}

.status-pill.is-active {
  color: var(--accent-deep);
  background: rgba(203, 97, 48, 0.14);
}

.status-pill.is-danger {
  color: var(--danger);
  background: rgba(162, 52, 52, 0.12);
}

.status-pill.is-muted {
  color: var(--ink-soft);
  background: rgba(95, 85, 72, 0.12);
}

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.flash-danger {
  border-color: rgba(162, 52, 52, 0.24);
  color: var(--danger);
}

.flash-info {
  border-color: rgba(203, 97, 48, 0.22);
}

.build-summary,
.file-preview {
  margin: 14px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 13, 10, 0.92);
  color: #f5ecdf;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.changed-files,
.file-tree {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.changed-files {
  padding: 0;
  list-style: none;
}

.changed-files li,
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.9);
}

.file-row-name {
  overflow-wrap: anywhere;
}

.preview-card {
  margin-top: 16px;
  padding: 16px;
}

.customer-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.danger-ghost {
  color: var(--danger);
  border-color: rgba(162, 52, 52, 0.18);
}

.danger-ghost:hover {
  color: var(--danger);
  border-color: rgba(162, 52, 52, 0.28);
  background: rgba(162, 52, 52, 0.08);
}

.preview-head span,
.changed-files code,
.file-row code {
  color: var(--ink-soft);
}

.back-link {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--ink-soft);
}

.back-link.subtle {
  margin: 0 0 12px;
}

.auth-shell {
  gap: 24px;
  align-items: stretch;
}

.auth-shell > * {
  flex: 1 1 320px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-provider-group {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-provider-button {
  justify-content: flex-start;
  padding-inline: 18px;
  font-weight: 700;
}

.auth-provider-note,
.auth-status {
  margin-bottom: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 18px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(21, 18, 14, 0.12);
}

.account-email {
  margin-top: 10px;
}

.provider-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(203, 97, 48, 0.12);
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 700;
}

.meta-copy a {
  color: var(--accent-deep);
}

.small {
  border-radius: 18px;
}

code {
  font-family:
    "IBM Plex Mono",
    "SFMono-Regular",
    Consolas,
    monospace;
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

  .dashboard-grid,
  .project-grid,
  .auth-shell {
    flex-direction: column;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 28px;
  }

  .topnav {
    justify-content: space-between;
  }

  .hero-copy {
    padding: 30px 24px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 14px;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .button,
  .ghost-button,
  .topnav-link {
    width: 100%;
  }
}
