:root {
  --parchment: #FBF6EA;
  --parchment-deep: #F3EAD6;
  --ink: #212B38;
  --ink-soft: #4C5768;
  --gold: #A8853B;
  --gold-bright: #C6A75C;
  --line: #E4D9BE;
  --white: #FFFDF7;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Assistant', system-ui, sans-serif;
  --hebrew: 'Frank Ruhl Libre', 'Assistant', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--parchment) 88%, white);
  position: sticky; top: 0; z-index: 20;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.5rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink);
}
.wordmark::after { content: '·'; color: var(--gold); margin-left: 0.35em; }
.header-note { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; cursor: pointer;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 11px 22px; border-radius: 2px; transition: all 0.18s ease;
  background: none; text-align: center;
}
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #8f6f2f; }
.btn-quiet { border-color: var(--gold); color: var(--gold); }
.btn-quiet:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.btn-big { padding: 14px 28px; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 5vw, 72px);
  align-items: center; padding: clamp(36px, 7vw, 90px) clamp(18px, 4vw, 48px);
  max-width: 1200px; margin: 0 auto;
}
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 14px;
}
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.12; }
.lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 46ch; margin: 18px 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-points { list-style: none; padding: 0; margin: 30px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.hero-points li { padding: 5px 0 5px 22px; position: relative; }
.hero-points li::before { content: '✦'; position: absolute; left: 0; color: var(--gold); font-size: 0.7rem; top: 9px; }

.hero-card { display: flex; justify-content: center; }
.mini-hero { transform: rotate(2.5deg); }
.mini-hero:hover { transform: rotate(0deg); }
.mini-hero { transition: transform 0.35s ease; }

/* ---------- gallery ---------- */
.designs { padding: clamp(30px, 5vw, 60px) clamp(18px, 4vw, 48px) 30px; max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: var(--ink-soft); margin: 8px 0 0; }
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.gallery-item {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 22px 18px 20px; background: var(--white);
  border: 1px solid var(--line); border-radius: 3px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(60, 45, 10, 0.12); }
.gallery-meta { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.design-no { font-size: 0.72rem; letter-spacing: 0.24em; color: var(--gold); text-transform: uppercase; }
.design-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.design-desc { font-size: 0.84rem; color: var(--ink-soft); }
.design-cta { margin-top: 8px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }

/* mini card scaling */
.mini { width: 250px; height: 350px; overflow: hidden; position: relative; }
.mini .card { transform: scale(0.595); transform-origin: top left; position: absolute; top: 0; left: 0; }
.mini-hero { width: 320px; height: 448px; }
.mini-hero .card { transform: scale(0.762); }

/* ---------- how ---------- */
.how {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: 1000px; margin: 0 auto; padding: clamp(30px, 5vw, 70px) clamp(18px, 4vw, 48px);
}
.how-step { text-align: center; border-top: 1px solid var(--gold); padding-top: 18px; }
.how-step span { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.how-step p { color: var(--ink-soft); font-size: 0.92rem; margin: 6px 0 0; }

.site-footer {
  border-top: 1px solid var(--line); text-align: center;
  padding: 26px; font-size: 0.85rem; color: var(--ink-soft);
}

/* ---------- editor ---------- */
.editor-layout {
  display: grid; grid-template-columns: 1fr minmax(320px, 420px);
  gap: clamp(20px, 4vw, 60px);
  max-width: 1200px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(18px, 4vw, 48px);
  align-items: start;
}
.form-title { font-size: 1.7rem; margin-bottom: 18px; }
.field { display: block; margin-bottom: 15px; }
.field > span, .field-label {
  display: block; font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 5px;
}
.field em { text-transform: none; letter-spacing: 0; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 2px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 0.92rem; color: var(--ink-soft); cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }

.theme-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); cursor: pointer; color: var(--ink-soft);
}
.pill.active { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 1px var(--gold); }
.pill-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); }
[data-swatch="gilded"] { background: linear-gradient(135deg, #FDF8EC 50%, #B08D3E 50%); }
[data-swatch="royal"]  { background: linear-gradient(135deg, #182645 50%, #C9A961 50%); }
[data-swatch="garden"] { background: linear-gradient(135deg, #FFF9F5 50%, #C98A8E 50%); }
[data-swatch="ivory"]  { background: linear-gradient(135deg, #FFFDF8 50%, #2E3238 50%); }
[data-swatch="estate"] { background: linear-gradient(135deg, #571C27 50%, #D9BE84 50%); }
[data-swatch="sky"]    { background: linear-gradient(135deg, #EAF2F7 50%, #6E88A3 50%); }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.form-hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 10px; }

.editor-preview {
  position: sticky; top: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 18px;
}
.preview-frame { filter: drop-shadow(0 18px 40px rgba(60, 45, 10, 0.18)); }

/* ---------- notfound ---------- */
.notfound { text-align: center; padding: 90px 20px; }
.notfound h1 { font-size: 2rem; margin-bottom: 10px; }
.notfound p { color: var(--ink-soft); margin-bottom: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-points { text-align: left; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-preview { position: static; order: -1; }
  .how { grid-template-columns: 1fr; max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- editor header & download flow ---------- */
.editor-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.btn-back { justify-self: start; padding: 8px 14px; font-size: 0.8rem; }
.editor-title { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.wordmark-small { font-family: var(--serif); font-weight: 700; letter-spacing: 0.12em; font-size: 1.05rem; text-transform: uppercase; }
.design-tag {
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  background: var(--parchment-deep); color: var(--ink-soft);
  padding: 2px 10px; border-radius: 999px;
}
.header-spacer { justify-self: end; }

.btn-download { width: 100%; max-width: 420px; }
.save-note { font-size: 0.8rem; color: var(--ink-soft); text-align: center; max-width: 40ch; margin: 0; }
.form-sub { color: var(--ink-soft); font-size: 0.9rem; margin: -10px 0 18px; }
#resetBtn { margin-top: 14px; }
