  :root{
    --bg:#050505;
    --line:#e9e9e9;
    --line-dim:#7a7a7a;
    --gold:#ffd98a;
    --cyan:#8fd3ff;
    --ember:#ff9d7a;
  }
  *{box-sizing:border-box;}
  html,body{
    margin:0;
    padding:0;
    width:100%;
    height:100%;
    background:var(--bg);
    overflow:hidden;
    -webkit-tap-highlight-color:transparent;
  }
  canvas{
    display:block;
    position:fixed;
    inset:0;
    width:100%;
    height:100%;
  }

  /* ── lang switcher ── */
  .lang-switch{
    position:fixed;
    top:clamp(14px,3vh,26px);
    left:clamp(16px,3vw,28px);
    z-index:30;
    display:flex;
    align-items:center;
    gap:10px;
    pointer-events:auto;
  }
  .lang-flag{
    cursor:pointer;
    background:none;
    border:none;
    padding:0;
    line-height:0;
    opacity:0.5;
    transition:opacity .3s ease, transform .3s ease;
  }
  .lang-flag.active{ opacity:1; }
  .lang-flag:hover{ opacity:0.85; transform:scale(1.07); }
  .lang-sep{
    font-family:'Caveat',cursive;
    font-size:0.9rem;
    color:var(--line-dim);
    opacity:0.6;
    pointer-events:none;
    user-select:none;
  }
  .lang-flag canvas{
    position:static;
    display:inline;
    width:auto;
    height:auto;
  }

  /* ── footer ── */
  .footer{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    display:flex;
    justify-content:center;
    padding:clamp(18px,4vh,36px) 0;
    z-index:10;
    pointer-events:none;
  }
  .footer-inner{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
  }
  .footer-eyebrow{
    font-family:'Caveat',cursive;
    font-weight:600;
    font-size:clamp(0.85rem,1.6vw,1rem);
    letter-spacing:3px;
    text-transform:uppercase;
    color:var(--line);
    opacity:0.9;
  }
  .vivace-wrap{
    position:relative;
    pointer-events:auto;
  }
  .vivace-tooltip{
    position:absolute;
    bottom:calc(100% + 16px);
    left:50%;
    transform:translate(-50%,8px) scale(0.96);
    width:min(260px,72vw);
    background:#0b0b0b;
    border:1.5px solid var(--line-dim);
    border-radius:255px 18px 225px 18px / 18px 225px 18px 255px;
    padding:14px 18px;
    font-family:'Caveat',cursive;
    font-weight:500;
    font-size:1.08rem;
    line-height:1.35;
    color:var(--line);
    text-align:center;
    opacity:0;
    pointer-events:none;
    transition:opacity .35s ease, transform .35s ease;
    box-shadow:0 10px 26px rgba(0,0,0,0.5);
    z-index:20;
  }
  .vivace-tooltip::after{
    content:'';
    position:absolute;
    top:100%;
    left:50%;
    width:11px;
    height:11px;
    background:#0b0b0b;
    border-right:1.5px solid var(--line-dim);
    border-bottom:1.5px solid var(--line-dim);
    transform:translateX(-50%) rotate(45deg);
    margin-top:-6px;
  }
  .vivace-wrap:hover .vivace-tooltip,
  .vivace-wrap:focus-within .vivace-tooltip{
    opacity:1;
    transform:translate(-50%,0) scale(1);
  }
  .footer a{
    pointer-events:auto;
    font-family:'Caveat',cursive;
    font-weight:600;
    font-size:clamp(1.3rem,2.8vw,1.75rem);
    letter-spacing:0.5px;
    color:var(--line);
    text-decoration:none;
    opacity:0.95;
    position:relative;
    padding:2px 4px;
    transition:opacity .35s ease, transform .35s ease;
  }
  .footer a::after{
    content:'';
    position:absolute;
    left:2px;
    right:2px;
    bottom:-2px;
    height:1.5px;
    background:var(--line);
    opacity:0.55;
    transform:scaleX(0.15);
    transform-origin:center;
    transition:transform .4s ease, opacity .4s ease;
  }
  .footer a:hover,
  .footer a:focus-visible{ opacity:1; transform:translateY(-2px); }
  .footer a:hover::after,
  .footer a:focus-visible::after{ transform:scaleX(1); opacity:0.9; }
  .footer a:focus-visible{
    outline:1px dashed var(--line-dim);
    outline-offset:6px;
    border-radius:3px;
  }
  /* ── licence button + modal ── */
  .licence-btn{
    position:fixed;
    bottom:clamp(14px,3vh,26px);
    right:clamp(16px,3vw,28px);
    z-index:30;
    background:none;
    border:none;
    cursor:pointer;
    padding:0;
    font-family:'Caveat',cursive;
    font-size:0.78rem;
    letter-spacing:1.5px;
    text-transform:uppercase;
    color:var(--line-dim);
    opacity:0.55;
    transition:opacity .3s ease;
  }
  .licence-btn:hover{ opacity:1; }

  .licence-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.72);
    z-index:40;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    opacity:0;
    pointer-events:none;
    transition:opacity .35s ease;
  }
  .licence-overlay.open{
    opacity:1;
    pointer-events:auto;
  }
  .licence-box{
    position:relative;
    width:min(560px,92vw);
    max-height:80vh;
    background:#0b0b0b;
    border:1.5px solid var(--line-dim);
    border-radius:255px 18px 225px 18px / 18px 225px 18px 255px;
    padding:clamp(20px,4vw,36px) clamp(22px,4vw,38px);
    overflow-y:auto;
    transform:translateY(12px) scale(0.97);
    transition:transform .35s ease;
  }
  .licence-overlay.open .licence-box{
    transform:translateY(0) scale(1);
  }
  .licence-box h2{
    font-family:'Caveat',cursive;
    font-weight:700;
    font-size:1.25rem;
    letter-spacing:2px;
    text-transform:uppercase;
    color:var(--line);
    margin:0 0 16px;
  }
  .licence-box pre{
    font-family:'Caveat',cursive;
    font-size:0.95rem;
    line-height:1.55;
    color:#c8c8c8;
    white-space:pre-wrap;
    word-break:break-word;
    margin:0;
  }
  .licence-box a{
    color:var(--cyan);
    text-decoration:none;
  }
  .licence-box a:hover{ text-decoration:underline; }
  .licence-close{
    position:absolute;
    top:14px;
    right:18px;
    background:none;
    border:none;
    cursor:pointer;
    font-family:'Caveat',cursive;
    font-size:1.3rem;
    color:var(--line-dim);
    opacity:0.7;
    transition:opacity .2s ease;
    line-height:1;
    padding:2px 6px;
  }
  .licence-close:hover{ opacity:1; }
