/* Shared delight layer: themes, mascot, motion sketches, chapter transitions and the hidden mini-game. */
html{
  --surface-header:rgba(5,5,15,.88);
  --surface-card-a:rgba(15,8,35,.96);
  --surface-card-b:rgba(8,4,22,.96);
  --surface-field:rgba(10,5,30,.8);
  --surface-footer:rgba(2,2,10,.95);
  --theme-pattern:radial-gradient(ellipse 70% 50% at 50% -10%,rgba(168,85,247,.12),transparent),radial-gradient(circle at 90% 8%,rgba(0,229,255,.06),transparent 28%);
  color-scheme:dark;
}
html[data-theme="orbloom"]{
  --bg:#040d10;
  --bg2:#071518;
  --card:rgba(0,229,180,.04);
  --card2:rgba(0,229,180,.025);
  --primary:#6255df;
  --cyan:#22d7ae;
  --hot:#e040fb;
  --gold:#ffc05f;
  --text:#f7fbfa;
  --muted:#a8c0be;
  --border:rgba(34,215,174,.18);
  --border-bright:rgba(34,215,174,.45);
  --surface-header:rgba(4,13,16,.9);
  --surface-card-a:rgba(5,30,26,.96);
  --surface-card-b:rgba(3,18,16,.96);
  --surface-field:rgba(4,22,19,.85);
  --surface-footer:rgba(2,6,8,.98);
  --theme-pattern:radial-gradient(circle at 12% 14%,rgba(34,215,174,.1),transparent 26%),radial-gradient(circle at 90% 36%,rgba(255,192,95,.06),transparent 22%);
  --glow-primary:0 0 20px rgba(34,215,174,.4),0 0 60px rgba(34,215,174,.15);
  --glow-cyan:0 0 20px rgba(34,215,174,.4),0 0 60px rgba(34,215,174,.15);
}
html[data-theme="prism"]{
  --bg:#060515;
  --bg2:#0c0a24;
  --card:rgba(93,217,255,.04);
  --card2:rgba(93,217,255,.025);
  --primary:#5f50e4;
  --cyan:#5dd9ff;
  --hot:#ff6aff;
  --gold:#ff9d66;
  --text:#f8f7ff;
  --muted:#b2aed8;
  --border:rgba(93,217,255,.16);
  --border-bright:rgba(93,217,255,.45);
  --surface-header:rgba(6,5,21,.9);
  --surface-card-a:rgba(14,10,40,.96);
  --surface-card-b:rgba(8,6,26,.96);
  --surface-field:rgba(10,8,34,.85);
  --surface-footer:rgba(3,2,12,.98);
  --theme-pattern:linear-gradient(135deg,rgba(121,104,255,.06) 0 1px,transparent 1px 52px),linear-gradient(45deg,rgba(93,217,255,.04) 0 1px,transparent 1px 52px);
  --glow-primary:0 0 20px rgba(93,217,255,.4),0 0 60px rgba(93,217,255,.15);
  --glow-cyan:0 0 20px rgba(93,217,255,.4),0 0 60px rgba(93,217,255,.15);
}
body{background-color:var(--bg);background-image:var(--theme-pattern);background-attachment:fixed;transition:background-color .35s,color .35s}
.site-header{background:var(--surface-header)}
.site-footer{background:var(--surface-footer)}
.card{background:linear-gradient(155deg,var(--surface-card-a),var(--surface-card-b))}
.field input,.field select,.field textarea{background:var(--surface-field)}
.button{background:linear-gradient(135deg,var(--primary),var(--hot,#e040fb))}
.button.secondary{background:rgba(255,255,255,.04)}

/* Footer theme switcher */
.theme-switcher{margin-top:24px}
.theme-switcher-label{display:block;margin-bottom:9px;color:var(--text);font-size:.75rem;font-weight:850;letter-spacing:.1em;text-transform:uppercase}
.theme-options{display:flex;flex-wrap:wrap;gap:7px}
.theme-choice{display:inline-flex;min-height:38px;align-items:center;gap:7px;border:1px solid var(--border);border-radius:999px;background:rgba(255,255,255,.035);color:var(--muted);padding:7px 10px;cursor:pointer;font-size:.74rem;font-weight:750}
.theme-choice:hover,.theme-choice[aria-checked="true"]{border-color:color-mix(in srgb,var(--theme-accent) 58%,var(--border));background:color-mix(in srgb,var(--theme-accent) 13%,transparent);color:var(--text)}
.theme-choice[aria-checked="true"]{box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent) 18%,transparent)}
.theme-swatch{width:13px;height:13px;border-radius:50%;background:var(--theme-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 15%,transparent)}
.theme-choice[data-theme-option="midnight"]{--theme-accent:#7567ee}
.theme-choice[data-theme-option="orbloom"]{--theme-accent:#22d7ae}
.theme-choice[data-theme-option="prism"]{--theme-accent:#5dd9ff}
.theme-live,.secret-trigger-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* The abstract studio guide, Glint */
.studio-mascot{--mascot-size:78px;position:relative;display:inline-block;flex:0 0 auto;width:var(--mascot-size);height:var(--mascot-size);filter:drop-shadow(0 15px 20px rgba(0,0,0,.28))}
.mascot-core{position:absolute;inset:9%;border:1px solid rgba(255,255,255,.35);border-radius:42% 58% 54% 46%;background:linear-gradient(145deg,var(--primary),var(--teal) 64%,var(--amber));box-shadow:inset 8px 8px 18px rgba(255,255,255,.2),inset -8px -10px 16px rgba(7,17,31,.25);transform:rotate(16deg);animation:mascot-float 3.2s ease-in-out infinite alternate}
.mascot-eye{position:absolute;z-index:2;top:37%;width:9%;height:13%;border-radius:99px;background:#fff;box-shadow:0 0 9px rgba(255,255,255,.55)}
.mascot-eye.eye-left{left:33%}.mascot-eye.eye-right{right:31%}
.mascot-mouth{position:absolute;z-index:2;left:40%;top:55%;width:22%;height:11%;border-bottom:2px solid rgba(255,255,255,.9);border-radius:0 0 99px 99px}
.mascot-spark{position:absolute;z-index:3;right:-2%;top:4%;width:18%;height:18%;background:var(--amber);clip-path:polygon(50% 0,62% 37%,100% 50%,62% 63%,50% 100%,38% 63%,0 50%,38% 37%);animation:spark-turn 4s linear infinite}
.game-visual.upcoming:after{content:"";width:170px;height:170px;border:1px solid color-mix(in srgb,var(--primary) 32%,transparent);border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--primary) 14%,transparent),transparent 66%);font-size:0}
.game-visual.upcoming .studio-mascot{--mascot-size:104px;z-index:2}
.mascot-note{display:flex;align-items:center;gap:24px;margin-bottom:30px;border:1px solid color-mix(in srgb,var(--teal) 30%,var(--border));border-radius:22px;background:radial-gradient(circle at 10% 30%,color-mix(in srgb,var(--teal) 13%,transparent),transparent 35%),linear-gradient(145deg,var(--surface-card-a),var(--surface-card-b));padding:20px 24px}
.mascot-note .studio-mascot{--mascot-size:82px}
.mascot-note strong{display:block;margin:2px 0 3px;font-size:1.1rem}
.mascot-note p{margin:0;color:var(--muted)}

/* Honest, abstract motion sketches for game cards; real footage can replace these later. */
.motion-preview{pointer-events:none;position:absolute;z-index:4;inset:0;display:grid;place-items:center;overflow:hidden;background:rgba(6,14,25,.94);opacity:0;transform:scale(1.025);transition:opacity .22s,transform .32s}
.game-card:hover .motion-preview,.game-card:focus-within .motion-preview,.game-card.is-preview-visible .motion-preview{opacity:1;transform:none}
.motion-preview-label{position:absolute;left:12px;top:12px;z-index:4;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:rgba(5,12,22,.76);color:#fff;padding:5px 8px;font-size:.66rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.orb-motion{background:radial-gradient(circle at 50% 20%,rgba(255,184,77,.13),transparent 35%),#081722}
.orb-motion-board{position:relative;display:grid;grid-template-columns:repeat(3,44px);gap:14px;align-items:end;height:128px}
.mini-tube{position:relative;display:flex;height:116px;flex-direction:column-reverse;align-items:center;gap:4px;border:2px solid rgba(255,255,255,.22);border-top:0;border-radius:0 0 18px 18px;padding:7px}
.mini-orb{display:block;width:27px;height:27px;flex:0 0 auto;border-radius:50%;background:var(--mini-orb,var(--primary));box-shadow:inset 0 3px 5px rgba(255,255,255,.34),0 4px 10px color-mix(in srgb,var(--mini-orb,var(--primary)) 30%,transparent)}
.mini-orb.teal{--mini-orb:var(--teal)}.mini-orb.amber{--mini-orb:var(--amber)}.mini-orb.violet{--mini-orb:var(--primary)}
.orb-motion-board .mini-tube:first-child .mini-orb:first-child{animation:orb-preview 2.4s ease-in-out infinite}
.prism-motion{background:radial-gradient(circle at 75% 20%,rgba(93,217,255,.12),transparent 35%),#0d1025}
.prism-motion-board{position:relative;width:190px;height:125px;background-image:linear-gradient(rgba(255,255,255,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.055) 1px,transparent 1px);background-size:25px 25px}
.mini-path{position:absolute;height:7px;border-radius:99px;background:var(--path-color,var(--teal));box-shadow:0 0 14px color-mix(in srgb,var(--path-color,var(--teal)) 40%,transparent)}
.mini-path.path-a{--path-color:var(--teal);left:10px;top:25px;width:112px}.mini-path.path-b{--path-color:var(--primary);right:12px;top:72px;width:95px;transform:rotate(90deg)}.mini-path.path-c{--path-color:var(--amber);left:40px;bottom:12px;width:132px}
.mini-arrow{position:absolute;z-index:2;left:8px;top:6px;color:#fff;font-size:1.55rem;font-style:normal;text-shadow:0 0 12px var(--teal);animation:prism-preview 2.2s ease-in-out infinite}
.motion-preview *{animation-play-state:paused!important}
.game-card:hover .motion-preview *,.game-card:focus-within .motion-preview *,.game-card.is-preview-visible .motion-preview *{animation-play-state:running!important}
.game-item[hidden] .motion-preview *{animation-play-state:paused!important}

/* Letter markers keep both colour-matching puzzles understandable without colour alone. */
.puzzle-orb{position:relative;color:#fff}
.puzzle-orb:after{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:.78rem;font-weight:950;text-shadow:0 2px 5px rgba(0,0,0,.55)}
.puzzle-orb[data-color="violet"]:after{content:"V"}.puzzle-orb[data-color="teal"]:after{content:"T"}.puzzle-orb[data-color="amber"]:after{content:"A"}

/* Stronger homepage chapter rhythm */
body.home-delight main>section{position:relative;isolation:isolate}
body.home-delight main>section>.container{position:relative;z-index:2}
.chapter-number{pointer-events:none;position:absolute;z-index:0;right:max(20px,calc((100vw - var(--max))/2));top:12px;color:color-mix(in srgb,var(--primary) 10%,transparent);font-size:clamp(5.5rem,14vw,12rem);font-weight:950;letter-spacing:-.08em;line-height:1;user-select:none}
body.home-delight main>section:nth-child(even) .chapter-number{right:auto;left:max(20px,calc((100vw - var(--max))/2))}
body.home-delight main>section:not(.hero):before{content:"";pointer-events:none;position:absolute;z-index:1;left:-5%;top:3px;width:110%;height:2px;background:linear-gradient(90deg,transparent,var(--primary),var(--cyan),var(--hot),transparent);opacity:.4;transform:rotate(-.65deg);transform-origin:center}
body.home-delight main>section:nth-child(even):before{transform:rotate(.65deg)}
body.home-delight .section-head h2{position:relative;max-width:760px}
body.home-delight .section-head h2:after{content:"";display:block;width:74px;height:5px;margin-top:16px;border-radius:99px;background:linear-gradient(90deg,var(--primary),var(--cyan))}
body.home-delight .studio-card{transform:rotate(-1.2deg);transition:transform .3s,box-shadow .3s}
body.home-delight .studio-card:hover{transform:rotate(0) translateY(-4px)}

/* Magnetic movement is applied to an inner span, leaving hit areas stable. */
.magnetic-content{display:inline-flex;align-items:center;justify-content:center;transform:translate3d(var(--mag-x,0),var(--mag-y,0),0);transition:transform .16s ease;will-change:transform}

/* Separate interactive studio mark keeps the company-name Home link conventional. */
.brand-cluster{display:flex;align-items:center;gap:11px;white-space:nowrap}
.brand-cluster>.brand{gap:0}
.brand-secret-trigger{flex:0 0 auto;border:0;padding:0;color:#fff;cursor:pointer}
.brand-secret-trigger.secret-tap{animation:secret-tap .36s ease}

/* Hidden sorting sprint */
body.mini-game-open{overflow:hidden}
.secret-game-shell[hidden]{display:none}
.secret-game-shell{position:fixed;z-index:1200;inset:0;display:grid;place-items:center;padding:20px}
.secret-game-backdrop{position:absolute;inset:0;background:rgba(2,7,14,.82);backdrop-filter:blur(10px)}
.secret-game-dialog{position:relative;width:min(620px,100%);max-height:min(760px,calc(100vh - 32px));overflow:auto;border:1px solid color-mix(in srgb,var(--teal) 34%,var(--border));border-radius:28px;background:radial-gradient(circle at 90% 8%,color-mix(in srgb,var(--primary) 16%,transparent),transparent 30%),var(--bg2);box-shadow:0 28px 100px rgba(0,0,0,.48);padding:28px}
.secret-close{position:absolute;right:16px;top:16px;width:42px;height:42px;border:1px solid var(--border);border-radius:50%;background:rgba(255,255,255,.06);color:var(--text);cursor:pointer;font-size:1.35rem}
.secret-heading{display:flex;align-items:center;gap:18px;padding-right:44px}
.secret-heading .studio-mascot{--mascot-size:70px}
.secret-heading h2{margin:2px 0 4px;font-size:clamp(1.65rem,4vw,2.35rem);line-height:1.05}.secret-heading p{margin:0;color:var(--muted)}
.secret-relaxed{display:flex;align-items:center;gap:9px;width:max-content;max-width:100%;margin:18px 0 0;color:var(--muted);font-size:.9rem;font-weight:700;cursor:pointer}.secret-relaxed input{width:20px;height:20px;margin:0;accent-color:var(--teal)}.secret-relaxed:has(input:disabled){cursor:default;opacity:.62}
.secret-meter{display:flex;align-items:center;gap:12px;margin:22px 0 18px}.secret-meter-track{height:8px;flex:1;overflow:hidden;border-radius:99px;background:rgba(255,255,255,.08)}.secret-meter-fill{width:calc(var(--secret-time,1)*100%);height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--amber),var(--teal));transition:width .1s linear}.secret-timer{min-width:38px;color:var(--amber);font-weight:900}
.secret-status{min-height:28px;margin:0 0 12px;color:var(--teal);font-weight:750}
.secret-orbs{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;border:1px solid var(--border);border-radius:20px;background:rgba(3,11,20,.42);padding:15px}
.secret-orb{--secret-color:var(--primary);aspect-ratio:1;border:0;border-radius:50%;background:radial-gradient(circle at 32% 26%,#fff 0 7%,var(--secret-color) 10% 65%,color-mix(in srgb,var(--secret-color) 62%,#07111f));box-shadow:inset 0 3px 6px rgba(255,255,255,.3),0 7px 17px color-mix(in srgb,var(--secret-color) 26%,transparent);color:#fff;cursor:pointer;font-size:.8rem;font-weight:950;text-shadow:0 2px 5px rgba(0,0,0,.55);transition:transform .18s,opacity .18s}.secret-orb[data-color="teal"]{--secret-color:var(--teal)}.secret-orb[data-color="amber"]{--secret-color:var(--amber)}.secret-orb[aria-pressed="true"]{transform:translateY(-5px) scale(1.08);box-shadow:0 0 0 3px #fff,0 0 0 6px color-mix(in srgb,var(--secret-color) 45%,transparent)}.secret-orb:disabled{opacity:.12;transform:scale(.5)}
.secret-gates{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}.secret-gate{--gate-color:var(--primary);min-height:64px;border:1px solid color-mix(in srgb,var(--gate-color) 45%,var(--border));border-radius:15px;background:color-mix(in srgb,var(--gate-color) 10%,rgba(4,12,22,.85));color:var(--text);cursor:pointer;padding:8px}.secret-gate[data-color="teal"]{--gate-color:var(--teal)}.secret-gate[data-color="amber"]{--gate-color:var(--amber)}.secret-gate span,.secret-gate b{display:block}.secret-gate span{font-size:.75rem;color:var(--muted)}.secret-gate.is-wrong{animation:gate-wrong .3s ease}
.secret-reveal{margin-top:16px;border-left:4px solid var(--amber);border-radius:0 13px 13px 0;background:rgba(255,184,77,.08);padding:13px 16px}.secret-reveal[hidden]{display:none}.secret-reveal strong{color:var(--amber)}
.secret-actions{display:flex;justify-content:flex-end;margin-top:17px}.secret-restart{min-width:120px}

/* Blocked-path 404 */
.blocked-page{min-height:calc(100vh - 78px);display:grid;place-items:center;padding:70px 0}
.blocked-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:60px;align-items:center}
.blocked-code{color:var(--teal);font-size:.82rem;font-weight:850;letter-spacing:.16em;text-transform:uppercase}.blocked-grid h1{margin:12px 0 18px;font-size:clamp(3rem,7vw,6.6rem);line-height:.96;letter-spacing:-.06em}.blocked-grid .studio-mascot{--mascot-size:180px;justify-self:center}.blocked-board{position:relative;display:grid;min-height:330px;place-items:center;border:1px solid var(--border);border-radius:38px;background:radial-gradient(circle at 50% 40%,color-mix(in srgb,var(--primary) 15%,transparent),transparent 35%),linear-gradient(145deg,var(--surface-card-a),var(--surface-card-b));box-shadow:var(--shadow)}.blocked-board:before,.blocked-board:after{content:"";position:absolute;height:9px;border-radius:99px;background:linear-gradient(90deg,var(--primary),var(--teal))}.blocked-board:before{left:9%;top:27%;width:42%;transform:rotate(24deg)}.blocked-board:after{right:7%;bottom:24%;width:45%;transform:rotate(-28deg)}

.blocked-page+.site-footer .footer-grid{grid-template-columns:2fr 1fr 1fr}

@keyframes mascot-float{to{transform:rotate(11deg) translateY(-5px)}}
@keyframes spark-turn{to{transform:rotate(1turn)}}
@keyframes orb-preview{0%,18%,100%{transform:none}42%{transform:translateY(-52px)}68%{transform:translate(58px,-52px)}88%{transform:translate(58px,0)}}
@keyframes prism-preview{0%,15%{transform:translate(0,0) rotate(0)}45%{transform:translate(98px,0) rotate(0)}70%{transform:translate(98px,48px) rotate(90deg)}100%{transform:translate(145px,92px) rotate(0)}}
@keyframes secret-tap{50%{transform:scale(1.16) rotate(-7deg);box-shadow:0 0 0 6px color-mix(in srgb,var(--teal) 25%,transparent),0 12px 28px rgba(30,214,195,.3)}}
@keyframes gate-wrong{25%{transform:translateX(-4px)}50%{transform:translateX(4px)}75%{transform:translateX(-2px)}}

@media(max-width:820px){.blocked-grid{grid-template-columns:1fr;gap:35px}.blocked-grid .studio-mascot{--mascot-size:138px}.secret-orbs{grid-template-columns:repeat(5,1fr)}.chapter-number{top:28px;font-size:7rem}.mascot-note{align-items:flex-start}}
@media(max-width:600px){.theme-options{display:grid;grid-template-columns:1fr}.theme-choice{justify-content:flex-start}.mascot-note{gap:14px;padding:17px}.mascot-note .studio-mascot{--mascot-size:62px}.secret-game-shell{padding:8px}.secret-game-dialog{max-height:calc(100vh - 16px);border-radius:22px;padding:22px 17px}.secret-heading{gap:10px}.secret-heading .studio-mascot{--mascot-size:54px}.secret-orbs{grid-template-columns:repeat(5,1fr);gap:7px;padding:11px}.secret-gates{gap:7px}.secret-gate{min-height:58px;padding:6px 3px}.blocked-page{padding:45px 0}.blocked-board{min-height:260px}.blocked-grid .studio-mascot{--mascot-size:112px}}
@media(max-width:820px){.blocked-page+.site-footer .footer-grid{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){body{transition:none}.mascot-core,.mascot-spark,.mini-orb,.mini-arrow,.brand-secret-trigger,.secret-gate{animation:none!important}.motion-preview,.magnetic-content,body.home-delight .studio-card,.secret-orb,.secret-meter-fill{transition:none!important}.magnetic-content{transform:none!important}.motion-preview *{animation:none!important}.game-card.is-preview-visible .motion-preview{opacity:.92;transform:none}.secret-meter-track{display:none}}
