/* Design "Панделка": powder-blue linen envelope tied with an ivory satin ribbon, ivory paper,
   a Polaroid that slides out of a gold slot */
body.theme-pandelka { --paper: #fbf8f2; --paper-2: #eef2f6; --ink: #2f3b4c; --muted: #6f7c8e; --accent: #4f6f99; --accent-2: #9db4d2; --gold: #b8955a; --gold-2: #ead6a6; --line: rgb(79 111 153 / .18); }

/* ── opening ── */
.opening.ribbon {
  --linen: #c9d8e8; --linen-2: #dbe6f1; --linen-3: #a9bfd6;
  background:
    radial-gradient(120% 80% at 50% 25%, rgb(255 255 255 / .55), transparent 60%),
    radial-gradient(90% 70% at 50% 115%, rgb(40 60 90 / .28), transparent 70%),
    var(--linen);
  display: grid; place-items: center; perspective: 1400px;
}
.opening.ribbon::before, .linen::before { /* linen weave + grain */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / .16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(60 85 120 / .07) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .3 0 0 0 0 .45 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
.opening.ribbon.clear::before { opacity: 0; }
.ribbon .envelope { position: relative; width: min(86vw, 430px); aspect-ratio: 4 / 5; transform-style: preserve-3d; margin-top: 8vh; }
.ribbon .envelope .shadow { position: absolute; inset: 6% -2% -6%; background: radial-gradient(closest-side, rgb(40 60 90 / .45), transparent); filter: blur(18px); }
.ribbon .envelope .back { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(#93abc6, #b6c9dd); }
.ribbon .envelope .back::after { /* ivory liner with tiny stars, seen once the flap is up */
  content: ""; position: absolute; inset: 4% 4% 40%; border-radius: 4px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cpath d='M18 10l1.6 4.4L24 16l-4.4 1.6L18 22l-1.6-4.4L12 16l4.4-1.6z' fill='%23c9a764' opacity='.55'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #fffdf7, #f1e8d6);
  background-size: 36px 36px, auto;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.ribbon .envelope .card { position: absolute; z-index: 2; inset: 7% 7% 9%; border-radius: 4px; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center;
  background: linear-gradient(#fffdf9, #f4efe5); box-shadow: 0 2px 0 rgb(255 255 255 / .7) inset, 0 20px 40px -20px rgb(30 50 80 / .5); color: var(--accent); }
.ribbon .envelope .card .script { font-size: clamp(54px, 15vw, 76px); }
.ribbon .envelope .card .caps { font-size: 11px; color: var(--muted); }
.ribbon .envelope .card .mini-date { font: 400 16px/1 var(--caps); letter-spacing: .26em; color: var(--ink); }

.ribbon .flap { position: absolute; inset: 0; }
.ribbon .flap .face { position: absolute; inset: 0; }
.ribbon .flap svg.edge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ribbon .flap svg.edge polyline { fill: none; stroke: #fffaf0; stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .75; }
.linen { background: radial-gradient(140% 100% at 30% 20%, var(--linen-2), var(--linen) 55%, var(--linen-3)); }
.linen::before { opacity: .9; }
.ribbon .f-left .face { clip-path: polygon(0 0, 53% 52%, 0 100%); filter: brightness(1.03); }
.ribbon .f-right .face { clip-path: polygon(100% 0, 47% 52%, 100% 100%); filter: brightness(.95); }
.ribbon .f-bottom .face { clip-path: polygon(0 100%, 50% 47%, 100% 100%); filter: brightness(1.07); }
.ribbon .f-left .face::after, .ribbon .f-right .face::after, .ribbon .f-bottom .face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to var(--to, right), rgb(40 60 90 / .18), transparent 60%); }
.ribbon .f-right .face { --to: left; }
.ribbon .f-bottom .face { --to: top; }
.ribbon .f-left, .ribbon .f-right, .ribbon .f-bottom { z-index: 3; }
.ribbon .f-top { inset: 0 0 auto; height: 60%; transform-origin: 50% 0; transform-style: preserve-3d; z-index: 4; }
.ribbon .f-top .face { backface-visibility: hidden; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.ribbon .f-top .face.front { filter: drop-shadow(0 6px 6px rgb(40 60 90 / .3)); }
.ribbon .f-top .face.front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgb(255 255 255 / .18), rgb(40 60 90 / .12)); }
.ribbon .f-top .face.inner { transform: rotateX(180deg); background: linear-gradient(160deg, #fffdf7, #efe4cf); }

/* satin ribbon wrapped around the envelope, tied in a bow at the tip of the flap */
.band { position: absolute; z-index: 5; pointer-events: none; }
.band.v { left: 50%; top: -2%; bottom: -2%; width: 11%; transform: translateX(-50%); }
.band.h { top: 60%; left: -2%; right: -2%; height: 8.5%; transform: translateY(-50%); }
.band span { position: absolute; inset: 0; box-shadow: 0 2px 6px -3px rgb(40 60 90 / .28); }
.band.v span { background: linear-gradient(90deg, #ece3d5, #fbf8f2 16%, #fffefb 38%, #f5efe4 58%, #fffdf9 78%, #e6dccd); }
.band.h span { background: linear-gradient(180deg, #ece3d5, #fbf8f2 16%, #fffefb 38%, #f5efe4 58%, #fffdf9 78%, #e6dccd); }
.band.v .a { bottom: 50%; } .band.v .b { top: 50%; }
.band.h .a { right: 50%; } .band.h .b { left: 50%; }
.bow { position: absolute; left: 50%; top: 60%; width: clamp(210px, 64vw, 300px); aspect-ratio: 1.25; transform: translate(-50%, -46%); z-index: 6; filter: drop-shadow(0 8px 10px rgb(40 60 90 / .35)); overflow: visible; }
.bow svg { width: 100%; height: 100%; overflow: visible; }

.opening.ribbon .glow { position: absolute; left: 50%; top: 52%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); border-radius: 50%; opacity: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(closest-side, rgb(255 253 245 / .95), rgb(255 240 210 / .5) 30%, transparent 62%); }
.opening.ribbon .flash { position: absolute; inset: 0; background: #fffdf8; opacity: 0; z-index: 8; pointer-events: none; }
.opening.ribbon .tap-hint { color: #fffaf0; text-shadow: 0 1px 6px rgb(40 60 90 / .4); }

/* ── letter ── */
.theme-pandelka .cover { padding-top: 54px; }
.theme-pandelka .cover .names { font-size: clamp(84px, 26vw, 132px); margin: 6px 0 0; }
.sprigs { width: min(86vw, 460px); height: auto; margin: 0 auto; color: var(--accent-2); }
.sprigs.bottom { transform: scaleY(-1); }
.frame-line { position: absolute; inset: 12px; border: 1px solid var(--line); border-radius: 22px; pointer-events: none; }
.frame-line::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgb(184 149 90 / .35); border-radius: 16px; }

/* gold slot with the Polaroid sliding out of it */
.slot { width: min(76vw, 300px); margin: 18px auto 0; position: relative; z-index: 2; }
.slot .bar { height: 16px; border-radius: 9px; background: linear-gradient(180deg, #f4e2b6, #c9a25e 45%, #9b7537 55%, #e9d3a0); box-shadow: 0 4px 10px -4px rgb(90 60 20 / .6), 0 1px 0 rgb(255 255 255 / .6) inset; position: relative; }
.slot .bar::after { content: ""; position: absolute; left: 6%; right: 6%; top: 6px; height: 4px; border-radius: 3px; background: #4a3415; box-shadow: 0 1px 0 rgb(255 255 255 / .4); }
.slot .well { overflow: hidden; margin: -8px 7% 0; padding: 0 10px 22px; }
.polaroid { background: #fffefb; padding: 12px 12px 46px; border-radius: 3px; box-shadow: 0 18px 30px -18px rgb(40 60 90 / .55), 0 0 0 1px rgb(0 0 0 / .04); transform-origin: 50% 0; }
.polaroid svg { width: 100%; height: auto; border-radius: 2px; }
.polaroid p { margin: 12px 0 0; font: 400 26px/1 var(--script); color: var(--accent); text-align: center; }
.theme-pandelka .cover .date { margin-top: 8px; }
.theme-pandelka .godparents { margin: 18px 0 0; font-style: italic; color: var(--muted); }
.theme-pandelka .godparents b { font-weight: 500; font-style: normal; color: var(--ink); }
/* the rail is an SVG with a tall viewBox: without a height it takes 1000px and runs past the list */
.theme-pandelka .programme .rail { height: calc(100% - 20px); }
