:root {
  color-scheme: light only;
  --ratio: 1.7778;
  --vs: min(100vw / 1.7778, 100vh);
}
  *, *::before, *::after { cursor: none !important; }
  html, body { cursor: none !important; }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body {
    background: #000; color: #fff;
    font-family: 'Orbitron', sans-serif;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-anchor: none;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar { display: none; width: 0; height: 0; }
  body { height: 100vh; }
  body.locked { overflow: hidden; height: 100vh; }
  html.locked { overflow: hidden; height: 100vh; }

  /* ─────────── START SCREEN / DISCLAIMER ─────────── */
  .start-screen {
    position: fixed; inset: 0;
    background: #050505;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 2147483600;
    overflow: hidden;
    transition: opacity 0.5s ease;
    padding: 18px;
  }
  .start-screen.gone { opacity: 0; pointer-events: none; }

  .start-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
  .grid-bg {
    position: absolute; inset: -2px;
    background-image:
        linear-gradient(rgba(255,255,255,0.020) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.020) 1px, transparent 1px);
    background-size: 72px 72px;
    background-position: center;
  }
  .vignette {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
  }
  .scanline {
    position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
    animation: scanlineMove 9s linear infinite;
    will-change: transform;
  }
  .scanline-2 {
    position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: scanlineMove 14s linear infinite;
    animation-delay: -5s;
    will-change: transform;
  }
  .scanline-3 {
    position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: scanlineMove 22s linear infinite;
    animation-delay: -11s;
    will-change: transform;
  }
  @keyframes scanlineMove { 0% { transform: translate3d(0, -2vh, 0); } 100% { transform: translate3d(0, 102vh, 0); } }

  .start-inner {
    position: relative; z-index: 10;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%;
  }

  .panel {
    position: relative;
    width: 75vw;
    min-height: 75vh;
    max-height: 92vh;
    height: auto;
    max-width: 1600px;
    background: rgba(8,8,8,0.93);
    border: 1px solid rgba(255,255,255,0.10);
    display: flex; flex-direction: column;
    animation: panelIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes panelIn {
    0% { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  .corner {
    position: absolute; width: 16px; height: 16px;
    border: 1px solid rgba(255,255,255,0.55);
    pointer-events: none;
  }
  .corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
  .corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
  .corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
  .corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

  .panel-head {
    padding: clamp(28px, 4vh, 54px) clamp(28px, 4.5vw, 72px) clamp(20px, 3vh, 38px);
    display: flex; align-items: center; gap: clamp(14px, 1.8vw, 22px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .warn-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: clamp(38px, 5vh, 56px); height: clamp(38px, 5vh, 56px);
    border: 1px solid rgba(255,255,255,0.45);
    color: #fff; font-size: clamp(18px, 2.4vh, 28px); line-height: 1;
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    transform: translateY(-1px);
    flex-shrink: 0;
  }
  .warn-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(20px, 3.4vh, 42px);
    letter-spacing: 0.42em;
    color: #fff;
    text-transform: uppercase;
  }

  .panel-body {
    flex: 1;
    padding: clamp(28px, 4vh, 60px) clamp(28px, 4.5vw, 72px);
    display: flex; flex-direction: column; justify-content: center;
    gap: clamp(24px, 4vh, 52px);
  }
  .warn-item { display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 18px); }
  .warn-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(11px, 1.5vh, 16px); font-weight: 700;
    letter-spacing: 0.32em; text-transform: uppercase;
    color: rgba(255,255,255,0.55);
  }
  .warn-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(15px, 2.2vh, 28px);
    line-height: 1.55;
    color: rgba(255,255,255,0.9);
    max-width: 72ch;
  }

  .panel-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10) 15%, rgba(255,255,255,0.10) 85%, transparent);
    margin: 0 clamp(28px, 4.5vw, 72px);
  }

  .panel-foot {
    padding: clamp(28px, 4vh, 60px) clamp(28px, 4.5vw, 72px);
    display: flex; flex-direction: column; align-items: center;
    gap: clamp(18px, 2.6vh, 36px);
  }

  .f11-hint {
    display: inline-flex; align-items: center; gap: clamp(10px, 1.4vw, 18px);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(12px, 1.6vh, 18px);
    letter-spacing: 0.22em; text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    user-select: none; pointer-events: none; white-space: nowrap;
    animation: f11Pulse 3.4s ease-in-out infinite;
    text-align: center;
  }
  .f11-hint.hidden { display: none; }
  .f11-hint kbd {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: clamp(12px, 1.6vh, 18px);
    padding: clamp(5px, 0.7vh, 8px) clamp(12px, 1.4vw, 18px);
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.04);
    color: #fff; letter-spacing: 0.16em; line-height: 1;
  }
  @keyframes f11Pulse {
    0%,100% { opacity: 0.68; }
    50%     { opacity: 1; }
  }

  .start-btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: clamp(260px, 34vw, 480px);
    padding: clamp(18px, 2.4vh, 28px) clamp(48px, 6vw, 88px);
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(14px, 1.9vh, 22px);
    letter-spacing: 0.36em; text-transform: uppercase;
    color: #fff; background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    cursor: pointer; pointer-events: auto;
    transition: background-color 0.28s ease, color 0.28s ease,
                border-color 0.28s ease, letter-spacing 0.35s ease,
                transform 0.2s ease;
    z-index: 10; isolation: isolate;
  }
  .start-btn:hover { background: #fff; color: #000; border-color: #fff; }
  .start-btn:active { transform: scale(0.98); }
  @media (max-height: 720px) {
    .panel-head {
      padding: 14px 22px 10px;
      gap: 10px;
    }
    .panel-body {
      padding: 14px 22px;
      gap: 14px;
    }
    .panel-foot {
      padding: 12px 22px 16px;
      gap: 10px;
    }
    .warn-mark {
      width: 30px; height: 30px;
      font-size: 16px;
    }
    .warn-title {
      font-size: 18px;
      letter-spacing: 0.28em;
    }
    .warn-key {
      font-size: 10px;
      letter-spacing: 0.24em;
    }
    .warn-text {
      font-size: 13px;
      line-height: 1.4;
    }

    /* Кнопки качества — в строку, без subtitle, компактные */
    .w4-start-quality {
      gap: 5px;
      margin-bottom: 0;
    }
    .w4-start-quality-label {
      display: none;
    }
    .w4-start-quality-row {
      max-width: 420px;
      gap: 8px;
    }
    .w4-start-quality-btn {
      flex-direction: row;
      align-items: center;
      justify-content: center;
      padding: 7px 12px;
      gap: 0;
      min-width: 0;
      max-width: 50%;
    }
    .w4-start-quality-btn .q-title {
      font-size: 11px;
      letter-spacing: 0.16em;
    }
    .w4-start-quality-btn .q-sub {
      display: none;
    }

    /* F11 подсказка — лишняя на маленьких, прячем */
    .f11-hint {
      display: none;
    }

    .start-btn {
      min-width: 200px;
      padding: 12px 32px;
      font-size: 13px;
      letter-spacing: 0.26em;
    }
  }

  @media (max-height: 560px) {
    .panel-head {
      padding: 10px 18px 8px;
    }
    .panel-body {
      padding: 10px 18px;
      gap: 10px;
    }
    .panel-foot {
      padding: 10px 18px 12px;
      gap: 8px;
    }
    .warn-text {
      font-size: 12px;
      line-height: 1.35;
    }
    .start-btn {
      padding: 10px 28px;
      font-size: 12px;
    }
  }
  .start-btn.stage-2 {
    border-color: rgba(255,255,255,0.7);
    letter-spacing: 0.44em;
    animation: btnGlow 2.2s ease-in-out infinite;
  }
  @keyframes btnGlow {
    0%,100% { filter: drop-shadow(0 0 0px rgba(255,255,255,0)); }
    50%     { filter: drop-shadow(0 0 24px rgba(255,255,255,0.15)); }
  }
  .breach-overlay {
    position: fixed; inset: 0; z-index: 2147483645;
    background: #000; display: none;
    align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; overflow: hidden;
  }
  .breach-overlay.active { display: flex; animation: breachIn 0.08s linear forwards; }
  @keyframes breachIn { from { opacity: 0; } to { opacity: 1; } }

  .breach-text {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: clamp(0.95rem, 3.4vw, 3rem);
    line-height: 1.15; letter-spacing: 0.08em; text-align: center;
    padding: 0 6vw; max-width: 92vw; margin: 0 auto;
    color: #ff0022;
    text-shadow:
      0 0 1px #ff0022,
      0 0 4px rgba(255,0,34,0.85),
      0 0 12px rgba(255,0,34,0.55),
      0 0 28px rgba(255,0,34,0.28),
      0 0 55px rgba(255,0,34,0.14);
    animation: breachBlink 0.6s linear forwards;
    user-select: none; white-space: nowrap;
    will-change: opacity;
    -webkit-font-smoothing: antialiased;
  }
  @keyframes breachBlink {
    0% { opacity: 1; } 11.6% { opacity: 1; } 11.7% { opacity: 0; }
    16.6% { opacity: 0; } 16.7% { opacity: 1; } 36.6% { opacity: 1; }
    36.7% { opacity: 0; } 44.9% { opacity: 0; } 45% { opacity: 1; }
    71.6% { opacity: 1; } 71.7% { opacity: 0.55; } 100% { opacity: 0; }
  }

  .crt-flash {
    position: fixed; inset: 0; z-index: 2147483647;
    background: #ffffff; pointer-events: none; opacity: 0;
  }
  .crt-flash.bang { animation: whiteFlash 0.42s ease-out forwards; }
  @keyframes whiteFlash {
    0% { opacity: 0; } 5% { opacity: 1; } 22% { opacity: 1; } 100% { opacity: 0; }
  }

  .scene2 {
    position: fixed; inset: 0; background: #ffffff;
    z-index: 2147483620;
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .45s ease;
    overflow: hidden;
  }
  .scene2.active { display: flex; opacity: 1; }
  .scene2.fade-out { opacity: 0; }

  .typewriter {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: clamp(2rem, 6.5vw, 5rem);
    color: #111;
    display: inline-flex; align-items: baseline;
    white-space: nowrap; user-select: none;
    letter-spacing: 0.02em;
  }
  .tw-char { display: inline-block; opacity: 0; will-change: transform, opacity; }
  .tw-cursor {
    display: inline-block; margin-left: 0.08em;
    font-weight: 400; color: #111;
    animation: twBlink 0.9s steps(2, start) infinite;
    will-change: transform, opacity;
  }
  @keyframes twBlink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

  .code-block {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: 50% 50%;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1.15rem);
    line-height: 1.55; color: #111;
    white-space: pre; text-align: left;
    max-width: 88vw; display: none;
    will-change: transform, opacity;
  }

  #collapseDot {
    position: fixed; left: 50%; top: 50%;
    width: 6px; height: 6px;
    background: #000; border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2147483625; pointer-events: none; opacity: 0;
  }

  #forgeContainer {
    display: none; position: fixed; inset: 0;
    z-index: 2147483620;
    background: #000;
    opacity: 1;
    will-change: opacity;
  }
  #forgeContainer, #forgeContainer * { box-sizing: border-box; }
  #forgeStage { position: absolute; inset: 0; z-index: 1; }
  #forgeStage canvas#forgeC { display: block; width: 100%; height: 100%; }
  #forgeFx { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
  #forgeStage.shake { animation: forgeShake .5s cubic-bezier(.36,.07,.19,.97) both; }
  @keyframes forgeShake { 10%,90%{transform:translate(-6px,-3px)} 20%,80%{transform:translate(8px,4px)} 30%,50%,70%{transform:translate(-10px,-5px)} 40%,60%{transform:translate(10px,5px)} }

  .curtain {
    position: absolute; inset: 0; z-index: 4;
    background: #000;
    transform: translateX(100%);
    will-change: transform;
    display: flex; align-items: center; justify-content: center;
    perspective: 2200px; pointer-events: none;
    overflow: hidden; padding-bottom: 34vh;
  }
  .curtain::before {
    content:''; position:absolute; left:-80px; top:0; bottom:0; width:80px;
    background:linear-gradient(to right,rgba(0,0,0,0) 0%,rgba(0,0,0,.4) 40%,rgba(0,0,0,.85) 75%,rgba(0,0,0,1) 100%);
    pointer-events:none;
  }
  .curtain.slide { animation: curtainSlide 1s cubic-bezier(.65,0,.35,1) forwards; }
  @keyframes curtainSlide { 0%{transform:translateX(100%)} 85%{transform:translateX(-4%)} 100%{transform:translateX(0)} }

  .logo {
    position: relative; display: flex; gap: 0.04em;
    transform-style: preserve-3d; z-index: 2;
    will-change: transform; perspective: 1800px;
    isolation: isolate; pointer-events: auto;
  }
  .logo::before {
    content:''; position:absolute; inset:-100px -160px;
    background:radial-gradient(ellipse at center,rgba(255,255,255,.24) 0%,rgba(255,255,255,.09) 30%,transparent 70%);
    filter:blur(50px); pointer-events:none; opacity:0;
    transition:opacity 1.2s ease; z-index:-1;
  }
  .logo.lit-all::before { opacity: 1; }

  .ch {
    position: relative; display: inline-block;
    font-family: 'Chakra Petch', 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(4.5rem, 15vw, 13rem);
    line-height: 1; letter-spacing: .02em;
    transform-style: preserve-3d;
    will-change: transform, opacity, color, filter;
    user-select: none; z-index: 1;
    pointer-events: auto;
    cursor: pointer;
    color: #000;
    -webkit-text-stroke: 1.6px rgba(255,255,255,.55);
    text-shadow: 0 0 8px rgba(255,255,255,.25);
    opacity: 0;
  }
  .logo.revealed .ch { opacity: 1; }
  .ch.lit {
    color:#fff; -webkit-text-stroke:1px rgba(255,255,255,.30);
    text-shadow:
      0 -1px 0 rgba(255,255,255,1),
      1px 1px 0 #f0f0f0, 2px 2px 0 #e4e4e4, 3px 3px 0 #d8d8d8,
      4px 4px 0 #cccccc, 5px 5px 0 #c0c0c0, 6px 6px 0 #b4b4b4,
      7px 7px 0 #a8a8a8, 8px 8px 0 #9c9c9c, 9px 9px 0 #909090,
      10px 10px 0 #848484, 11px 11px 0 #787878, 12px 12px 0 #6c6c6c,
      13px 13px 0 #606060, 14px 14px 0 #545454, 15px 15px 0 #484848,
      16px 16px 0 #3c3c3c, 17px 17px 0 #303030, 18px 18px 0 #262626,
      19px 19px 0 #1c1c1c, 20px 20px 0 #141414, 21px 21px 0 #0e0e0e,
      22px 22px 0 #090909, 23px 23px 0 #050505, 24px 24px 0 #020202,
      25px 25px 0 #000,
      0 0 16px rgba(255,255,255,.95),
      0 0 34px rgba(255,255,255,.55),
      0 0 70px rgba(255,255,255,.28);
    animation:
      chSettle 1.6s cubic-bezier(0.45, 0, 0.55, 1) forwards,
      levitate var(--lev-dur, 4.8s) ease-in-out 1.6s infinite;
  }

  .logo.shaking {
    animation: chShake 0.55s cubic-bezier(.36,.07,.19,.97) infinite;
  }
  .logo.shaking .ch.lit {
    animation-play-state: running, paused;
  }
  @keyframes chShake {
    0%   { transform: translate(0, 0) rotate(0deg); }
    10%  { transform: translate(-8px, 4px) rotate(-1.2deg); }
    20%  { transform: translate(7px, -5px) rotate(1.5deg); }
    30%  { transform: translate(-10px, -3px) rotate(-0.9deg); }
    40%  { transform: translate(9px, 6px) rotate(1.8deg); }
    50%  { transform: translate(-6px, -6px) rotate(-1.5deg); }
    60%  { transform: translate(5px, 3px) rotate(0.8deg); }
    70%  { transform: translate(-9px, -4px) rotate(-2deg); }
    80%  { transform: translate(8px, 6px) rotate(1.3deg); }
    90%  { transform: translate(-5px, -3px) rotate(-0.6deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
  }

  @keyframes chSettle {
    0%   { transform: translateY(14px) scale(0.86); opacity: 0.35; filter: brightness(2.4) blur(3px); }
    30%  { transform: translateY(-6px) scale(1.08); opacity: 1;    filter: brightness(1.8) blur(0.5px); }
    55%  { transform: translateY(3px) scale(0.985); filter: brightness(1.25) blur(0); }
    78%  { transform: translateY(-1.5px) scale(1.005); filter: brightness(1.08); }
    100% { transform: translateY(0) scale(1); filter: brightness(1); }
  }

  @keyframes levitate {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
  }

  .logo.scattering .ch.lit {
    opacity: var(--letter-opacity, 1) !important;
    animation-play-state: paused;
  }
  .logo-pixels {
    position: absolute;
    z-index: 6;
    pointer-events: none;
  }

  .ignite-beam {
    position:absolute; top:-25%; left:-20%; width:16%; height:150%;
    background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.3) 30%,rgba(255,255,255,.95) 50%,rgba(255,255,255,.3) 70%,rgba(255,255,255,0) 100%);
    filter:blur(14px); opacity:0; pointer-events:none; z-index:5; mix-blend-mode:screen;
  }
  .logo.igniting .ignite-beam { animation: beamSweep 1.2s cubic-bezier(.45,0,.55,1) forwards; }
  @keyframes beamSweep { 0%{left:-20%;opacity:0} 15%{opacity:1} 85%{opacity:1} 100%{left:110%;opacity:0} }

  .arrival-flash {
    position:absolute; inset:0; z-index:5;
    background:#fff; opacity:0; pointer-events:none; mix-blend-mode:screen;
  }
  .arrival-flash.pop { animation: arrivalPop .35s ease-out forwards; }
  @keyframes arrivalPop { 0%{opacity:0} 20%{opacity:.55} 100%{opacity:0} }

  .logo-wrap { position: relative; display: flex; align-items: center; justify-content: center; transform-style: preserve-3d; }
  .menu {
    position:absolute; top:calc(100% + clamp(1.2rem,3.6vh,2.8rem)); left:50%;
    translate:-50% 0;
    display:flex; flex-direction:column; align-items:center; gap:.15rem;
    perspective:900px; transform-style:preserve-3d;
    opacity:0; pointer-events:none; z-index:3;
  }
  .menu.visible { opacity:1; pointer-events:auto; }
  .menu::before {
    content:''; position:absolute; top:-1.3rem; left:50%; translate:-50% 0;
    width:clamp(140px,34vw,300px); height:1px;
    background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.45) 50%,transparent 100%);
    opacity:0; transition:opacity 1s ease .25s; pointer-events:none;
  }
  .menu.visible::before { opacity:1; }

  .mi {
    position:relative; display:flex; align-items:baseline; gap:.6em;
    padding:.3em 1.05em;
    font-family:'Chakra Petch',sans-serif; font-weight:600;
    font-size:clamp(.6rem,1.5vw,.84rem); line-height:1.4;
    letter-spacing:.3em; text-transform:uppercase; text-decoration:none;
    white-space:nowrap; color:rgba(255,255,255,.38);
    background:rgba(255,255,255,0); border:1px solid rgba(255,255,255,0);
    border-radius:3px; opacity:0;
    transform-style:preserve-3d;
    will-change:transform,color,opacity;
    transition: color .35s, background .35s, border-color .35s, text-shadow .35s, transform .45s cubic-bezier(.34,1.56,.64,1);
    pointer-events: auto;
  }
  .menu.visible .mi {
    opacity:1;
    animation: miIn .7s cubic-bezier(.22,.9,.28,1) backwards;
    animation-delay: calc(var(--d,0) * 90ms);
  }
  @keyframes miIn {
    0%{opacity:0;transform:translateY(20px) rotateX(-62deg) scale(.94);filter:blur(3px)}
    100%{opacity:1;transform:translateY(0) rotateX(0) scale(1);filter:blur(0)}
  }
  .mi::after {
    content:''; position:absolute; left:14%; right:14%; bottom:.05em; height:1px;
    background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.9) 50%,transparent 100%);
    scale:0 1; opacity:0;
    transition: scale .42s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
    pointer-events:none;
  }
  .mi-num {
    font-family:'JetBrains Mono',monospace; font-weight:400;
    font-size:.82em; letter-spacing:.1em; color:rgba(255,255,255,.26);
    transition: color .35s, text-shadow .35s;
  }
  .mi:hover, .mi:focus-visible {
    outline:none; color:#fff;
    background:rgba(255,255,255,.05);
    border-color:rgba(255,255,255,.22);
    transform: translateZ(34px) translateY(-1px) scale(1.03);
    text-shadow: 0 0 10px rgba(255,255,255,.85), 0 0 26px rgba(255,255,255,.35);
  }
  .mi:hover::after, .mi:focus-visible::after { scale:1 1; opacity:1; }
  .mi:hover .mi-num, .mi:focus-visible .mi-num { color:#fff; text-shadow:0 0 10px rgba(255,255,255,.9); }

.w4-section {
    position: fixed; inset: 0;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    background: #000;
}
.w4-section.visible { pointer-events: auto; }

#aboutSection    { z-index: 2147483621; background: #000; }
#skillsSection   { z-index: 2147483622; background: #f5f5f5; }
#projectsSection { z-index: 2147483623; background: #000; }
#storySection    { z-index: 2147483624; background: #f0f0f0; }
#contactSection  { z-index: 2147483625; background: #000; }
#endSection      { z-index: 2147483626; background: #f5f5f5; }

.w4-section canvas {
    position: absolute; inset: 0;
    width: 100vw; height: 100vh;
    display: block;
    z-index: 0;
}

/* Ссылки в 05 некликабельны, пока сама секция не в фокусе */
#contactSection:not(.visible) .sphere,
#contactSection:not(.visible) .sphere * {
    pointer-events: none !important;
}
#contactSection:not(.visible) .sphere .text-block {
    opacity: 0 !important;
    transition: none !important;
}
/* flyTransition — слой для «полёта сквозь меню» */
#flyTransition {
    position: fixed; inset: 0;
    z-index: 2147483640;
    display: none;
    pointer-events: none;
    background: transparent;
}
#flyTransition.active { display: block; }
#flyTransition .fly-window {
    position: absolute;
    overflow: hidden;
    will-change: transform, opacity;
    pointer-events: none;
}

#flyTransition .fly-menu-line {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.42em;
    color: #0a0a0a;
    text-transform: uppercase;
    white-space: nowrap;
    will-change: transform, opacity;
    pointer-events: none;
}
#flyTransition .fly-menu-num {
    opacity: 0.55;
    margin-right: 0.9em;
}

  .corner-label {
    position: absolute;
    top: 2vh;
    left: 2vh;
    z-index: 20;
    pointer-events: none;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: clamp(13px, 1.05vw, 15px);
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: #ffffff;
    mix-blend-mode: difference;
    opacity: 0.6;
    display: flex;
    gap: 1em;
    align-items: baseline;
  }
  .corner-label .num { opacity: 0.75; }
  .corner-label .name { letter-spacing: 0.4em; }

  .text-overlay {
    position: absolute;
     top: 0.6em; bottom: 0.6em; left: 42vw; right: 2vh;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.25em;
    color: #ffffff;
    mix-blend-mode: difference;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 21px);
    line-height: 1.45;
    letter-spacing: 0.005em;
  }

  .block {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    max-width: 52ch;
  }
  .block.show { opacity: 1; transform: translateY(0); }

  .big {
    font-size: 1.7em;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.2em;
    display: block;
    line-height: 1.05;
  }

  .row {
    display: flex;
    align-items: baseline;
    gap: 0.9em;
    margin-bottom: 0.15em;
  }
  .row:last-child { margin-bottom: 0; }
  .row .k {
    font-size: 0.82em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.55;
    min-width: 6ch;
  }
  .row .v {
    font-weight: 500;
    letter-spacing: 0.02em;
    display: flex;
    flex-direction: column;
    gap: 0.1em;
  }

  .v .stacked { display: block; font-weight: 400; }
  .v .stacked.muted { opacity: 0.5; }

  .line { display: block; margin-bottom: 0.15em; }
  .line:last-child { margin-bottom: 0; }

  .muted { opacity: 0.55; }

  .divider {
    display: block;
    width: 5ch;
    height: 1px;
    background: transparent;
    opacity: 0;
    margin: 0.55em 0;
  }

  .final {
    font-size: 1.3em;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.3;
  }
  #pixelTransition {
    position: fixed; inset: 0;
    z-index: 2147483646;
    display: none;
    pointer-events: none;
  }

.cursor-dot {
    position: fixed; width: 11.25px; height: 11.25px; border-radius: 50%;
    pointer-events: none;
    transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
    will-change: transform;
    z-index: 2147483647;
    background: #fff !important; border: none !important;
    outline: 2.5px solid #fff !important; outline-offset: -1.25px !important;
    forced-color-adjust: none !important;
    box-shadow: 0 0 7.5px 2.5px #fff, 0 0 20px 7.5px rgba(255,255,255,.85);
    mix-blend-mode: difference;
    opacity: 0; visibility: hidden;
}
  .cursor-dot.visible { opacity: 1; visibility: visible; }
  /* ═══════════════════════════════════════════════════════════════════
   02 · SKILLS
   ═══════════════════════════════════════════════════════════════════ */

#skillsSection .text-overlay {
    left: 54vw;
    right: 2vh;
    top: 1.3em;
    bottom: 6vh;
    gap: 0.8vh;
    justify-content: space-between;
    font-size: min(1.65vw, 23px);
    line-height: 1.55;
}

#skillsSection .big {
    display: block;
    font-size: 1.9em;
    font-weight: 500;
    letter-spacing: 0.18em;
    line-height: 1.15;
    margin-bottom: 1.75em;
    text-transform: lowercase;
}

#skillsSection .cat {
    display: block;
    font-size: 1em;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.4;
    margin-bottom: 0.05em;
}

#skillsSection .line {
    display: block;
    margin-bottom: 0.05em;
    font-weight: 300;
}

#skillsSection .divider {
    display: block;
    width: 4ch; height: 1px;
    background: currentColor;
    opacity: 0.35;
    margin: 0.2em 0 0.35em;
}

#skillsSection .final {
    font-size: 1.05em;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════════
   03 · PROJECTS
   ═══════════════════════════════════════════════════════════════════ */

#projectsSection .text-overlay {
    top: 2vh;
    bottom: 3vh;
    left: 36vw;
    right: 2vh;
    justify-content: flex-start;
    gap: 2.2vh;
    font-size: min(1.8vw, 25px);
    line-height: 1.65;
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
#projectsSection.projects-expanded .text-overlay {
    opacity: 0;
    transform: translateY(-45px);
    pointer-events: none;
}

#projectsSection .block { max-width: 76ch; }

#projectsSection .block[data-block="2"] {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    margin-top: 1.2vh;
    margin-bottom: 1.2vh;
}
#projectsSection .block[data-block="3"] { margin-top: 0; margin-bottom: 0; }

#projectsSection .big {
    font-size: 2.3em;
    font-weight: 600;
    letter-spacing: 0.13em;
    margin-bottom: 1.4em;
    display: block;
    line-height: 1.05;
    text-transform: lowercase;
}

#projectsSection .line {
    display: block;
    margin-bottom: 0.08em;
    font-weight: 300;
}

#projectsSection .divider {
    display: block;
    width: 5ch; height: 1px;
    background: currentColor;
    opacity: 0.45;
    margin: 0.7em 0;
}

#projectsSection .project {
    pointer-events: none;
    cursor: pointer;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 0 0 0 1.4em;
    border-left: 1px solid currentColor;
    min-height: 0;
    transition: padding-left 0.25s ease;
}
#projectsSection .block[data-block="2"].show .project { pointer-events: auto; }
#projectsSection .project:hover { padding-left: 2em; }
#projectsSection .project + .project { border-top: 1px solid currentColor; }

#projectsSection .project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1em;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: min(2vw, 28px);
    font-weight: 300;
    letter-spacing: 0.005em;
    text-align: left;
    line-height: 1.2;
    pointer-events: none;
}
#projectsSection .project-caret {
    font-weight: 200;
    font-size: 1.1em;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.7;
}
#projectsSection .project-body {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease;
    font-weight: 300;
    font-size: 0.95em;
    line-height: 1.55;
}
#projectsSection .project-inner { overflow: hidden; padding-top: 0.7em; }
#projectsSection .project-inner > p { margin: 0 0 0.9em 0; padding: 0; }
#projectsSection .project-inner > p:last-of-type { margin-bottom: 0.3em; }

#projectsSection .faq-block {
    margin-top: 2em;
    padding-top: 1.4em;
    border-top: 1px solid currentColor;
    opacity: 0.95;
}
#projectsSection .faq-title {
    display: flex; align-items: center; gap: 1.2em;
    font-size: 0.72em;
    font-weight: 400;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 1.8em;
}
#projectsSection .faq-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.3;
}
#projectsSection .faq-item {
    margin-bottom: 1.6em;
    padding-left: 1.4em;
    border-left: 1px solid currentColor;
    opacity: 0.85;
}
#projectsSection .faq-item:last-child { margin-bottom: 0; }
#projectsSection .faq-q {
    display: block;
    font-weight: 400;
    font-size: 1em;
    margin-bottom: 0.5em;
    line-height: 1.45;
}
#projectsSection .faq-a {
    display: block;
    font-weight: 300;
    font-size: 0.97em;
    opacity: 0.68;
    line-height: 1.7;
}
#projectsSection .faq-a b { font-weight: 600; opacity: 0.95; }

#projectsSection .final {
    font-size: 1em;
    font-weight: 300;
    line-height: 1.65;
}

#projectsSection .end-label {
    display: inline-flex;
    align-items: baseline;
    gap: 0.9em;
    font-size: 0.72em;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.6;
    white-space: nowrap;
    vertical-align: baseline;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}
#projectsSection .end-label:hover { opacity: 1; }
#projectsSection .end-label .num { opacity: 0.75; }

/* ── expanded overlay ── */
#projectsSection .expanded-overlay {
    position: fixed;
    top: 6vh; bottom: 2vh;
    left: 36vw; right: 2vh;
    z-index: 40;
    pointer-events: none;
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.5s ease 0.05s,
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
    color: #ffffff;
    mix-blend-mode: difference;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-weight: 300;
    font-size: min(1.5vw, 21px);
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 1.5em;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
}
#projectsSection .expanded-overlay::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* кастомный ползунок */
#projectsSection .exp-scroll {
    position: absolute;
    top: 6vh;
    bottom: 2vh;
    right: 2vh;
    width: 12px;
    z-index: 45;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#projectsSection.projects-expanded .exp-scroll {
    opacity: 1;
}
#projectsSection .exp-scroll-thumb {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    background: transparent;
    pointer-events: auto;
    cursor: none !important;
    touch-action: none;
}
#projectsSection .exp-scroll-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 4px;
    width: 4px;
    background: rgba(10,10,10,0.35); /* тёмный, видно на светлом фоне */
    border-radius: 2px;
    transition: background-color 0.2s ease, right 0.2s ease, width 0.2s ease;
}
#projectsSection .exp-scroll-thumb:hover::before,
#projectsSection .exp-scroll.dragging .exp-scroll-thumb::before {
    background: rgba(10,10,10,0.75);
    right: 3px;
    width: 5px;
}
#projectsSection.projects-expanded .expanded-overlay {
    opacity: 1; transform: translateY(0); pointer-events: auto;
}
#projectsSection .expanded-overlay .project {
    flex: none; display: block; margin: 0; padding: 0;
    border: none; cursor: default; max-width: 82ch;
}
#projectsSection .expanded-overlay .project:hover { padding: 0; }
#projectsSection .expanded-overlay .project-header {
    font-size: min(2.5vw, 34px);
    font-weight: 300;
    line-height: 1.15;
    margin: 0 0 1.2em 0;
    pointer-events: auto;
    cursor: pointer;
}
#projectsSection .expanded-overlay .project-caret { display: none; }
#projectsSection .expanded-overlay .project-body {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
    font-size: 1.05em;
    line-height: 1.7;
}
#projectsSection .expanded-overlay .project-inner { padding-top: 0; }
#projectsSection .expanded-overlay .project-inner > p { margin-bottom: 1.1em; }
#projectsSection .expanded-overlay .faq-block { margin-top: 2.2em; }

#projectsSection .expanded-close {
    position: fixed;
    top: 2vh; right: 2vh;
    z-index: 60;
    padding: 11px 18px;
    background: none;
    border: 1px solid currentColor;
    color: #ffffff;
    mix-blend-mode: difference;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease 0.25s, background 0.2s;
}
#projectsSection.projects-expanded .expanded-close {
    opacity: 1; pointer-events: auto;
}
#projectsSection.projects-expanded .expanded-close:hover { background: #808080; }

/* ═══════════════════════════════════════════════════════════════════
   04 · STORY
   ═══════════════════════════════════════════════════════════════════ */

#storySection .text-overlay {
    top: 0.6em;
    bottom: 0.6em;
    left: 58vw;
    right: 2vh;
    justify-content: flex-start;
    gap: 1.7em;
    font-size: min(1.55vw, 2.5vh, 21px);
    line-height: 1.5;
}

#storySection .block { max-width: 60ch; }

#storySection .story-title {
    display: block;
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.05;
    text-transform: lowercase;
    margin-bottom: 0.5em;
    opacity: 0.92;
}

#storySection .big {
    display: block;
    font-size: 1.7em;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 0.35em;
    text-transform: lowercase;
}

#storySection .line {
    display: block;
    margin-bottom: 0.15em;
    font-weight: 400;
}
#storySection .line:last-child { margin-bottom: 0; }
#storySection .final {
    font-size: 1em;
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   05 · CONTACT
   ═══════════════════════════════════════════════════════════════════ */

#contactSection canvas { pointer-events: none; }

/* corner-label в 05 был БЕЗ mix-blend (у него чёрный фон всё время) */
#contactSection .corner-label {
    mix-blend-mode: normal;
    color: #ffffff;
}

#endSection .corner-label {
    mix-blend-mode: normal;
    color: #0a0a0a;
}

#contactSection .contact-title {
    position: fixed;
    bottom: 3.5vh;
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    z-index: 10;
    pointer-events: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: min(2.4vw, 34px);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: lowercase;
    text-align: center;
    white-space: nowrap;
    opacity: 0;

    color: var(--title-ink, #ffffff);
    text-shadow:
        1px 0 0 var(--title-chromaA, rgba(0,0,0,0)),
        -1px 0 0 var(--title-chromaB, rgba(0,0,0,0)),
        0 0 24px var(--title-glow, rgba(255, 255, 255, 0.25)),
        0 0 8px rgba(255, 255, 255, 0.3);

    transition:
        opacity 0.9s ease,
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.55s ease-out,
        text-shadow 0.55s ease-out;
}
#contactSection .contact-title.show {
    opacity: 0.95;
    transform: translateX(-50%) translateY(0);
}

#contactSection .scene {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(80px, 12vw, 200px);
    padding: 0 4vw;
    padding-bottom: 12vh;
    pointer-events: none;
}

#contactSection .sphere {
    position: relative;
    width: clamp(340px, 30vw, 480px);
    height: clamp(340px, 30vw, 480px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    isolation: isolate;
    pointer-events: none;
    transform: translate3d(var(--push, 0px), 0, 0);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
#contactSection .sphere.active { pointer-events: auto; }

#contactSection .sphere .text-block {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    pointer-events: none;
    padding: 20px;

    opacity: var(--labels-a, 0);
    transform: translateY(calc((1 - var(--labels-a, 0)) * 22px));
    will-change: opacity, transform;
}

#contactSection .sphere .text-block::before {
    content: '';
    position: absolute;
    inset: -80% -40%;
    background: radial-gradient(
        ellipse at center,
        rgba(0,0,0,0.82) 0%,
        rgba(0,0,0,0.55) 35%,
        rgba(0,0,0,0.2) 60%,
        transparent 80%
    );
    z-index: -1;
    pointer-events: none;
}

#contactSection .sphere .icon {
    width: clamp(46px, 4.5vw, 62px);
    height: clamp(46px, 4.5vw, 62px);
    color: var(--accentA);
    filter:
        drop-shadow(0 0 14px var(--accentA))
        drop-shadow(0 0 4px rgba(255,255,255,0.6));
    transition: filter 0.4s ease, transform 0.4s ease;
}
#contactSection .sphere:hover .icon {
    filter:
        drop-shadow(0 0 26px var(--accentA))
        drop-shadow(0 0 8px #fff);
    transform: scale(1.06);
}
#contactSection .sphere .icon svg {
    width: 100%; height: 100%;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#contactSection .sphere .label {
    font-size: min(0.95vw, 13px);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-weight: 500;
    color: #ffffff;
    text-shadow:
        0.6px 0 0 var(--chromaA, rgba(255,255,255,0.4)),
        -0.6px 0 0 var(--chromaB, rgba(255,255,255,0.3)),
        0 0 12px var(--accentA),
        0 0 3px rgba(255, 255, 255, 0.5);
    animation: holoFlicker 5s ease-in-out infinite;
    animation-delay: -1.2s;
}

#contactSection .sphere .value {
    font-size: min(1.4vw, 19px);
    font-weight: 500;
    letter-spacing: 0.02em;
    word-break: break-all;
    color: #ffffff;
    text-shadow:
        0.8px 0 0 var(--chromaA, rgba(255,255,255,0.4)),
        -0.8px 0 0 var(--chromaB, rgba(255,255,255,0.3)),
        0 0 16px var(--accentA),
        0 0 4px rgba(255, 255, 255, 0.5);
    animation: holoFlicker 5s ease-in-out infinite;
}

#contactSection .sphere:hover .value,
#contactSection .sphere:hover .label {
    text-shadow:
        1.4px 0 0 var(--chromaA, rgba(255,255,255,0.6)),
        -1.4px 0 0 var(--chromaB, rgba(255,255,255,0.5)),
        0 0 32px var(--accentA),
        0 0 8px rgba(255, 255, 255, 0.75);
}

#contactSection .sphere.telegram {
    --accentA: #4fd2ff;
    --chromaA: rgba(0, 255, 240, 0.65);
    --chromaB: rgba(255, 0, 160, 0.55);
}
#contactSection .sphere.mail {
    --accentA: #ffb246;
    --chromaA: rgba(255, 200, 60, 0.65);
    --chromaB: rgba(255, 90, 120, 0.55);
}

/* ═══════════════════════════════════════════════════════════════════
   06 · END
   ═══════════════════════════════════════════════════════════════════ */

#endSection canvas { cursor: default; }

.end-text-viewport {
    position: absolute;
    top: 6vh; bottom: 6vh;
    left: 42vw; right: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}
.end-text-scroll {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    will-change: transform;
    color: #0a0a0a;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
}
.end-text-scroll > div { white-space: pre; }

#endSection .corner-label {
    transform: translate3d(var(--shift, 0px), 0, 0);
    will-change: transform;
}

/* ═══════════════════════════════════════════════════════════════════
   ФИНАЛЬНЫЕ ПРАВКИ / OVERRIDES
   ═══════════════════════════════════════════════════════════════════ */

/* body height теперь управляется JS через BASE_VH.
   Убираем дефолтные 500vh — ставим минимум, чтобы браузер не резервировал. */

/* .corner-label общий стиль — используется во всех секциях */
.w4-section .corner-label {
    position: absolute;
    top: 2vh;
    left: clamp(64px, 9.8vh, 90px);
    z-index: 20;
    pointer-events: none;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: clamp(13px, 1.05vw, 15px);
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: #ffffff;
    mix-blend-mode: difference;
    opacity: 0.6;
    display: flex;
    gap: 1em;
    align-items: baseline;
    line-height: 1;
}
.w4-section .corner-label .num { opacity: 0.75; }
.w4-section .corner-label .name { letter-spacing: 0.4em; }

/* .text-overlay общий стиль */
.w4-section .text-overlay {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    mix-blend-mode: difference;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: min(1.5vw, 2.5vh, 21px);
    font-weight: 400;
    letter-spacing: 0.005em;
}

/* .block общий */
.w4-section .block {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.w4-section .block.show { opacity: 1; transform: translateY(0); }

/* #collapseDot теперь в HTML (был создан в JS). Оставляем стиль. */
#collapseDot {
    position: fixed; left: 50%; top: 50%;
    width: 6px; height: 6px;
    background: #000; border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2147483625; pointer-events: none; opacity: 0;
}
/* ═══════════════════════════════════════════════════════════════════
   W4 LOGO SYSTEM
   ═══════════════════════════════════════════════════════════════════ */

/* Глобальное лого в углу */
.global-logo {
    position: fixed;
    top: 0.5vh;
    left: clamp(8px, 1vh, 16px);
    z-index: 2147483630;
    pointer-events: none;
    mix-blend-mode: difference;
    opacity: 1;
    transition: opacity 0.4s ease,
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    height: clamp(26px, 2.4vh, 36px);
    width: 42px;
}
.global-logo.hidden { opacity: 0; pointer-events: none; }

.global-logo.fly-away {
    transform: translateX(-160px);
    pointer-events: none;
    opacity: 0;
}
.global-logo.fly-away .w4-logo-btn {
    pointer-events: none;
}

.w4-logo-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: none;
    border: none;
    color: #ffffff;
    transition: transform 0.25s ease, filter 0.25s ease;
    pointer-events: auto;
    outline: none;
}

.w4-logo-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}
.w4-logo-btn svg { width: 100%; height: auto; display: block; }
.w4-logo-btn:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 12px currentColor);
}

/* Сдвигаем corner-label правее, чтобы не пересекалось с лого */
.w4-section .corner-label { left: 5.5vh; }

/* Overlay перехода по клику на лого */
#logoOverlay {
    position: fixed;
    inset: 0;
    z-index: 2147483642;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}
#logoOverlay.active {
    display: flex;
    animation: logoOverlayIn 0.5s ease-out forwards;
    pointer-events: auto;
}
#logoOverlay.fading {
    animation: logoOverlayOut 0.45s ease-in forwards;
    pointer-events: none;
}
@keyframes logoOverlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes logoOverlayOut { from { opacity: 1; } to { opacity: 0; } }

#logoOverlayLogo {
    width: 78vmin;
    max-width: 900px;
    height: auto;
    opacity: 0;
    transform: scale(0.92);
}
#logoOverlay.active #logoOverlayLogo {
    animation: logoMarkIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}
#logoOverlay.fading #logoOverlayLogo {
    animation: logoMarkOut 0.45s ease-in forwards;
}
@keyframes logoMarkIn  {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes logoMarkOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(1.06); }
}
#logoOverlayLogo svg { width: 100%; height: auto; display: block; }

/* Breach — новое оформление: белое лого сверху + мелкая белая ошибка снизу */
.breach-overlay {
    flex-direction: column;
    gap: 5vh;
    justify-content: center;
    align-items: center;
}
.breach-logo {
    width: 68vmin;
    max-width: 700px;
    height: auto;
}
.breach-logo svg {
    width: 100%; height: auto; display: block;
    filter: drop-shadow(0 0 22px rgba(255,255,255,0.7))
            drop-shadow(0 0 44px rgba(255,255,255,0.4));
    animation: breachLogoIn 0.55s ease-out;
}
@keyframes breachLogoIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.breach-text {
    font-size: clamp(0.7rem, 1.5vw, 1.25rem);
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    letter-spacing: 0.14em;
    animation: breachTextIn 0.5s ease-out 0.15s backwards;
}
@keyframes breachTextIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.w4-section .corner-label {
    top: 2vh !important;
    left: 60px !important;
    right: auto !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}
/* ═══════════════════════════════════════════════════════════════════
   W4 · QUALITY SELECTOR
   ═══════════════════════════════════════════════════════════════════ */
.w4-quality {
    position: fixed;
    top: 2vh;
    right: clamp(16px, 2.4vh, 28px);
    z-index: 2147483644;
    display: flex;
    align-items: baseline;
    gap: 1.15em;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: clamp(11px, 1.05vw, 14px);
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.35);
    padding: 6px 12px;
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}
.w4-quality.visible {
    opacity: 0.9;
    pointer-events: auto;
}
.w4-quality-label {
    opacity: 0.42;
    letter-spacing: 0.34em;
    pointer-events: none;
    user-select: none;
}
.w4-quality-btn {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    background: none;
    border: none;
    color: #ffffff;
    padding: 0.25em 0;
    opacity: 0.42;
    position: relative;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}
.w4-quality-btn:hover { opacity: 0.85; }
.w4-quality-btn.active { opacity: 1; }
.w4-quality-btn.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: currentColor;
    opacity: 0.65;
}

/* ═══ выбор качества на стартовом экране ═══ */
.w4-start-quality {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.2vh, 12px);
    margin-bottom: clamp(0px, 0.5vh, 6px);
    width: 100%;
}
.w4-start-quality-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(9px, 1.3vh, 12px);
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    line-height: 1;
}
.w4-start-quality-row {
    display: flex;
    gap: clamp(6px, 1vw, 12px);
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
    max-width: 560px;
}
.w4-start-quality-btn {
    font-family: 'JetBrains Mono', monospace;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.7);
    padding: clamp(6px, 1.1vh, 12px) clamp(10px, 1.4vw, 18px);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: clamp(1px, 0.3vh, 3px);
    text-align: left;
    transition: all 0.2s ease;
    flex: 1 1 0;
    min-width: 0;
    max-width: 50%;
    pointer-events: auto;
    line-height: 1.15;
}
.w4-start-quality-btn:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}
.w4-start-quality-btn.active {
    border-color: #fff;
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.w4-start-quality-btn .q-title {
    font-size: clamp(11px, 1.4vh, 15px);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.w4-start-quality-btn .q-sub {
    font-size: clamp(9px, 1vh, 11px);
    font-weight: 400;
    letter-spacing: 0.04em;
    opacity: 0.6;
    text-transform: lowercase;
    line-height: 1.2;
}

/* На низком качестве слово wat4me некликабельно */
body.w4-tier-low #logo .ch {
    pointer-events: none !important;
    cursor: default !important;
}

/* На низком качестве блоки текста появляются мгновенно, без анимаций */
body.w4-tier-low .w4-section .block {
    transition: none !important;
}
body.w4-tier-low .w4-section .block.show {
    transform: none !important;
}

/* На низком качестве breach (лого + ERR_0x0F4D) показывается ровно, без мигания */
body.w4-tier-low .breach-text {
    animation: none !important;
    opacity: 1 !important;
}
