/* ============================================================
   DeAi協同組合 — Theme & Season layer
   Đề án 1 「和紙 / Washi」 = default in style.css — quiet editorial
   Đề án 2 「夜 / Yoru」   = CINEMA: full-bleed night, lantern gold
   Đề án 3 「空 / Sora」   = POSTER: bold graphic indigo, hard edges
   Seasons (auto by month): haru / natsu / aki / fuyu
   ============================================================ */

/* ============================================================
   Đề án 2 — 夜 (Yoru): cinematic night
   ============================================================ */

html[data-theme="yoru"] {
  --paper:        #16140f;
  --paper-2:      #1e1b14;
  --surface:      #1b1813;
  --ink:          #f0ede4;
  --ink-2:        #c9c3b4;
  --ink-3:        #a49d89;   /* lifted so meta text clears the 16% decor */
  --hair:         #2e2a21;
  --hair-strong:  #45402f;

  --dark:         #0b0a07;
  --dark-text:    #f0ede4;
  --dark-text-2:  #a8a293;
  --dark-hair:    rgba(240, 237, 228, 0.12);

  --shu:          #c9a63b;   /* kin — lantern gold */

  /* slower, more deliberate motion */
  --dur-reveal: 950ms;
  --dur-hero: 1250ms;
}

html[data-theme="yoru"] body::after {
  opacity: 0.08;
}

html[data-theme="yoru"] .header {
  background-color: rgba(22, 20, 15, 0.9);
}

/* The logo lockup has dark lettering — seat it on a paper plate */
html[data-theme="yoru"] .logo-wrapper {
  background: #f7f4ee;
  padding: 5px 12px;
  border-radius: 2px;
}

html[data-theme="yoru"] .loader-inner {
  background: #f7f4ee;
  padding: 30px 38px;
  border-radius: 3px;
}

/* --- Cinematic hero: the photograph fills the night --- */

html[data-theme="yoru"] .hero {
  padding-top: 0;
}

html[data-theme="yoru"] .hero .container {
  position: static;
}

html[data-theme="yoru"] .hero-grid {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  padding-top: clamp(120px, 16vh, 180px);
  padding-bottom: clamp(100px, 14vh, 160px);
}

html[data-theme="yoru"] .hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

html[data-theme="yoru"] .hero-figure {
  position: absolute;
  inset: 0;
  margin: 0;
  max-width: none;
  z-index: 0;
}

html[data-theme="yoru"] .hero-figure .img-frame {
  height: 100%;
  border: none;
  padding: 0;
  background: transparent;
}

html[data-theme="yoru"] .hero-figure .img-reveal {
  height: 100%;
}

html[data-theme="yoru"] .hero-figure .img-reveal img {
  aspect-ratio: auto;
  height: 100%;
  filter: grayscale(0.3) brightness(0.4) contrast(1.06);
}

html[data-theme="yoru"] .hero-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(11, 10, 7, 0.94) 18%,
    rgba(11, 10, 7, 0.55) 62%,
    rgba(11, 10, 7, 0.82) 100%);
}

html[data-theme="yoru"] .hero-figure .fig-caption {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  bottom: 96px;
  z-index: 2;
  color: var(--dark-text-2);
}

html[data-theme="yoru"] .hero-en-bg {
  top: auto;
  bottom: 6vh;
  right: auto;
  left: -0.04em;
  z-index: 1;
  font-size: clamp(7rem, 24vw, 20rem);
  -webkit-text-stroke-color: rgba(201, 166, 59, 0.3);
}

html[data-theme="yoru"] .hero-title {
  font-size: clamp(2.5rem, 6.2vw, 5rem);
}

html[data-theme="yoru"] .hero-eyebrow {
  border-color: rgba(240, 237, 228, 0.28);
  color: var(--ink-2);
}

html[data-theme="yoru"] .hero-tate {
  color: var(--shu);
  font-size: 1rem;
  z-index: 2;
}

html[data-theme="yoru"] .marquee {
  position: relative;
  z-index: 2;
  background: var(--dark);
  border-color: rgba(201, 166, 59, 0.3);
}

/* Gold-lantern buttons */
html[data-theme="yoru"] .btn {
  border-color: rgba(240, 237, 228, 0.55);
  color: var(--dark-text);
}

html[data-theme="yoru"] .btn-primary {
  background-color: var(--shu);
  border-color: var(--shu);
  color: #14120d;
}

html[data-theme="yoru"] .btn-primary:hover,
html[data-theme="yoru"] .band-dark .btn-primary:hover {
  background-color: #e2c46a;
  border-color: #e2c46a;
  color: #14120d;
}

/* Ghost numerals as set pieces */
html[data-theme="yoru"] .service-num {
  font-size: clamp(3.6rem, 7vw, 6.4rem);
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 166, 59, 0.55);
}

html[data-theme="yoru"] .service-row:hover .service-num {
  color: transparent;
  -webkit-text-stroke-color: var(--shu);
}

html[data-theme="yoru"] .timeline-num {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 166, 59, 0.55);
}

html[data-theme="yoru"] .sec-title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
}

html[data-theme="yoru"] .stats {
  border-top: 1px solid rgba(201, 166, 59, 0.35);
  border-bottom: 1px solid rgba(201, 166, 59, 0.35);
}

html[data-theme="yoru"] .stat-num {
  color: var(--shu);
}

html[data-theme="yoru"] .about-quote {
  border-left-color: var(--shu);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

html[data-theme="yoru"] .img-reveal img {
  filter: brightness(0.9) contrast(1.02);
}

html[data-theme="yoru"] .contact-form-card {
  background-color: var(--surface);
  border: 1px solid var(--hair);
}

html[data-theme="yoru"] .map-wrapper iframe {
  filter: grayscale(1) invert(0.92) contrast(0.95);
}

html[data-theme="yoru"] .map-pane:hover .map-wrapper iframe {
  filter: none;
}

html[data-theme="yoru"] .footer-wordmark {
  -webkit-text-stroke-color: rgba(240, 237, 228, 0.22);
}

html[data-theme="yoru"] .footer-wordmark .shu {
  -webkit-text-stroke-color: rgba(201, 166, 59, 0.65);
}

html[data-theme="yoru"] ::selection {
  color: #14120d;
}

/* --- Yoru motion language: film opening ---
   Title card on black → gold rule draws → curtain lifts →
   Ken Burns settle outlives the curtain (no dead moment). */

html[data-theme="yoru"] .page-loader {
  background: #0b0a07;
}

html[data-theme="yoru"] .loader-inner {
  display: none;
}

html[data-theme="yoru"] .page-loader::before {
  content: '出会い';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  color: #c9a63b;
  white-space: nowrap;
  padding-left: 0.18em; /* optical centering against tracking */
  opacity: 0;
  animation: yrTitleCard 1.5s cubic-bezier(0.16, 1, 0.3, 1) 150ms forwards;
}

@keyframes yrTitleCard {
  from { opacity: 0; letter-spacing: 0.6em; }
  to   { opacity: 1; letter-spacing: 0.2em; }
}

html[data-theme="yoru"] .page-loader::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(50% + 52px);
  width: 130px;
  height: 1px;
  background: rgba(201, 166, 59, 0.8);
  transform: translateX(-50%) scaleX(0);
  animation: yrRule 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

@keyframes yrRule {
  to { transform: translateX(-50%) scaleX(1); }
}

/* Curtain exit instead of a fade */
html[data-theme="yoru"] .page-loader.loaded {
  opacity: 1;
  transform: translateY(-101%);
  visibility: hidden;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1),
              visibility 0s 0.9s;
}

/* Hero photo: no clip wipe — fade up from black on a moving shot */
html.js[data-theme="yoru"] .hero-figure .img-reveal {
  clip-path: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out-quart);
}

html.js[data-theme="yoru"] .hero-figure .img-revealed .img-reveal {
  opacity: 1;
  animation: none;
}

html.js[data-theme="yoru"] .hero-figure .img-reveal img {
  transform: scale(1.14);
}

html.js[data-theme="yoru"] .hero-figure .img-revealed .img-reveal img {
  transition: none;
  animation: yrKenBurns 14s linear forwards;
  will-change: transform;
}

@keyframes yrKenBurns {
  from { transform: scale(1.14) translate3d(0, 0, 0); }
  to   { transform: scale(1.02) translate3d(-1.2%, 1%, 0); }
}

/* Oversize so scroll parallax never exposes edges */
html[data-theme="yoru"] .hero-figure {
  top: -8%;
  bottom: -8%;
}

/* Title: film-credit tracking-in instead of line masks */
html.js[data-theme="yoru"] .line-inner {
  transform: none;
  transition: none;
}

html.js[data-theme="yoru"] .hero-title {
  opacity: 0;
  letter-spacing: 0.34em;
  filter: blur(4px);
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1),
              letter-spacing 1.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js[data-theme="yoru"] .hero-title.lines-visible {
  opacity: 1;
  letter-spacing: 0.06em;
  filter: blur(0);
}

/* Section titles track in like credits (one-shot, short headlines) */
html.js[data-theme="yoru"] .reveal .sec-title {
  letter-spacing: 0.3em;
  transition: letter-spacing 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js[data-theme="yoru"] .reveal.is-visible .sec-title {
  letter-spacing: 0.08em;
}

/* Gold cursor (elements created by script.js, yoru + fine pointer only) */
.yr-cursor-dot,
.yr-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 4000;
  opacity: 0;
  border-radius: 50%;
  transition: opacity 0.4s ease;
}

.yr-cursor-dot {
  width: 7px;
  height: 7px;
  background: #c9a63b;
}

.yr-cursor-ring {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(201, 166, 59, 0.65);
  transition: opacity 0.4s ease,
              width 0.3s var(--ease-out-cubic),
              height 0.3s var(--ease-out-cubic),
              border-color 0.3s var(--ease-out-cubic);
}

.yr-cursor-dot.on,
.yr-cursor-ring.on {
  opacity: 1;
}

.yr-cursor-ring.grow {
  width: 58px;
  height: 58px;
  border-color: rgba(201, 166, 59, 0.35);
}

html.yr-cursor-on[data-theme="yoru"] body,
html.yr-cursor-on[data-theme="yoru"] a,
html.yr-cursor-on[data-theme="yoru"] button {
  cursor: none;
}

html.yr-cursor-on[data-theme="yoru"] input,
html.yr-cursor-on[data-theme="yoru"] textarea,
html.yr-cursor-on[data-theme="yoru"] select {
  cursor: auto;
}

/* ============================================================
   Đề án 3 — 空 (Sora): bold graphic poster
   ============================================================ */

html[data-theme="sora"] {
  --paper:        #f4f6f9;
  --paper-2:      #e7ecf3;
  --surface:      #ffffff;
  --ink:          #0f1319;
  --ink-2:        #3f4a57;
  --ink-3:        #57626d;   /* deepened so meta text clears the 16% decor */
  --hair:         #d5dde6;
  --hair-strong:  #a9b7c6;

  --dark:         #16305e;   /* deep indigo band */
  --dark-text:    #f2f5fa;
  --dark-text-2:  #a9bcd9;
  --dark-hair:    rgba(242, 245, 250, 0.18);

  --shu:          #2b59a5;   /* ai — indigo */

  --font-heading: 'Zen Kaku Gothic New', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-display: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;

  /* snappy, energetic motion */
  --dur-reveal: 500ms;
  --dur-ui: 200ms;
}

html[data-theme="sora"] body::after {
  opacity: 0.02;
}

html[data-theme="sora"] h1,
html[data-theme="sora"] h2,
html[data-theme="sora"] h3,
html[data-theme="sora"] h4 {
  font-weight: 900;
  letter-spacing: 0.02em;
}

html[data-theme="sora"] .header {
  background-color: rgba(244, 246, 249, 0.92);
  border-bottom: 2px solid var(--ink);
}

html[data-theme="sora"] .nav-link {
  font-weight: 700;
}

/* --- Poster hero: one column, massive type, framed panorama --- */

html[data-theme="sora"] .hero-grid {
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 60px);
  align-items: start;
}

html[data-theme="sora"] .hero-title {
  font-size: clamp(2.4rem, 8.4vw, 6.2rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  font-weight: 900;
  max-width: 12em;
}

html[data-theme="sora"] .hero-title .accent {
  color: #fff;
  background: var(--shu);
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

html[data-theme="sora"] .hero-en-bg {
  top: 3vh;
  color: #dee7f3;
  -webkit-text-stroke: 0;
  font-weight: 900;
  z-index: 0;
}

html[data-theme="sora"] .hero-content {
  position: relative;
  z-index: 2;
}

html[data-theme="sora"] .hero-eyebrow {
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 8px 16px;
  font-weight: 700;
}

html[data-theme="sora"] .hero-figure {
  max-width: none;
  position: relative;
  z-index: 2;
}

html[data-theme="sora"] .hero-figure .img-reveal img {
  aspect-ratio: 21 / 9;
}

html[data-theme="sora"] .hero-tate {
  display: none;
}

/* Hard-edged frames with offset shadows */
html[data-theme="sora"] .img-frame {
  border: 2px solid var(--ink);
  padding: 0;
  box-shadow: 10px 10px 0 rgba(43, 89, 165, 0.25);
}

html[data-theme="sora"] .about-caption-card {
  padding: 14px 16px 16px;
}

/* Chunky poster buttons */
html[data-theme="sora"] .btn {
  border: 2px solid var(--ink);
  border-radius: 0;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--ink);
}

html[data-theme="sora"] .btn-primary {
  background-color: var(--shu);
  border-color: var(--ink);
  color: #fff;
}

html[data-theme="sora"] .btn-primary:hover {
  background-color: #1d4590;
  border-color: var(--ink);
  color: #fff;
}

html[data-theme="sora"] .band-dark .btn {
  border-color: var(--dark-text);
  box-shadow: 4px 4px 0 rgba(242, 245, 250, 0.35);
}

/* Solid indigo ticker band */
html[data-theme="sora"] .marquee {
  background: var(--shu);
  border-color: var(--ink);
  border-width: 2px;
}

html[data-theme="sora"] .marquee-item {
  color: #fff;
  font-weight: 700;
}

html[data-theme="sora"] .marquee-item .en {
  color: rgba(255, 255, 255, 0.6);
}

html[data-theme="sora"] .marquee-item .sep {
  background: #fff;
  opacity: 0.8;
}

/* Section furniture: filled chips, heavy rules */
html[data-theme="sora"] .sec-index {
  background: var(--shu);
  color: #fff;
  padding: 5px 10px;
  letter-spacing: 0.14em;
}

html[data-theme="sora"] .sec-head {
  border-bottom: 2px solid var(--ink);
}

html[data-theme="sora"] .sec-title {
  letter-spacing: 0.04em;
}

html[data-theme="sora"] .service-row:hover {
  background-color: var(--surface);
}

html[data-theme="sora"] .service-num {
  font-weight: 700;
  color: var(--shu);
}

html[data-theme="sora"] .timeline-num {
  font-weight: 900;
  color: #dee7f3;
}

html[data-theme="sora"] .timeline-step:hover .timeline-num {
  color: var(--shu);
}

html[data-theme="sora"] .disclosure-th::before {
  border-radius: 0;
  background: var(--shu);
}

html[data-theme="sora"] .office-tab.active {
  border-left-width: 4px;
}

html[data-theme="sora"] .card-grid,
html[data-theme="sora"] .card-grid > * {
  border-color: var(--ink);
}

html[data-theme="sora"] .school-badge::before {
  border-radius: 0;
}

html[data-theme="sora"] .about-quote {
  border-left: 6px solid var(--shu);
  font-weight: 900;
}

html[data-theme="sora"] .contact-form-card {
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 rgba(11, 15, 25, 0.35);
}

html[data-theme="sora"] .info-note {
  border: 2px solid var(--ink);
  border-left: 6px solid var(--shu);
}

html[data-theme="sora"] .footer-wordmark {
  font-weight: 900;
  color: rgba(242, 245, 250, 0.07);
  -webkit-text-stroke: 1px rgba(242, 245, 250, 0.35);
}

html[data-theme="sora"] .footer-wordmark .shu {
  -webkit-text-stroke-color: rgba(126, 163, 232, 0.8);
}

/* --- Sora motion language: kinetic poster ---
   Indigo shutter splice → headline lines slam in from alternating
   sides with settling skew → chips stamp → everything at rest <1s. */

html[data-theme="sora"] .page-loader {
  background: #16305e;
  transform-origin: top;
  transition: transform 320ms cubic-bezier(0.83, 0, 0.17, 1) 150ms,
              visibility 0s 480ms;
}

html[data-theme="sora"] .loader-inner {
  display: none;
}

html[data-theme="sora"] .page-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #2b59a5;
  transform-origin: top;
  transition: transform 280ms cubic-bezier(0.83, 0, 0.17, 1);
}

html[data-theme="sora"] .page-loader::before {
  content: 'DEAI';
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.4rem, 10vw, 7rem);
  color: #fff;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.5);
  animation: kpStampIn 260ms cubic-bezier(0.2, 0, 0, 1) 140ms forwards;
}

@keyframes kpStampIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
  40%  { opacity: 1; }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Two-stage shutter splice exit */
html[data-theme="sora"] .page-loader.loaded {
  opacity: 1;
  transform: scaleY(0);
  visibility: hidden;
}

html[data-theme="sora"] .page-loader.loaded::after {
  transform: scaleY(0);
}

/* Headline lines slam in from alternating sides, skew settles to 0 */
html.js[data-theme="sora"] .line-inner {
  opacity: 0;
  transform: translateX(-72px) skewX(6deg);
  transform-origin: left bottom;
  transition: transform 550ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 180ms linear;
  transition-delay: calc(var(--i, 0) * 90ms);
}

html.js[data-theme="sora"] .line:nth-child(even) .line-inner {
  transform: translateX(72px) skewX(-6deg);
  transform-origin: right bottom;
}

html.js[data-theme="sora"] .lines-visible .line .line-inner {
  opacity: 1;
  transform: none;
}

/* Fast tight reveals: 50ms stagger, short travel */
html.js[data-theme="sora"] .reveal {
  transform: translateY(24px);
  transition-delay: calc(var(--i, 0) * 50ms);
}

/* Section index chips stamp down and rest at -2deg */
html.js[data-theme="sora"] .reveal.is-visible .sec-index {
  animation: kpStamp 380ms cubic-bezier(0.34, 1.56, 0.64, 1) 120ms backwards;
  transform: rotate(-2deg);
}

@keyframes kpStamp {
  0%   { opacity: 0; transform: scale(1.8) rotate(-8deg); }
  55%  { opacity: 1; transform: scale(0.94) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-2deg); }
}

/* The ticker rolls fast — the one element that never rests */
html[data-theme="sora"] .marquee-track {
  animation-duration: 18s;
  will-change: transform;
}

/* Hard image cuts: quick wipe, no slow settle */
html.js[data-theme="sora"] .img-revealed .img-reveal {
  animation-duration: 550ms;
  animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
}

html.js[data-theme="sora"] .img-reveal img {
  transform: scale(1.06);
}

html.js[data-theme="sora"] .img-revealed .img-reveal img {
  transition-duration: 550ms;
}

/* Magnetic buttons: while the lerp writes transform, CSS must not fight it;
   snap-back springs through the base transition when the class drops */
html[data-theme="sora"] .btn {
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 150ms var(--ease-out-cubic),
              background-color 150ms var(--ease-out-cubic),
              color 150ms var(--ease-out-cubic);
}

html[data-theme="sora"] .btn.magnet-live {
  transition: box-shadow 150ms var(--ease-out-cubic),
              background-color 150ms var(--ease-out-cubic),
              color 150ms var(--ease-out-cubic);
}

html[data-theme="sora"] .btn:hover {
  box-shadow: 6px 6px 0 var(--ink);
}

/* ============================================================
   Seasons — decorative accent + falling particles
   Text colors are never touched; only ornaments shift.
   ============================================================ */

html[data-season="haru"]  { --season-decor: #c9647f; }
html[data-season="natsu"] { --season-decor: #3f7d99; }
html[data-season="aki"]   { --season-decor: #c05f2e; }
html[data-season="fuyu"]  { --season-decor: #64798e; }

/* Seasonal cast on the paper — one gentle notch, so the season reads
   without ever fighting the ink */
html[data-theme="washi"][data-season="haru"]  { --paper: #f9f2f0; }
html[data-theme="washi"][data-season="natsu"] { --paper: #f2f6ee; }
html[data-theme="washi"][data-season="aki"]   { --paper: #f9f3e5; }
html[data-theme="washi"][data-season="fuyu"]  { --paper: #f3f4f5; }

html[data-theme="sora"][data-season="haru"]  { --paper: #f7f3f6; }
html[data-theme="sora"][data-season="natsu"] { --paper: #f1f6f7; }
html[data-theme="sora"][data-season="aki"]   { --paper: #f7f4ef; }
html[data-theme="sora"][data-season="fuyu"]  { --paper: #f1f4f8; }

/* Yoru: lift the decor tones so ornaments & motifs read on night paper */
html[data-theme="yoru"][data-season="haru"]  { --season-decor: #d98ba0; }
html[data-theme="yoru"][data-season="natsu"] { --season-decor: #7fb0c4; }
html[data-theme="yoru"][data-season="aki"]   { --season-decor: #d47a45; }
html[data-theme="yoru"][data-season="fuyu"]  { --season-decor: #a9bcca; }

/* The header glass must follow the tinted paper, not the base hue.
   color-mix() holding a var() cannot fall back to an earlier declaration
   when unsupported (invalid at computed-value time ⇒ transparent header),
   so it is @supports-gated; old engines keep the base-rgba films.
   Yoru keeps its own darker film — its paper is never tinted. */
@supports (background-color: color-mix(in srgb, red 50%, transparent)) {
  .header {
    background-color: color-mix(in srgb, var(--paper) 88%, transparent);
  }
  html[data-theme="sora"] .header {
    background-color: color-mix(in srgb, var(--paper) 92%, transparent);
  }
}

/* Ornaments that carry the season */
[data-season] .hero-eyebrow .dot,
[data-season] .marquee-item .sep,
[data-season] .school-badge::before,
[data-season] .scroll-progress,
[data-season] .loader-line::after {
  background: var(--season-decor, var(--shu));
}

/* On sora's solid indigo ticker, white seps stay white */
html[data-theme="sora"][data-season] .marquee-item .sep {
  background: #fff;
}

/* ---------- Particle layer ---------- */

.season-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}

.particle {
  position: absolute;
  top: 0;
  left: var(--x, 50vw);
  animation: pFall var(--dur, 14s) linear var(--delay, 0s) infinite;
}

.particle::before {
  content: '';
  display: block;
  width: var(--sz, 12px);
  height: var(--sz, 12px);
  animation: pSway var(--sway, 3.6s) ease-in-out calc(var(--delay, 0s) - 6s) infinite alternate;
}

@keyframes pFall {
  from { transform: translate3d(0, -8vh, 0); }
  to   { transform: translate3d(var(--drift, 3vw), 108vh, 0); }
}

@keyframes pSway {
  from { transform: translateX(-12px) rotate(-14deg); }
  to   { transform: translateX(12px) rotate(16deg); }
}

/* 春 — sakura petals
   (border-radius doubles as the no-mask-support fallback: soft dots) */
.p-sakura::before {
  --shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 C16 5 19 10 17 15 C15.5 18.5 13 20 12 23 C11 20 8.5 18.5 7 15 C5 10 8 5 12 1 Z'/%3E%3C/svg%3E");
  background: #e29fb1;
  opacity: 0.5;
  border-radius: 50%;
  -webkit-mask: var(--shape) center / contain no-repeat;
  mask: var(--shape) center / contain no-repeat;
}

html[data-theme="yoru"] .p-sakura::before {
  background: #d98ba0;
  opacity: 0.6;
}

/* 秋 — momiji leaves (9 curved palmate lobes, two-tone turning color) */
.p-momiji::before {
  --shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-28 -35 56 56'%3E%3Cpath d='M-3.07 6.29Q-4 6.93 -10.71 11.89Q-6.47 4.7 -7.63 4.77Q-10.15 5.4 -22.11 6.34Q-11.47 0.8 -10 -0.17Q-13.92 -1.46 -26.63 -8.65Q-12.12 -7 -8.9 -6.47Q-11.52 -10.37 -18.22 -25.08Q-6.3 -14.16 -3.71 -11.41Q-3.43 -16.14 0 -33Q3.43 -16.14 3.71 -11.41Q6.3 -14.16 18.22 -25.08Q11.52 -10.37 8.9 -6.47Q12.12 -7 26.63 -8.65Q13.92 -1.46 10 -0.17Q11.47 0.8 22.11 6.34Q10.15 5.4 7.63 4.77Q6.47 4.7 10.71 11.89Q4 6.93 3.07 6.29L1.8 5.7Q1.08 13.3 1.35 19L-1.35 19Q-1.08 13.3 -1.8 5.7Z'/%3E%3C/svg%3E");
  background: linear-gradient(135deg, #bd4a20, #d98a3a);
  opacity: 0.65;
  border-radius: 50%;
  -webkit-mask: var(--shape) center / contain no-repeat;
  mask: var(--shape) center / contain no-repeat;
}

html[data-theme="yoru"] .p-momiji::before {
  background: linear-gradient(135deg, #cf6a35, #e29a52);
}

/* 冬 — snow */
.p-yuki::before {
  background: #b9c8d6;
  border-radius: 50%;
  opacity: 0.75;
}

html[data-theme="yoru"] .p-yuki::before {
  background: #eef2f6;
  opacity: 0.85;
}

/* 夏 — fireflies: fixed spots, breathing glow */
.p-hotaru {
  top: var(--y, 50vh);
  animation: none;
  will-change: auto;
}

.p-hotaru::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8b93d;
  box-shadow: 0 0 10px 3px rgba(232, 185, 61, 0.4);
  animation: hotaru var(--dur, 6s) ease-in-out var(--delay, 0s) infinite;
}

html[data-theme="yoru"] .p-hotaru::before {
  background: #ffd97a;
  box-shadow: 0 0 14px 5px rgba(255, 217, 122, 0.5);
}

@keyframes hotaru {
  0%, 100% { opacity: 0.05; transform: translate3d(0, 0, 0); }
  45%      { opacity: 0.9; }
  60%      { opacity: 0.7; transform: translate3d(var(--drift, 16px), -14px, 0); }
}

/* A blossom / leaf that lets go of the corner branch (spawned by
   script.js now and then) — falls once, slightly larger, then removed */
.p-detach {
  animation: pDetachFall var(--dur, 8s) cubic-bezier(0.25, 0.1, 0.5, 1) forwards;
}

.p-detach::before {
  opacity: 0.75;
}

@keyframes pDetachFall {
  0%   { transform: translate3d(0, 9vh, 0); opacity: 0; }
  7%   { opacity: 1; }
  100% { transform: translate3d(var(--drift, -6vw), 112vh, 0); opacity: 1; }
}

/* ---------- Seasonal background — layered ink-wash scene ----------
   Built by script.js as .season-bg (fixed, z-index:-1, behind every
   opaque band; body stays transparent — style.css): a soft tonal glow,
   two corner motifs (SVG masks from --motif-a/b, painted with the
   season gradient), and a few large mid-layer shapes that script.js
   turns with the scroll. No JS → no data-season → no layer. */

.season-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Tonal washes: the glow cores sit BELOW the corner-motif boxes so the
   stacked worst pixel (paper + glow + motif ink) stays ≥4.6:1 for ink-3
   text at every scroll offset — verified across themes × seasons */
.sbg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(56vw 44vh at 78% 62%, var(--sbg-glow-a, transparent), transparent 68%),
    radial-gradient(48vw 40vh at 8% 60%, var(--sbg-glow-b, transparent), transparent 70%);
}

/* Phones: skip the full-viewport wash — it keeps a screen-sized GPU
   texture alive (~2MB+) for a barely visible tint */
@media (max-width: 767.98px) {
  .sbg-glow { display: none; }
}

/* Masked pieces stay hidden unless masks work (else: solid rectangles) */
.sbg-motif,
.sbg-float {
  display: none;
}

@supports ((-webkit-mask-repeat: no-repeat) or (mask-repeat: no-repeat)) {
  .sbg-motif,
  .sbg-float {
    display: block;
    position: absolute;
    background: var(--sbg-grad, var(--season-decor));
    /* no will-change: the inline translate3d promotes layers on first
       write; a static (reduced-motion) session shouldn't pay for them */
  }

  .sbg-a {
    top: -2vh;
    right: 0;
    width: clamp(320px, 42vw, 620px);
    height: clamp(240px, 32vw, 480px);
    opacity: 0.16;
    -webkit-mask: var(--motif-a) right top / contain no-repeat;
    mask: var(--motif-a) right top / contain no-repeat;
  }

  .sbg-b {
    bottom: 2vh;
    left: 0;
    width: clamp(230px, 27vw, 420px);
    height: clamp(150px, 17vw, 265px);
    opacity: 0.13;
    -webkit-mask: var(--motif-b) left bottom / contain no-repeat;
    mask: var(--motif-b) left bottom / contain no-repeat;
  }

  .sbg-float {
    opacity: 0.12;
    -webkit-mask: var(--float-shape) center / contain no-repeat;
    mask: var(--float-shape) center / contain no-repeat;
  }

  /* Yoru floats stay at the base 0.12 — 0.14 over the glow core dips
     fuyu meta text to 4.36:1 */
  html[data-theme="yoru"] .sbg-b { opacity: 0.14; }

  @media (max-width: 767.98px) {
    .sbg-a {
      width: min(76vw, 340px);
      height: min(58vw, 265px);
      opacity: 0.14;
    }
    /* One corner motif is enough on a phone */
    .sbg-b { display: none; }
  }
}

/* Mid-layer float shapes (single leaf / petal / crystal / wave fan) */
.f-petal {
  --float-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 C16 5 19 10 17 15 C15.5 18.5 13 20 12 23 C11 20 8.5 18.5 7 15 C5 10 8 5 12 1 Z'/%3E%3C/svg%3E");
}

.f-momiji {
  --float-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-28 -35 56 56'%3E%3Cpath d='M-3.07 6.29Q-4 6.93 -10.71 11.89Q-6.47 4.7 -7.63 4.77Q-10.15 5.4 -22.11 6.34Q-11.47 0.8 -10 -0.17Q-13.92 -1.46 -26.63 -8.65Q-12.12 -7 -8.9 -6.47Q-11.52 -10.37 -18.22 -25.08Q-6.3 -14.16 -3.71 -11.41Q-3.43 -16.14 0 -33Q3.43 -16.14 3.71 -11.41Q6.3 -14.16 18.22 -25.08Q11.52 -10.37 8.9 -6.47Q12.12 -7 26.63 -8.65Q13.92 -1.46 10 -0.17Q11.47 0.8 22.11 6.34Q10.15 5.4 7.63 4.77Q6.47 4.7 10.71 11.89Q4 6.93 3.07 6.29L1.8 5.7Q1.08 13.3 1.35 19L-1.35 19Q-1.08 13.3 -1.8 5.7Z'/%3E%3C/svg%3E");
}

.f-kessho {
  --float-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cdefs%3E%3Cg id='s' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M0 0 V-46 M0 -18 L-10 -28 M0 -18 L10 -28 M0 -34 L-7 -41 M0 -34 L7 -41'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s'/%3E%3Cuse href='%23s' transform='rotate(60)'/%3E%3Cuse href='%23s' transform='rotate(120)'/%3E%3Cuse href='%23s' transform='rotate(180)'/%3E%3Cuse href='%23s' transform='rotate(240)'/%3E%3Cuse href='%23s' transform='rotate(300)'/%3E%3C/svg%3E");
}

.f-nami {
  --float-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 56'%3E%3Cg fill='none' stroke='black' stroke-width='4'%3E%3Cpath d='M0 56a56 56 0 0 1 112 0M16 56a40 40 0 0 1 80 0M32 56a24 24 0 0 1 48 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* Season palette for the background layer: a two-tone gradient for the
   masked pieces + soft glow tints. Mid-tone stops keep ink-3 text AA
   over every decor pixel (see --ink-3 notes in each theme). */
html[data-season="haru"] {
  --sbg-grad: linear-gradient(150deg, #cf6d88, #e0a0b2);
  --sbg-glow-a: rgba(209, 116, 144, 0.09);
  --sbg-glow-b: rgba(209, 116, 144, 0.06);
}

html[data-season="natsu"] {
  --sbg-grad: linear-gradient(150deg, #4a89a5, #7db4c6);
  --sbg-glow-a: rgba(83, 144, 170, 0.09);
  --sbg-glow-b: rgba(83, 144, 170, 0.06);
}

html[data-season="aki"] {
  --sbg-grad: linear-gradient(150deg, #c96a2e, #dfa050);
  --sbg-glow-a: rgba(206, 120, 52, 0.1);
  --sbg-glow-b: rgba(206, 120, 52, 0.07);
}

html[data-season="fuyu"] {
  --sbg-grad: linear-gradient(150deg, #7f95a8, #aebfce);
  --sbg-glow-a: rgba(140, 160, 180, 0.1);
  --sbg-glow-b: rgba(140, 160, 180, 0.07);
}

html[data-theme="yoru"][data-season="haru"]  { --sbg-grad: linear-gradient(150deg, #c97b91, #dda3b4); --sbg-glow-a: rgba(217, 139, 160, 0.08); --sbg-glow-b: rgba(217, 139, 160, 0.05); }
html[data-theme="yoru"][data-season="natsu"] { --sbg-grad: linear-gradient(150deg, #64a0b8, #8fc2d4); --sbg-glow-a: rgba(127, 176, 196, 0.08); --sbg-glow-b: rgba(127, 176, 196, 0.05); }
html[data-theme="yoru"][data-season="aki"]   { --sbg-grad: linear-gradient(150deg, #c86a3f, #dfa050); --sbg-glow-a: rgba(212, 122, 69, 0.08); --sbg-glow-b: rgba(212, 122, 69, 0.05); }
html[data-theme="yoru"][data-season="fuyu"]  { --sbg-grad: linear-gradient(150deg, #93a7b6, #b3c4d0); --sbg-glow-a: rgba(169, 188, 202, 0.08); --sbg-glow-b: rgba(169, 188, 202, 0.05); }

/* 春 — a cherry branch leaning in from the corner; drifting petals below */
html[data-season="haru"] {
  --motif-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 400'%3E%3Cdefs%3E%3Cg id='h'%3E%3Cellipse cx='0' cy='-9' rx='4' ry='8'/%3E%3Cellipse cx='0' cy='-9' rx='4' ry='8' transform='rotate(72)'/%3E%3Cellipse cx='0' cy='-9' rx='4' ry='8' transform='rotate(144)'/%3E%3Cellipse cx='0' cy='-9' rx='4' ry='8' transform='rotate(216)'/%3E%3Cellipse cx='0' cy='-9' rx='4' ry='8' transform='rotate(288)'/%3E%3C/g%3E%3C/defs%3E%3Cg fill='none' stroke='black' stroke-width='4.5' stroke-linecap='round'%3E%3Cpath d='M520 36 C450 52 386 84 330 132 C284 172 252 224 238 296 C233 322 231 348 232 376'/%3E%3Cpath d='M372 104 C352 132 340 158 336 188' stroke-width='3'/%3E%3Cpath d='M300 162 C282 184 270 210 266 240' stroke-width='3'/%3E%3Cpath d='M452 62 C436 84 428 104 424 122' stroke-width='3'/%3E%3C/g%3E%3Cuse href='%23h' transform='translate(336 196) rotate(15) scale(1.5)'/%3E%3Cuse href='%23h' transform='translate(266 248) rotate(-20) scale(1.25)'/%3E%3Cuse href='%23h' transform='translate(424 130) rotate(40) scale(1.4)'/%3E%3Cuse href='%23h' transform='translate(238 300) rotate(65)'/%3E%3Cuse href='%23h' transform='translate(495 46) rotate(-10) scale(1.2)'/%3E%3Ccircle cx='356' cy='150' r='4'/%3E%3Ccircle cx='286' cy='204' r='3.5'/%3E%3Ccircle cx='444' cy='92' r='3'/%3E%3Cellipse cx='180' cy='120' rx='4.5' ry='9' transform='rotate(40 180 120)'/%3E%3Cellipse cx='138' cy='232' rx='4' ry='8' transform='rotate(-24 138 232)'/%3E%3Cellipse cx='240' cy='58' rx='4' ry='8' transform='rotate(70 240 58)'/%3E%3C/svg%3E");
  --motif-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 240'%3E%3Cellipse cx='40' cy='200' rx='5' ry='10' transform='rotate(20 40 200)'/%3E%3Cellipse cx='92' cy='168' rx='4.5' ry='9' transform='rotate(-32 92 168)'/%3E%3Cellipse cx='150' cy='192' rx='5.5' ry='11' transform='rotate(48 150 192)'/%3E%3Cellipse cx='204' cy='142' rx='4' ry='8' transform='rotate(-14 204 142)'/%3E%3Cellipse cx='262' cy='120' rx='5' ry='10' transform='rotate(30 262 120)'/%3E%3Cellipse cx='318' cy='78' rx='4' ry='8' transform='rotate(8 318 78)'/%3E%3Cellipse cx='120' cy='110' rx='3.5' ry='7' transform='rotate(60 120 110)'/%3E%3Cellipse cx='30' cy='120' rx='3.5' ry='7' transform='rotate(-45 30 120)'/%3E%3C/svg%3E");
}

/* 夏 — a fūrin wind chime in the breeze; seigaiha waves at the shore */
html[data-season="natsu"] {
  --motif-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 400'%3E%3Cg fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M250 0 V72'/%3E%3Cpath d='M214 112 a36 34 0 1 1 72 0 c0 7 -3 11 -8 14 h-56 c-5 -3 -8 -7 -8 -14 Z'/%3E%3Cpath d='M250 126 V168'/%3E%3Crect x='240' y='184' width='20' height='56' rx='3' transform='rotate(9 250 184)'/%3E%3Cpath d='M118 140 q42 -12 74 2' stroke-width='3'/%3E%3Cpath d='M96 182 q50 -10 88 8' stroke-width='3'/%3E%3Cpath d='M136 224 q34 -8 60 4' stroke-width='3'/%3E%3C/g%3E%3Ccircle cx='250' cy='173' r='5'/%3E%3C/svg%3E");
  --motif-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 220'%3E%3Cg fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M0 220a56 56 0 0 1 112 0M16 220a40 40 0 0 1 80 0M32 220a24 24 0 0 1 48 0'/%3E%3Cpath d='M112 220a56 56 0 0 1 112 0M128 220a40 40 0 0 1 80 0M144 220a24 24 0 0 1 48 0'/%3E%3Cpath d='M224 220a56 56 0 0 1 112 0M240 220a40 40 0 0 1 80 0M256 220a24 24 0 0 1 48 0'/%3E%3Cpath d='M336 220a56 56 0 0 1 112 0M352 220a40 40 0 0 1 80 0M368 220a24 24 0 0 1 48 0'/%3E%3Cpath d='M-56 164a56 56 0 0 1 112 0M-40 164a40 40 0 0 1 80 0M-24 164a24 24 0 0 1 48 0'/%3E%3Cpath d='M56 164a56 56 0 0 1 112 0M72 164a40 40 0 0 1 80 0M88 164a24 24 0 0 1 48 0'/%3E%3Cpath d='M168 164a56 56 0 0 1 112 0M184 164a40 40 0 0 1 80 0M200 164a24 24 0 0 1 48 0'/%3E%3Cpath d='M280 164a56 56 0 0 1 112 0M296 164a40 40 0 0 1 80 0M312 164a24 24 0 0 1 48 0'/%3E%3Cpath d='M392 164a56 56 0 0 1 112 0M408 164a40 40 0 0 1 80 0M424 164a24 24 0 0 1 48 0'/%3E%3Cpath d='M112 108a56 56 0 0 1 112 0M128 108a40 40 0 0 1 80 0M144 108a24 24 0 0 1 48 0'/%3E%3Cpath d='M224 108a56 56 0 0 1 112 0M240 108a40 40 0 0 1 80 0M256 108a24 24 0 0 1 48 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* 秋 — a maple branch shedding momiji (9 curved palmate lobes) */
html[data-season="aki"] {
  --motif-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 400'%3E%3Cdefs%3E%3Cpath id='mj' d='M-3.07 6.29Q-4 6.93 -10.71 11.89Q-6.47 4.7 -7.63 4.77Q-10.15 5.4 -22.11 6.34Q-11.47 0.8 -10 -0.17Q-13.92 -1.46 -26.63 -8.65Q-12.12 -7 -8.9 -6.47Q-11.52 -10.37 -18.22 -25.08Q-6.3 -14.16 -3.71 -11.41Q-3.43 -16.14 0 -33Q3.43 -16.14 3.71 -11.41Q6.3 -14.16 18.22 -25.08Q11.52 -10.37 8.9 -6.47Q12.12 -7 26.63 -8.65Q13.92 -1.46 10 -0.17Q11.47 0.8 22.11 6.34Q10.15 5.4 7.63 4.77Q6.47 4.7 10.71 11.89Q4 6.93 3.07 6.29L1.8 5.7Q1.08 13.3 1.35 19L-1.35 19Q-1.08 13.3 -1.8 5.7Z'/%3E%3C/defs%3E%3Cg fill='none' stroke='black' stroke-width='4.5' stroke-linecap='round'%3E%3Cpath d='M520 60 C446 70 382 96 328 140 C286 174 258 220 246 278 C242 300 240 322 241 344'/%3E%3Cpath d='M400 96 C384 122 376 146 374 170' stroke-width='3'/%3E%3Cpath d='M312 154 C296 176 288 200 284 224' stroke-width='3'/%3E%3Cpath d='M462 74 C452 92 446 108 444 122' stroke-width='3'/%3E%3C/g%3E%3Cuse href='%23mj' transform='translate(374 192) rotate(28) scale(2.1)'/%3E%3Cuse href='%23mj' transform='translate(284 246) rotate(-18) scale(1.8)'/%3E%3Cuse href='%23mj' transform='translate(446 142) rotate(55) scale(1.6)'/%3E%3Cuse href='%23mj' transform='translate(246 300) rotate(75) scale(1.45)'/%3E%3Cuse href='%23mj' transform='translate(176 154) rotate(95) scale(1.3)'/%3E%3Cuse href='%23mj' transform='translate(132 270) rotate(-55) scale(1.1)'/%3E%3Cuse href='%23mj' transform='translate(334 58) rotate(-35) scale(1.35)'/%3E%3C/svg%3E");
  --motif-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 240'%3E%3Cdefs%3E%3Cpath id='mj' d='M-3.07 6.29Q-4 6.93 -10.71 11.89Q-6.47 4.7 -7.63 4.77Q-10.15 5.4 -22.11 6.34Q-11.47 0.8 -10 -0.17Q-13.92 -1.46 -26.63 -8.65Q-12.12 -7 -8.9 -6.47Q-11.52 -10.37 -18.22 -25.08Q-6.3 -14.16 -3.71 -11.41Q-3.43 -16.14 0 -33Q3.43 -16.14 3.71 -11.41Q6.3 -14.16 18.22 -25.08Q11.52 -10.37 8.9 -6.47Q12.12 -7 26.63 -8.65Q13.92 -1.46 10 -0.17Q11.47 0.8 22.11 6.34Q10.15 5.4 7.63 4.77Q6.47 4.7 10.71 11.89Q4 6.93 3.07 6.29L1.8 5.7Q1.08 13.3 1.35 19L-1.35 19Q-1.08 13.3 -1.8 5.7Z'/%3E%3C/defs%3E%3Cuse href='%23mj' transform='translate(54 186) rotate(15) scale(1.6)'/%3E%3Cuse href='%23mj' transform='translate(128 142) rotate(-40) scale(1.2)'/%3E%3Cuse href='%23mj' transform='translate(208 182) rotate(70) scale(1.45)'/%3E%3Cuse href='%23mj' transform='translate(294 112) rotate(-12) scale(1.05)'/%3E%3Cuse href='%23mj' transform='translate(42 96) rotate(35) scale(0.85)'/%3E%3C/svg%3E");
}

/* 冬 — snow crystals and falling flecks */
html[data-season="fuyu"] {
  --motif-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 400'%3E%3Cdefs%3E%3Cg id='s' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M0 0 V-46 M0 -18 L-10 -28 M0 -18 L10 -28 M0 -34 L-7 -41 M0 -34 L7 -41'/%3E%3C/g%3E%3Cg id='c'%3E%3Cuse href='%23s'/%3E%3Cuse href='%23s' transform='rotate(60)'/%3E%3Cuse href='%23s' transform='rotate(120)'/%3E%3Cuse href='%23s' transform='rotate(180)'/%3E%3Cuse href='%23s' transform='rotate(240)'/%3E%3Cuse href='%23s' transform='rotate(300)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23c' transform='translate(348 128) scale(1.7)'/%3E%3Cuse href='%23c' transform='translate(212 236) rotate(18)'/%3E%3Cuse href='%23c' transform='translate(420 300) rotate(30) scale(0.75)'/%3E%3Ccircle cx='150' cy='92' r='4'/%3E%3Ccircle cx='262' cy='58' r='3'/%3E%3Ccircle cx='120' cy='310' r='3.5'/%3E%3Ccircle cx='306' cy='338' r='2.5'/%3E%3Ccircle cx='452' cy='196' r='3'/%3E%3Ccircle cx='260' cy='150' r='2.5'/%3E%3C/svg%3E");
  --motif-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 220'%3E%3Cdefs%3E%3Cg id='s' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M0 0 V-46 M0 -18 L-10 -28 M0 -18 L10 -28 M0 -34 L-7 -41 M0 -34 L7 -41'/%3E%3C/g%3E%3Cg id='c'%3E%3Cuse href='%23s'/%3E%3Cuse href='%23s' transform='rotate(60)'/%3E%3Cuse href='%23s' transform='rotate(120)'/%3E%3Cuse href='%23s' transform='rotate(180)'/%3E%3Cuse href='%23s' transform='rotate(240)'/%3E%3Cuse href='%23s' transform='rotate(300)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23c' transform='translate(104 108)'/%3E%3Cuse href='%23c' transform='translate(248 76) scale(0.7)'/%3E%3Ccircle cx='52' cy='58' r='3'/%3E%3Ccircle cx='176' cy='164' r='3.5'/%3E%3Ccircle cx='302' cy='150' r='2.5'/%3E%3Ccircle cx='36' cy='172' r='2.5'/%3E%3Ccircle cx='214' cy='30' r='2'/%3E%3C/svg%3E");
}

/* ============================================================
   Skin dock — season switcher (bottom right)
   ============================================================ */

.skin-dock {
  position: fixed;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(14px, 2.4vw, 28px);
  z-index: 1500;
  font-family: var(--font-body);
}

/* The ink drawer owns the screen while open */
body.menu-open .skin-dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-ui) var(--ease-out-quart),
              visibility 0s var(--dur-ui);
}

.skin-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--hair-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(28, 27, 23, 0.12);
  transition: border-color var(--dur-hover) var(--ease-out-cubic),
              color var(--dur-hover) var(--ease-out-cubic);
}

.skin-toggle:hover {
  border-color: var(--shu);
  color: var(--shu);
}

.skin-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  /* Wide enough to keep the five season chips on one row */
  width: 276px;
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  padding: 18px;
  box-shadow: 0 12px 32px rgba(28, 27, 23, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-ui) var(--ease-out-quart),
              transform var(--dur-ui) var(--ease-out-quart),
              visibility 0s linear var(--dur-ui);
}

.skin-dock.open .skin-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-ui) var(--ease-out-quart),
              transform var(--dur-ui) var(--ease-out-quart),
              visibility 0s;
}

.skin-row-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.skin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.skin-row:last-child {
  margin-bottom: 0;
}

.skin-opt {
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 999px;
  transition: border-color var(--dur-hover) var(--ease-out-cubic),
              color var(--dur-hover) var(--ease-out-cubic);
}

.skin-opt:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.skin-opt[aria-pressed="true"] {
  border-color: var(--shu);
  color: var(--shu);
}

/* ============================================================
   Reduced motion / print — seasons stay quiet
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .season-layer {
    display: none !important;
  }

  /* Floats are motion-only decor; corner motifs stay (they match the
     static load-time reduced state) but any JS parallax is neutralized */
  .sbg-float {
    display: none !important;
  }

  .sbg-motif {
    transform: none !important;
  }

  /* Theme motion layers collapse to instant final states */
  html[data-theme="yoru"] .hero-title,
  html[data-theme="yoru"] .sec-title {
    opacity: 1 !important;
    filter: none !important;
    letter-spacing: 0.08em !important;
  }

  html.js[data-theme="yoru"] .hero-figure .img-reveal {
    opacity: 1 !important;
  }

  html[data-theme="sora"] .line-inner,
  html[data-theme="sora"] .sec-index {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .yr-cursor-dot,
  .yr-cursor-ring {
    display: none !important;
  }
}

@media print {
  .season-layer,
  .season-bg,
  .skin-dock {
    display: none !important;
  }

  /* Yoru prints as ink-on-white like the other themes */
  html[data-theme="yoru"] {
    --paper: #f7f4ee;
    --paper-2: #efebe1;
    --surface: #fffdf8;
    --ink: #1c1b17;
    --ink-2: #57534a;
    --ink-3: #706a5c;
    --hair: #e0dbcf;
    --hair-strong: #c8c1b0;
    --dark: #191712;
    --dark-text: #f0ede4;
    --dark-text-2: #a8a293;
    --dark-hair: rgba(240, 237, 228, 0.14);
    --shu: #c73a24;
  }

  html[data-theme="yoru"] .map-wrapper iframe,
  html[data-theme="yoru"] .img-reveal img,
  html[data-theme="yoru"] .hero-figure .img-reveal img {
    filter: none !important;
  }

  html[data-theme="yoru"] .logo-wrapper {
    background: none;
    padding: 0;
  }

  html[data-theme="yoru"] .hero-figure::after {
    display: none;
  }
}

/* ============================================================
   Responsive adjustments for the theme layouts
   ============================================================ */

@media (max-width: 992px) {
  /* Yoru cinema hero: keep the overlay full-bleed */
  html[data-theme="yoru"] .hero-figure {
    max-width: none;
  }

  html[data-theme="yoru"] .hero-grid {
    min-height: 88vh;
    min-height: 88dvh;
  }
}

@media (max-width: 768px) {
  html[data-theme="yoru"] .hero-figure .fig-caption {
    display: none;
  }

  html[data-theme="sora"] .img-frame {
    box-shadow: 6px 6px 0 rgba(43, 89, 165, 0.25);
  }

  html[data-theme="sora"] .contact-form-card {
    box-shadow: 6px 6px 0 rgba(11, 15, 25, 0.35);
  }
}
