:root {
  --paper: #f4efe4;
  --paper-deep: #ece4d4;
  --ink: #1c1410;
  --ink-soft: #5c5148;
  --wine: #7a2433;
  --wine-deep: #5c1b27;
  --gold: #c4a35a;
  --gold-soft: #e8d7a8;
  --rose: #c45c6a;
  --card: #fffcf7;
  --line: #e4d8c6;
  --shadow: 0 18px 40px rgba(48, 28, 18, 0.12);
  --radius: 22px;
  --header: 72px;
  --sans: 'Poppins', 'Segoe UI', sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --script: 'Great Vibes', cursive;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 163, 90, 0.18), transparent 50%),
    radial-gradient(900px 500px at 110% 0%, rgba(196, 92, 106, 0.12), transparent 45%),
    var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  background: rgba(244, 239, 228, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--wine);
  color: #fff;
  font-size: 22px;
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand span span {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--wine);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--wine);
  color: #fff;
  box-shadow: 0 10px 24px rgba(122, 36, 51, 0.22);
}

.btn-gold {
  background: var(--gold);
  color: #1c1410;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
  flex: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  padding: 18px 0 12px;
}

.eyebrow {
  display: inline-flex;
  gap: 8px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
.serif {
  font-family: var(--serif);
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  margin: 12px 0 16px;
}

.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
}

.search-box {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-size: 16px;
}

.hero-card {
  background: var(--card);
  border-radius: 32px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.hero-preview,
.thumb-frame {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 42px 0 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 34px;
}

.muted {
  color: var(--ink-soft);
}

.grid {
  display: grid;
  gap: 16px;
}

.occasion-grid {
  grid-template-columns: repeat(4, 1fr);
}

.card-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 20px rgba(48, 28, 18, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

a.card-tile {
  display: block;
}

.card-tile:hover,
.card-tile.active {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.card-tile .icon {
  font-size: 28px;
}

.card-tile h3 {
  margin: 10px 0 4px;
  font-size: 18px;
}

.card-tile p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.recipient-grid,
.style-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.chip-tile {
  text-align: center;
  padding: 16px 10px;
}

.chip-tile .icon {
  font-size: 26px;
}

.template-grid {
  grid-template-columns: repeat(4, 1fr);
}

.template-card {
  padding: 10px;
}

.thumb-frame {
  border-radius: 18px;
  overflow: hidden;
  background: #ddd;
  aspect-ratio: 1;
  position: relative;
}

.thumb-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: inline-size;
}

.thumb-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(calc(100cqw / 1080));
  transform-origin: top left;
  pointer-events: none;
}

.template-card h3 {
  margin: 10px 8px 0;
  font-size: 15px;
}

.template-card p {
  margin: 2px 8px 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.skip-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--wine);
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.page-intro h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 8px 0 10px;
}

.wizard {
  display: grid;
  gap: 28px;
}

.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.step-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

.step-pill.active {
  background: var(--wine);
  color: #fff;
  border-color: var(--wine);
}

.editor-layout {
  display: grid;
  grid-template-columns: 220px minmax(280px, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.side-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding-right: 4px;
}

.canvas-wrap {
  background: var(--card);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 16px;
}

.canvas-stage {
  width: min(100%, 540px);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
}

.canvas-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.editor-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.tabs button {
  border: 0;
  background: var(--paper-deep);
  border-radius: 12px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.tabs button.active {
  background: var(--wine);
  color: #fff;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label,
.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-btn {
  width: 100%;
  position: relative;
}

.file-btn input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ready-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 16, 0.55);
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
}

.ready-overlay.open {
  display: grid;
}

.ready-card {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: 28px;
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}

.ready-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 40px;
  color: var(--ink-soft);
  font-size: 14px;
}

.footer-inner {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--wine);
}

.mobile-actions {
  display: none;
}

.notice {
  background: #fff7e6;
  border: 1px solid #ead8a6;
  color: #5c4810;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  display: none;
}

.notice.show {
  display: block;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--ink-soft);
}

.prose {
  max-width: 760px;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 16px;
}

.prose h2 {
  margin: 32px 0 10px;
  font-size: 28px;
}

.prose ul {
  padding-left: 20px;
}

.contact-grid,
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.info-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
}

.form-success {
  display: none;
  background: #eef7ee;
  border: 1px solid #c6e0c6;
  color: #245c24;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.form-success.show {
  display: block;
}

.wp-convert {
  margin-top: 40px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed var(--gold);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.wp-convert code {
  font-size: 12px;
  background: var(--paper-deep);
  padding: 1px 6px;
  border-radius: 6px;
}

@media (max-width: 980px) {
  .hero,
  .editor-layout,
  .contact-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .occasion-grid,
  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .side-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 120px;
    overflow: auto;
    max-height: none;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .header-cta {
    display: none;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }

  .site-header.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    position: sticky;
    bottom: 12px;
    z-index: 12;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0 14px;
  }

  .page {
    width: min(1160px, calc(100% - 20px));
  }

  .hero h1 {
    font-size: 38px;
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}
