/* CHRISTMAS LAYER. Loaded only while XMAS is true in worker/build.mjs, which also adds class "xmas" to <html> and the banner.
   To take it off in January: set XMAS = false in worker/build.mjs and deploy. Nothing else on the site refers to this file.
   No animation, so there is nothing to switch off for prefers-reduced-motion. */
:root {
  --xmas-berry: #7a1a2a;       /* banner background, white text on it is about 11:1 */
  --xmas-gold: #f1d28a;        /* sprig berries and rules, 12:1 on the black page */
  --xmas-leaf: var(--green-light);
}

.xmas-banner { background: var(--xmas-berry); color: var(--ink); border-bottom: 2px solid var(--xmas-gold); }
.xmas-banner-inner { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40px; padding-block: 8px; text-align: center; font-size: .88rem; line-height: 1.35; }
.xmas-banner p { margin: 0; }
.xmas-banner a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.xmas-banner a:hover { color: var(--xmas-gold); }
.xmas-banner a:focus-visible { outline-color: var(--xmas-gold); }

.xmas-sprig { flex: none; width: 30px; height: 22px; }
.xmas-sprig .leaf { fill: var(--xmas-leaf); }
.xmas-sprig .berry { fill: var(--xmas-gold); }
.xmas-sprig:last-child { transform: scaleX(-1); }

.xmas .rule { background: var(--xmas-gold); }
.xmas .work-tagline::after { content: ""; display: block; width: 46px; height: 2px; margin-top: 10px; background: var(--xmas-gold); }
.xmas .site-footer { border-top: 3px solid var(--xmas-berry); }
.footer-brand p.xmas-greeting { display: flex; align-items: center; gap: 10px; color: var(--xmas-gold); font-weight: 650; }
.xmas-greeting .xmas-sprig { width: 26px; height: 19px; }

@media (max-width: 540px) {
  .xmas-banner-inner { font-size: .82rem; gap: 8px; }
  .xmas-banner .xmas-sprig { width: 24px; height: 18px; }
}

/* Santa hat on the header logo and one tree by the footer greeting. Hat sizes and positions are in percentages of the logo, so it scales with it. */
:root {
  --xmas-trim: #f3ead8;
  --xmas-red: #c8323f;        /* hat, berries and the red bauble: brighter than the banner berry so it reads on black */
  --xmas-pine: #3f8a45;
  --xmas-pine-light: #79b65a;
}
.xmas .navigation .wordmark { position: relative; }
/* Sized to the logo: the brim spans the "c" (0 to 14% of the logo width) and sits on its top edge (25% down). */
.xmas-hat { position: absolute; left: -0.5%; top: -35%; width: 17%; height: auto; aspect-ratio: 60 / 50; transform: rotate(-8deg); transform-origin: 40% 85%; pointer-events: none; overflow: visible; }
.xmas-hat .hat-body { fill: var(--xmas-red); }
.xmas-hat .hat-trim, .xmas-hat .hat-bobble { fill: var(--xmas-trim); }
.xmas-tree { flex: none; width: 24px; height: 32px; }
.xmas-tree .tree-line { fill: none; stroke: var(--xmas-leaf); stroke-width: 1.600; stroke-linejoin: round; stroke-linecap: round; }
.xmas-tree .star, .xmas-tree .bauble { fill: var(--xmas-gold); }

/* Garland framing the top corners of the home and blog heroes (drawn by worker/xmas-garland.mjs). Decorative only. */
.xmas-frame { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.xmas-garland { position: absolute; top: 0; width: clamp(150px, 23vw, 330px); height: auto; aspect-ratio: 300 / 190; overflow: visible; }
.xmas-garland-left { left: 0; }
.xmas-garland-right { right: 0; transform: scaleX(-1); }
.xmas-garland .garland-pine-dark, .xmas-garland .garland-pine-light { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.xmas-garland .garland-pine-dark { stroke: var(--xmas-pine); }
.xmas-garland .garland-pine-light { stroke: var(--xmas-pine-light); }
.xmas-garland .garland-berry, .xmas-garland .garland-bauble-red { fill: var(--xmas-red); }
.xmas-garland .garland-bauble-gold, .xmas-garland .garland-cap { fill: var(--xmas-gold); }
.xmas-garland .garland-string { stroke: var(--xmas-gold); stroke-width: 1.2; fill: none; }
.xmas-garland .garland-shine { fill: var(--xmas-trim); opacity: .55; }

/* Advent calendar above Our Work on the home page (markup from worker/xmas-advent.mjs, doors driven by xmas.js).
   Same two-column shape as Our Work, mirrored: calendar left, copy right. Copy goes first on mobile. */
:root {
  --xmas-pine-deep: #1f4a28;
  --xmas-night: #121010;
  --xmas-glow: #3a0f18;
  --xmas-gold-line: #f1d28a4d;
}
.xmas-advent { background: radial-gradient(ellipse 60% 85% at 22% 45%, var(--xmas-glow) 0%, transparent 70%), var(--black); border-top: 1px solid var(--line); }
.advent-grid { display: grid; grid-template-columns: 1.05fr .85fr; gap: clamp(26px, 5.4vw, 84px); align-items: center; }
.advent-board { background: var(--xmas-night); border: 1px solid var(--xmas-gold-line); padding: clamp(12px, 1.8vw, 24px); box-shadow: 0 18px 50px #00000299; }
.advent-head { display: flex; align-items: center; justify-content: center; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--xmas-gold-line); }
.advent-head img { width: clamp(104px, 11vw, 150px); height: auto; }
.advent-x { color: var(--xmas-gold); font-size: 1.3rem; line-height: 1; }
.advent-brand { font: 600 clamp(1.15rem, 1.9vw, 1.6rem)/1 Geist, system-ui, sans-serif; letter-spacing: -.02em; color: var(--xmas-gold); }

.advent-doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); grid-auto-flow: dense; gap: clamp(5px, .7vw, 9px); aspect-ratio: 6 / 5; }
.advent-cell { min-width: 0; min-height: 0; }
.advent-door-wide { grid-column: span 2; }
.advent-door-big { grid-column: span 2; grid-row: span 2; }
.advent-door { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--xmas-night); perspective: 700px; }
.advent-door[aria-disabled="true"] { cursor: not-allowed; }
.advent-inside { position: absolute; inset: 0; overflow: hidden; background: var(--black); }
.advent-inside img { width: 100%; height: 100%; object-fit: cover; }
.advent-front { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid var(--xmas-gold-line); transform-origin: left center; transition: transform .35s ease, box-shadow .2s ease; }
.advent-berry .advent-front { background: var(--xmas-berry); }
.advent-pine .advent-front { background: var(--xmas-pine-deep); }
.advent-panel .advent-front { background: var(--panel); }
.advent-night .advent-front { background: var(--xmas-night); }
.advent-num { font: 600 clamp(1rem, 1.9vw, 1.6rem)/1 Geist, system-ui, sans-serif; color: var(--xmas-gold); }
.advent-door-big .advent-num { font-size: clamp(2.2rem, 4.4vw, 3.8rem); }
.advent-door:not([aria-disabled]):not(.is-open):hover .advent-front { transform: rotateY(-16deg); }
.advent-door.is-today:not(.is-open) .advent-front { box-shadow: inset 0 0 0 2px var(--xmas-gold); }
.advent-door.is-open .advent-front { transform: rotateY(-102deg); z-index: 1; }
.advent-door:focus-visible { outline: 2px solid var(--xmas-gold); outline-offset: 3px; z-index: 2; }

.advent-label { color: var(--xmas-gold); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.advent-copy h2 { font-size: clamp(2.2rem, 4.2vw, 4rem); line-height: 1.03; letter-spacing: -.045em; margin-bottom: 16px; text-wrap: balance; }
.advent-copy > p:not(.advent-label):not(.advent-status) { max-width: 36ch; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.45; }
.advent-status { margin-top: 14px; color: var(--green-light); font-weight: 650; }

.advent-dialog { width: min(780px, 92vw); border-top: 3px solid var(--xmas-berry); }
.advent-dialog-top, .advent-dialog-bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 18px; padding: 15px 18px; }
.advent-dialog-bottom { align-items: center; flex-wrap: wrap; }
.advent-dialog-day { color: var(--xmas-gold); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.advent-dialog h2 { font-size: clamp(1.3rem, 3vw, 2rem); line-height: 1.15; }
#advent-dialog-photo { display: block; width: 100%; height: auto; max-height: min(60dvh, 560px); object-fit: contain; background: var(--black); }
#advent-dialog-caption { color: var(--muted); font-size: .9rem; max-width: 46ch; }

@media (max-width: 799px) {
  .advent-grid { grid-template-columns: 1fr; }
  .advent-copy { order: -1; }
  .advent-doors { grid-template-columns: repeat(5, minmax(0, 1fr)); aspect-ratio: 5 / 6; }
  .advent-num { font-size: clamp(.95rem, 4.6vw, 1.3rem); }
}
.xmas .hero-controls { z-index: 1; }
