:root {
  color-scheme: light;
  --bg: #fffaf1;
  --bg-accent: #ffe3bd;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: rgba(31, 41, 55, 0.1);
  --shadow: 0 24px 60px rgba(224, 137, 46, 0.14);
  --brand: #f38b2a;
  --brand-deep: #cf6520;
  --accent: #ffd54a;
  --success: #1d7a52;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 74, 0.5), transparent 25%),
    radial-gradient(circle at top right, rgba(243, 139, 42, 0.2), transparent 30%),
    linear-gradient(180deg, #fffef9 0%, var(--bg) 100%);
}

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

button,
a,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero,
.tool-layout {
  display: grid;
  gap: 24px;
}

.hero {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 360px);
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.panel,
.stats-card {
  backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero-copy,
.stats-card,
.panel {
  border-radius: var(--radius-xl);
}

.hero-copy {
  padding: 32px;
}

.eyebrow,
.panel-kicker,
.stats-label {
  margin: 0 0 10px;
  color: var(--brand-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 4.7rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

h3 {
  font-size: 1.05rem;
}

.lede,
.panel p,
.dropzone-subtitle,
.empty-state,
.status,
.stats-caption,
.stats-meta,
.color-control span {
  color: var(--muted);
}

.lede {
  max-width: 54ch;
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 18px 0 0;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-points span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(31, 41, 55, 0.08);
  font-size: 0.95rem;
}

.stats-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stats-value {
  margin: 0;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-family: "Space Grotesk", sans-serif;
  color: var(--brand-deep);
}

.stats-caption {
  margin: 6px 0 0;
}

.stats-meta {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.tool-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 360px);
  align-items: start;
}

.panel {
  padding: 26px;
}

.tool-panel {
  padding-bottom: 22px;
}

.panel-head,
.image-card-head,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.color-control {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  justify-items: end;
}

.color-control input {
  width: 52px;
  height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(243, 139, 42, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 243, 224, 0.92));
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  transform: translateY(-1px);
  border-color: rgba(243, 139, 42, 0.75);
  box-shadow: 0 18px 34px rgba(243, 139, 42, 0.15);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.image-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.image-frame {
  margin-top: 16px;
  min-height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff8ef;
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.checkerboard {
  background-image:
    linear-gradient(45deg, rgba(31, 41, 55, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(31, 41, 55, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(31, 41, 55, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(31, 41, 55, 0.05) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.empty-state {
  padding: 24px;
  text-align: center;
  max-width: 28ch;
  line-height: 1.5;
}

.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ghost-button {
  background: #fff;
  color: var(--text);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  border-color: transparent;
}

.ghost-button:hover:not(:disabled),
.primary-button:hover:not(.disabled) {
  transform: translateY(-1px);
}

.ghost-button:disabled,
.primary-button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.status {
  margin: 18px 2px 0;
  min-height: 24px;
}

.status.success {
  color: var(--success);
}

.rail {
  display: grid;
  gap: 20px;
}

.policy-content {
  display: grid;
  gap: 22px;
}

.policy-section {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.policy-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.policy-section p {
  margin: 0;
  line-height: 1.7;
}

.policy-section a {
  color: var(--brand-deep);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 6px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav {
  display: flex;
  gap: 16px;
}

.footer-nav a {
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 700;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.ad-shell {
  position: relative;
  margin-top: 16px;
  min-height: 280px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff 0%, #fff3da 100%);
  border: 1px dashed rgba(243, 139, 42, 0.45);
  overflow: hidden;
}

.ad-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.ad-shell.configured .ad-fallback {
  display: none;
}

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

  .panel-head,
  .image-card-head {
    align-items: start;
    flex-direction: column;
  }

  .action-row {
    width: 100%;
    justify-content: stretch;
  }

  .action-row > * {
    flex: 1 1 0;
  }

  .color-control {
    justify-items: start;
  }

  .site-footer {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
    padding-bottom: 32px;
  }

  .hero-copy,
  .stats-card,
  .panel {
    padding: 20px;
  }

  .dropzone,
  .image-card {
    padding: 16px;
  }

  .image-frame {
    min-height: 220px;
  }
}
