/* The Advent of Code log (templates/blog/aoc-<lang>.html), after studio.css
   and post.css. The hero is a terminal on a winter night: a fir garland
   with holly and twinkling lamps under the window bar, a wreath on the
   right, frost in the corners, snow falling (aoc.ts), the calendar as
   twelve gifts with snow on their lids, and a snowdrift at the bottom with
   a candy cane, a present and an elf peeking over it. The body is post.css
   prose in sections, one per day: a holly sprig before each kicker, a candy
   stripe between the days, the PowerShell snippet on the terminal's glass
   with another elf looking over its edge, the picture of each day as a
   perforated postage stamp. The whole sheet is a New Year letter: cream
   paper in an air mail edge, a handwritten greeting, address and signature.
   Paler snow falls behind the page. Gold is a star, teal a day open and
   unsolved, berry red the festive accent, magenta the prompt, fountain pen
   blue the handwriting. The pictures are static/blog/advent-of-code-2026/.
   The two script faces (Caveat for the hand, Marck Script for the stamps'
   greeting, both with Cyrillic) come from Google Fonts, which the CSP
   allows for styles and fonts. */

@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Marck+Script&display=swap");

.aoc {
    --term: #0D1533;
    --term-2: #16214A;
    --term-line: rgba(255, 236, 200, .1);
    --term-ink: #FBF1E2;
    --term-dim: #A9A3B8;
    --star: var(--gold-2);
    --berry: #C8202F;
    --snow: #F5F8FD;
}

/* Hero: the terminal */

.aoc-hero { container: aoc / inline-size; }
.aoc-term {
    --pad: clamp(14px, 2.4vw, 28px);
    position: relative;
    overflow: hidden;
    padding: 0 var(--pad);
    border-radius: calc(var(--radius-xl) - var(--sheet-pad, 16px) * .5);
    background:
        radial-gradient(70% 70% at 50% 0%, rgba(255, 196, 110, .22), transparent 70%),
        radial-gradient(60% 80% at 100% 100%, rgba(255, 150, 70, .18), transparent 60%),
        radial-gradient(70% 90% at 0% 100%, rgba(255, 190, 110, .14), transparent 60%),
        linear-gradient(180deg, #13204A, var(--term) 65%);
    color: var(--term-ink);
    font-family: var(--font-mono);
}
/* Frost in the corners of the window. */
.aoc-term::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(120px 90px at 0 0, rgba(230, 240, 255, .22), transparent 70%),
        radial-gradient(140px 100px at 100% 0, rgba(230, 240, 255, .16), transparent 70%),
        radial-gradient(160px 80px at 0 100%, rgba(230, 240, 255, .12), transparent 70%);
}
/* Faint scan lines, as on an old screen. */
.aoc-term::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 4px);
}
/* The snow of the window (aoc.ts) falls behind everything in it. */
.aoc-snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.aoc-term > :not(.aoc-snow) { position: relative; z-index: 1; }

.aoc-term-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-inline: calc(var(--pad) * -1);
    padding: 12px var(--pad);
    border-bottom: 1px solid var(--term-line);
    background: rgba(255, 255, 255, .04);
    font-size: 12px;
    color: var(--term-dim);
}
.aoc-term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.aoc-term-bar i:nth-child(2) { background: #FEBC2E; }
.aoc-term-bar i:nth-child(3) { background: #28C840; }
.aoc-term-bar span { margin-left: 10px; letter-spacing: .02em; }

/* The garland hangs from the bar across the whole window. */
.aoc-term > .aoc-garland {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: 38px;
    height: 54px;
    pointer-events: none;
    background: url("/static/blog/advent-of-code-2026/garland.svg") repeat-x 0 0 / 180px 54px;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35));
}
/* The wreath on its ribbon, over the garland. */
.aoc-term > .aoc-wreath {
    position: absolute;
    z-index: 3;
    top: 4px;
    right: clamp(12px, 4%, 40px);
    width: clamp(70px, 11cqi, 112px);
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45));
    transform-origin: 50% 0;
    animation: aoc-sway 6s ease-in-out infinite;
}
@keyframes aoc-sway { 50% { transform: rotate(2.5deg); } }

.aoc-prompt {
    margin: 64px 0 6px;
    padding-right: clamp(70px, 11cqi, 110px);
    font-size: clamp(12.5px, 1.5vw, 15px);
    line-height: 1.5;
    color: var(--term-ink);
    overflow-wrap: anywhere;
}
.aoc-ps { color: #FFC56E; font-weight: 600; }
.aoc-caret {
    display: inline-block;
    width: .6em;
    height: 1.1em;
    margin-left: 4px;
    vertical-align: -.2em;
    background: var(--term-ink);
    animation: aoc-blink 1.1s steps(1) infinite;
}
@keyframes aoc-blink { 50% { opacity: 0; } }

/* The answer of the command, above the calendar it prints. */
.aoc-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 18px;
    padding-right: clamp(70px, 11cqi, 110px);
    font-size: 12px;
    line-height: 1.5;
    color: var(--term-dim);
}
.aoc-status-stars { font-weight: 600; color: var(--gold-1); }

/* The calendar: six gifts a row, four in a narrow hero, three on a phone. */
.aoc-cal {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(12px, 1.6vw, 16px) clamp(6px, 1vw, 10px);
    margin: 0;
    padding: 6px 0 0;
    list-style: none;
}
@container aoc (max-width: 760px) { .aoc-cal { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* On a phone the calendar keeps four a row and drops the names, so the
   first screen shows the letter too, not only the calendar. */
@container aoc (max-width: 560px) {
    .aoc-tile { min-height: 64px; padding: 10px 8px 7px; }
    .aoc-tile-name { display: none; }
}

/* A day not solved is a wrapped present: paper in cranberry, pine or night
   blue with a little pattern, a gold ribbon crossing it and a bow on top. */
.aoc-tile {
    --paper: #8E1E2A;
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 4px;
    height: 100%;
    min-height: 92px;
    padding: 12px 11px 9px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .25);
    background:
        linear-gradient(90deg, transparent 70%, #E9B949 70% 72%, #F7D98A 72% 75%, #C9962E 75% 77%, transparent 77%),
        linear-gradient(180deg, transparent 60%, #E9B949 60% 62%, #F7D98A 62% 65%, #C9962E 65% 67%, transparent 67%),
        radial-gradient(circle, rgba(255, 240, 210, .16) 1.4px, transparent 1.8px) 0 0 / 11px 11px,
        linear-gradient(160deg, color-mix(in srgb, var(--paper) 85%, #fff), var(--paper) 60%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 12px -6px rgba(0, 0, 0, .6);
    color: #FFF3DE;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
    text-decoration: none;
    transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .35s var(--spring);
}
.aoc-cal li:nth-child(3n+2) .aoc-tile { --paper: #1F5136; }
.aoc-cal li:nth-child(3n) .aoc-tile { --paper: #24407C; }
/* The bow where the ribbon meets the lid. */
.aoc-tile::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: -9px;
    left: calc(73.5% - 13px);
    width: 26px;
    height: 16px;
    background:
        radial-gradient(circle at 50% 55%, #C9962E 0 3.2px, transparent 3.6px),
        radial-gradient(ellipse 40% 46% at 27% 50%, #F2C94C 0 70%, #C9962E 72%, transparent 76%),
        radial-gradient(ellipse 40% 46% at 73% 50%, #F2C94C 0 70%, #C9962E 72%, transparent 76%);
    filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .35));
}
/* Snow on every lid. */
.aoc-tile::before {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    top: -5px;
    height: 10px;
    border-radius: 10px 10px 8px 8px;
    background:
        radial-gradient(circle at 22% 100%, var(--snow) 3.5px, transparent 4px),
        radial-gradient(circle at 63% 100%, var(--snow) 4.5px, transparent 5px),
        linear-gradient(var(--snow), #DCE6F2);
    background-size: 100% 13px, 100% 14px, 100% 100%;
    background-repeat: no-repeat;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.aoc-tile-n { position: relative; font: 600 clamp(18px, 2.2vw, 24px)/1 var(--font-mono); letter-spacing: -.03em; color: inherit; opacity: .92; }
.aoc-tile-name { position: relative; font: 500 11.5px/1.3 var(--font-body); overflow-wrap: anywhere; }
.aoc-stars { position: relative; display: flex; gap: 3px; font-size: 13px; line-height: 1; }
.aoc-stars i { font-style: normal; color: rgba(255, 240, 210, .3); }
.aoc-stars i.is-on { color: var(--star); text-shadow: 0 0 10px color-mix(in srgb, var(--star) 70%, transparent); }

/* A solved day is a present unwrapped: no ribbon, no bow, warm gold light
   from inside the box. */
.aoc-tile.is-solved {
    border-color: color-mix(in srgb, var(--star) 55%, transparent);
    background:
        radial-gradient(110% 90% at 35% 25%, rgba(255, 214, 140, .5), transparent 70%),
        linear-gradient(160deg, #5A3A1A, #2A1A10);
    box-shadow: 0 0 24px -4px color-mix(in srgb, var(--star) 60%, transparent), inset 0 0 0 1px rgba(255, 231, 168, .25);
    color: #FFF3DE;
}
.aoc-tile.is-solved::after { display: none; }
.aoc-tile.is-solved .aoc-tile-n { color: var(--gold-1); }
a.aoc-tile:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--star); }
a.aoc-tile:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 3px; }
/* Open on the site but not solved here yet (aoc.ts): a gold dashed seam. */
.aoc-tile.is-open { outline: 2px dashed rgba(255, 214, 140, .75); outline-offset: -5px; }
/* The puzzle of today (aoc.ts): the box glows like a lamp, slowly. */
.aoc-tile.is-today { animation: aoc-today 2.6s ease-in-out infinite; }
@keyframes aoc-today {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 184, 77, .55), 0 0 14px rgba(255, 184, 77, .25); }
    50% { box-shadow: 0 0 0 2px rgba(255, 184, 77, .95), 0 0 26px 3px rgba(255, 184, 77, .6); }
}

/* The snowdrift at the bottom: a back drift, the cane, the present and the
   elf standing in it, a front drift over their feet. */
.aoc-ground {
    height: clamp(78px, 11cqi, 104px);
    margin: 8px calc(var(--pad) * -1) 0;
    background: url("/static/blog/advent-of-code-2026/drift.svg") repeat-x 0 100% / 260px 60px;
}
.aoc-ground::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 30px;
    background: url("/static/blog/advent-of-code-2026/drift.svg") repeat-x 70px 100% / 300px 30px;
}
.aoc-ground img { position: absolute; z-index: 1; height: auto; pointer-events: none; }
.aoc-cane { left: 7%; bottom: 10px; width: clamp(26px, 3.4cqi, 36px); rotate: -9deg; }
.aoc-gift { left: calc(7% + clamp(34px, 5cqi, 52px)); bottom: 8px; width: clamp(46px, 6.4cqi, 64px); rotate: 4deg; }
.aoc-elf {
    right: clamp(18px, 12%, 140px);
    bottom: 18px;
    width: clamp(78px, 11cqi, 112px);
    animation: aoc-peek 7s ease-in-out infinite;
}
/* Every few seconds the elf ducks a little and comes back up. */
@keyframes aoc-peek { 0%, 70%, 100% { translate: 0 0; } 78%, 86% { translate: 0 10px; } }

/* Body */

.aoc-sec > * + * { margin-top: 1.1em; }
.aoc-sec > h2 { margin-top: .5em; }
.aoc-sec > h3 { margin-top: 1.6em; }
.aoc-sec > h3 + * { margin-top: .5em; }
.post-body > .aoc-sec + .aoc-sec { margin-top: clamp(40px, 6vw, 72px); }
.post-body > .aoc-sign-row + .post-glossary { margin-top: clamp(40px, 6vw, 72px); }
.post-body > .aoc-letter-head + .aoc-sec { margin-top: clamp(30px, 4vw, 48px); }
.aoc-kicker { display: flex; align-items: center; gap: 8px; color: var(--berry); }
/* A sprig of holly before every kicker. */
.aoc-kicker::before {
    content: "";
    flex: none;
    width: 26px;
    height: 18px;
    background: url("/static/blog/advent-of-code-2026/holly.svg") center / contain no-repeat;
}
/* A candy stripe between the days. */
.aoc-day::before {
    content: "";
    display: block;
    height: 8px;
    margin-bottom: clamp(26px, 4vw, 42px);
    border-radius: 8px;
    background: repeating-linear-gradient(-45deg, #D3202F 0 9px, #FFF8F0 9px 18px);
    box-shadow: inset 0 0 0 1px rgba(126, 15, 26, .25), 0 4px 10px -6px rgba(126, 15, 26, .6);
}

/* The picture of the day (static/blog/advent-of-code-2026/dayNN.svg) is a
   postage stamp: white paper with perforated edges (the holes are a mask:
   a grid of circles over the whole stamp, joined with a solid content box
   so they bite only the margin), set a little askew, with the post's name,
   the year, the stars of the day as its value and a greeting in a Soviet
   card's script over the picture, and a postmark over its corner. On a
   wide screen it stands a little wider than the text. */
.aoc-sec > .aoc-stamp { margin-top: 1.6em; }
.aoc-stamp {
    position: relative;
    filter: drop-shadow(0 16px 18px rgba(70, 30, 20, .26)) drop-shadow(0 1px 1.5px rgba(70, 30, 20, .2));
}
@media (min-width: 900px) {
    .post-body .aoc-stamp { width: calc(100% + 80px); max-width: none; margin-inline: -40px; }
}
.aoc-stamp-paper {
    --r: 6px;
    --s: 17px;
    position: relative;
    container: stamp / inline-size;
    padding: calc(var(--r) * 2.4);
    background: #FFFDF7;
    rotate: -.8deg;
    -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(var(--r) at var(--r) var(--r), #0000 97%, #000) calc(var(--r) * -1) calc(var(--r) * -1) / var(--s) var(--s) round;
    mask: linear-gradient(#000 0 0) content-box, radial-gradient(var(--r) at var(--r) var(--r), #0000 97%, #000) calc(var(--r) * -1) calc(var(--r) * -1) / var(--s) var(--s) round;
}
.aoc-illo { display: block; width: 100%; height: auto; outline: 1px solid rgba(23, 18, 28, .18); outline-offset: -1px; }
.aoc-stamp-paper > span {
    position: absolute;
    color: #FFF6DE;
    text-shadow: 0 1px 2px rgba(20, 8, 20, .6);
    pointer-events: none;
}
.aoc-stamp-country {
    left: calc(var(--r) * 2.4 + 3cqi);
    top: calc(var(--r) * 2.4 + 2.6cqi);
    font: 600 clamp(8px, 1.9cqi, 12px)/1 var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
}
.aoc-stamp-year {
    right: calc(var(--r) * 2.4 + 3cqi);
    top: calc(var(--r) * 2.4 + 2.6cqi);
    font: 600 clamp(9px, 2.2cqi, 14px)/1 var(--font-mono);
    letter-spacing: .1em;
}
.aoc-stamp-value {
    left: calc(var(--r) * 2.4 + 3cqi);
    bottom: calc(var(--r) * 2.4 + 2.4cqi);
    font: 700 clamp(18px, 5.4cqi, 34px)/1 var(--font-display);
    color: var(--gold-1);
}
.aoc-stamp-wish {
    right: calc(var(--r) * 2.4 + 4cqi);
    bottom: calc(var(--r) * 2.4 + 1.6cqi);
    font: 400 clamp(22px, 6.6cqi, 44px)/1 "Marck Script", "Segoe Script", cursive;
    color: #FFE7A8;
    rotate: -5deg;
    text-shadow: 0 0 12px rgba(255, 190, 90, .55), 0 2px 3px rgba(40, 10, 10, .7);
}
/* The postmark: rings, the post's name round the edge, the date, and the
   wavy cancel lines running over the stamp. */
.aoc-postmark {
    position: absolute;
    right: clamp(-46px, -4vw, -10px);
    top: clamp(-34px, -3vw, -14px);
    width: clamp(120px, 26%, 190px);
    height: auto;
    color: rgba(47, 40, 92, .78);
    font-family: var(--font-mono);
    rotate: -12deg;
    pointer-events: none;
}

/* The letter: the sheet of the post is cream writing paper with the red and
   white edge of an air mail envelope, a little wider margins, and in the
   ink of a fountain pen a greeting, an address block with two stamps and a
   postmark, and a signature at the end. */
.post { --sheet-pad: clamp(22px, 3.4vw, 46px); }
/* The sheet sits above the page's snow and the things on the table. */
.post-article {
    z-index: 1;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 60px 90px -50px rgba(20, 4, 6, .75), 0 4px 14px rgba(20, 4, 6, .35);
}
/* The air mail edge: red and blue bands with cream between, as on an old
   envelope, and the lamp's warm light falling on the top left of the page. */
.post-article::before {
    border: clamp(8px, 1vw, 11px) solid transparent;
    background:
        radial-gradient(70% 45% at 12% 0%, rgba(255, 190, 110, .2), transparent 70%) padding-box,
        radial-gradient(160% 80% at 50% 0%, #FFFDF7, #FAF1DE) padding-box,
        repeating-linear-gradient(-45deg, #C8343A 0 14px, #FFFDF7 14px 20px, #2B4A8F 20px 34px, #FFFDF7 34px 40px) border-box;
}
.aoc-hand { font-family: "Caveat", "Segoe Print", cursive; font-weight: 500; color: #2C3A8E; }
.aoc-letter-head {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 18px 30px;
    padding-bottom: 26px;
    border-bottom: 1px dashed rgba(44, 58, 142, .28);
}
.aoc-avia {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    font: 700 11.5px/1 var(--font-mono);
    letter-spacing: .22em;
    color: #2B4A8F;
}
.aoc-avia::before, .aoc-avia::after {
    content: "";
    flex: 1;
    height: 6px;
    background: repeating-linear-gradient(-45deg, #C8343A 0 6px, transparent 6px 9px, #2B4A8F 9px 15px, transparent 15px 18px);
    opacity: .75;
}
.aoc-greeting { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; text-wrap: pretty; }
.aoc-address {
    position: relative;
    display: grid;
    align-content: end;
    gap: 10px;
    padding-left: 26px;
    border-left: 1px solid rgba(23, 18, 28, .16);
}
/* Two Soviet New Year stamps: the clock tower at midnight and Ded Moroz
   with a letter, each with its value and a line in script, and a postmark
   struck across both. */
.aoc-letter-stamps { position: relative; display: flex; justify-content: flex-end; gap: 14px; margin-bottom: 10px; padding-top: 4px; }
.aoc-mini-stamp {
    --r: 3.5px;
    --s: 10px;
    position: relative;
    display: block;
    width: clamp(78px, 9vw, 94px);
    padding: calc(var(--r) * 2.2);
    background: #FFFDF7;
    rotate: 4deg;
    -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(var(--r) at var(--r) var(--r), #0000 97%, #000) calc(var(--r) * -1) calc(var(--r) * -1) / var(--s) var(--s) round;
    mask: linear-gradient(#000 0 0) content-box, radial-gradient(var(--r) at var(--r) var(--r), #0000 97%, #000) calc(var(--r) * -1) calc(var(--r) * -1) / var(--s) var(--s) round;
}
.aoc-mini-stamp--moroz { rotate: -4deg; }
.aoc-letter-stamps > span { filter: drop-shadow(0 5px 6px rgba(70, 30, 20, .3)); }
.aoc-mini-art { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; }
.aoc-mini-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aoc-mini-art > span { position: absolute; pointer-events: none; }
.aoc-mini-value { top: 4px; left: 5px; font: 700 10px/1 var(--font-mono); color: #FFE7A8; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.aoc-mini-wish {
    left: 4px;
    right: 4px;
    bottom: 4px;
    font: 400 clamp(11px, 1.3vw, 13px)/1 "Marck Script", "Segoe Script", cursive;
    text-align: center;
    color: #FFE7A8;
    text-shadow: 0 0 6px rgba(255, 190, 90, .6), 0 1px 2px rgba(0, 0, 0, .7);
}
.aoc-mini-stamp--moroz .aoc-mini-value { color: #C8202F; text-shadow: 0 0 3px #fff; }
/* Inline code on the letter: warm, like a word underlined in pencil. */
.post-body :not(pre) > code { background: #F2E3C6; color: #4A2A1A; }
.aoc-postmark--small {
    right: clamp(38px, 5vw, 58px);
    left: auto;
    top: 18px;
    width: clamp(130px, 15vw, 160px);
    rotate: -9deg;
    color: rgba(47, 40, 92, .72);
}
.aoc-line {
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(44, 58, 142, .25);
    font-size: clamp(21px, 2.2vw, 25px);
    line-height: 1.25;
}
.aoc-line span { font-weight: 700; margin-right: 4px; }
/* The signature, with a glass of tea in its holder and tangerines beside
   it, as on the kitchen table. */
.post-body > .aoc-sign-row { display: flex; align-items: flex-end; justify-content: flex-end; gap: clamp(10px, 3vw, 28px); margin-top: 2.4em; }
.aoc-tea { flex: none; width: clamp(130px, 22vw, 190px); height: auto; }
.aoc-sign { margin: 0 0 14px; font-size: clamp(26px, 2.8vw, 32px); line-height: 1.15; text-align: right; }
@media (max-width: 640px) {
    .aoc-letter-head { grid-template-columns: minmax(0, 1fr); }
    .aoc-address { padding: 18px 0 0; border-left: 0; border-top: 1px solid rgba(23, 18, 28, .16); }
}

/* The glossary is a page from an exercise book: ruled lines, a red margin,
   the heading by hand, a holly berry before every word. */
.post-page .post-glossary {
    border-color: rgba(120, 80, 40, .16);
    background:
        linear-gradient(90deg, transparent 46px, rgba(200, 52, 58, .45) 46px 48px, transparent 48px),
        repeating-linear-gradient(180deg, transparent 0 27px, rgba(120, 140, 190, .28) 27px 28px),
        #FFFEF8;
    box-shadow: 0 10px 24px -16px rgba(70, 30, 20, .4);
}
.post-body .post-glossary h2 { font: 700 clamp(30px, 3.4vw, 38px)/1.1 "Caveat", "Segoe Print", cursive; letter-spacing: 0; color: #2C3A8E; padding-left: 40px; }
.post-glossary dl { padding-left: 34px; }
.post-page .g-entry dt::before { rotate: 0deg; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FF8A8A, #C61F2E 60%); }
.post-page .g-entry:target { background: rgba(255, 244, 220, .9); box-shadow: inset 0 0 0 2px rgba(233, 185, 73, .6); }

/* The festive colours replace the studio's magenta and teal on this page:
   cranberry links and markers, gold glossary words, a red and gold bar of
   reading progress. */
.post-page .post-head .eyebrow a, .post-body a:not([class]) { color: #B3262E; }
.post-body li::marker { color: #C61F2E; }
.post-body a.term {
    background: color-mix(in srgb, #E9B949 20%, transparent);
    text-decoration-color: color-mix(in srgb, #C9962E calc(45% + var(--near, 0) * 55%), transparent);
}
.post-body a.term:hover, .post-body a.term:focus-visible, .post-body a.term.is-open { background: color-mix(in srgb, #E9B949 34%, transparent); text-decoration-color: #A8740F; }
.post-gloss-term::before { rotate: 0deg; border-radius: 50%; background: #C61F2E; }
.post-progress span { background: linear-gradient(90deg, #C8202F, #E9B949); }
.post-toc-link.is-active::before { background: #C8202F; }

/* The table under the letter: a red checked tablecloth in the warm light of
   a lamp, the room darker at its edges. The code glyphs of other posts are
   not on this table. */
.post-page {
    background:
        radial-gradient(80% 55% at 50% 0%, rgba(255, 196, 120, .3), transparent 70%),
        radial-gradient(50% 40% at 0% 100%, rgba(255, 160, 80, .14), transparent 70%),
        radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(18, 4, 6, .55)),
        repeating-linear-gradient(0deg, rgba(255, 238, 215, .075) 0 22px, transparent 22px 44px),
        repeating-linear-gradient(90deg, rgba(255, 238, 215, .075) 0 22px, transparent 22px 44px),
        #6A1820;
    background-attachment: fixed, fixed, fixed, scroll, scroll, scroll;
}
.post-page .post-bg { display: none; }
.post-page .post-bar .brand, .post-page .footer .brand { color: #FFF1DC; }
.post-page .bar-links a, .post-page .footer-links a, .post-page .copyright, .post-page .seller, .post-page .seller a { color: rgba(255, 241, 220, .82); }
.post-page .bar-links a:not(.lang-switch):hover { background: rgba(255, 241, 220, .1); }
.post-page .footer-links a:hover, .post-page .seller a:hover { color: #FFD68C; }
.post-page .post-more-title { color: #FFF1DC; }
.post-page .post-more .more-link { color: #FFD68C; }

/* The things on the table around the letter, on wide screens where the
   table shows: a fir branch with baubles and a cone, garlands of old cone
   bulbs down both sides, tangerines, a letter to Ded Moroz, a candy cane.
   Some lie partly under the letter. Positions count from the middle of the
   page, so they keep their place beside the sheet. */
@media (min-width: 1240px) {
    .post { position: relative; }
    .post::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background:
            url("/static/blog/advent-of-code-2026/branch.svg") calc(50% - 690px) 90px / 460px auto no-repeat,
            url("/static/blog/advent-of-code-2026/tangerines.svg") calc(50% + 660px) 160px / 250px auto no-repeat,
            url("/static/blog/advent-of-code-2026/envelope.svg") calc(50% - 660px) 1250px / 330px auto no-repeat,
            url("/static/blog/advent-of-code-2026/candy-cane.svg") calc(50% + 640px) 1500px / 54px auto no-repeat,
            url("/static/blog/advent-of-code-2026/tangerines.svg") calc(50% - 650px) 2500px / 230px auto no-repeat,
            url("/static/blog/advent-of-code-2026/branch.svg") calc(50% + 680px) 3100px / 400px auto no-repeat,
            url("/static/blog/advent-of-code-2026/lights.svg") calc(50% + 640px) 520px / 260px auto repeat-y,
            url("/static/blog/advent-of-code-2026/lights.svg") calc(50% - 640px) 0 / 240px auto repeat-y;
    }
}

/* A PowerShell snippet: a file tab, the language, the copy button (aoc.ts),
   then the code on the terminal's glass. Long lines scroll sideways. An elf
   looks over its top edge, so it leaves room above. */
.aoc-sec > .aoc-snippet { margin-top: clamp(64px, 8vw, 80px); }
.aoc-snippet {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(60, 30, 15, .3);
    background: #1F1511;
    box-shadow: 0 26px 50px -34px rgba(60, 25, 10, .65);
}
.aoc-snippet-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 6px 8px 6px 16px;
    border-radius: 17px 17px 0 0;
    border-bottom: 1px solid rgba(255, 236, 210, .08);
    background: #2A1C16;
    font: 500 12px/1.3 var(--font-mono);
    color: #A8957F;
}
.aoc-snippet-file { color: #F4E6D6; }
.aoc-snippet-lang { margin-right: auto; padding: 2px 8px; border-radius: 999px; background: rgba(233, 185, 73, .18); color: #F2D28A; }
.aoc-copy {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 236, 210, .16);
    border-radius: 10px;
    background: rgba(255, 236, 210, .05);
    font: 500 12px/1 var(--font-mono);
    color: #F4E6D6;
    cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.aoc-copy:hover { background: rgba(255, 236, 210, .12); }
.aoc-copy:focus-visible { outline: 2px solid #FFC56E; outline-offset: 2px; }
.aoc-copy.is-done { border-color: rgba(233, 185, 73, .7); color: #F2D28A; }
/* The code on cocoa: warm colours, every one well over 7:1 on the
   background. */
.aoc-code {
    margin: 0;
    padding: 16px 18px 18px;
    overflow-x: auto;
    border-radius: 0 0 17px 17px;
    font: 400 14px/1.7 var(--font-mono);
    color: #F4E6D6;
    tab-size: 4;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 236, 210, .2) transparent;
}
.post-body .aoc-code code { padding: 0; border-radius: 0; background: none; font: inherit; color: inherit; white-space: pre; }
.aoc-t-cmd { color: #F7D774; }
.aoc-t-var { color: #A9D4EE; }
.aoc-t-op { color: #F7A487; }
.aoc-t-num { color: #FFC08A; }
.aoc-t-str { color: #C3E3A8; }
.aoc-t-kw { color: #E9C2FF; }
.aoc-t-pipe { color: #F7A487; font-weight: 600; }
.aoc-t-com { color: #B9A48C; font-style: italic; }
/* The elf with its mittens on the top edge of the snippet. */
.aoc-snippet > .aoc-peek {
    position: absolute;
    z-index: 2;
    left: clamp(110px, 30%, 210px);
    bottom: calc(100% - 9px);
    width: clamp(70px, 9vw, 92px);
    height: auto;
    pointer-events: none;
}

/* The page's own snow (aoc.ts), beside the glyphs of post.ts. */
.aoc-page-snow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.aoc-page-snow canvas { display: block; width: 100%; height: 100%; }

@media (max-width: 560px) {
    .aoc-code { padding: 14px 14px 16px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .aoc-caret, .aoc-tile.is-today, .aoc-term > .aoc-wreath, .aoc-elf { animation: none; }
    a.aoc-tile:hover { transform: none; }
}
.motion-off .aoc-caret, .motion-off .aoc-tile.is-today, .motion-off .aoc-term > .aoc-wreath, .motion-off .aoc-elf { animation: none; }
.motion-off a.aoc-tile:hover { transform: none; }

@media (forced-colors: active) {
    .aoc-tile, .aoc-snippet { border: 1px solid CanvasText; }
    .aoc-stars i.is-on { color: Highlight; }
    .aoc-page-snow, .aoc-snow { display: none; }
}

@media print {
    .aoc-term, .aoc-snippet, .aoc-day::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .aoc-copy, .aoc-page-snow, .aoc-snow { display: none; }
    .aoc-code { white-space: pre-wrap; }
}
