/* =========================================================================
   GreetByMail
   Direction: the post office counter. Envelope stock, airmail chevrons,
   perforated stamp edges, a rubber postmark. Cards are the only colour that
   shouts; the furniture around them stays quiet.
   ========================================================================= */

:root {
  --paper:      #EFF2F7;   /* envelope stock */
  --surface:    #FFFFFF;
  --ink:        #131F35;
  --ink-soft:   #5A6A85;
  --red:        #C8102E;   /* airmail red */
  --blue:       #1F4FA8;   /* airmail blue */
  --seal:       #A9812C;   /* wax seal gold, used once or twice */
  --sun:        #F6B93B;   /* the livelier palette: picked up from the painted cards */
  --leaf:       #3E9B5F;
  --sky:        #5DA9E9;
  --rose:       #EF7A85;
  --plum:       #8E6CC3;
  --line:       rgba(19, 31, 53, .14);
  --line-soft:  rgba(19, 31, 53, .07);

  --display: "Bodoni Moda", Didot, "Times New Roman", serif;
  --body:    "Karla", "Helvetica Neue", Arial, sans-serif;
  --label:   "Archivo Narrow", "Arial Narrow", Arial, sans-serif;

  --wrap: 1180px;
  --gap: 24px;
  --radius: 2px;
  --shadow: 0 1px 2px rgba(19,31,53,.06), 0 10px 28px rgba(19,31,53,.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--body);
  letter-spacing: .002em;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 32px, 760px); margin-inline: auto; }

.stack > * + * { margin-top: 14px; }

/* ---------------------------------------------------------------- type ---- */

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -.012em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 56ch; }

.label {
  font-family: var(--label);
  font-size: .74rem;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
}
.label--red { color: var(--red); }

.rule-label {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.rule-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------ airmail ---- */
/* The signature: the red/blue chevron band off an airmail envelope. */

.airmail {
  height: 7px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 9px,
    var(--paper) 9px 18px,
    var(--blue) 18px 27px,
    var(--paper) 27px 36px
  );
}
.airmail--thin { height: 5px; }
.airmail--onwhite {
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 9px,
    #fff 9px 18px,
    var(--blue) 18px 27px,
    #fff 27px 36px
  );
}

/* ------------------------------------------------------------ postmark --- */

.postmark {
  display: inline-grid;
  place-items: center;
  width: 92px; height: 92px;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: .1em;
  line-height: 1.15;
  text-align: center;
  font-size: .6rem;
  transform: rotate(-11deg);
  opacity: .78;
  position: relative;
}
.postmark::before {
  content: ""; position: absolute; inset: 5px;
  border: 1px dashed currentColor; border-radius: 50%; opacity: .55;
}
.postmark b { display: block; font-size: .82rem; letter-spacing: .06em; }

/* ---------------------------------------------------------------- nav ---- */

.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, #fff);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead__bar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 0;
}
.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; margin-right: auto; }
.brand__mark {
  font-family: var(--display); font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em;
}
.brand__mark em { font-style: italic; color: var(--red); }
.brand__sub { font-family: var(--label); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  text-decoration: none; font-size: .93rem; color: var(--ink);
  padding-bottom: 3px; border-bottom: 1.5px solid transparent;
}
.nav a:hover, .nav a:focus-visible { border-bottom-color: var(--red); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  padding: 8px 12px; font-family: var(--label); text-transform: uppercase;
  letter-spacing: .14em; font-size: .72rem; border-radius: var(--radius); cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 6px 16px 14px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
}

/* --------------------------------------------------------------- hero ---- */
/* The page opens as a piece of mail addressed to the reader. */

.hero { padding: 40px 0 56px; }
.envelope {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.envelope__flap { }
.envelope__body {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 40px;
  padding: 46px 44px 44px;
  align-items: center;
}
.envelope__address { max-width: 34rem; }
.envelope__address h1 { margin: 14px 0 18px; }
.envelope__address h1 em { font-style: italic; color: var(--red); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__note {
  margin-top: 22px; font-size: .86rem; color: var(--ink-soft);
  display: flex; gap: 8px; align-items: center;
}
.hero__note::before {
  content: ""; width: 26px; height: 1px; background: var(--red); flex: none;
}

.hero__stamp { position: relative; display: grid; place-items: center; }
.hero__stamp .stamp { width: min(100%, 260px); transform: rotate(2.2deg); }
.hero__stamp .postmark { position: absolute; right: -8px; bottom: 4px; }

@media (max-width: 900px) {
  .envelope__body { grid-template-columns: 1fr; gap: 30px; padding: 30px 22px 34px; }
  .hero__stamp { order: -1; justify-items: start; }
  .hero__stamp .stamp { width: min(72%, 220px); }
  .hero__stamp .postmark { right: auto; left: 58%; bottom: 0; width: 76px; height: 76px; }
}

/* -------------------------------------------------------------- stamp ---- */
/* Perforated edge. If a browser can't mask, it degrades to a plain frame. */

.stamp {
  display: block;              /* a size container needs a definite width, so
                                  never let this shrink-to-fit               */
  text-decoration: none;       /* it is often a link wrapping card text      */
  background: var(--surface);
  padding: 11px;
  filter: drop-shadow(0 6px 18px rgba(19,31,53,.14));
}
a.stamp, a.stamp * { text-decoration: none; }

/* Perforation is applied only where the browser can composite masks; without
   it the card simply keeps its plain white frame. */
@supports (mask-composite: intersect) {
  .stamp {
    --d: 13px;
    -webkit-mask:
      radial-gradient(circle calc(var(--d)/2) at 50% 0,    #0000 96%, #000) 50% 0   / var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 50% 100%, #0000 96%, #000) 50% 100%/ var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 0 50%,    #0000 96%, #000) 0 50%   / 100% var(--d) repeat-y,
      radial-gradient(circle calc(var(--d)/2) at 100% 50%, #0000 96%, #000) 100% 50%/ 100% var(--d) repeat-y;
    -webkit-mask-composite: source-in;
    mask:
      radial-gradient(circle calc(var(--d)/2) at 50% 0,    #0000 96%, #000) 50% 0   / var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 50% 100%, #0000 96%, #000) 50% 100%/ var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 0 50%,    #0000 96%, #000) 0 50%   / 100% var(--d) repeat-y,
      radial-gradient(circle calc(var(--d)/2) at 100% 50%, #0000 96%, #000) 100% 50%/ 100% var(--d) repeat-y;
    mask-composite: intersect;
  }
  .tile__stamp {
    --d: 11px;
    -webkit-mask:
      radial-gradient(circle calc(var(--d)/2) at 50% 0,    #0000 96%, #000) 50% 0   / var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 50% 100%, #0000 96%, #000) 50% 100%/ var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 0 50%,    #0000 96%, #000) 0 50%   / 100% var(--d) repeat-y,
      radial-gradient(circle calc(var(--d)/2) at 100% 50%, #0000 96%, #000) 100% 50%/ 100% var(--d) repeat-y;
    -webkit-mask-composite: source-in;
    mask:
      radial-gradient(circle calc(var(--d)/2) at 50% 0,    #0000 96%, #000) 50% 0   / var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 50% 100%, #0000 96%, #000) 50% 100%/ var(--d) 100% repeat-x,
      radial-gradient(circle calc(var(--d)/2) at 0 50%,    #0000 96%, #000) 0 50%   / 100% var(--d) repeat-y,
      radial-gradient(circle calc(var(--d)/2) at 100% 50%, #0000 96%, #000) 100% 50%/ 100% var(--d) repeat-y;
    mask-composite: intersect;
  }
}

/* --------------------------------------------------------------- card ---- */

.cardart-fit { container-type: inline-size; display: block; width: 100%; }
.cardart--fluid { font-size: clamp(7px, 4.1cqw, 21px); }

/* Browsers without container queries still get a sensible, readable card. */
@supports not (container-type: inline-size) {
  .cardart--fluid { font-size: 13px; }
}

/* ---------------------------------------------------------------- grid --- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px 22px;
}
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
}

.tile { display: block; text-decoration: none; position: relative; }
.tile__stamp {
  display: block;
  transition: transform .25s ease;
  background: var(--surface);
  padding: 9px;
  filter: drop-shadow(0 4px 12px rgba(19,31,53,.12));
}
.tile:hover .tile__stamp,
.tile:focus-visible .tile__stamp { transform: translateY(-5px) rotate(-1deg); }

.tile__meta { display: block; margin-top: 11px; }
.tile__title { display: block; font-size: .93rem; line-height: 1.3; }
.tile__cat {
  display: block; font-family: var(--label); font-size: .68rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px;
}
.tile__flag {
  position: absolute; top: 8px; right: 8px;
  background: var(--ink); color: #fff;
  font-family: var(--label); font-size: .6rem; letter-spacing: .14em;
  text-transform: uppercase; padding: 3px 7px;
}

/* -------------------------------------------------------------- chips ---- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface);
  padding: 7px 13px; font-size: .87rem; border-radius: 40px;
  transition: border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip span { font-family: var(--label); font-size: .72rem; color: var(--ink-soft); margin-left: 5px; }
.chip[aria-current="true"] span { color: rgba(255,255,255,.6); }

/* ------------------------------------------------------------ buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--label); text-transform: uppercase; letter-spacing: .15em;
  font-size: .78rem; text-decoration: none; cursor: pointer;
  padding: 15px 24px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.btn:hover { background: #000; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--red { background: var(--red); border-color: var(--red); }
.btn--red:hover { background: #A80D26; border-color: #A80D26; }
.btn--sm { padding: 10px 16px; font-size: .72rem; }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* -------------------------------------------------------------- forms ---- */

.field { display: block; margin-bottom: 18px; }
.field > .label { margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=date],
.field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 13px;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent;
}
.field__hint { font-size: .8rem; color: var(--ink-soft); margin-top: 5px; }
.field__count { font-family: var(--label); font-size: .72rem; color: var(--ink-soft); float: right; }

.row { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
.row--3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 620px) { .row, .row--3 { grid-template-columns: 1fr; } }

fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { padding: 0; }

.choice {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start;
  border: 1px solid var(--line); background: var(--surface);
  padding: 17px 18px; cursor: pointer; margin-bottom: 12px;
  border-radius: var(--radius); transition: border-color .15s ease, box-shadow .15s ease;
}
.choice:hover { border-color: var(--ink-soft); }
.choice input { margin: 3px 0 0; accent-color: var(--red); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice strong { display: block; font-weight: 500; }
.choice small { color: var(--ink-soft); display: block; margin-top: 3px; line-height: 1.5; }
.choice .price { font-family: var(--label); letter-spacing: .1em; white-space: nowrap; }

/* ------------------------------------------------------------- editor ---- */

.editor { display: grid; grid-template-columns: 1fr 380px; gap: 44px; align-items: start; }
.editor__preview { position: sticky; top: 92px; }
.editor__preview .stamp { max-width: 340px; margin-inline: auto; }
@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; gap: 26px; }
  .editor__preview { position: static; order: -1; }
  .editor__preview .stamp { max-width: 260px; }
}

.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  cursor: pointer; padding: 0; position: relative;
}
.swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -4px; border: 1.5px solid var(--ink); border-radius: 50%;
}

/* --------------------------------------------------------------- steps --- */

.steps { display: flex; gap: 0; list-style: none; margin: 0 0 30px; padding: 0; flex-wrap: wrap; }
.steps li {
  font-family: var(--label); text-transform: uppercase; letter-spacing: .15em;
  font-size: .72rem; color: var(--ink-soft);
  padding: 8px 16px 8px 0; display: flex; align-items: center; gap: 9px;
}
.steps li::after { content: "→"; margin-left: 16px; opacity: .4; }
.steps li:last-child::after { content: none; }
.steps li[aria-current="step"] { color: var(--ink); }
.steps li[aria-current="step"] b { background: var(--red); color: #fff; }
.steps b {
  display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%;
  background: var(--line); color: var(--ink); font-size: .68rem;
}

/* --------------------------------------------------------------- panel --- */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  padding: 26px; border-radius: var(--radius);
}
.panel + .panel { margin-top: 18px; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.summary { list-style: none; margin: 0; padding: 0; font-size: .94rem; }
.summary li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.summary li:last-child { border-bottom: 0; }
.summary .total { font-family: var(--label); letter-spacing: .1em; text-transform: uppercase; padding-top: 14px; }
.summary .total span:last-child { font-size: 1.15rem; letter-spacing: 0; }

/* --------------------------------------------------------------- notes --- */

.note {
  border-left: 3px solid var(--blue); background: var(--surface);
  padding: 14px 16px; font-size: .92rem; margin-bottom: 20px;
}
.note--error { border-left-color: var(--red); }
.note--good { border-left-color: #1E7A5A; }
.note ul { margin: 6px 0 0; padding-left: 18px; }

/* ------------------------------------------------------- motion: artwork --- */
/* Motif animation only runs inside .cardart--animated, so catalog thumbnails,
   emailed cards and print sheets stay perfectly still. */

.cardart--animated .gbm-drift,
.cardart--animated .gbm-beat,
.cardart--animated .gbm-fall,
.cardart--animated .gbm-twinkle,
.cardart--animated .gbm-turn,
.cardart--animated .gbm-sway,
.cardart--animated .gbm-tumble,
.cardart--animated .gbm-flicker,
.cardart--animated .gbm-burst,
.cardart--animated .gbm-glide,
.cardart--animated .gbm-step {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  will-change: transform, opacity;
}

.cardart--animated .gbm-drift   { animation-name: gbm-drift;   animation-duration: 4.6s; animation-timing-function: ease-in-out; animation-direction: alternate; }
.cardart--animated .gbm-beat    { animation-name: gbm-beat;    animation-duration: 1.9s; animation-timing-function: ease-in-out; animation-direction: alternate; }
.cardart--animated .gbm-fall    { animation-name: gbm-fall;    animation-duration: 6.5s; animation-timing-function: linear; }
.cardart--animated .gbm-twinkle { animation-name: gbm-twinkle; animation-duration: 2.8s; animation-timing-function: ease-in-out; }
.cardart--animated .gbm-turn    { animation-name: gbm-turn;    animation-duration: 26s;  animation-timing-function: linear; }
.cardart--animated .gbm-sway    { animation-name: gbm-sway;    animation-duration: 3.6s; animation-timing-function: ease-in-out; animation-direction: alternate; }
.cardart--animated .gbm-tumble  { animation-name: gbm-tumble;  animation-duration: 5.4s; animation-timing-function: linear; }
.cardart--animated .gbm-flicker { animation-name: gbm-flicker; animation-duration: .9s;  animation-timing-function: ease-in-out; animation-direction: alternate; }
.cardart--animated .gbm-burst   { animation-name: gbm-burst;   animation-duration: 3.2s; animation-timing-function: ease-out; }
.cardart--animated .gbm-glide   { animation-name: gbm-glide;   animation-duration: 7s;   animation-timing-function: ease-in-out; animation-direction: alternate; }
.cardart--animated .gbm-step    { animation-name: gbm-step;    animation-duration: 4.4s; animation-timing-function: ease-in-out; }

@keyframes gbm-drift   { from { transform: translateY(1.2px) rotate(-3deg); } to { transform: translateY(-1.8px) rotate(3deg); } }
@keyframes gbm-beat    { from { transform: scale(.94); } to { transform: scale(1.12); } }
@keyframes gbm-fall    { 0% { transform: translateY(-6px); opacity: 0; }
                         14% { opacity: .85; }
                         82% { opacity: .85; }
                         100% { transform: translateY(9px); opacity: 0; } }
@keyframes gbm-twinkle { 0%, 100% { opacity: .3; transform: scale(.78); }
                         50% { opacity: 1; transform: scale(1.1); } }
@keyframes gbm-turn    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes gbm-sway    { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes gbm-tumble  { 0% { transform: translateY(-5px) rotate(0deg); opacity: 0; }
                         18% { opacity: .9; }
                         80% { opacity: .9; }
                         100% { transform: translateY(8px) rotate(220deg); opacity: 0; } }
@keyframes gbm-flicker { from { transform: scaleY(.86) scaleX(1.04); opacity: .8; }
                         to   { transform: scaleY(1.1) scaleX(.96); opacity: 1; } }
@keyframes gbm-burst   { 0% { transform: scale(.25); opacity: 0; }
                         22% { opacity: 1; }
                         70% { transform: scale(1.12); opacity: .55; }
                         100% { transform: scale(1.2); opacity: 0; } }
@keyframes gbm-glide   { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@keyframes gbm-step    { 0% { opacity: 0; transform: scale(.8); }
                         12% { opacity: 1; transform: scale(1); }
                         62% { opacity: 1; }
                         100% { opacity: 0; transform: scale(1); } }

/* ------------------------------------------------ motion: the envelope ----- */
/* The recipient's card arrives inside an envelope that opens once, then gets
   out of the way. Pure CSS with fill-mode both, so it settles correctly even
   if JavaScript never runs. */

.reveal-stage {
  position: relative;
  width: min(100%, 460px);
  margin-inline: auto;
  perspective: 1400px;
}

.reveal-stage__card {
  position: relative;
  z-index: 2;
  animation: gbm-card-rise 1.55s cubic-bezier(.2,.75,.2,1) .5s both;
}

.reveal-flap, .reveal-pocket {
  position: absolute;
  left: -7%;
  right: -7%;
  pointer-events: none;
  animation: gbm-env-clear .8s ease 2.15s both;
}

.reveal-pocket {
  bottom: -5%;
  height: 46%;
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(19,31,53,.13);
  clip-path: polygon(0 0, 50% 30%, 100% 0, 100% 100%, 0 100%);
}
.reveal-pocket::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(-45deg,
    var(--red) 0 8px, #fff 8px 16px, var(--blue) 16px 24px, #fff 24px 32px);
}

.reveal-flap {
  bottom: 36%;
  height: 15%;
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 88%, var(--ink));
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  animation: gbm-flap-open 1s cubic-bezier(.3,.7,.3,1) both,
             gbm-env-clear .8s ease 2.15s both;
}

@keyframes gbm-flap-open {
  from { transform: rotateX(0deg); }
  to   { transform: rotateX(-172deg); }
}
@keyframes gbm-card-rise {
  from { transform: translateZ(2px) translateY(34%) scale(.9); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: translateZ(2px) translateY(0) scale(1); opacity: 1; }
}
@keyframes gbm-env-clear {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(14%); }
}

/* Anyone who has asked for less motion gets the card, opened, with no theatre. */
@media (prefers-reduced-motion: reduce) {
  .cardart--animated * { animation: none !important; }
  .reveal-flap, .reveal-pocket { display: none; }
  .reveal-stage__card { animation: none !important; transform: none; opacity: 1; }
}

/* ---------------------------------------------------------- sections ----- */

.section { padding: 54px 0; }
.section--tight { padding: 34px 0; }
.section--white { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 26px; }
.section__head p { color: var(--ink-soft); max-width: 54ch; margin-top: 8px; }

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; }
@media (max-width: 820px) { .two-up { grid-template-columns: 1fr; } }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; gap: 22px; } }
.how__item { border-top: 2px solid var(--ink); padding-top: 14px; }
.how__item .label { margin-bottom: 8px; }
.how__item h3 { margin-bottom: 6px; }
.how__item p { color: var(--ink-soft); font-size: .95rem; }

/* -------------------------------------------------------------- pager ---- */

.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 40px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-size: .9rem; border-radius: var(--radius); padding: 0 10px;
}
.pager [aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .is-off { opacity: .4; pointer-events: none; }

/* -------------------------------------------------------------- footer --- */

.footer { background: var(--ink); color: #fff; margin-top: 60px; }
.footer a { color: rgba(255,255,255,.78); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 46px 0 34px; }
@media (max-width: 760px) { .footer__cols { grid-template-columns: 1fr 1fr; gap: 26px; } }
.footer h4 { font-family: var(--label); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: rgba(255,255,255,.55); margin: 0 0 12px; font-weight: 500; }
.footer ul { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.footer li { margin-bottom: 8px; }
.footer__legal {
  border-top: 1px solid rgba(255,255,255,.14); padding: 18px 0 34px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .82rem; color: rgba(255,255,255,.55);
}
.footer__brand .brand__mark { color: #fff; }
.footer__brand p { color: rgba(255,255,255,.62); font-size: .92rem; margin-top: 10px; max-width: 32ch; }

/* --------------------------------------------------------- view (open) --- */

.opened { display: grid; place-items: center; padding: 46px 0 20px; }
.opened .stamp { max-width: 460px; width: 100%; }
.opened__from {
  font-family: var(--label); text-transform: uppercase; letter-spacing: .2em;
  font-size: .76rem; color: var(--ink-soft); margin-bottom: 18px; text-align: center;
}
.reveal { animation: lift .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes lift {
  from { opacity: 0; transform: translateY(18px) rotate(-1.5deg); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- misc --- */

.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.mt-0 { margin-top: 0; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.hide { display: none; }

.addr {
  font-family: var(--label); line-height: 1.55; font-size: .95rem;
  letter-spacing: .04em; text-transform: uppercase;
}

.toolbar {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 24px;
}
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar input[type=search] {
  font: inherit; padding: 10px 13px; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--radius); min-width: 220px;
}
.toolbar select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
  .reveal, .tile__stamp { animation: none !important; }
}

@media print {
  .masthead, .footer, .btn, .toolbar, .airmail { display: none !important; }
  body { background: #fff; }
  .stamp { mask: none; -webkit-mask: none; filter: none; padding: 0; }
}


/* =========================================================================
   Painted & lively — pictures, themes and Describe-a-card (2026-10)
   The post-office furniture stays; the pictures, colour blobs and a little
   motion carry the life.
   ========================================================================= */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn--big { padding: 18px 30px; font-size: .84rem; }
.section__head--row { display: flex; justify-content: space-between; align-items: end; gap: 18px; flex-wrap: wrap; }

/* Pictures that are not painted yet: a soft gradient with the card motif drifting over it. */
.pic-blank {
  background: radial-gradient(circle at 25% 30%, color-mix(in srgb, var(--c1) 70%, #fff), transparent 60%),
              linear-gradient(135deg, var(--c1), var(--c2));
  display: block; overflow: hidden; position: relative;
}
.pic-blank svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
img.pic-blank, .pic-blank, [class$="__img"] { object-fit: cover; }

/* ---- home hero: three stamps of pictures and a postmark ---- */
.hero2 {
  position: relative; overflow: hidden; padding: 46px 0 64px;
  background:
    radial-gradient(520px 300px at 92% 8%, color-mix(in srgb, var(--sun) 32%, transparent), transparent 70%),
    radial-gradient(460px 320px at 70% 100%, color-mix(in srgb, var(--sky) 26%, transparent), transparent 70%),
    radial-gradient(380px 260px at 0% 90%, color-mix(in srgb, var(--rose) 22%, transparent), transparent 70%);
}
.hero2__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.hero2__copy h1 { margin: 14px 0 18px; }
.hero2__collage { position: relative; min-height: 470px; }
.stampframe {
  position: absolute; display: block; background: #fff; padding: 10px;
  filter: drop-shadow(0 10px 24px rgba(19,31,53,.18));
  animation: gbm-bob 7s ease-in-out infinite;
}
.stampframe__img { display: block; width: 100%; height: 100%; }
.stampframe--a { width: 54%; aspect-ratio: 4/5; left: 4%;  top: 0;    transform: rotate(-4deg); --r: -4deg; }
.stampframe--b { width: 46%; aspect-ratio: 1/1; right: 0;  top: 9%;   transform: rotate(5deg);  --r: 5deg;  animation-delay: -2.4s; }
.stampframe--c { width: 50%; aspect-ratio: 4/3; left: 30%; bottom: 0; transform: rotate(-1.5deg); --r: -1.5deg; animation-delay: -4.6s; }
.postmark--hero { position: absolute; left: 0; bottom: 6%; background: color-mix(in srgb, #fff 70%, transparent); }
@keyframes gbm-bob {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-8px) rotate(calc(var(--r, 0deg) * .6)); }
}
@media (max-width: 900px) {
  .hero2__grid { grid-template-columns: 1fr; gap: 26px; }
  .hero2__collage { min-height: 0; aspect-ratio: 1/.9; order: -1; }
}

/* ---- the three themes ---- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.theme {
  position: relative; display: block; overflow: hidden; text-decoration: none; color: #fff;
  aspect-ratio: 4/3; border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.theme:hover, .theme:focus-visible { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 16px 34px rgba(19,31,53,.2); }
.theme__img { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .6s ease; }
.theme:hover .theme__img { transform: scale(1.05); }
.theme__text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 46px 18px 16px;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.6));
}
.theme__text b { display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.theme__text span { font-size: .9rem; opacity: .92; }
@media (max-width: 760px) { .themes { grid-template-columns: 1fr; } .theme { aspect-ratio: 16/9; } }

/* ---- Describe-a-card promo band ---- */
.maker-band { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.maker-band__form { display: flex; gap: 10px; margin-top: 22px; max-width: 560px; }
.maker-band__form input {
  flex: 1; min-width: 0; font: inherit; padding: 14px 16px; border-radius: 40px;
  border: 1px solid var(--line); background: var(--paper);
}
.maker-band__form input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plum) 25%, transparent); }
.maker-band__form .btn { border-radius: 40px; }
.maker-band__art { position: relative; }
.maker-band__img { display: block; width: 100%; aspect-ratio: 4/3; border-radius: 18px; transform: rotate(1.5deg); box-shadow: var(--shadow); }
.maker-band__art::before {
  content: ""; position: absolute; inset: -18px -14px auto auto; width: 90px; height: 90px; border-radius: 50%;
  background: var(--sun); opacity: .55; z-index: -1;
}
@media (max-width: 820px) { .maker-band { grid-template-columns: 1fr; } .maker-band__form { flex-direction: column; } }

.mail-art__img { display: block; width: 100%; aspect-ratio: 4/3; border-radius: 4px; box-shadow: var(--shadow); transform: rotate(-1.2deg); }

.how__num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; margin-bottom: 10px;
  font-family: var(--display); font-weight: 600; color: #fff; background: var(--red);
}
.how__item:nth-child(2) .how__num { background: var(--blue); }
.how__item:nth-child(3) .how__num { background: var(--leaf); }

/* ---- a little more colour on the furniture ---- */
.chip:nth-child(5n+1):hover { border-color: var(--red);  color: var(--red); }
.chip:nth-child(5n+2):hover { border-color: var(--blue); color: var(--blue); }
.chip:nth-child(5n+3):hover { border-color: var(--leaf); color: var(--leaf); }
.chip:nth-child(5n+4):hover { border-color: var(--plum); color: var(--plum); }
.chip:nth-child(5n+5):hover { border-color: var(--seal); color: var(--seal); }
.grid > .tile:nth-child(odd):hover .tile__stamp { transform: translateY(-5px) rotate(1deg); }
.tile__flag--art { background: var(--leaf); }
.theme-chips { margin-bottom: 12px; }
.theme-chips .chip[aria-current="true"] { background: var(--leaf); border-color: var(--leaf); }

/* ---- create.php: Describe a card ---- */
.maker {
  padding: 40px 0 60px;
  background:
    radial-gradient(420px 260px at 100% 0%, color-mix(in srgb, var(--plum) 18%, transparent), transparent 70%),
    radial-gradient(420px 260px at 0% 100%, color-mix(in srgb, var(--sun) 22%, transparent), transparent 70%);
}
.maker__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
.maker__intro h1 { margin: 12px 0 16px; }
.maker__art { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-top: 26px; border-radius: 16px; box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.maker__art--blank {
  background:
    radial-gradient(circle at 30% 35%, #fff8, transparent 40%),
    linear-gradient(135deg, var(--sun), var(--rose) 50%, var(--plum));
}
.maker__form { position: relative; }
.maker__form fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.maker__form legend { margin-bottom: 8px; }
@media (max-width: 900px) { .maker__grid { grid-template-columns: 1fr; } .maker__art { display: none; } }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 20px; }
.example {
  font: inherit; font-size: .82rem; line-height: 1.35; text-align: left; cursor: pointer;
  border: 1px dashed var(--line); background: var(--paper); color: var(--ink-soft);
  padding: 8px 12px; border-radius: 10px; max-width: 100%;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.example:hover, .example:focus-visible { border-style: solid; border-color: var(--plum); color: var(--ink); background: #fff; }
.example::before { content: "✎ "; color: var(--plum); }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span {
  display: inline-block; padding: 8px 14px; border-radius: 40px; font-size: .88rem;
  border: 1px solid var(--line); background: var(--surface); transition: all .15s ease;
}
.pick label:hover span { border-color: var(--ink); }
.pick input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.note--made { border-left: 3px solid var(--leaf); background: color-mix(in srgb, var(--leaf) 9%, #fff); }

/* The "painting your card" overlay shown while the server works (about 30 s). */
.painting {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(3px);
}
.painting[hidden] { display: none; }
.painting__box {
  background: #fff; max-width: 420px; padding: 34px 30px 30px; text-align: center;
  border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
.painting__box h2 { margin: 18px 0 10px; }
.painting__box p { color: var(--ink-soft); }
.painting__brush { display: flex; justify-content: center; gap: 10px; }
.painting__brush span {
  width: 18px; height: 18px; border-radius: 50%; background: var(--red);
  animation: gbm-dab 1.2s ease-in-out infinite;
}
.painting__brush span:nth-child(2) { background: var(--sun); animation-delay: .15s; }
.painting__brush span:nth-child(3) { background: var(--sky); animation-delay: .3s; }
@keyframes gbm-dab { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14px) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  .stampframe, .painting__brush span { animation: none !important; }
  .theme, .theme__img { transition: none !important; }
}
