/* Happy Birthday Images — design tokens + components */
:root {
  --bg: #fff8f1;
  --surface: #ffffff;
  --surface-2: #fdf0e6;
  --ink: #2a1b2e;
  --ink-2: #4c3a52;
  --muted: #7a6a7f;
  --line: #efdfd2;
  --coral: #e8505b;
  --coral-ink: #c7353f;
  --gold: #f2b544;
  --plum: #6b3fa0;
  --accent: var(--coral);
  --accent-soft: #fde4e2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(42,27,46,.05), 0 10px 30px -12px rgba(42,27,46,.18);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18121c; --surface: #221a27; --surface-2: #2b2131; --ink: #f6eef2; --ink-2: #dcccdf;
    --muted: #a897ab; --line: #3a2e40; --accent-soft: #3a2228; --coral-ink: #ff8a92;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

/* theme accents for wish pages */
.theme-rose    { --accent: #e8505b; --accent-soft: #fde4e2; }
.theme-sunrise { --accent: #ec7a2c; --accent-soft: #fde8d6; }
.theme-ocean   { --accent: #1f7fb8; --accent-soft: #dcecf6; }
.theme-mint    { --accent: #14876b; --accent-soft: #d8f1e9; }
.theme-plum    { --accent: #7b45b5; --accent-soft: #ece1f7; }
.theme-gold    { --accent: #b9831b; --accent-soft: #f8ecd2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [class*="theme-"] { --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.45rem, 2.8vw, 1.9rem); margin: 1.6em 0 .5em; }
h3 { font-size: 1.15rem; margin: 0 0 .3em; }
p { margin: 0 0 1em; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink);
  font: 600 .98rem/1 var(--font-body); padding: .9em 1.35em; border-radius: 999px;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s, color .15s;
  min-height: 46px;
}
.btn:hover { transform: translateY(-1px); color: var(--bg); background: var(--coral-ink); border-color: var(--coral-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-sm { padding: .6em 1em; font-size: .88rem; min-height: 38px; }
.chip {
  font: 600 .8rem/1 var(--font-body); background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: .55em .9em; cursor: pointer; text-decoration: none;
  min-height: 34px; display: inline-flex; align-items: center;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-done { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; }
.brand-text { font: 650 1.15rem/1 var(--font-display); letter-spacing: -.01em; }
.brand-text em { font-style: italic; color: var(--coral-ink); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .55em .8em; border-radius: 10px; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.site-nav .btn { margin-left: 8px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 66px; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 18px; }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: .9em .6em; }
  .site-nav .btn { margin: 8px 0 0; }
}

/* Hero */
.hero { padding: 40px 0 24px; overflow: hidden; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; padding-top: 24px; padding-bottom: 24px; } }
.eyebrow { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--coral-ink); margin-bottom: .6em; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); }
.hero h1 em { color: var(--coral-ink); }
.lede { font-size: 1.12rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-art { position: relative; height: 380px; max-width: 460px; width: 100%; margin: 0 auto; }
.hero-card { position: absolute; width: 58%; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card-a { left: 4%; top: 6%; transform: rotate(-6deg); }
.hero-card-b { right: 4%; top: 14%; transform: rotate(5deg); }
@media (min-width: 900px) { .hero-art { height: 470px; } }

/* Blocks */
.block { padding: 28px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-head h2 { margin-top: .4em; }
.link-more { font-weight: 600; white-space: nowrap; }
.page-head { max-width: 760px; padding: 8px 0 20px; }

/* Topic cards */
.topic-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .topic-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.topic-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .18s, box-shadow .18s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.topic-card img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.topic-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--accent); }
.topic-title { font-weight: 700; font-size: .98rem; line-height: 1.3; }
.topic-meta { font-size: .8rem; color: var(--muted); }

/* Guides */
.guide-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.guide-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: transform .18s, box-shadow .18s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.guide-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--plum); }
.guide-title { font: 650 1.22rem/1.25 var(--font-display); }
.guide-excerpt { color: var(--ink-2); font-size: .95rem; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #2a1b2e; font-weight: 700; margin-bottom: 10px; }
.steps p { color: var(--ink-2); margin: 0; font-size: .96rem; }

/* Images */
.image-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .image-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .image-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.image-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.image-item img, .image-link img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.image-link { border-radius: var(--radius); overflow: hidden; display: block; border: 1px solid var(--line); transition: transform .18s; }
.image-link:hover { transform: translateY(-3px); }
.image-item figcaption { display: flex; gap: 6px; padding: 10px; flex-wrap: wrap; }
.image-item figcaption .btn { flex: 1 1 auto; }

/* Article */
.article { padding-bottom: 40px; }
.article > * { max-width: 820px; }
.article > .image-set, .article > .related { max-width: none; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 0 0; margin: 0; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.article-head { padding: 6px 0 4px; }
.article-meta { font-size: .88rem; color: var(--muted); font-weight: 600; }
.toc { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 16px 20px; margin: 18px 0 8px; }
.toc strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2 260px; column-gap: 28px; }
.toc li { margin: 3px 0; break-inside: avoid; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* Messages */
.msg-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: msg; }
.msg { counter-increment: msg; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 18px 14px 56px; }
.msg::before { content: counter(msg); position: absolute; left: 16px; top: 18px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 .78rem/26px var(--font-body); text-align: center; }
.msg-text { margin: 0 0 10px; font-size: 1.03rem; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.prose { max-width: 760px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: .35em 0; }
.example { margin: 1em 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 1.08rem; font-style: italic; }
.example-label { display: block; font: 700 .72rem/1 var(--font-body); font-style: normal; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.takeaways { background: var(--accent-soft); border-radius: var(--radius); padding: 6px 24px 14px; margin: 28px 0; }
.takeaways h2 { margin-top: .8em; font-size: 1.3rem; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); padding-bottom: 6px; }

/* CTA + promo */
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 26px 28px; margin: 36px 0; }
.cta-band h2 { color: var(--bg); margin: 0 0 4px; font-size: 1.5rem; }
.cta-band p { margin: 0; opacity: .85; max-width: 520px; }
.cta-band .btn { background: var(--gold); color: #2a1b2e; border-color: var(--gold); }
.cta-band .btn:hover { background: #fff; border-color: #fff; color: #2a1b2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta-band { background: var(--surface-2); color: var(--ink); } :root:not([data-theme="light"]) .cta-band h2 { color: var(--ink); } }
.app-promo { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 28px 0; }
.app-promo p { margin: 0; }
.related h2 { font-size: 1.4rem; }

/* Ads */
.ad-wrap { margin: 28px 0; min-height: 120px; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 4px; }

/* Contact */
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 20px 0; }
.contact-card p { margin: 0 0 4px; }
.contact-email { font: 650 1.3rem/1.3 var(--font-display); word-break: break-all; }
.center-block { text-align: center; padding: 70px 16px; }
.center-block .hero-actions { justify-content: center; }

/* Card maker */
.maker { display: grid; gap: 22px; align-items: start; margin-bottom: 20px; }
@media (min-width: 960px) { .maker { grid-template-columns: minmax(0, 1fr) 400px; } }
.maker-preview { background: var(--surface-2); border-radius: var(--radius); padding: 18px; display: grid; place-items: center; }
@media (min-width: 960px) { .maker-preview { position: sticky; top: 86px; } }
#card-canvas { width: 100%; max-width: 520px; height: auto; border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
.maker-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; }
.maker-panel fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.maker-panel legend { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; padding: 0; }
.maker-panel label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.maker-panel input[type="text"], .maker-panel textarea, .maker-panel select {
  display: block; width: 100%; margin-top: 5px; font: 400 16px/1.4 var(--font-body); color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: .7em .85em;
}
.maker-panel textarea { resize: vertical; min-height: 96px; }
.maker-panel input:focus, .maker-panel textarea:focus, .maker-panel select:focus { border-color: var(--coral); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row-2 legend { grid-column: 1 / -1; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { aspect-ratio: 4/5; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; overflow: hidden; background: var(--surface-2); }
.swatch canvas { width: 100%; height: 100%; display: block; }
.swatch[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--coral); }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { margin: 0 !important; }
.maker-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.maker-actions .btn { flex: 1 1 140px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem; transition: all .25s; pointer-events: none; z-index: 50; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 20px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-h { font: 700 .78rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 6px 0 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 6px 0; }
.footer-links a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.footer-links a:hover { color: var(--coral-ink); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 24px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
.about-teaser { max-width: var(--wrap); }
.about-teaser > * { max-width: 760px; }
