/* Creative Designer — shared styles */

:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-sunken: #f0f0ec;
  --border: #e3e3dd;
  --border-strong: #cdcdc5;
  --text: #16161a;
  --text-muted: #55555d;
  --text-faint: #85858d;
  --accent: #e8590c;
  --pending: #f59f00;

  --ads: #e8590c;
  --ads-bg: #fdeee5;
  --landing: #2563eb;
  --landing-bg: #e8effd;
  --crm: #0f9d6b;
  --crm-bg: #e2f5ed;
  --social: #d6336c;
  --social-bg: #fbe8ef;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 16, 20, 0.04), 0 4px 16px rgba(16, 16, 20, 0.05);
  --shadow-hover: 0 2px 4px rgba(16, 16, 20, 0.06), 0 14px 32px rgba(16, 16, 20, 0.09);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121214;
    --surface: #1b1b1f;
    --surface-sunken: #161619;
    --border: #2a2a30;
    --border-strong: #3d3d45;
    --text: #f2f2f4;
    --text-muted: #a9a9b3;
    --text-faint: #7c7c86;
    --accent: #ff8a4c;

    --ads: #ff8a4c;
    --ads-bg: rgba(232, 89, 12, 0.16);
    --landing: #6d9cff;
    --landing-bg: rgba(37, 99, 235, 0.18);
    --crm: #3fd3a0;
    --crm-bg: rgba(15, 157, 107, 0.18);
    --social: #f06595;
    --social-bg: rgba(214, 51, 108, 0.18);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.35);
  }
}

.tone-ads { --tone: var(--ads); --tone-bg: var(--ads-bg); }
.tone-landing { --tone: var(--landing); --tone-bg: var(--landing-bg); }
.tone-crm { --tone: var(--crm); --tone-bg: var(--crm-bg); }
.tone-social { --tone: var(--social); --tone-bg: var(--social-bg); }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { display: block; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff8a4c, #e8590c 55%, #d6336c);
  color: #fff;
}
.brand-mark svg { width: 16px; height: 16px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pending); }

/* Type */
h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lede { max-width: 620px; margin: 0; color: var(--text-muted); font-size: clamp(16px, 2vw, 18px); }
.section-title {
  margin: 0 0 14px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hint { color: var(--text-faint); font-size: 13px; }

/* Homepage */
.hero { padding: 40px 0 28px; }
@media (min-width: 768px) { .hero { padding: 64px 0 36px; } }

.type-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding-bottom: 48px; }
@media (min-width: 720px) { .type-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }

.type-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
@media (min-width: 720px) { .type-card { padding: 24px; } }
.type-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.type-card:focus-visible { outline: 2px solid var(--tone); outline-offset: 3px; }
.type-card h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.type-card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.card-title { display: flex; align-items: center; gap: 12px; }

.type-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--tone-bg);
  color: var(--tone);
}
.type-icon svg { width: 20px; height: 20px; }

.card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 124px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-sunken);
}
.frame {
  position: relative;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: 6px;
  background: var(--tone-bg);
}
.frame::before {
  content: "";
  position: absolute;
  top: 16%;
  left: 14%;
  right: 30%;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--tone) 50%, transparent);
}
.frame::after {
  content: "";
  position: absolute;
  bottom: 14%;
  left: 14%;
  width: 34%;
  height: 8px;
  border-radius: 4px;
  background: var(--tone);
}

.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pending); }
.open { display: inline-flex; align-items: center; gap: 4px; color: var(--tone); font-size: 14px; font-weight: 600; }
.open svg { width: 16px; height: 16px; transition: transform 0.18s ease; }
.type-card:hover .open svg { transform: translateX(3px); }

.how { padding-bottom: 56px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 18px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.step h3 { margin: 10px 0 4px; font-size: 16px; }
.step p { margin: 0; color: var(--text-muted); font-size: 14px; }
.step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
}

/* Category pages */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 20px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}
.crumb:hover { color: var(--text); }
.crumb svg { width: 16px; height: 16px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head .type-icon { width: 52px; height: 52px; border-radius: 14px; }
.page-head .type-icon svg { width: 24px; height: 24px; }
.page-head h1 { margin-bottom: 6px; font-size: clamp(26px, 4vw, 36px); }

.notice {
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent);
  border-radius: 12px;
  background: var(--tone-bg);
  font-size: 14px;
}

.layout { display: grid; grid-template-columns: 1fr; gap: 20px; padding-bottom: 56px; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.panel {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 12px; font-size: 15px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.prompt-box { display: flex; flex-direction: column; gap: 12px; }
.prompt-box textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-sunken);
  color: var(--text);
  font: inherit;
  resize: none;
  cursor: not-allowed;
}
.prompt-box textarea::placeholder { color: var(--text-faint); }
.prompt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .options { grid-template-columns: repeat(4, 1fr); } }
.options--wide { grid-template-columns: 1fr; }
@media (min-width: 640px) { .options--wide { grid-template-columns: repeat(2, 1fr); } }
.option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: var(--ratio, 4 / 5);
  padding: 8px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-sunken);
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}
.option strong { color: var(--text-muted); font-size: 13px; }

.todo { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.todo li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.todo li:first-child { padding-top: 4px; border-top: 0; }
.ring { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 2px dashed var(--border-strong); border-radius: 50%; }
.todo strong { display: block; font-size: 14px; font-weight: 600; }
.todo span { color: var(--text-muted); font-size: 13px; }

/* Footer */
.site-footer { padding: 24px 0 40px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 13px; }

/* ---------- App (prompt → options → download) ---------- */
:root { --ready: #2f9e44; --error: #e03131; --warn-ink: #a35200; }
@media (prefers-color-scheme: dark) {
  :root { --ready: #51cf66; --error: #ff6b6b; --warn-ink: #ffc078; }
}

.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--text-muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 480px) { .nav .pill { display: none; } }

.status.ready::before { background: var(--ready); }

.prompt-box textarea:not(:disabled) { cursor: text; background: var(--surface); }
.prompt-box textarea:focus { outline: 2px solid var(--tone); outline-offset: 1px; }
.btn:not(:disabled) { cursor: pointer; }
.btn:not(:disabled):hover { opacity: 0.88; }
.btn-secondary { border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text); }
.hint.error { color: var(--error); }

.understanding { margin: 0 0 8px; font-size: 15px; }
.note { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-sunken); color: var(--text-muted); font-size: 14px; }

.option-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 12px; }
@media (min-width: 560px) { .option-grid { grid-template-columns: repeat(2, 1fr); } }
.option-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.option-card.picked { border-color: var(--tone); box-shadow: 0 0 0 2px var(--tone); }
.option-card h3 { margin: 0; font-size: 15px; }
.option-card p { margin: 0; color: var(--text-muted); font-size: 14px; }
.option-card .btn { align-self: flex-start; }

.preview { position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: #1a1617; }
.preview > .cd-r2 { position: absolute; top: 0; left: 0; transform-origin: top left; }
.preview-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.badge.ok { background: color-mix(in srgb, var(--ready) 15%, transparent); color: var(--ready); }
.badge.warn { background: color-mix(in srgb, var(--pending) 20%, transparent); color: var(--warn-ink); }
.badge.bad { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.problems { margin: 0; padding-left: 18px; color: var(--error); font-size: 13px; }

.export-body { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .export-body { grid-template-columns: 240px 1fr; align-items: start; } }
.export-preview .preview { max-width: 240px; }
.export-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.sizes { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.sizes legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; }
.sizes label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.stage { position: fixed; top: 0; left: -100000px; }

.tick {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--ready) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.side-link { display: inline-block; margin-top: 12px; color: var(--tone); font-size: 14px; font-weight: 600; text-decoration: none; }

/* Photo library */
.library-upload { margin-bottom: 28px; }
.library-upload > .hint { margin: 10px 0 0; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 16px;
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--tone); background: var(--tone-bg); }
.library { padding-bottom: 56px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.photo-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-sunken); }
.photo-card .body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.photo-card p { margin: 0; color: var(--text-muted); font-size: 13px; }
.photo-card .issue { color: var(--warn-ink); }
.empty { color: var(--text-muted); }

/* Sign-in */
#user-button { display: inline-flex; min-width: 28px; }
.sign-in-gate { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 56px; padding: 32px 16px; text-align: center; }
.sign-in-gate[hidden] { display: none; }
.gate-message { margin: 0; color: var(--text-muted); font-size: 15px; }
