/* ============================================================
   SONG WORLDS (Sept 2026)
   One stylesheet for the song-world overlay on the music page AND the
   standalone song pages in /songs/, so the two can never drift apart.
   Each world paints with its song: --w-base (the ground), --w-accent,
   --w-glow, and --w-text: the accent as type (labels, the Malayalam title,
   the page's button), which a song can set a step lighter when its accent
   is too deep to read at small sizes on its ground (palette.text).
   ============================================================ */

/* ---- the song pages load only fonts.css and this file: a minimal base.
   :where() keeps these at zero specificity, so every rule below still wins. ---- */
:where(html.sp) *,:where(html.sp) *::before,:where(html.sp) *::after{box-sizing:border-box;margin:0;padding:0}
:where(html.sp){--ease:cubic-bezier(.22,.9,.28,1);-webkit-text-size-adjust:100%;text-size-adjust:100%;
  background:var(--w-base,#0A1A2C)}
:where(html.sp) body{font-family:'Albert Sans',system-ui,sans-serif;line-height:1.6;color:#EFF6FD;
  background:var(--w-base,#0A1A2C);-webkit-font-smoothing:antialiased;min-height:100svh;overflow-x:hidden}
:where(html.sp) img,:where(html.sp) video{max-width:100%;display:block}
:where(html.sp) a{color:inherit;text-decoration:none}
:where(html.sp) button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
:where(html.sp) ::selection{background:var(--w-text,var(--w-accent,#7FD4FF));color:var(--w-base,#0A1A2C)}
:where(html.sp) :focus-visible{outline:2px solid var(--w-text,var(--w-accent,#7FD4FF));outline-offset:3px;border-radius:4px}

/* ---------- the overlay shell (music page) ----------
   visibility follows the fade, so a closed world is out of the tab order
   and out of the accessibility tree, not just transparent. */
.world{position:fixed;inset:0;z-index:80;overflow-y:auto;overscroll-behavior:contain;
  background:var(--w-base,#0A1A2C);color:#EFF6FD;opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .6s var(--ease),visibility 0s linear .6s}
.world.on{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .6s var(--ease)}

/* ---------- the hero ---------- */
.world-hero{position:relative;min-height:72svh;display:flex;align-items:flex-end;overflow:hidden}
.world-hero .wbg{position:absolute;inset:0;background-size:cover;background-position:center;
  animation:kenburns 26s ease-in-out infinite alternate}
.world-hero video.wbg{width:100%;height:100%;max-width:none;object-fit:cover;animation:none}
@keyframes kenburns{from{transform:scale(1)}to{transform:scale(1.09)}}
.world-hero::after{content:"";position:absolute;inset:0;
  background:linear-gradient(to top,var(--w-base,#0A1A2C) 4%,transparent 60%),linear-gradient(to bottom,rgba(0,0,0,.35),transparent 30%)}
.world-hero .whead{position:relative;z-index:2;padding:0 clamp(20px,5vw,64px) clamp(30px,5vw,54px);max-width:1120px;margin:0 auto;width:100%}
.world-hero .wchip{font-size:.66rem;letter-spacing:.3em;text-transform:uppercase;font-weight:700;color:var(--w-text,var(--w-accent,#7FD4FF))}
.world-hero .wtitle{font-family:'Instrument Serif',serif;font-style:italic;font-weight:400;font-size:clamp(2.6rem,8vw,5.6rem);line-height:1;margin-top:10px}
.world-hero .wtitle:focus{outline:none}
.night-world .world-hero .wtitle{font-family:'Syne',sans-serif;font-style:normal;font-weight:800;text-transform:uppercase;
  font-size:clamp(2.1rem,9.4vw,5.6rem);   /* Syne runs wide: a one-word night title still fits a 360px phone */
  text-shadow:0 0 40px var(--w-glow,rgba(95,201,255,.4))}
.world-hero .wmal{font-family:'Noto Serif Malayalam',serif;font-size:clamp(1.1rem,2.6vw,1.6rem);color:var(--w-text,var(--w-accent,#7FD4FF));margin-top:8px}

/* ---------- the body: story, film, lyrics, credits, links ---------- */
.world-body{max-width:1120px;margin:0 auto;padding:clamp(36px,6vw,70px) clamp(20px,5vw,64px) 120px}
.world-body .wstory{max-width:62ch;color:rgba(235,244,252,.85);font-size:1.05rem}
.world-body .wstory p+p{margin-top:1em}
.world-body .wstory .lede{font-family:'Instrument Serif',serif;font-style:italic;font-size:clamp(1.3rem,2.8vw,1.7rem);
  line-height:1.5;color:#fff;margin-bottom:18px}
.wlabel{font-size:.7rem;letter-spacing:.3em;text-transform:uppercase;font-weight:700;color:var(--w-text,var(--w-accent,#7FD4FF));
  margin:clamp(36px,5vw,56px) 0 18px;display:flex;align-items:center;gap:14px}
.wlabel::after{content:"";flex:1;height:1px;background:rgba(255,255,255,.15)}
.lyrics{display:grid;grid-template-columns:1fr 1fr;gap:clamp(24px,4vw,54px)}
.lyrics .col .lyr-h{font-size:.66rem;letter-spacing:.26em;text-transform:uppercase;color:rgba(255,255,255,.55);margin-bottom:14px;font-weight:700}
.lyrics .mal-l{font-family:'Noto Serif Malayalam',serif;font-size:1.05rem;line-height:2.15;white-space:pre-line}
.lyrics .mal-l:lang(hi){font-family:'Noto Serif Devanagari',serif;line-height:2.05}
.lyrics .en-l{font-family:'Instrument Serif',serif;font-style:italic;font-size:1.08rem;line-height:2.05;
  color:rgba(235,244,252,.85);white-space:pre-line}
@media(max-width:720px){.lyrics{grid-template-columns:1fr}}
.wshelf{display:flex;gap:10px;flex-wrap:wrap}
.wshelf a,.wshelf button{padding:11px 20px;border-radius:999px;border:1px solid rgba(255,255,255,.25);font-size:.76rem;
  font-weight:600;letter-spacing:.08em;line-height:1.6;transition:all .3s;color:#fff}
.wshelf a:hover,.wshelf button:hover{border-color:var(--w-text,var(--w-accent,#7FD4FF));color:var(--w-text,var(--w-accent,#7FD4FF));transform:translateY(-2px)}
.wshelf .wshare{background:rgba(255,255,255,.07)}
.wcredits{white-space:pre-line;font-size:.92rem;line-height:2;color:rgba(235,244,252,.72);
  max-width:56ch}
.wcredits b{color:rgba(235,244,252,.95);font-weight:600}

/* the film: YouTube's own player, so every play is a real view and nobody signs in.
   It loads only as the reader nears it; until then the song's art holds the frame. */
.wwatch{position:relative;aspect-ratio:16/9;max-width:880px;border-radius:18px;overflow:hidden;isolation:isolate;
  background-color:#000;background-position:center;background-size:cover;background-repeat:no-repeat;border:1px solid rgba(255,255,255,.12);
  box-shadow:0 30px 80px -34px rgba(0,0,0,.75)}
.wwatch::before{content:"";position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.6),rgba(0,0,0,.28))}
.wwatch-note{position:absolute;left:18px;bottom:14px;font-size:.62rem;letter-spacing:.24em;text-transform:uppercase;
  font-weight:700;color:rgba(255,255,255,.72)}
.wwatch iframe{position:absolute;inset:0;width:100%;height:100%;border:0;opacity:0;transition:opacity .5s var(--ease)}
.wwatch.ready iframe{opacity:1}
.wwatch-go{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:13px 22px;border-radius:999px;
  border:1px solid rgba(255,255,255,.4);background:rgba(0,0,0,.55);color:#fff;font-size:.7rem;font-weight:700;
  letter-spacing:.16em;text-transform:uppercase;white-space:nowrap}
.wwatch-go:hover{border-color:var(--w-text,var(--w-accent,#7FD4FF))}
/* a page opened from disk: a link to YouTube in place of the player (see wireWatch) */
a.wwatch-go{text-decoration:none;z-index:2}
.wwatch.local .wwatch-note{display:none}
.wwatch-local{position:absolute;left:0;right:0;top:calc(50% + 34px);z-index:2;text-align:center;padding:0 16px;
  font-size:.62rem;letter-spacing:.14em;text-transform:uppercase;color:rgba(255,255,255,.72)}

/* ---------- the controls: ink glass, white type, a hairline white ring
   (July 22, Ashwin: "they should look like how the cross looks") ---------- */
.world-close,.world-home{position:fixed;top:18px;right:18px;z-index:90;width:52px;height:52px;border-radius:50%;
  background:rgba(0,0,0,.45);color:#fff;border:1px solid rgba(255,255,255,.3);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  font-size:1.15rem;display:grid;place-items:center;transition:transform .3s,background .3s,border-color .3s}
.world-close:hover{transform:rotate(90deg);border-color:rgba(255,255,255,.55)}
.world-home .as-mk{display:block;width:31px;height:auto;aspect-ratio:1368/958;fill:#fff}   /* drawn in the page (Sept 24) */
.world-home:hover{background:rgba(0,0,0,.62);border-color:rgba(255,255,255,.55)}
.world-back{position:fixed;top:18px;left:18px;z-index:90;display:inline-flex;align-items:center;gap:8px;
  padding:12px 18px;border-radius:999px;border:1px solid rgba(255,255,255,.3);
  background:rgba(0,0,0,.45);color:#fff;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;cursor:pointer;
  transition:background .3s,border-color .3s}
.world-back span{font-size:1rem;line-height:1}
.world-back:hover{background:rgba(0,0,0,.62);border-color:rgba(255,255,255,.55)}
/* once the reader is past the hero, a veil of the world's own ground gathers behind the
   top controls, so the words slip under them instead of running into them */
.world-shade{position:fixed;left:0;right:0;top:0;height:96px;z-index:85;pointer-events:none;opacity:0;
  background:linear-gradient(to bottom,var(--w-base,#0A1A2C) 30%,transparent);
  background:linear-gradient(to bottom,var(--w-base,#0A1A2C) 22%,color-mix(in srgb,var(--w-base,#0A1A2C) 72%,transparent) 55%,transparent);
  transition:opacity .45s var(--ease)}
.world-shade.on{opacity:1}

/* ---------- walking between worlds (July 20, friends' feedback; placement Sept 2026) ----------
   The arrows stay. Each now carries the neighbouring song's name, set in that
   song's own face, and they live where they never sit on the words:
   the margins on wide screens, a dock at the foot of the page everywhere else. */
.world-nav{display:flex;align-items:center;gap:12px;color:#fff;cursor:pointer;-webkit-tap-highlight-color:transparent}
.world-nav .wn-ar{flex:none;width:52px;height:52px;border-radius:50%;border:1px solid rgba(255,255,255,.3);
  background:rgba(0,0,0,.45);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  font-size:1.7rem;line-height:1;display:flex;align-items:center;justify-content:center;padding-bottom:4px;
  transition:transform .25s,background .3s,border-color .3s}
.world-nav:hover .wn-ar{transform:scale(1.08);background:rgba(0,0,0,.62);border-color:rgba(255,255,255,.55)}
.wn-t{display:flex;flex-direction:column;min-width:0;line-height:1.15;text-align:left}
.wn-t small{font-size:.56rem;letter-spacing:.26em;text-transform:uppercase;font-weight:700;color:var(--w-text,var(--w-accent,#7FD4FF))}
.wn-t b{font-family:'Instrument Serif',serif;font-style:italic;font-weight:400;font-size:1.06rem;margin-top:3px;
  max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.world-nav.to-night .wn-t b{font-family:'Syne',sans-serif;font-style:normal;font-weight:700;text-transform:uppercase;
  font-size:.74rem;letter-spacing:.06em;margin-top:5px}
.world-nav.next .wn-t{align-items:flex-end;text-align:right}

@media (min-width:1181px){
  .world-dock{display:block;height:0}
  .world-nav{position:fixed;top:50%;z-index:90;transform:translateY(-50%)}
  .world-nav.prev{left:14px}
  .world-nav.next{right:14px}
  .world-nav .wn-t{position:absolute;top:50%;width:max-content;max-width:260px;padding:10px 15px;border-radius:14px;
    background:rgba(0,0,0,.6);border:1px solid rgba(255,255,255,.16);opacity:0;pointer-events:none;
    transition:opacity .3s var(--ease),transform .3s var(--ease)}
  .world-nav.prev .wn-t{left:64px;transform:translate(-6px,-50%)}
  .world-nav.next .wn-t{right:64px;transform:translate(6px,-50%)}
  .world-nav:hover .wn-t,.world-nav:focus-visible .wn-t{opacity:1;transform:translate(0,-50%)}
}
@media (max-width:1180px){
  .world-dock{position:fixed;left:0;right:0;bottom:0;z-index:90;display:flex;justify-content:space-between;align-items:center;gap:10px;
    padding:44px max(12px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    background:linear-gradient(to top,var(--w-base,#0A1A2C) 40%,transparent);
    background:linear-gradient(to top,var(--w-base,#0A1A2C) 36%,color-mix(in srgb,var(--w-base,#0A1A2C) 70%,transparent) 66%,transparent);
    pointer-events:none}
  .world-nav{pointer-events:auto;min-width:0;max-width:calc(50% - 5px);gap:10px;border-radius:999px}
  .world-nav .wn-ar{width:46px;height:46px}
  .world-body{padding-bottom:calc(150px + env(safe-area-inset-bottom))}
}
@media (max-width:760px){
  .world-back{top:12px;left:12px;min-height:44px;padding:0 16px}
  .world-close,.world-home{top:12px;right:12px;width:44px;height:44px}
  .world-home .as-mk{width:26px}
}
/* touch screens: the glass is drawn solid. A live blur over the playing loop
   re-renders every frame on a phone; the ink alone reads the same. */
@media (hover:none),(max-width:760px){
  .world-close,.world-home,.world-back,.world-nav .wn-ar{-webkit-backdrop-filter:none;backdrop-filter:none;background:rgba(0,0,0,.52)}
}

/* ---------- the song pages (songs/<id>.html) ---------- */
.sp-world{position:relative}
.sp .world-body{padding-bottom:30px}
.sp-more{max-width:1120px;margin:0 auto;padding:10px clamp(20px,5vw,64px) calc(150px + env(safe-area-inset-bottom))}
@media (min-width:1181px){.sp-more{padding-bottom:80px}}
.sp-more .sp-cta{display:inline-flex;align-items:center;gap:10px;padding:14px 24px;border-radius:999px;
  background:var(--w-text,var(--w-accent,#7FD4FF));color:var(--w-base,#0A1A2C);font-size:.74rem;font-weight:700;letter-spacing:.14em;
  text-transform:uppercase;transition:transform .3s var(--ease),box-shadow .3s}
.sp-more .sp-cta:hover{transform:translateY(-2px);box-shadow:0 14px 34px -14px var(--w-glow,rgba(95,201,255,.5))}
.sp-more p{margin-top:16px;max-width:52ch;color:rgba(235,244,252,.6);font-size:.9rem}
.sp-foot{margin-top:clamp(40px,6vw,64px);padding-top:22px;border-top:1px solid rgba(255,255,255,.12);
  display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center;font-size:.78rem;color:rgba(235,244,252,.55)}
.sp-foot a{text-decoration:underline;text-underline-offset:3px;text-decoration-color:rgba(255,255,255,.3)}
.sp-foot a:hover{color:#fff}
.sp-foot .sp-mal{font-family:'Noto Serif Malayalam',serif;color:rgba(235,244,252,.75);font-size:.92rem}

@media (prefers-reduced-motion:reduce){
  .world,.world.on,.world-nav .wn-t,.wwatch iframe,.world-shade{transition-duration:.01ms}
  .world-hero .wbg{animation:none}
}
