/* Suvenire Kalaja - the postcard rack. Every photo is a postcard on a spinning wire rack,
   and the back of every card carries a live postmark. */

:root {
  --blue: #2433D6;
  --blue-deep: #17219A;
  --red: #F04A2B;
  --lime: #D7F35B;
  --paper: #F6F6F1;
  --card: #FFFFFF;
  --ink: #0C1030;
  --ink-2: #3A3F5C;
  --rule: #C9CBD6;

  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
  --mono: 'Space Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;

  /* rack geometry */
  --cw: 172px;
  --ch: calc(var(--cw) * 1.4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main, .foot { overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
main > section:not(.hero) :focus-visible, .letter :focus-visible { outline-color: var(--blue); }

.mono-label {
  margin: 0; font: 700 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- nav ---------- */
.nav {
  position: absolute; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter); color: #fff;
}
.nav-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
}
.nav-stamp {
  width: 22px; height: 26px; background: var(--lime);
  -webkit-mask: radial-gradient(circle, #0000 2px, #000 2.5px) -3px -3px / 6px 6px round, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle, #0000 2px, #000 2.5px) -3px -3px / 6px 6px round, linear-gradient(#000 0 0) content-box;
  padding: 3px;
}
.nav-links { display: flex; gap: 2px; min-width: 0; }
.nav-links a {
  padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.nav-links a:hover { background: rgb(255 255 255 / .14); }
.lang { display: flex; gap: 2px; border: 1.5px solid rgb(255 255 255 / .5); border-radius: 6px; padding: 3px; flex: none; }
.lang button {
  font: 700 12px/1 var(--mono); color: #fff; background: none; border: 0;
  border-radius: 4px; padding: 8px 10px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--lime); color: var(--ink); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  border-radius: 8px; font-weight: 700; font-size: 17px; text-decoration: none; white-space: nowrap;
  transition: transform .15s, background-color .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-red { background: var(--red); color: var(--ink); }
.btn-paper { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.hero .btn-paper { box-shadow: none; }
.btn-blue { background: var(--blue); color: #fff; }

/* ---------- hero ---------- */
.hero {
  position: relative; background: var(--blue); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 24px;
  min-height: max(720px, 100svh); padding: 96px var(--gutter) 56px;
  overflow: hidden;
}
.hero::before { /* faint cancellation waves across the ground */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='72' viewBox='0 0 240 72'%3E%3Cg fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M0 12c20-10 40 10 60 0s40 10 60 0 40 10 60 0 40 10 60 0'/%3E%3Cpath d='M0 36c20-10 40 10 60 0s40 10 60 0 40 10 60 0 40 10 60 0'/%3E%3Cpath d='M0 60c20-10 40 10 60 0s40 10 60 0 40 10 60 0 40 10 60 0'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-text { position: relative; max-width: 620px; }
.hero-kicker { margin: 0 0 18px; font: 700 13px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lime); }
.hero-name { margin: 0; line-height: .8; }
.hero-name-small {
  display: block; font: 700 clamp(44px, 5vw, 72px)/1 var(--hand); color: var(--lime);
  transform: rotate(-4deg); transform-origin: 0 100%; margin: 0 0 -.12em .08em;
}
.hero-name-big {
  display: block; font-family: var(--sans); font-weight: 800; font-stretch: 75%;
  font-variation-settings: "opsz" 96;
  font-size: clamp(104px, 15vw, 236px); letter-spacing: -.045em; text-transform: uppercase;
}
.hero-tagline { margin: 26px 0 22px; max-width: 30ch; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; }
.live {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px;
  padding: 9px 16px 9px 13px; border-radius: 999px; background: rgb(255 255 255 / .12);
  font-size: 16px;
}
.live b { font-weight: 800; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgb(215 243 91 / .6); animation: pulse 2s infinite; }
.is-closed .live-dot { background: #FF9C87; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgb(215 243 91 / 0); } 100% { box-shadow: 0 0 0 0 rgb(215 243 91 / 0); } }

/* ---------- rack ---------- */
.rack-wrap { position: relative; display: grid; justify-items: center; min-width: 0; }
.rack-hint {
  position: absolute; z-index: 5; left: -96px; bottom: 120px; margin: 0; max-width: 11ch;
  font: 700 25px/1 var(--hand); color: var(--lime); transform: rotate(-6deg);
}
html:not(.js) .rack-hint { display: none; }
.rack-hint::after { content: "↗"; display: block; font-family: var(--sans); font-size: 30px; margin: 4px 0 0 60%; }

/* No-JS: a flat row of postcards you scroll sideways. */
.cards {
  list-style: none; margin: 0; padding: 0 0 12px; display: flex; gap: 16px; overflow-x: auto; max-width: 100%;
}
.pc { flex: none; width: var(--cw); }
.pc figure { margin: 0; }
.pc-note { display: none; }
.rack-sign, .rack-pole, .rack-base { display: none; }

/* the postcard itself (front) */
.pc figure, .lift-front figure, .type-face {
  position: relative; margin: 0; height: var(--ch); background: var(--card); padding: 6px 6px 0;
  display: flex; flex-direction: column; box-shadow: 0 1px 0 rgb(0 0 0 / .08), 0 10px 24px -10px rgb(4 8 40 / .55);
}
.pc img, .lift-front img { flex: 1; min-height: 0; width: 100%; object-fit: cover; background: #ccd; }
.pc figcaption, .lift-front figcaption { flex: none; height: 38px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0 1px; color: var(--ink); overflow: hidden; }
.pc-cap { font-weight: 700; font-size: 10.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Rack credits are two short lines in the condensed cut so the licence always fits;
   the lifted card shows the same credit on one line. */
.pc-credit { font: 500 8px/1.2 var(--sans); font-stretch: 75%; color: var(--ink-2); white-space: nowrap; }
.pc-credit > span { display: block; }
.pc-sep { display: none; font-style: normal; }
.lift-front .pc-credit { font: 400 12px/1.2 var(--mono); white-space: normal; }
.lift-front .pc-credit > span { display: inline; }
.lift-front .pc-sep { display: inline; }

/* typographic cards */
.type-face { padding: 14px 12px; justify-content: space-between; overflow: hidden; }
[data-tone="blue"] > .type-face { background: var(--paper); }
[data-tone="red"] > .type-face { background: var(--red); }
[data-tone="lime"] > .type-face { background: var(--lime); }
.type-face p { margin: 0; }
.type-label { font: 700 9.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.type-big { font-weight: 800; font-stretch: 75%; font-size: 46px; line-height: .9; letter-spacing: -.03em; text-transform: uppercase; }
.type-mid { font-weight: 800; font-stretch: 75%; font-size: 34px; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; }
.type-small { font: 700 22px/1 var(--hand); }
.type-star { font-size: .6em; vertical-align: .55em; margin-left: 2px; }
.pc-status .type-big { font-size: 38px; }

/* "Greetings from" - the letters are windows onto the bazaar */
.pc-greet .type-face { background: var(--blue-deep); color: #fff; justify-content: center; text-align: center; gap: 2px; padding: 10px 6px; }
.pc-greet .type-face::before {
  content: ""; position: absolute; inset: 0; padding: 5px; pointer-events: none;
  background: repeating-linear-gradient(-45deg, var(--red) 0 8px, #fff 8px 12px, var(--lime) 12px 20px, #fff 20px 24px);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.lift-front.pc-greet .type-face::before { padding: 12px; background: repeating-linear-gradient(-45deg, var(--red) 0 18px, #fff 18px 27px, var(--lime) 27px 45px, #fff 45px 54px); }
.greet-small { font: 700 22px/1 var(--hand); color: var(--lime); transform: rotate(-5deg); }
.greet-big {
  font-weight: 800; font-stretch: 75%; font-size: 52px; line-height: .9; letter-spacing: -.03em; text-transform: uppercase;
  background: url(photos/qilim-korcar.jpg) center 40% / 260% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px rgb(255 255 255 / .9);
}
.greet-foot { font: 400 8px/1 var(--mono); letter-spacing: .1em; margin-top: 8px !important; opacity: .85; }

/* ---------- the 3D rack (JS on) ---------- */
/* The rack is laid out at twice its size (zoom: 2) and pushed back by one perspective
   distance, which projects it to the same size on screen. Browsers rasterise a 3D card at
   its layout size, so this is what keeps the photos and captions sharp on a 3x phone. */
.js .rack {
  --persp: 1500px; --lift: 88px;
  position: relative; width: 100%; height: calc(var(--ch) * 2 + 150px);
  perspective: var(--persp); perspective-origin: 50% 30%;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.js .rack.is-dragging { cursor: grabbing; }
.js .rack-stage {
  position: absolute; left: 50%; top: 58px; width: 0; height: calc(var(--ch) * 2 + 22px);
  transform-style: preserve-3d; transform: rotateX(-7deg);
}
.js .cards {
  position: absolute; inset: 0; display: block; overflow: visible; padding: 0;
  transform-style: preserve-3d; transform: translate3d(0, var(--lift), calc(var(--persp) * -1)) rotateY(var(--rot, 0deg));
}
.js .pc {
  position: absolute; left: calc(var(--cw) / -2); top: var(--ty); width: var(--cw); height: var(--ch);
  transform-style: preserve-3d; transform: rotateY(var(--a)) translateZ(var(--r));
  cursor: pointer; outline: none; zoom: 2;
}
.js .pc > figure, .js .pc > .type-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.js .pc:focus-visible > figure, .js .pc:focus-visible > .type-face { box-shadow: 0 0 0 3px var(--lime), 0 10px 24px -10px rgb(4 8 40 / .55); }
.pc-back {
  position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: #DADCEB; padding: 10px;
  background-image:
    linear-gradient(var(--ink-2), var(--ink-2)),
    repeating-linear-gradient(transparent 0 15px, #A9ADC4 15px 16px);
  background-size: 1px 70%, 42% 48px;
  background-position: 52% 55%, 92% 75%;
  background-repeat: no-repeat;
}
.pc-back::before { content: ""; position: absolute; top: 9px; right: 9px; width: 24px; height: 30px; border: 1.5px dashed #8E93B0; }
/* the wire pocket each card sits in */
.js .pc::after {
  content: ""; position: absolute; left: -5px; right: -5px; bottom: -7px; height: 16px;
  border: 2px solid #0A0E2C; border-top: 0; border-radius: 0 0 3px 3px; transform: translateZ(2px);
  pointer-events: none; opacity: .85;
}
.js .rack-pole {
  display: block; position: absolute; left: -4px; top: -40px; width: 8px; height: calc(var(--ch) * 2 + 102px);
  zoom: 2; transform: translate3d(0, calc(var(--lift) / 2), calc(var(--persp) / -2));
  background: linear-gradient(90deg, #070A22, #3A3F66 45%, #070A22);
  border-radius: 4px;
}
.js .rack-sign {
  display: grid; place-items: center; position: absolute; z-index: 2; left: 50%; top: 0; transform: translateX(-50%);
  width: 132px; height: 50px; border-radius: 6px; background: var(--lime); color: var(--ink);
  font: 700 11px/1.15 var(--mono); letter-spacing: .14em; text-transform: uppercase; text-align: center;
  box-shadow: 0 6px 18px -8px rgb(0 0 0 / .5);
}
.js .rack-sign span:first-child { font: 800 22px/1 var(--sans); font-stretch: 75%; letter-spacing: .02em; }
.js .rack-base {
  display: block; position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  width: 220px; height: 26px; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(4 8 40 / .55), rgb(4 8 40 / 0));
}

/* ---------- airmail band ---------- */
.airmail {
  position: relative; height: 44px; overflow: hidden; display: grid; place-items: center;
  background: repeating-linear-gradient(-45deg, var(--red) 0 22px, var(--card) 22px 34px, var(--blue) 34px 56px, var(--card) 56px 68px);
}
.airmail span {
  background: var(--card); padding: 5px 14px; white-space: nowrap;
  font: 700 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
  max-width: calc(100% - 2 * var(--gutter)); overflow: hidden;
}

/* ---------- letter ---------- */
.letter-wrap { padding: clamp(64px, 9vw, 120px) var(--gutter); }
.letter {
  position: relative; max-width: 860px; margin: 0 auto; background: var(--card);
  padding: clamp(28px, 5vw, 64px); box-shadow: 0 30px 60px -36px rgb(12 16 48 / .45);
  transform: rotate(-.6deg);
}
.letter::before { /* airmail edge */
  content: ""; position: absolute; inset: 0; padding: 9px; pointer-events: none;
  background: repeating-linear-gradient(-45deg, var(--red) 0 16px, transparent 16px 24px, var(--blue) 24px 40px, transparent 40px 48px);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.letter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; color: var(--blue); }
.letter-place { margin: 0; font: 700 28px/1 var(--hand); color: var(--ink-2); }
.letter-hello { margin: 0 0 12px; font: 700 clamp(40px, 5vw, 58px)/1 var(--hand); color: var(--blue); }
.letter-body { margin: 0 0 22px; font-size: clamp(20px, 2.2vw, 27px); line-height: 1.45; font-weight: 500; letter-spacing: -.01em; max-width: 34ch; }
.letter-sign { margin: 0 0 36px; font: 700 clamp(30px, 3.6vw, 40px)/1.05 var(--hand); color: var(--blue); max-width: 16ch; transform: rotate(-2deg); }
.letter-ps { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1.5px dashed var(--rule); padding-top: 22px; }
.ps-label { margin: 0; font: 700 30px/1 var(--hand); color: var(--red); }
.labels { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.labels li {
  font: 700 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 12px; border: 1.5px solid var(--blue); color: var(--blue); border-radius: 3px;
}
.labels li:nth-child(2n) { background: var(--blue); color: #fff; }

/* ---------- hours: a sheet of stamps ---------- */
.hours { padding: 0 var(--gutter) clamp(72px, 9vw, 120px); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head .mono-label { color: var(--blue); }
.hours-now { margin: 0; font-size: clamp(26px, 3vw, 38px); font-weight: 800; font-stretch: 80%; letter-spacing: -.02em; }
.hours-now b { color: var(--blue); }
.is-closed .hours-now b { color: var(--red); }
.sheet {
  list-style: none; margin: 0; padding: 18px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0;
  background: #E6E7EE; border-radius: 4px;
}
.stamp {
  position: relative; padding: 9px; background: var(--card);
  -webkit-mask: radial-gradient(circle, #0000 4.5px, #000 5px) -8px -8px / 16px 16px round, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle, #0000 4.5px, #000 5px) -8px -8px / 16px 16px round, linear-gradient(#000 0 0) content-box;
}
.stamp-face {
  height: 100%; min-height: 168px; padding: 12px 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  background: var(--blue); color: #fff; position: relative; overflow: hidden;
}
.stamp:nth-child(3n+2) .stamp-face { background: var(--lime); color: var(--ink); }
.stamp:nth-child(3n) .stamp-face { background: var(--red); color: var(--ink); }
.stamp-day { font: 700 11px/1.1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.stamp-val { font-weight: 800; font-stretch: 75%; font-size: clamp(26px, 2.6vw, 38px); line-height: .92; letter-spacing: -.02em; }
.stamp-foot { font: 400 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.stamp-cancel { position: absolute; left: -24%; bottom: -12%; width: 170%; pointer-events: none; color: var(--ink); }
.stamp:nth-child(3n+1) .stamp-cancel { color: #fff; }
.stamp.is-today { z-index: 1; transform: scale(1.07) rotate(-2.5deg); filter: drop-shadow(0 10px 14px rgb(12 16 48 / .3)); }

/* ---------- rating ---------- */
.rating { padding: 0 var(--gutter) clamp(72px, 9vw, 120px); }
.rating-card {
  max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 4vw, 64px);
  background: var(--ink); color: #fff; padding: clamp(28px, 4vw, 52px); border-radius: 6px;
}
.rating-big .mono-label { color: var(--lime); }
.rating-num { margin: 12px 0 6px; font-weight: 800; font-stretch: 75%; font-size: clamp(96px, 11vw, 150px); line-height: .85; letter-spacing: -.04em; }
.rating-num span { font-size: .3em; letter-spacing: 0; color: #B9BCD6; margin-left: 6px; }
.rating-count { margin: 0; font: 700 26px/1 var(--hand); color: var(--lime); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.bars li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px; align-items: center; gap: 12px; font: 400 14px/1 var(--mono); }
.bars i { height: 14px; background: rgb(255 255 255 / .12); border-radius: 2px; position: relative; overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset: 0; width: calc(var(--n) * 100%); background: var(--lime); transform-origin: 0 50%; transition: transform 1s cubic-bezier(.2, .8, .2, 1); }
.js .rating:not(.is-seen) .bars i::after { transform: scaleX(0); }
.bars b { text-align: right; font-weight: 400; color: #C9CBE0; }
.rating-btn { background: var(--lime); color: var(--ink); }

/* ---------- visit: an envelope with a map window ---------- */
.visit { padding: 0 var(--gutter) clamp(80px, 10vw, 140px); }
.envelope {
  position: relative; max-width: var(--max); margin: 0 auto; background: var(--card);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 4vw, 52px); box-shadow: 0 30px 60px -36px rgb(12 16 48 / .45);
}
.envelope::before {
  content: ""; position: absolute; inset: 0; padding: 10px; pointer-events: none;
  background: repeating-linear-gradient(-45deg, var(--red) 0 18px, transparent 18px 27px, var(--blue) 27px 45px, transparent 45px 54px);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.env-window { position: relative; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: #E3E6EE; box-shadow: inset 0 0 0 1.5px var(--rule); }
.env-window iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.env-to .mono-label { color: var(--blue); margin-bottom: 18px; }
.env-addr {
  font: 700 clamp(30px, 3.4vw, 42px)/1.2 var(--hand); font-style: normal; color: var(--ink); margin: 0 0 28px;
  background: repeating-linear-gradient(transparent 0 calc(1.2em - 2px), var(--rule) calc(1.2em - 2px) 1.2em);
  max-width: 15ch;
}

/* ---------- footer ---------- */
.foot { background: var(--blue); color: #fff; padding: clamp(40px, 6vw, 72px) var(--gutter) 120px; }
.foot-mark {
  margin: 0 0 28px; font-weight: 800; font-stretch: 75%; font-size: clamp(96px, 24vw, 360px); line-height: .78;
  letter-spacing: -.05em; text-transform: uppercase; color: var(--lime);
}
.foot-notes { display: grid; gap: 8px; max-width: 70ch; font-size: 14px; }
.foot-notes p { margin: 0; }

/* ---------- dock (phone) ---------- */
.dock { display: none; }

/* ---------- viewer: the lifted, flippable postcard ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.viewer[hidden] { display: none; }
.viewer-backdrop { position: absolute; inset: 0; background: rgb(8 12 40 / .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .35s; }
.viewer.is-leaving .viewer-backdrop { opacity: 0; }
.viewer-stage { position: relative; display: grid; justify-items: center; gap: 22px; padding: 16px; }
.lift { --lw: min(440px, 86vw, calc((100svh - 140px) / 1.4)); width: var(--lw); height: calc(var(--lw) * 1.4); perspective: 1800px; }
.lift-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.3, .5, 1); }
.lift.is-flipped .lift-inner { transform: rotateY(180deg); }
.lift-front, .lift-back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .7);
}
.lift-back { transform: rotateY(180deg); }
/* the front reuses the card markup at a larger size */
.lift-front figure, .lift-front .type-face { height: 100%; padding: 12px 12px 0; box-shadow: none; }
.lift-front figcaption { height: 58px; gap: 3px; }
.lift-front .pc-cap { font-size: 18px; }
.lift-front .type-face { padding: 32px 26px; }
.lift-front .type-label { font-size: 15px; }
.lift-front .type-big { font-size: calc(var(--lw) * .29); }
.lift-front .pc-status .type-big, .lift-front .type-big.type-status { font-size: calc(var(--lw) * .23); }
.lift-front .type-mid { font-size: calc(var(--lw) * .2); }
.lift-front .type-small, .lift-front .greet-small { font-size: calc(var(--lw) * .1); }
.lift-front .greet-big { font-size: calc(var(--lw) * .4); -webkit-text-stroke-width: 2px; }
.lift-front .greet-small { font-size: calc(var(--lw) * .12); }
.lift-front .greet-foot { font-size: 13px; }

/* the back */
.back {
  position: absolute; inset: 0; background: var(--card); color: var(--ink); padding: calc(var(--lw) * .06);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; overflow: hidden;
}
.back-top { display: flex; justify-content: flex-end; align-items: flex-start; gap: 10px; min-height: calc(var(--lw) * .3); }
.back-kind {
  position: absolute; left: calc(var(--lw) * .028); top: calc(var(--lw) * .07); margin: 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 700 9.5px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
}
.back-kind span { color: var(--blue); margin-top: 10px; }
.back-stampbox { position: relative; flex: none; width: calc(var(--lw) * .23); }
.back-stamp { display: block; width: 100%; height: auto; transform: rotate(3deg); filter: drop-shadow(0 1px 1px rgb(0 0 0 / .18)); }
.back-postmark {
  position: absolute; width: calc(var(--lw) * .74); right: calc(var(--lw) * .12); top: calc(var(--lw) * .02);
  color: var(--blue-deep); opacity: .9; transform: rotate(-11deg); pointer-events: none; mix-blend-mode: multiply;
}
.back-note {
  margin: 0; align-self: center; font: 700 calc(var(--lw) * .08)/1.18 var(--hand); color: var(--blue-deep);
  transform: rotate(-1.5deg); text-wrap: pretty;
}
.back-sign { margin: 0; font: 700 calc(var(--lw) * .065)/1 var(--hand); color: var(--red-ink, #B5301A); text-align: right; transform: rotate(-2deg); }
.back-to {
  border-top: 1.5px solid var(--ink); padding-top: 10px; display: grid; gap: 0;
  font: 700 calc(var(--lw) * .062)/1.32 var(--hand); color: var(--ink);
}
.back-to span { border-bottom: 1px solid var(--rule); padding-left: 4px; }
.back-to small { font: 700 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.back-airmail {
  position: absolute; right: calc(var(--lw) * .06); bottom: calc(var(--lw) * .345); margin: 0; padding: 4px 8px;
  font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--blue);
  transform: rotate(-3deg);
}
.back::after { /* airmail edge on the back */
  content: ""; position: absolute; inset: 0; padding: 6px; pointer-events: none;
  background: repeating-linear-gradient(-45deg, var(--red) 0 12px, transparent 12px 18px, var(--blue) 18px 30px, transparent 30px 36px);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.viewer-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; transition: opacity .3s .2s; }
.viewer.is-entering .viewer-bar, .viewer.is-leaving .viewer-bar { opacity: 0; transition-delay: 0s; }
.vbtn {
  min-height: 46px; padding: 0 18px; border: 0; border-radius: 8px; cursor: pointer;
  font: 700 15px/1 var(--sans); background: var(--card); color: var(--ink);
}
.vbtn-red { background: var(--red); color: var(--ink); }
.vbtn-icon { width: 46px; padding: 0; font-size: 24px; }
.vbtn:hover { filter: brightness(.94); }
.v-close { position: fixed; top: 16px; right: 16px; }
.v-short { display: none; }
.v-sent { position: absolute; bottom: -34px; left: 0; right: 0; text-align: center; margin: 0; font: 700 22px/1 var(--hand); color: var(--lime); }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .letter.reveal.is-in { transform: rotate(-.6deg); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --cw: 140px; }
  .rack-hint { left: -130px; }
  .hero-name-big { font-size: clamp(96px, 14vw, 170px); }
}
@media (max-width: 900px) {
  :root { --cw: 112px; }
  .nav { gap: 10px; padding-top: 12px; flex-wrap: wrap; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 6px 10px; font-size: 14px; background: rgb(255 255 255 / .1); margin-right: 4px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 126px; padding-bottom: 40px; gap: 0; min-height: 0; }
  .hero-name-small { font-size: 42px; }
  .hero-name-big { font-size: min(31vw, 150px); }
  .hero-tagline { margin: 16px 0 14px; font-size: 17px; }
  .live { margin-bottom: 0; }
  .hero-actions { display: none; }
  .hero-text { display: contents; }
  .hero-kicker { order: 1; }
  .hero-name { order: 2; }
  .rack-wrap { order: 3; margin-top: 4px; }
  .live { order: 4; justify-self: start; margin-top: 4px; }
  .hero-tagline { order: 5; margin-bottom: 0; }
  .rack-hint { left: 0; right: 0; bottom: 4px; max-width: none; text-align: center; font-size: 21px; transform: none; }
  .rack-hint::after { display: none; }
  .js .rack { height: calc(var(--ch) * 2.4 + 128px); --persp: 1000px; --lift: 38px; }
  .js .rack-stage { top: 50px; }
  .js .rack-sign { width: 110px; height: 42px; }
  .js .rack-sign span:first-child { font-size: 19px; }
  .type-face { padding: 10px 8px; }
  .type-big { font-size: 33px; }
  .pc-status .type-big { font-size: 27px; }
  .type-mid { font-size: 24px; }
  .type-small, .greet-small { font-size: 17px; }
  .type-label { font-size: 8px; }
  .greet-big { font-size: 37px; }
  .pc figcaption { height: 31px; }
  .pc-cap { font-size: 8.5px; }
  .pc-credit { font-size: 6.6px; }
  .sheet { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px; }
  .stamp-face { min-height: 128px; }
  .rating-card { grid-template-columns: minmax(0, 1fr); }
  .envelope { grid-template-columns: minmax(0, 1fr); }
  .dock {
    display: flex; position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 12px; gap: 6px; padding: 6px;
    background: var(--ink); border-radius: 12px; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .5);
    transform: translateY(140%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  }
  .dock.is-shown { transform: none; }
  .dock a { flex: 1; display: grid; place-items: center; min-height: 48px; border-radius: 8px; font-weight: 700; font-size: 15px; text-decoration: none; color: #fff; }
  .dock a:first-child { background: var(--red); color: var(--ink); }
  .dock a:nth-child(2) { background: var(--lime); color: var(--ink); }
}
@media (max-width: 520px) {
  .sheet { padding: 10px; }
  .stamp { padding: 7px; -webkit-mask-size: 12px 12px, auto; mask-size: 12px 12px, auto; -webkit-mask-position: -6px -6px, 0 0; mask-position: -6px -6px, 0 0; }
  .stamp-face { min-height: 112px; padding: 9px 7px; }
  .stamp-day { font-size: 8.5px; letter-spacing: 0; white-space: nowrap; }
  .stamp[data-day="0"] { grid-column: span 2; }
  .v-long { display: none; }
  .v-short { display: inline; }
  .stamp-val { font-size: 23px; }
  .vbtn { padding: 0 14px; font-size: 14px; }
  .viewer-stage { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot { animation: none; }
  .lift-inner { transition-duration: .01s; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .letter.reveal { transform: rotate(-.6deg); }
  .bars i::after { transition: none; }
}
