:root {
  color-scheme: light;
  --ink: #201c18;
  --muted: #766c62;
  --line: #e7ded5;
  --paper: #fbf7f1;
  --panel: #fffdf9;
  --soft: #f4ece4;
  --accent: #bd6e66;
  --teal: #72b8b5;
  --shadow: 0 18px 44px rgba(67, 48, 33, .13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 8%, rgba(189, 110, 102, .16), transparent 28%),
    radial-gradient(circle at 85% 16%, rgba(114, 184, 181, .18), transparent 26%),
    linear-gradient(180deg, #fbf7f1 0%, #f5ece4 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 16px 42px;
}

.intro-panel,
.crop-panel,
.result-panel {
  background: rgba(255, 253, 249, .9);
  border: 1px solid rgba(231, 222, 213, .9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.intro-panel {
  min-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: #8b5c53;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: 34px;
  line-height: 1.13;
  max-width: 10em;
}

h2 {
  font-size: 24px;
  line-height: 1.22;
}

.lede,
.section-heading p,
.notice-grid p {
  color: var(--muted);
  line-height: 1.68;
}

.lede {
  margin: 14px 0 0;
  font-size: 15px;
}

.upload-card {
  min-height: 220px;
  margin: 28px 0 16px;
  border: 1px dashed #d8c9bb;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 20%, rgba(226, 142, 154, .24), transparent 28%),
    radial-gradient(circle at 78% 78%, rgba(114, 184, 181, .22), transparent 30%),
    linear-gradient(135deg, #fffaf5, #f6eee7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.upload-card:hover {
  transform: translateY(-2px);
  border-color: #c7ad9c;
  box-shadow: 0 12px 26px rgba(67, 48, 33, .09);
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
}

.upload-card strong {
  font-size: 18px;
}

.upload-card small {
  color: var(--muted);
  font-size: 13px;
}

.notice-grid {
  display: grid;
  gap: 10px;
}

.notice-grid p {
  margin: 0;
  border-radius: 8px;
  background: var(--soft);
  padding: 11px 12px;
  font-size: 13px;
}

.demo-button {
  min-height: 44px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.legal-page {
  min-height: auto;
}

.legal-page h1 {
  max-width: 11em;
}

.legal-copy {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.legal-copy h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.legal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

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

.result-panel {
  margin-top: 18px;
}

.crop-panel {
  margin-top: 18px;
}

.crop-panel[hidden],
.result-panel[hidden] {
  display: none;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading p {
  margin: 8px 0 0;
  font-size: 14px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fffaf4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#previewCanvas {
  aspect-ratio: 4 / 5;
}

#cropCanvas {
  aspect-ratio: 4 / 5;
}

#posterCanvas {
  aspect-ratio: 3 / 4;
  margin-top: 14px;
}

.crop-controls {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.crop-controls label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 12px;
}

.crop-controls span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.crop-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.mirror-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}

.mirror-toggle span {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 15px;
}

.social-prompt {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 14px;
}

.social-prompt .eyebrow {
  margin-bottom: 6px;
}

.social-prompt p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.social-prompt button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #efe5dc;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.tone-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.tone-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 12px;
}

.tone-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.tone-grid strong {
  font-size: 17px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
  padding: 0;
}

.actions button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.actions .secondary {
  background: #efe5dc;
  color: var(--ink);
}

@media (min-width: 680px) {
  .app-shell {
    padding: 34px 22px 56px;
  }

  .intro-panel,
  .crop-panel,
  .result-panel {
    padding: 30px;
  }

  h1 {
    font-size: 42px;
  }

  .notice-grid,
  .crop-controls,
  .tone-grid,
  .actions,
  .social-prompt {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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