@layer reset, tokens, scene, components, views, utilities;

/* Self-hosted subsets (assets/fonts/README.md). Fallback faces are metric-adjusted to keep swap shifts small. */
@font-face { font-family: "Rye"; src: url("/assets/fonts/rye.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Rye Fallback"; src: local("Georgia"), local("Times New Roman"), local("DejaVu Serif");
  size-adjust: 118%; ascent-override: 84%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "Lora Fallback"; src: local("Georgia"), local("Times New Roman"), local("DejaVu Serif");
  size-adjust: 104%; ascent-override: 97%; descent-override: 26%; line-gap-override: 0%; }


/* Cross-document view transitions (progressive): chrome holds still, content cross-fades. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

@layer reset { *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
 }
@layer tokens { :root {
  --ink: #2b1d12;
  --ink-soft: #4a3423;
  --parchment: #f3e4c8;
  --sky: #e9c58f;
  --font-display: "Rye", "Rye Fallback", serif;
  --font-body: "Lora", "Lora Fallback", Georgia, serif;
  --sway-amp: 1.2deg;
  --sway-period: 6s;
  /* Sign hangs from the top edge; the top --rope-crop of its height (rope) is off-screen. */
  --sign-w: clamp(250px, 27vw, 420px);
  --sign-h: calc(var(--sign-w) / 1.3576);
  --rope-crop: .24;
  --nav-w: min(880px, 94vw);
  --nav-top: calc(var(--sign-h) * (.985 - var(--rope-crop)) - 6px);
  --chrome-h: calc(var(--nav-top) + var(--nav-w) / 4.8329 + 12px);
}
@media (max-width: 767.98px) {
  :root { --sign-w: min(76vw, 330px); --nav-w: 96vw; --chrome-h: calc(var(--nav-top) + 118px); }
}
 }
@layer scene { html { scroll-padding-top: calc(var(--chrome-h) + 1rem); }
body { font-family: var(--font-body); color: var(--ink); background: var(--sky); min-height: 100vh;
  overflow-x: hidden; line-height: 1.6; }
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%; }
main { position: relative; z-index: 5; padding: calc(var(--chrome-h) + 1rem) clamp(24px, 6vw, 90px) 14vh; }
@media (max-width: 767.98px) { main { padding-inline: 16px; } }

.sign { view-transition-name: sign; }
.cloud-nav { view-transition-name: nav; }
 }
@layer components {
/* Sign (D7): outer = CSS idle sway, inner = JS spring. Live text over the painted plank. */
.sign { position: fixed; top: calc(var(--sign-h) * var(--rope-crop) * -1); left: 50%; z-index: 20; width: var(--sign-w);
  translate: -50% 0; transform-origin: 50% 0; animation: sway var(--sway-period) ease-in-out infinite alternate; }
@keyframes sway { from { rotate: calc(-1 * var(--sway-amp)); } to { rotate: var(--sway-amp); } }
.sign__body { display: block; position: relative; width: 100%; transform-origin: 50% 0; cursor: grab;
  color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
  touch-action: pan-y; /* horizontal drags swing the sign; vertical pans still scroll the page */
  filter: drop-shadow(0 10px 10px rgb(43 29 18 / .35)); }
.sign__name { position: absolute; left: var(--bx); top: var(--by); width: var(--bw); height: var(--bh);
  display: grid; place-items: center; padding-bottom: 2%;
  font-family: var(--font-display); font-size: calc(var(--sign-w) * .16); line-height: 1; color: var(--ink);
  text-shadow: 0 1px 0 rgb(255 240 210 / .45); }
.sign__body.is-dragging { cursor: grabbing; }
.sign__body img { pointer-events: none; }
.sign__body:focus-visible { outline: none; }
.sign__body:focus-visible .sign__name { outline: 3px solid var(--parchment); outline-offset: -12%; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .sign { animation: none; } }

/* Cloud nav: painted cloud bank (desktop), one puff per link (mobile). */
.cloud-nav { position: fixed; z-index: 15; top: var(--nav-top); left: 50%; translate: -50% 0; width: var(--nav-w);
  aspect-ratio: 4.8329; background: image-set(url("/assets/img/art/cloud-bank-1400.avif") type("image/avif"), url("/assets/img/art/cloud-bank-1400.webp") type("image/webp")) center / 100% 100% no-repeat;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; align-content: center; gap: 0 1.1em;
  padding: calc(var(--nav-w) * .005) calc(var(--nav-w) * .11) 0; filter: drop-shadow(0 6px 8px rgb(43 29 18 / .18)); }
.cloud-nav a { font-family: var(--font-display); font-size: clamp(.9rem, 1.2vw, 1.1rem); text-decoration: none; white-space: nowrap;
  padding: .2em .1em; text-underline-offset: 5px; }
.cloud-nav a:hover, .cloud-nav a[aria-current="page"] { text-decoration: underline wavy 1.5px; }
.cloud-nav a:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; border-radius: 4px; }
/* Off-site cue (D10): painted tag in the nav */
.offsite { position: relative; display: inline-flex; align-items: center; gap: .25em; }
.offsite__tag { width: 1.9em; rotate: -8deg; translate: 0 -.15em; transition: translate .25s; }
.offsite:hover .offsite__tag, .offsite:focus-visible .offsite__tag { translate: .35em -.15em; }
@media (max-width: 767.98px) {
  .cloud-nav { aspect-ratio: auto; background: none; padding: 0; gap: 2px 0; filter: drop-shadow(0 4px 5px rgb(43 29 18 / .18)); }
  .cloud-nav a { font-size: .95rem; padding: 1.15em 1.6em .8em; background: image-set(url("/assets/img/art/cloud-puffs-2-562.avif") type("image/avif"), url("/assets/img/art/cloud-puffs-2-562.webp") type("image/webp")) center / 100% 100% no-repeat; }
  .cloud-nav a:nth-child(3n+1) { background-image: image-set(url("/assets/img/art/cloud-puffs-1-374.avif") type("image/avif"), url("/assets/img/art/cloud-puffs-1-374.webp") type("image/webp")); }
  .cloud-nav a:nth-child(3n) { background-image: image-set(url("/assets/img/art/cloud-puffs-3-640.avif") type("image/avif"), url("/assets/img/art/cloud-puffs-3-640.webp") type("image/webp")); }
}
@media (prefers-reduced-motion: reduce) { .offsite__tag { transition: none; } }

/* Painted panels: % padding would resolve against the containing block, so pads derive from --w. */
.scroll { --w: min(480px, 100%); width: var(--w); aspect-ratio: 2.1558; background: image-set(url("/assets/img/art/scroll-banner-1280.avif") type("image/avif"), url("/assets/img/art/scroll-banner-1280.webp") type("image/webp")) center / 100% 100% no-repeat;
  display: grid; place-items: center; padding: calc(var(--w) * .03) calc(var(--w) * .17) calc(var(--w) * .04); text-align: center; font-style: italic;
  font-size: clamp(.9rem, 1.25vw, 1.05rem); line-height: 1.4; filter: drop-shadow(0 8px 10px rgb(43 29 18 / .25)); }

/* Props with a measured content box (--bx/--by/--bw/--bh from art.yml), tilted by --tilt. */
.prop { position: relative; display: block; text-decoration: none; rotate: var(--tilt, 0deg); transition: rotate .2s;
  filter: drop-shadow(0 8px 8px rgb(43 29 18 / .28)); }
.prop:hover, .prop:focus-visible { rotate: 0deg; }
.prop:focus-visible { outline: none; }
.prop:focus-visible .prop__label, .prop:focus-visible .note h2 { outline: 3px solid var(--parchment); outline-offset: 2px; border-radius: 6px; }
.prop__label { position: absolute; left: var(--bx); top: var(--by); width: var(--bw); height: var(--bh);
  display: grid; place-items: center; font-family: var(--font-display); line-height: 1; color: var(--ink);
  text-shadow: 0 1px 0 rgb(255 240 210 / .4); }
.prop--arrow { width: clamp(190px, 19vw, 240px); }
.prop--arrow .prop__label { padding-right: 22%; font-size: clamp(1.4rem, 2.3vw, 1.9rem); }
.prop--plank { width: clamp(190px, 19vw, 240px); }
.prop--plank .prop__label { font-size: clamp(1.15rem, 1.9vw, 1.55rem); padding: 0 6%; }
.note { --w: clamp(190px, 18vw, 230px); width: var(--w); aspect-ratio: 0.7762; background: image-set(url("/assets/img/art/note-pinned-600.avif") type("image/avif"), url("/assets/img/art/note-pinned-600.webp") type("image/webp")) center / 100% 100% no-repeat;
  padding: calc(var(--w) * .2) calc(var(--w) * .14) calc(var(--w) * .16); text-align: center; display: grid; align-content: center; gap: .4em; }
.note h2 { font-family: var(--font-display); font-weight: normal; font-size: clamp(1.4rem, 2.2vw, 1.75rem); line-height: 1.05; }
.note p { font-size: .82rem; line-height: 1.35; color: var(--ink-soft); }

/* Small board: Recent Posts */
.board-small { --w: clamp(280px, 26vw, 340px); width: var(--w); aspect-ratio: 1.3916; background: image-set(url("/assets/img/art/board-small-720.avif") type("image/avif"), url("/assets/img/art/board-small-720.webp") type("image/webp")) center / 100% 100% no-repeat;
  padding: calc(var(--w) * .08) calc(var(--w) * .16) calc(var(--w) * .07); color: var(--parchment); filter: drop-shadow(0 8px 10px rgb(43 29 18 / .3));
  text-shadow: 0 1px 2px rgb(0 0 0 / .7); }
.board-small h2 { font-family: var(--font-display); font-weight: normal; text-align: center; font-size: 1.3rem; margin-bottom: .2em; }
.board-small li + li { border-top: 1px dashed rgb(243 228 200 / .35); }
.board-small a { display: block; padding: .3em 0; text-decoration: none; line-height: 1.25; }
.board-small a:hover { text-decoration: underline; }
.board-small a:focus-visible { outline: 2px dashed var(--parchment); outline-offset: 2px; }
.board-small time { display: block; font-size: .72rem; opacity: .8; }

/* Polaroid: the painted window is transparent; the live photo sits behind it. */
.polaroid { position: relative; width: clamp(200px, 18vw, 240px); filter: drop-shadow(0 8px 10px rgb(43 29 18 / .3)); }
.polaroid__photo { position: absolute; left: var(--bx); top: var(--by); width: var(--bw); height: var(--bh); overflow: hidden;
  background: radial-gradient(circle at 30% 35%, #f1d9a6 0 12%, transparent 13%),
              linear-gradient(180deg, #e8b878 0 55%, #a7703f 55% 100%);
  display: grid; place-items: end center; padding-bottom: 8%; font-size: .7rem; color: rgb(43 29 18 / .75); text-align: center; text-decoration: none; }
.polaroid__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.polaroid__photo img.is-loaded { opacity: 1; }
.polaroid__photo:focus-visible { outline: 3px solid var(--parchment); outline-offset: -3px; }
.polaroid picture { position: relative; pointer-events: none; }
.polaroid figcaption { position: absolute; left: 12%; right: 10%; bottom: 7%; text-align: center; rotate: 4deg; }
.polaroid__shuffle { font-family: var(--font-display); font-size: .9rem; line-height: 1.2; padding: .1em .3em; border-radius: 4px; }
.polaroid__shuffle span { display: inline-block; transition: rotate .4s; }
.polaroid__shuffle:hover span, .polaroid__shuffle:focus-visible span { rotate: 180deg; }
.polaroid__shuffle:focus-visible { outline: 2px dashed var(--ink); }
.polaroid[aria-busy="true"] .polaroid__shuffle span { animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

@media (max-width: 767.98px) {
  .scroll { --w: 100%; font-size: .9rem; }
  .prop { rotate: 0deg; }
  .prop--arrow, .prop--plank { width: min(50vw, 220px); }
  .note { --w: min(58vw, 240px); }
  .board-small { --w: min(88vw, 340px); }
  .polaroid { width: min(66vw, 240px); }
}
@media (prefers-reduced-motion: reduce) {
  .prop, .polaroid__shuffle span, .polaroid__photo img { transition: none; }
  .polaroid[aria-busy="true"] .polaroid__shuffle span { animation: none; }
}

/* Subpage: 9-slice board frame + 3-slice parchment poster (D8). */
.sub { display: flex; justify-content: flex-end; }
.frame { width: min(640px, 52vw); margin-right: 3vw; container-type: inline-size; border: 42px solid transparent;
  border-image: image-set(url("/assets/img/art/board-frame-800.avif") type("image/avif"), url("/assets/img/art/board-frame-800.webp") type("image/webp")) 7.9% 14.62% 7.82% 14.7% / 42px / 0 stretch;
  background: linear-gradient(90deg, rgb(0 0 0 / .25) 0 2px, transparent 2px) 0 0 / 64px 100%,
              linear-gradient(180deg, #4b3021, #3a2418) padding-box;
  padding: 8px 10px 14px; filter: drop-shadow(0 14px 18px rgb(43 29 18 / .45)); }
.poster { position: relative; border-style: solid; border-color: transparent;
  border-width: calc(100cqi * 0.1929) 0 calc(100cqi * 0.2357) 0;
  border-image: image-set(url("/assets/img/art/poster-sheet-1120.avif") type("image/avif"), url("/assets/img/art/poster-sheet-1120.webp") type("image/webp")) 11.76% 0 14.38% 0 fill / 1 / 0 stretch;
  padding: 0 9%; }
/* Close (D12): a Rye "X" inked on the parchment, left of the right-hand nail. */
.poster__close { position: absolute; z-index: 1; top: calc(100cqi * -.135); right: 15%;
  display: grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%;
  font-family: var(--font-display); font-size: clamp(1.5rem, 5.5cqi, 2.1rem); line-height: 1; color: var(--ink);
  text-decoration: none; text-shadow: 0 1px 0 rgb(255 240 210 / .5); transition: rotate .2s, scale .2s, background-color .2s; }
.poster__close span { translate: 0 .06em; }
.poster__close:hover, .poster__close:focus-visible { rotate: -12deg; scale: 1.15; background-color: rgb(43 29 18 / .1); }
.poster__close:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
.poster__header { margin-top: calc(100cqi * -.075); font-family: var(--font-display); font-weight: normal; text-align: center;
  letter-spacing: .05em; font-size: clamp(1.9rem, 8.5cqi, 3.6rem); line-height: 1.05; text-wrap: balance;
  padding-inline: clamp(1.6rem, 7cqi, 2.4rem); /* clear the close X */ }
.poster__header:focus { outline: none; }
.poster__subhead { font-family: var(--font-display); text-align: center; font-size: clamp(1rem, 4cqi, 1.3rem); line-height: 1.25;
  margin: .2em 0 .9em; padding-bottom: .4em; border-bottom: 3px double var(--ink); text-wrap: balance; }
.poster__art { width: min(78%, 400px); margin: 0 auto 1.3em; }
.poster__art img { width: 100%; box-shadow: 0 2px 0 rgb(43 29 18 / .25); }

@media (max-width: 767.98px) {
  /* Board frame disappears; parchment runs edge to edge. */
  .sub { display: block; margin-inline: -16px; }
  .frame { width: 100%; margin: 0; border: 0; border-image: none; background: none; padding: 0; filter: none; }
  .poster { padding-inline: 8%; }
  .poster__header { font-size: 7.5cqi; padding-inline: 15cqi; }
}
@media (prefers-reduced-motion: reduce) { .poster__close { transition: none; } }

/* Markdown body inside the poster. */
.prose { overflow-wrap: break-word; }
.prose > * + * { margin-top: .9em; }
.prose .lede { font-weight: 600; }
.prose h2, .prose h3 { font-family: var(--font-display); font-weight: normal; line-height: 1.15; margin-top: 1.4em; }
.prose h2 { font-size: 1.45rem; }
.prose h3 { font-size: 1.2rem; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose a:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
/* Off-site cue in body copy (D10): classic glyph. Own domain is not off-site. */
.prose a[href^="http"]:not([href*="//bronius.com"]):not([href*=".bronius.com"])::after,
.prose a[href*="violinstudio.bronius.com"]::after { content: "\2009\2197"; font-size: .85em; text-decoration: none; display: inline-block; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: "\2605\2002"; }   /* sheriff-star bullets */
.prose ul li::marker { color: var(--ink-soft); font-size: .8em; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .5em; }
.prose hr { border: 0; border-top: 3px double var(--ink); margin-block: 1.6em; }
.prose code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86em;
  background: rgb(43 29 18 / .08); padding: .05em .3em; border-radius: 3px; }
.prose pre { background: rgb(43 29 18 / .08); padding: .8em 1em; border-radius: 4px; overflow-x: auto; font-size: .9em; line-height: 1.45; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote { border-left: 3px solid var(--ink-soft); padding-left: 1em; font-style: italic; }
.prose img { margin-inline: auto; }
/* Photos in content (legacy .media-placeholder blocks): a print tacked to the poster. */
.prose .media-placeholder { background: #fbf5e6; padding: 10px 10px 12px; margin-block: 1.6em; rotate: -.8deg;
  box-shadow: 0 1px 2px rgb(43 29 18 / .25), 0 6px 12px rgb(43 29 18 / .18); font-size: .9rem; font-style: italic; color: var(--ink-soft); }
.prose .media-placeholder:nth-of-type(even) { rotate: .8deg; }
.prose .media-placeholder strong { display: block; font-family: var(--font-display); font-style: normal; font-weight: normal; color: var(--ink); margin-bottom: .4em; }
.prose .media-placeholder img { width: 100%; margin-bottom: .5em; }
.post-meta { font-style: italic; color: var(--ink-soft); text-align: center; margin-top: -.4em; }

/* about.markdown: list of roles joined with Oxford commas. */
.rotate span::after { content: ", "; }
.rotate span:last-child::after { content: ""; }
.rotate span:nth-last-child(2)::after { content: ", and "; }

}
@layer views { .home { display: grid; justify-items: center; gap: clamp(1.5rem, 3vw, 2.5rem); max-width: 1000px; margin-inline: auto; }
.home__pillars, .home__lower { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap;
  gap: clamp(1.2rem, 4vw, 3.5rem); }
.home__lower { align-items: flex-start; }
.home__lower .board-small { rotate: -1.5deg; }
@media (max-width: 767.98px) {
  .home__pillars, .home__lower { flex-direction: column; align-items: center; }
  .home__lower > * { rotate: 0deg !important; }
  .home__lower > * { content-visibility: auto; contain-intrinsic-size: auto 300px; }
}
 }
@layer utilities { .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .5em .9em; background: var(--parchment); color: var(--ink);
  font-weight: 600; border-radius: 6px; translate: 0 -200%; transition: translate .15s; }
.skip-link:focus { translate: 0 0; outline: 2px dashed var(--ink); }
 }
