/* Ailyse Designs -- components (look 3A "Pinboard Hero").
   Uses tokens.css only. Base, header (paper bar + stitch line), nav, pin (real), sketch (tinted mask), button,
   polaroid (real frame), board (framed cork), card, pill, note (real post-it label), postit, index-card,
   data table, form, lightbox, phone CTA bar, footer. Phone first. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 var(--t-body)/var(--lh-body) var(--f-sans); color: var(--c-ink);
  background: var(--c-paper); padding-bottom: var(--bar-h); overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
input, textarea, select, button { font-size: 16px; }
a { color: var(--c-rose); text-underline-offset: 3px; }
a:hover { color: var(--c-rose-dark); }
:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 3px; border-radius: var(--r-1); }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; color: var(--c-ink); }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--c-card); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 8px; }
.hand { font: 500 var(--t-hand)/1.15 var(--f-hand); color: var(--c-muted); }
.lede { font-size: 19px; color: var(--c-muted); }

/* ---------- header: calm paper bar + charcoal sketch stitch line ---------- */
.site-head { position: relative; background: var(--c-card); padding: var(--s-3) 0 var(--s-2); margin-bottom: var(--el-stitch-h); }
.site-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--el-stitch-h) * -1); height: var(--el-stitch-h);
  background: var(--c-ink); opacity: .75;
  -webkit-mask: var(--sk-stitch) left center / auto 100% repeat-x; mask: var(--sk-stitch) left center / auto 100% repeat-x;
}
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.lockup-card { display: block; padding: 2px 0; }
.lockup-card img { height: 60px; width: auto; }
.main-nav { flex: 1 1 100%; border-top: 1px solid var(--c-line); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; }
.main-nav a {
  display: flex; align-items: center; min-height: var(--el-tap); padding: 0 7px; color: var(--c-ink);
  font: 700 15px/1 var(--f-sans); text-decoration: none; white-space: nowrap; min-width: var(--el-tap); justify-content: center;
}
.main-nav a:hover { color: var(--c-rose); }
.main-nav a[aria-current="page"] { color: var(--c-rose); text-decoration: underline 2px; text-underline-offset: 6px; }

/* ---------- pin (r2: a CSS push-pin HEAD seen from the front -- it reads as pushed THROUGH the paper because
   no stem is drawn. Colour = --pin-c; .tack = flat brass head. Place it ON the paper, never above the edge.) ---------- */
.pin {
  position: absolute; top: 3px; left: 50%; width: var(--el-pin); margin-left: calc(var(--el-pin) / -2); aspect-ratio: 1; z-index: 4;
  border-radius: 50%; pointer-events: none; --pin-c: var(--c-pin-rose);
  background: radial-gradient(circle at 36% 32%, rgba(255, 255, 255, .5) 0 16%, rgba(255, 255, 255, 0) 36%), var(--pin-c);
  box-shadow: var(--ds-pin);
}
.pin.berry { --pin-c: var(--c-pin-berry); }
.pin.blush { --pin-c: var(--c-pin-blush); }
.pin.plum { --pin-c: var(--c-pin-plum); }
.pin.sage { --pin-c: var(--c-pin-sage); }
.pin.mustard { --pin-c: var(--c-pin-mustard); }
.pin.tack { --pin-c: var(--c-pin-brass); background: radial-gradient(circle at 36% 32%, rgba(255, 250, 228, .65) 0 18%, rgba(255, 250, 228, 0) 40%), var(--pin-c); }

/* ---------- sticker (r2: a sketch-set-2 doodle cut out of paper, taped to the board) ---------- */
.sticker { position: absolute; z-index: 3; width: var(--el-sticker); pointer-events: none; filter: var(--ds-sticker); }
.sticker img { display: block; width: 100%; height: auto; }
.sticker > .washi { top: -9px; left: 50%; width: 64%; margin-left: -32%; transform: rotate(var(--wr, -6deg)); }
.sticker > .pin { top: 4px; width: var(--el-pin-lg); margin-left: calc(var(--el-pin-lg) / -2); }

/* ---------- sketch (charcoal doodle from the kit, tinted by background-color through its alpha) ---------- */
.sk {
  display: inline-block; background-color: var(--c-rose); pointer-events: none;
  -webkit-mask: var(--sk) center / contain no-repeat; mask: var(--sk) center / contain no-repeat;
}
.sk.ink { background-color: var(--c-ink); }
.sk.heart { --sk: var(--sk-heart); aspect-ratio: 179 / 195; }
.sk.tag { --sk: var(--sk-tag); aspect-ratio: 227 / 420; }
.sk.scissors { --sk: var(--sk-scissors); aspect-ratio: 420 / 300; }
.sk.arrow-curve { --sk: var(--sk-arrow-curve); aspect-ratio: 304 / 180; }
.sk.sparkle { --sk: var(--sk-sparkle); aspect-ratio: 197 / 214; }
.sk.divider { --sk: var(--sk-divider); aspect-ratio: 480 / 47; }
.sk.bag { --sk: var(--sk-bag); aspect-ratio: 128 / 98; }
.sk.pincushion { --sk: var(--sk-pincushion); aspect-ratio: 1 / 1; }
.sk.cur { background-color: currentColor; }

/* ---------- button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .28em; min-height: 48px; padding: 0 22px;
  background: var(--c-rose); color: var(--c-white); border: 2px solid var(--c-rose); border-radius: var(--r-pill);
  font: 700 16px/1.2 var(--f-sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--c-rose-dark); border-color: var(--c-rose-dark); color: var(--c-white); }
.btn.ghost { background: transparent; color: var(--c-rose); }
.btn.ghost:hover { background: var(--c-card); color: var(--c-rose-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- polaroid (real frame on top, product photo laid BEHIND its transparent window) ---------- */
.polaroid {
  position: relative; display: block; aspect-ratio: var(--el-polaroid-ratio); margin: 0; color: var(--c-ink); text-decoration: none; container-type: inline-size;
  filter: var(--ds-real); --tint: var(--c-polaroid);
}
.polaroid::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--img-polaroid) center / 100% 100% no-repeat; filter: var(--warm);
}
.polaroid .win {
  position: absolute; z-index: 1; overflow: hidden; background: var(--c-line);
  left: var(--el-polaroid-win-l); top: var(--el-polaroid-win-t); width: var(--el-polaroid-win-w); height: var(--el-polaroid-win-h);
}
.polaroid .win img, .polaroid .win video { width: 100%; height: 100%; object-fit: cover; }
.polaroid .cap {
  position: absolute; z-index: 3; left: 10%; right: 10%; top: 80%; bottom: 3%;
  display: block; text-align: center; overflow: hidden; line-height: 1;   /* r5b: sized to THE POLAROID (cq units), ellipsis if long */
  font: 700 clamp(12px, 12cqw, 23px)/1 var(--f-hand); color: var(--c-ink); white-space: nowrap; text-overflow: ellipsis; padding-top: 2.5cqw;
}
.polaroid .cap.long { font-size: clamp(11px, 10cqw, 20px); }
.polaroid .cap.xlong { font-size: clamp(10px, 8.6cqw, 18px); }
.polaroid > .pin { z-index: 5; }

/* ---------- board (a real corkboard panel: kit cork tile in a thin light-pine frame drawn in CSS) ---------- */
.board {
  position: relative; border: var(--el-frame) solid var(--c-wood-2); border-radius: 4px;
  border-image: linear-gradient(135deg, var(--c-wood-1) 0%, var(--c-wood-2) 22%, var(--c-wood-1) 41%, var(--c-wood-3) 58%, var(--c-wood-2) 74%, var(--c-wood-1) 100%) 1;
  background: linear-gradient(var(--c-cork-veil), var(--c-cork-veil)), var(--c-cork) var(--cork-img, var(--img-cork-hero)) center / cover no-repeat; /* R4: one sized board, never tiled */
  box-shadow: inset 0 2px 10px rgba(43, 38, 34, .45), inset 0 0 0 1px rgba(43, 38, 34, .25), 0 10px 26px rgba(43, 38, 34, .18), 0 2px 3px rgba(43, 38, 34, .2);
}
.board.thin { border-width: var(--el-frame-sm); }

/* ---------- washi tape (real) ---------- */
.washi { position: absolute; z-index: 5; width: 150px; aspect-ratio: 420 / 104; background: var(--img-washi-hearts) center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(43, 38, 34, .2)); pointer-events: none; }
.washi.polka { background-image: var(--img-washi-polka); }
.washi.candy-stripe { background-image: var(--img-washi-candy-stripe); }
.washi.cherry { background-image: var(--img-washi-cherry); }
.washi.daisy { background-image: var(--img-washi-daisy); }
.washi.stars { background-image: var(--img-washi-stars); }
.washi.leopard { background-image: var(--img-washi-leopard); }
.washi.gingham-mint { background-image: var(--img-washi-gingham-mint); }
.washi.rainbow { background-image: var(--img-washi-rainbow); }
/* r2: a polaroid can be taped instead of pinned (craft.js deals it) */
.polaroid > .washi { top: -8px; left: 50%; width: 66%; margin-left: -33%; transform: rotate(var(--wr, -4deg)); }  /* r5c: keeps the tape's own aspect (was stretched 1.3x = soft) */

/* ---------- postit (a real post-it photo; text sits on its measured tint) ---------- */
.postit {
  position: relative; display: grid; align-content: center; justify-items: center; text-align: center; aspect-ratio: 1; color: var(--c-ink); /* r2: text centred */
  background: var(--img-postit-butter) center / 100% 100% no-repeat; filter: var(--ds-real); --tint: var(--c-postit-butter);
}
.postit.blush { background-image: var(--img-postit-blush); --tint: var(--c-postit-blush); }
.postit.sage { background-image: var(--img-postit-sage); --tint: var(--c-postit-sage); }

/* ---------- paper card (real kit index card, warmed) ---------- */
.paper-card { position: relative; isolation: isolate; color: var(--c-ink); --tint: var(--c-indexcard); }
.paper-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; filter: var(--warm) drop-shadow(0 2px 2px rgba(43, 38, 34, .25)) drop-shadow(0 8px 12px rgba(43, 38, 34, .16));
  /* 9-slice: the red rule + first line stay at the top; the ruled middle repeats whole lines (27 px period in the
     source) so a card of any height keeps evenly ruled paper instead of stretched lines */
  border: solid transparent; border-width: 70px 19px 39px;
  border-image: var(--img-indexcard) 88 24 49 fill / 70px 19px 39px / 0 stretch round;
}

/* ---------- card (shop tile: clean white mat + tinted pin, plain caption underneath) ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-4); }
.card { position: relative; }
.card > a { display: block; color: inherit; text-decoration: none; }
.card .mat { position: relative; display: block; background: var(--c-white); padding: 7px; border-radius: 2px; box-shadow: var(--sh-1); transition: transform .2s ease, box-shadow .2s ease; }
.card .mat img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--c-line); }
.card .mat .pin { top: 3px; }
.card:nth-child(6n+2) .mat .pin { --pin-c: var(--c-pin-berry); }
.card:nth-child(6n+3) .mat .pin { --pin-c: var(--c-pin-mustard); }
.card:nth-child(6n+4) .mat .pin { --pin-c: var(--c-pin-plum); }
.card:nth-child(6n+5) .mat .pin { --pin-c: var(--c-pin-blush); }
.card:nth-child(6n+6) .mat .pin { --pin-c: var(--c-pin-sage); }
.card:nth-child(3n+2) .mat .pin { margin-left: -16px; }
.card:nth-child(3n+3) .mat .pin { margin-left: -3px; }
.card:nth-child(4n+1) .mat { transform: rotate(-.8deg); }
.card:nth-child(4n+2) .mat { transform: rotate(.4deg); }
.card:nth-child(4n+3) .mat { transform: rotate(.7deg); }
.card:nth-child(4n+4) .mat { transform: rotate(-.4deg); }
.card > a:hover .mat, .card > a:focus-visible .mat { transform: rotate(0) translateY(-3px); box-shadow: var(--sh-2); }
.card .meta { display: block; padding: var(--s-3) 2px 0; }
.card .name { display: block; font: 700 16px/1.3 var(--f-sans); color: var(--c-ink); }
.card > a:hover .name { color: var(--c-rose); text-decoration: underline; }
.card .sub { display: block; font-size: var(--t-small); color: var(--c-muted); }
.card .flags { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; z-index: 2; }

/* ---------- pill ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); background: var(--c-white); color: var(--c-ink); border: 1.5px solid var(--c-ink); font: 700 13px/1.3 var(--f-sans); }
.pill.nfs { background: var(--c-ink); color: var(--c-white); }

/* ---------- note (section label: a small real post-it, slight tilt, Caveat on its tint) ---------- */
.label-row { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
.label-row h1, .label-row h2 { margin: 0; }
/* R4: a rose stitched divider (sketch set 2) under every section heading */
.label-row h1::after, .label-row h2::after {
  content: ""; display: block; width: var(--el-divider-w); max-width: 70%; aspect-ratio: 480 / 47; margin-top: 6px;
  background-color: var(--c-rose); opacity: .7; -webkit-mask: var(--sk-divider) left center / contain no-repeat; mask: var(--sk-divider) left center / contain no-repeat;
}
.label-row p { margin: 4px 0 0; color: var(--c-muted); }
.note {
  flex: 0 0 auto; width: var(--el-postit-sm); height: var(--el-postit-sm); display: grid; place-items: center; padding: 8px;
  background: var(--img-postit-blush) center / 100% 100% no-repeat; filter: var(--ds-real); transform: rotate(-3deg);
  font: 700 26px/1 var(--f-hand); color: var(--c-ink); text-align: center; --tint: var(--c-postit-blush);
}
.note.butter { background-image: var(--img-postit-butter); transform: rotate(2.5deg); --tint: var(--c-postit-butter); }
.note.sage { background-image: var(--img-postit-sage); transform: rotate(-1.5deg); --tint: var(--c-postit-sage); }

/* ---------- index card ---------- */
.index-card {
  position: relative; background: var(--c-card); border-radius: var(--r-1); box-shadow: var(--sh-1);
  padding: var(--s-6) var(--s-5) var(--s-5); border-top: 3px solid var(--c-index-rule);
}
.index-card > .pin { top: 5px; width: var(--el-pin-lg); margin-left: calc(var(--el-pin-lg) / -2); }

/* ---------- data table (lives on an index card) ---------- */
.data { width: 100%; border-collapse: collapse; margin: 0 0 var(--s-5); font-size: 16px; }
.data th, .data td { text-align: left; vertical-align: top; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.data th { width: 38%; padding-right: var(--s-3); font-weight: 700; color: var(--c-muted); }
.data tr:last-child th, .data tr:last-child td { border-bottom: 0; }

/* ---------- form ---------- */
.choice { display: flex; gap: var(--s-2); border: 0; margin: 0 0 var(--s-4); padding: 0; min-width: 0; }
.choice legend { font: 700 17px/1.4 var(--f-sans); margin-bottom: 10px; padding: 0; }
.choice label { flex: 1 1 0; position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px 6px;
  background: var(--c-white); color: var(--c-ink); font: 700 15px/1.2 var(--f-sans); border: 1.5px solid var(--c-line); border-radius: var(--r-2);
}
.choice input:checked + span { border-color: var(--c-rose); box-shadow: inset 0 0 0 1.5px var(--c-rose); background: #fbeff1; }
.choice input:focus-visible + span { outline: 3px solid var(--c-ink); outline-offset: 2px; }
.field { display: block; margin: 0 0 14px; }
.field > span.lbl { display: block; font-weight: 700; line-height: 1.75em; }
.field small { font-weight: 400; color: var(--c-muted); }
.field input, .field textarea {
  width: 100%; font: 400 17px/1.5 var(--f-sans); color: var(--c-ink); background: var(--c-white); min-height: 48px;
  border: 1.5px solid var(--c-muted); border-radius: var(--r-2); padding: 10px 12px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--c-rose); outline-offset: 1px; border-color: var(--c-rose); }
.field .err { display: block; color: var(--c-rose-dark); font-weight: 700; font-size: 15px; margin-top: 4px; }
.field .err:empty { display: none; }
.field [aria-invalid="true"] { border-color: var(--c-rose-dark); border-width: 2px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { margin-top: 14px; }
.status.show { padding: 14px 16px; background: var(--c-white); border: 1.5px solid var(--c-rose); border-radius: var(--r-2); }

/* ---------- lightbox ---------- */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
dialog.lightbox::backdrop { background: rgba(31, 27, 24, .92); }
.lb-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 8px 72px; }
.lb-inner figure { margin: 0; background: var(--c-white); padding: 10px 10px 0; max-width: min(96vw, 1100px); }
.lb-inner img { max-height: calc(100vh - 190px); width: auto; margin: 0 auto; }
.lb-inner figcaption { font: 700 16px/1.3 var(--f-sans); color: var(--c-ink); padding: 10px 4px 12px; text-align: center; }
.lb-btn { position: absolute; min-width: 48px; min-height: 48px; border-radius: 50%; border: 2px solid var(--c-white); background: var(--c-ink); color: var(--c-white); font: 700 24px/1 var(--f-sans); cursor: pointer; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 8px; bottom: 12px; }
.lb-next { right: 8px; bottom: 12px; }
.lb-btn:focus-visible { outline: 3px solid var(--c-butter); outline-offset: 2px; }

/* ---------- phone CTA bar ---------- */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 10px var(--gutter); background: var(--c-card); border-top: 1px solid var(--c-line); box-shadow: 0 -4px 14px rgba(43, 38, 34, .1);
}
.cta-bar .price { font-weight: 700; }
.has-bar { --bar-h: 72px; }

/* ---------- footer ---------- */
.site-foot { background: var(--c-kraft); margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-6); text-align: center; }
.site-foot img.lockup { width: 150px; height: auto; margin: 0 auto var(--s-3); }
.site-foot p { margin: 0 0 var(--s-2); color: var(--c-muted); font-size: var(--t-small); }
.site-foot p a { color: var(--c-rose-dark); }
.site-foot nav ul { list-style: none; margin: var(--s-3) 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--s-2); }
.site-foot nav a { display: inline-flex; align-items: center; min-height: var(--el-tap); padding: 0 8px; color: var(--c-ink); font-weight: 700; }

@media (min-width: 900px) {
  .site-head { padding: var(--s-4) 0; }
  .site-head .wrap { flex-wrap: nowrap; }
  .lockup-card img { height: 78px; }
  .main-nav { flex: 0 1 auto; border-top: 0; }
  .main-nav ul { gap: var(--s-2); padding: 0 var(--s-3); }
  .main-nav a { padding: 0 12px; font-size: 16px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-7) var(--s-6); }
  .cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-7) var(--s-5); }
  .note { width: var(--el-postit); height: var(--el-postit); font-size: 29px; }
  .washi { width: 190px; }
  .cta-bar { display: none; }
  .has-bar { --bar-h: 0px; }
}
@media (max-width: 370px) { .main-nav a { padding: 0 4px; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
