:root {
  --castle-night: #382d61;
  --castle-ink: #30304c;
  --castle-paper: #fcf9f2;
  --castle-gold: #f2ce7c;
  --castle-muted: #686679;
  --castle-teal: #276b66;
  --castle-coral: #e89a8b;
}
* { box-sizing: border-box; }
body.castle-page { margin: 0; background: var(--castle-paper); color: var(--castle-ink); font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
a { color: inherit; }
button, input, select { font: inherit; }
.castle-wrap { width: min(1280px, calc(100% - 72px)); margin-inline: auto; }
.castle-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px max(36px, calc((100vw - 1280px) / 2)); background: #fffdf8; border-bottom: 1px solid #eae3d7; }
.castle-brand { position: relative; padding-left: 42px; text-decoration: none; font-weight: 800; line-height: 1.3; font-size: 1.25rem; letter-spacing: -.03em; color: var(--castle-night); }
.castle-brand > span { position: absolute; left: 0; top: -4px; color: var(--castle-teal); font-size: 2.15rem; }
.castle-brand small { display: block; margin-top: 3px; font-weight: 500; font-size: .69rem; letter-spacing: .015em; color: var(--castle-muted); }
.castle-school { display: block; padding-left: 20px; border-left: 1px solid #ded7ca; }
.castle-school img { display: block; width: 49px; height: 56px; object-fit: contain; }
.castle-hero { position: relative; overflow: hidden; padding: 70px 0 62px; background: radial-gradient(ellipse at 15% 10%, #f6e6d1 0, transparent 45%), radial-gradient(ellipse at 90% 80%, #dbece2 0, transparent 48%), #f7f1e7; }
.castle-hero-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.castle-hero-copy { position: relative; z-index: 1; }
.castle-eyebrow { font-size: .7rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; color: var(--castle-teal); }
.castle-hero .castle-eyebrow { display: inline-flex; gap: 9px; align-items: center; padding: 5px 12px; border-radius: 30px; border: 1px solid #d9cdb9; color: #6c5335; background: #fffaf166; letter-spacing: .09em; }
.castle-hero .castle-eyebrow > span { color: #95692a; font-size: 1rem; }
.castle-hero h1 { font-size: clamp(2.5rem, 4.6vw, 4.1rem); font-weight: 800; line-height: 1.1; letter-spacing: -.06em; margin: 24px 0; }
.castle-hero h1 em { position: relative; display: inline-block; font-family: Georgia, 'Times New Roman', serif; font-size: 1.05em; font-weight: 400; color: var(--castle-teal); letter-spacing: -.055em; }
.castle-hero h1 em::after { content: ''; display: block; position: absolute; left: 2%; right: -1%; bottom: -9px; height: 8px; border-top: 3px solid #e4b363; border-radius: 50%; transform: rotate(-2deg); }
.castle-hero p { max-width: 500px; color: #65616c; font-size: 1rem; line-height: 1.8; margin: 28px 0; }
.castle-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 2; }
.castle-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; background: var(--castle-teal); border: 1px solid var(--castle-teal); border-radius: 10px; padding: 13px 19px; font-size: .86rem; font-weight: 650; color: white; text-decoration: none; cursor: pointer; line-height: 1.4; transition: background .18s, transform .18s; }
.castle-button:hover { background: #1e5753; transform: translateY(-2px); }
.castle-button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #a86427; outline-offset: 4px; }
.castle-button-ghost { border-color: #cdc2b2; background: transparent; color: var(--castle-ink); }
.castle-button-ghost:hover { background: #fff9ed; }
.castle-button-outline { border-color: #d7ccdc; background: transparent; color: var(--castle-night); }
.castle-button-outline:hover { background: #eee7f2; }
.castle-school-note { display: flex; gap: 12px; align-items: center; margin-top: 28px; font-size: .75rem; color: #5d5463; }
.castle-school-note small { display: block; font-size: .7rem; color: #746d77; margin-top: 1px; }
.castle-camera-icon { display: grid; place-items: center; width: 37px; height: 37px; flex-shrink: 0; background: #e8dded; border-radius: 11px; color: #6d517d; transform: rotate(-6deg); }
.castle-camera-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.castle-hero-art { position: relative; min-width: 0; padding: 12px 12px 0; margin: 16px 7px 16px 0; border-radius: 24px; background: #fffdf9; box-shadow: 0 22px 50px #5e476514; transform: rotate(3deg); border: 1px solid #e5dbce; }
.castle-hero-art::before { content: '✦'; position: absolute; left: -37px; bottom: 17px; font-size: 44px; color: #c99363; transform: rotate(-9deg); z-index: 1; }
.castle-art-label { display: flex; align-items: center; gap: 18px; position: absolute; top: -23px; right: 20px; padding: 10px 19px; background: #f2d388; color: #624d2e; box-shadow: 0 4px 0 #d7b96d22; font-size: .78rem; font-weight: 650; border-radius: 5px; transform: rotate(-9deg); z-index: 1; }
.castle-art-label > span { font-size: 1.3rem; line-height: 1; }
.castle-scene { display: block; width: 100%; height: auto; border-radius: 17px; }
.castle-art-caption { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 14px 6px; font-size: .67rem; color: #766875; letter-spacing: .015em; }
.castle-art-caption > span { color: #b88759; }
.castle-sparkles { animation: castle-twinkle 5s ease-in-out infinite; }
.castle-hero-edge { position: absolute; inset: auto 0 0; height: 5px; background: linear-gradient(90deg, #e8b3a4 0 25%, #b9a8ce 25% 50%, #e8ca87 50% 75%, #a6c9bb 75%); }
@keyframes castle-twinkle { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.castle-gallery { padding-top: 54px; padding-bottom: 76px; min-height: 400px; scroll-margin-top: 25px; }
.castle-gallery-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; }
.castle-gallery h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.2; margin: 11px 0 14px; }
.castle-gallery-heading p { max-width: 700px; margin: 0 0 16px; color: var(--castle-muted); font-size: .94rem; }
.castle-edition-picker { min-width: 215px; padding-top: 3px; }
.castle-edition-picker label { display: block; font-size: .75rem; margin-bottom: 7px; font-weight: 600; color: var(--castle-muted); }
.castle-edition-picker select { width: 100%; background: #fff; border: 1px solid #dcd4c8; border-radius: 10px; padding: 11px 12px; font-size: .86rem; color: var(--castle-ink); }
.castle-howto { display: flex; gap: 28px; flex-wrap: wrap; padding: 21px 0; margin: 8px 0 20px; border-bottom: 1px solid #e8e0d3; color: #666172; font-size: .78rem; }
.castle-howto > span { display: flex; align-items: center; gap: 8px; }
.castle-howto b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #eae1ef; font-size: .65rem; font-weight: 650; color: #6c4f80; }
.castle-howto > span:nth-child(2) b { background: #e1eee7; color: #35685d; }
.castle-howto > span:nth-child(3) b { background: #f4e3c4; color: #8b632b; }
.castle-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; margin: 0 0 20px; }
.castle-days a { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 12px; border-radius: 11px; border: 1px solid #e2d9cb; text-decoration: none; font-size: .82rem; background: #fffdf9; transition: background .18s, border-color .18s; }
.castle-days a:hover { background: #f1e9f5; border-color: #ccbad6; }
.castle-days a[aria-current=page] { background: #f1e9f5; color: var(--castle-night); border-color: #86709d; box-shadow: inset 0 0 0 1px #86709d; }
.castle-day-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 9px; background: #f6e8d0; color: #825825; font-size: .95rem; }
.castle-days a[aria-current=page] .castle-day-icon { background: var(--castle-night); color: #fff; }
.castle-days :is(strong, small) { display: block; }
.castle-days small { margin-top: 2px; color: var(--castle-muted); font-size: .68rem; }
.castle-result-count { font-size: .8rem; color: var(--castle-muted); margin: 0 0 23px; }
.castle-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 27px; }
.castle-photo-card { display: block; text-decoration: none; min-width: 0; padding: 10px 10px 0; background: #fff; border: 1px solid #e8e1d7; border-bottom: 4px solid #c0b0d2; border-radius: 16px; box-shadow: 0 5px 15px #584c3e05; transition: transform .2s, box-shadow .2s; }
.castle-photo-card:nth-child(3n+2) { border-bottom-color: #a9cbbd; }
.castle-photo-card:nth-child(3n+3) { border-bottom-color: #ebc58d; }
.castle-photo-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 12px 24px #59486a12; }
.castle-photo-frame { position: relative; overflow: hidden; aspect-ratio: 4/3; border-radius: 9px; background: #ede8e0; }
.castle-photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.castle-photo-frame > span { position: absolute; bottom: 10px; right: 10px; background: #382d61eb; color: #fff; padding: 6px 12px; font-size: .71rem; border-radius: 7px; opacity: 0; transition: opacity .2s; }
.castle-photo-card:hover img { transform: scale(1.035); }
.castle-photo-card:hover .castle-photo-frame > span, .castle-photo-card:focus-visible .castle-photo-frame > span { opacity: 1; }
.castle-photo-caption { display: flex; gap: 12px; justify-content: space-between; padding: 14px 4px 17px; }
.castle-photo-caption strong { display: block; font-size: .82rem; }
.castle-photo-caption small { display: block; margin-top: 3px; font-size: .68rem; color: var(--castle-muted); overflow-wrap: anywhere; }
.castle-photo-caption > span { display: inline-flex; align-items: center; align-self: center; gap: 5px; white-space: nowrap; color: #725b76; background: #f4edf5; padding: 4px 9px; border-radius: 20px; font-size: .8rem; }
.castle-empty { grid-column: 1/-1; text-align: center; padding: 58px 22px; border: 1px dashed #d9c9dd; border-radius: 18px; background: linear-gradient(130deg, #f2ecf655, #f4e5c955); width: 100%; margin: 8px 0; }
.castle-empty > span { display: grid; place-items: center; width: 64px; height: 64px; margin: auto; font-size: 2.5rem; color: #94749d; background: #eae0f0; border-radius: 22px; transform: rotate(-6deg); }
.castle-empty h3 { font-weight: 650; font-size: 1.4rem; letter-spacing: -.03em; margin: 20px 0 10px; }
.castle-empty p { color: var(--castle-muted); font-size: .9rem; }
.castle-pagination { display: flex; justify-content: center; align-items: center; gap: 25px; margin-top: 40px; font-size: .85rem; }
.castle-footer { position: relative; text-align: center; padding: 33px 24px; border-top: 1px solid #e5dce7; background: #f0eaf2; color: #6f6078; font-size: .8rem; }
.castle-footer-star { display: block; font-size: 1.6rem; color: #9272a2; margin-bottom: 6px; }
.castle-footer strong { display: block; color: var(--castle-night); font-size: 1.1rem; font-weight: 700; letter-spacing: -.025em; }
.castle-footer p { margin: 8px 0 3px; }
.castle-footer small { display: block; font-size: .68rem; }
.castle-footer > div { margin-top: 13px; font-size: .72rem; }
.castle-footer a { text-underline-offset: 3px; }
.castle-footer .castle-contribute { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; margin: 20px auto 0; padding-top: 15px; border-top: 1px solid #e1d6e5; width: fit-content; max-width: 100%; font-size: .7rem; }
.castle-contribute > span { color: #76677f; }
.castle-contribute a { padding: 4px 0; text-decoration-color: #b9a6c3; }
.castle-contribute a:hover { color: var(--castle-night); text-decoration-color: currentColor; }
.castle-photo-detail { padding-block: 30px 65px; }
.castle-back { display: inline-flex; gap: 8px; margin-bottom: 28px; text-decoration: none; font-size: .83rem; color: #665675; }
.castle-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.castle-detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 35px; align-items: start; }
.castle-detail-image { padding: 11px; background: #fff; border: 1px solid #e3d9cf; border-radius: 17px; box-shadow: 0 8px 20px #59486a08; }
.castle-detail-image img { display: block; border-radius: 8px; width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #f2ede7; }
.castle-detail-info { border: 1px solid #e2d7e6; border-radius: 17px; padding: 26px; background: #f5eff7; border-top: 5px solid #bda9cd; }
.castle-detail-info h1 { font-size: 1.9rem; font-weight: 750; line-height: 1.15; letter-spacing: -.045em; margin: 14px 0; }
.castle-detail-info p { color: var(--castle-muted); font-size: .88rem; }
.castle-detail-info .castle-button { width: 100%; }
.castle-download-note { display: block; text-align: center; color: var(--castle-muted); font-size: .7rem; margin: 9px 0 20px; }
.castle-photo-rotation { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.castle-detail-info .castle-photo-rotation .castle-button { flex: 1 1 130px; width: auto; }
.castle-stats { display: flex; gap: 30px; border-top: 1px solid #dfd3e5; padding-top: 20px; margin: 22px 0 0; }
.castle-stats dt { font-size: .7rem; color: var(--castle-muted); }
.castle-stats dd { font-size: 1.25rem; margin: 4px 0 0; font-weight: 700; color: var(--castle-night); }
@media (max-width: 1100px) {
  .castle-hero-layout { gap: 30px; }
  .castle-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); }
  .castle-hero-actions .castle-button { font-size: .78rem; padding: 12px 16px; }
  .castle-art-caption { gap: 9px; font-size: .57rem; }
}
@media (max-width: 850px) {
  .castle-hero { padding: 46px 0 40px; }
  .castle-hero-layout { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 25px; }
  .castle-hero h1 { font-size: clamp(2rem, 4.7vw, 2.8rem); }
  .castle-hero p { font-size: .9rem; }
  .castle-art-label { font-size: .65rem; padding: 8px 12px; right: 10px; }
  .castle-hero-art::before { left: -21px; font-size: 30px; }
  .castle-school-note { font-size: .67rem; }
  .castle-school-note small { font-size: .63rem; }
  .castle-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .castle-detail-layout { grid-template-columns: 1fr; }
  .castle-detail-info { max-width: 650px; }
}
@media (max-width: 620px) {
  .castle-wrap { width: calc(100% - 36px); }
  .castle-nav { padding: 15px 18px; }
  .castle-brand { font-size: 1.05rem; padding-left: 34px; }
  .castle-brand > span { font-size: 1.8rem; top: -3px; }
  .castle-brand small { font-size: .6rem; }
  .castle-school { padding-left: 13px; }
  .castle-school img { width: 39px; height: 45px; }
  .castle-hero { padding: 35px 0 35px; }
  .castle-hero-layout { display: flex; flex-direction: column; gap: 34px; }
  .castle-hero-copy { width: 100%; }
  .castle-hero .castle-eyebrow { font-size: .6rem; padding: 4px 9px; }
  .castle-hero h1 { font-size: clamp(2rem, 8.6vw, 3.2rem); line-height: 1.13; margin: 21px 0; }
  .castle-hero p { max-width: 100%; font-size: .9rem; margin: 23px 0; }
  .castle-hero-actions { gap: 9px; }
  .castle-hero-actions .castle-button { width: 100%; font-size: .8rem; padding-block: 13px; }
  .castle-school-note { margin-top: 22px; }
  .castle-hero-art { width: min(330px, calc(100% - 24px)); margin: 5px 0 7px; padding: 8px 8px 0; border-radius: 17px; }
  .castle-scene { border-radius: 10px; }
  .castle-art-label { top: -18px; }
  .castle-art-caption { font-size: .58rem; padding-block: 11px; }
  .castle-art-label > span { font-size: 1rem; }
  .castle-gallery { padding-top: 35px; padding-bottom: 45px; }
  .castle-gallery-heading { display: block; }
  .castle-gallery h2 { font-size: 1.85rem; }
  .castle-gallery-heading p { font-size: .86rem; }
  .castle-edition-picker { margin: 20px 0; }
  .castle-howto { margin: 0 0 20px; gap: 11px 18px; padding: 16px 0 21px; font-size: .68rem; }
  .castle-howto b { width: 23px; height: 23px; font-size: .6rem; }
  .castle-days { gap: 7px; }
  .castle-days a { padding: 8px 12px; font-size: .72rem; }
  .castle-photo-grid { grid-template-columns: 1fr; gap: 21px; }
  .castle-photo-frame > span { opacity: 1; font-size: .65rem; }
  .castle-photo-detail { padding-block: 23px 40px; }
  .castle-detail-layout { gap: 24px; }
  .castle-detail-info { padding: 22px; }
  .castle-detail-info h1 { font-size: 1.8rem; }
  .castle-footer { padding: 26px 20px; }
  .castle-footer strong { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
