/* Foldycard blog: same paper, ink and colour as the card maker */
:root {
  color-scheme: light;
  --page: #e4e1ff; --page-2: #f1efff; --paper: #ffffff; --ink: #23173f; --muted: #5f557a; --soft: #cfc9ea;
  --coral: #ff5d7d; --sun: #ffd23f;
  --ring: 0 0 0 3px var(--sun), 0 0 0 4.5px var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 18px/1.65 'Bricolage Grotesque', system-ui, sans-serif; font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
button, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-left)); }
.wide { max-width: 1040px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 6px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 1.35rem; letter-spacing: -.035em; }
.brand img { width: 32px; height: 32px; }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { text-decoration: none; font-weight: 700; font-size: .92rem; padding: 7px 12px; border-radius: 999px; }
.top nav a:hover { background: var(--page-2); }
.top nav a.cta { background: var(--coral); border: 1.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }

/* ---------- article ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin: 18px 0 8px; }
.crumbs a { color: var(--muted); }
article h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; margin: 0 0 14px; text-wrap: balance; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 14px; }
.byline { font-size: .88rem; color: var(--muted); margin: 0 0 22px; }
article h2 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -.025em; font-weight: 800; margin: 46px 0 10px; scroll-margin-top: 16px; text-wrap: balance; }
article h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; margin: 28px 0 8px; }
article p, article li { max-width: 66ch; }
article ul, article ol { padding-left: 1.25em; }
article li { margin: 6px 0; }

.disclosure { font-size: .88rem; background: #fff6cc; border: 1.5px solid var(--ink); border-radius: 12px; padding: 10px 14px; margin: 0 0 22px; }

.toc { background: var(--page-2); border-radius: 16px; padding: 14px 18px; margin: 10px 0 8px; }
.toc strong { display: block; font-size: .95rem; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 28px; font-size: .95rem; }
.toc li { margin: 3px 0; break-inside: avoid; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; position: sticky; top: 0; z-index: 2; padding: 10px 0; background: var(--page); }
.chip { all: unset; cursor: pointer; font-size: .9rem; font-weight: 700; padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip:focus-visible { box-shadow: var(--ring); }

/* message slips: each one reads like a line written in a card */
.msgs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.msg {
  max-width: none; margin: 0; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 var(--ink);
  padding: 16px 18px 12px;
}
.msg q { display: block; quotes: none; font-family: Fraunces, Georgia, serif; font-size: 1.12rem; line-height: 1.5; }
.msg-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mbtn {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; border: 1.5px solid var(--soft); background: var(--paper); text-decoration: none; color: var(--ink);
}
.mbtn:hover { border-color: var(--ink); }
.mbtn.send { border-color: var(--ink); background: var(--coral); }
.mbtn svg { width: 14px; height: 14px; }
.mbtn:focus-visible { box-shadow: var(--ring); }
[hidden] { display: none !important; }

.tip { background: var(--paper); border: 1.5px dashed var(--ink); border-radius: 16px; padding: 14px 18px; margin: 22px 0; }
.tip strong { display: block; margin-bottom: 2px; }

/* the formula */
.formula { list-style: none; padding: 0; counter-reset: f; display: grid; gap: 10px; }
.formula li { counter-increment: f; position: relative; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 16px; padding: 12px 16px 12px 58px; margin: 0; max-width: none; }
.formula li::before { content: counter(f); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--sun); border: 1.5px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.example { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; line-height: 1.55; background: #fffdf6; border-left: 4px solid var(--coral); padding: 12px 16px; border-radius: 0 12px 12px 0; margin: 14px 0; white-space: pre-line; }

/* message builder */
.builder { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); padding: 18px; margin: 18px 0 8px; }
.builder h3 { margin: 0 0 10px; }
.builder .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .builder .row { grid-template-columns: 1fr; } }
.builder label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 700; }
.builder select, .builder textarea { width: 100%; border: 1.5px solid var(--soft); border-radius: 12px; padding: 10px 12px; background: #fff; }
.builder textarea { margin-top: 12px; min-height: 120px; resize: vertical; font-family: Fraunces, Georgia, serif; font-size: 1.08rem; line-height: 1.5; }
.builder .msg-actions { margin-top: 10px; }

/* gift picks */
.pick { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); padding: 18px 20px; margin: 18px 0; }
.pick h3 { margin: 0 0 6px; }
.pick p { margin: 8px 0; }
.pick dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: .95rem; }
.pick dt { font-weight: 800; }
.pick dd { margin: 0; color: var(--muted); }
.pick .pair { background: var(--page-2); border-radius: 14px; padding: 10px 14px; margin-top: 12px; }
.pick .pair q { display: block; quotes: none; font-family: Fraunces, Georgia, serif; font-size: 1.05rem; line-height: 1.5; margin: 4px 0 8px; }
.shop { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; padding: 9px 15px; border-radius: 12px; border: 1.5px solid var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--ink); text-decoration: none; }
.shop:active { transform: translateY(3px); box-shadow: none; }

/* closing call to action */
.send-cta { margin: 48px 0 24px; background: var(--ink); color: #fff; border-radius: 22px; padding: 24px; display: grid; gap: 10px; }
.send-cta h2 { color: #fff; margin: 0; font-size: 1.5rem; }
.send-cta p { margin: 0; color: #dcd6f5; }
.send-cta a { justify-self: start; display: inline-block; margin-top: 6px; padding: 12px 18px; border-radius: 14px; background: var(--coral); color: var(--ink); font-weight: 800; text-decoration: none; border: 1.5px solid #fff; }

.related { margin: 10px 0 30px; }
.related h2 { font-size: 1.2rem; margin: 0 0 8px; }
.related ul { margin: 0; }

footer { border-top: 1.5px solid var(--soft); margin-top: 30px; padding: 18px 0 34px; font-size: .85rem; color: var(--muted); }
footer p { margin: 4px 0; }

/* ---------- blog index ---------- */
.index-head h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; margin: 22px 0 10px; }
.index-head p { color: var(--muted); font-size: 1.12rem; margin: 0 0 22px; max-width: 58ch; }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding-bottom: 20px; }
.post { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start; text-decoration: none; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); padding: 16px; transition: transform .2s; }
.post:hover { transform: translateY(-2px); }
.post h2 { font-size: 1.15rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.015em; }
.post p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.mini { position: relative; aspect-ratio: 5 / 7; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--ink); background: var(--cover-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; container-type: inline-size; transform: rotate(-3deg); }
.mini-bg { position: absolute; inset: 0; } .mini-bg svg { width: 100%; height: 100%; display: block; }
.mini-art { position: relative; width: 62%; } .mini-art svg { display: block; width: 100%; height: auto; }
.mini-title { position: relative; margin-top: 3px; font-family: var(--f-title, Georgia, serif); font-weight: var(--f-title-w, 600); font-style: var(--f-title-st, normal); letter-spacing: var(--f-title-ls, 0); line-height: var(--f-title-lh, .95); text-align: center; color: var(--cover-ink); font-size: calc(13cqw * var(--f-title-scale, 1)); }

.flame { transform-box: fill-box; transform-origin: 50% 90%; animation: flicker 1.8s ease-in-out infinite; }
.glow { animation: glow 2.6s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1,1); } 50% { transform: scale(.95,1.06); } }
@keyframes glow { 0%,100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .flame, .glow, .post { animation: none; transition: none; } }

/* anniversary gifts by year */
.years { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.years li { margin: 0; background: var(--paper); border: 1.5px solid var(--soft); border-radius: 12px; padding: 8px 12px; font-size: .95rem; }
