@layer reset, base, shell, components, views, effects, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { color-scheme: dark; }
  body, h1, h2, h3, p, dl, dd, ul { margin: 0; }
  button, input, textarea { font: inherit; }
  button { color: inherit; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    --ink: #f5f3ff;
    --muted: #a5a5bd;
    --quiet: #72748f;
    --night: #060712;
    --night-2: #0a0b19;
    --panel: rgba(17, 18, 38, 0.78);
    --panel-strong: rgba(23, 23, 48, 0.94);
    --line: rgba(255, 255, 255, 0.085);
    --line-bright: rgba(255, 255, 255, 0.15);
    --violet: #9d87ff;
    --violet-bright: #c2b5ff;
    --cyan: #69e6ff;
    --rose: #ff7cba;
    --gold: #ffd76f;
    --mint: #7cf7ca;
    --danger: #ff6f86;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 13px;
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  }

  html { min-width: 320px; background: var(--night); }

  body {
    min-height: 100vh;
    overflow: hidden;
    color: var(--ink);
    background:
      radial-gradient(circle at 48% 120%, rgba(93, 74, 213, 0.24), transparent 44%),
      linear-gradient(145deg, #04050c 0%, #080916 48%, #050611 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    letter-spacing: -0.012em;
  }

  button, a, input, textarea { -webkit-tap-highlight-color: transparent; }

  button {
    border: 0;
    cursor: pointer;
  }

  button:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
  }

  ::selection { color: #080916; background: var(--cyan); }

  .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .skip-link {
    position: fixed;
    z-index: 9999;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    color: #0a0b18;
    background: var(--cyan);
    border-radius: 10px;
    font-weight: 800;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
  }

  .skip-link:focus { transform: translateY(0); }
}

@layer shell {
  .cosmos,
  .cable-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  .cosmos { z-index: 0; opacity: 0.78; }
  .cable-canvas { z-index: 120; }

  .aurora {
    position: fixed;
    z-index: 0;
    width: 46vw;
    height: 46vw;
    min-width: 520px;
    min-height: 520px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: aurora-drift 16s ease-in-out infinite alternate;
  }

  .aurora-one { top: -28%; right: 4%; background: var(--violet); }
  .aurora-two { bottom: -34%; left: 5%; background: var(--cyan); animation-delay: -7s; }

  .app-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr);
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    margin: 12px;
    overflow: hidden;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 25%),
      rgba(8, 9, 22, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 20px;
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(26px) saturate(120%);
    isolation: isolate;
    transition: filter 0.5s ease, transform 0.7s var(--ease-spring);
  }

  .app-shell::after {
    content: "";
    position: absolute;
    z-index: 100;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 28%, rgba(255,255,255,.032) 48%, transparent 68%);
    transform: translateX(-100%);
    animation: glass-sheen 12s ease-in-out infinite;
  }

  .topbar {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: auto auto minmax(180px, 1fr) auto minmax(160px, 1fr);
    align-items: center;
    gap: 15px;
    padding: 0 15px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 12, 28, 0.72);
    box-shadow: 0 1px rgba(0,0,0,.3);
    backdrop-filter: blur(20px);
  }

  .window-controls { display: flex; gap: 7px; padding-right: 1px; }

  .window-dot {
    position: relative;
    width: 11px;
    height: 11px;
    padding: 0;
    border-radius: 50%;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,.25), 0 0 0 0 rgba(255,255,255,0);
    transition: transform .25s var(--ease-spring), box-shadow .25s ease;
  }

  .window-dot:hover { transform: scale(1.35); box-shadow: 0 0 12px currentColor; }
  .dot-close { color: #ff6c7b; background: currentColor; }
  .dot-minimize { color: #ffc95b; background: currentColor; }
  .dot-maximize { color: #62e8a8; background: currentColor; }

  .back-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    color: var(--muted);
    background: transparent;
    border-radius: 9px;
    font-weight: 650;
    transition: color .2s ease, background .2s ease, transform .2s var(--ease-spring);
  }

  .back-button:hover { color: var(--ink); background: rgba(255,255,255,.055); transform: translateX(-2px); }
  .back-button span:first-child { font-size: 18px; line-height: 1; }

  .brand-lockup { display: flex; align-items: center; gap: 9px; min-width: 0; }

  .brand-orb {
    position: relative;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    background: conic-gradient(from 210deg, var(--violet), var(--cyan), var(--rose), var(--violet));
    box-shadow: 0 0 24px rgba(157, 135, 255, .4), inset 0 0 10px rgba(255,255,255,.4);
    animation: orb-breathe 3.8s ease-in-out infinite;
  }

  .brand-orb::before,
  .brand-orb::after,
  .brand-orb i {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: 999px;
  }

  .brand-orb::before { width: 12px; height: 2px; transform: rotate(45deg); }
  .brand-orb::after { width: 12px; height: 2px; transform: rotate(-45deg); }
  .brand-orb i { width: 2px; height: 16px; opacity: .8; }

  .brand-name { font-size: 13px; font-weight: 900; letter-spacing: .16em; }

  .unstable-badge {
    padding: 4px 7px;
    color: #cfcbff;
    background: rgba(157, 135, 255, .12);
    border: 1px solid rgba(157, 135, 255, .18);
    border-radius: 99px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 9px;
    letter-spacing: .04em;
    white-space: nowrap;
  }

  .quantum-area { position: relative; justify-self: center; }

  .model-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 190px;
    padding: 3px;
    overflow: hidden;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: inset 0 1px 5px rgba(0,0,0,.25);
  }

  .model-choice {
    position: relative;
    z-index: 2;
    height: 30px;
    padding: 0 12px;
    color: #8f91aa;
    background: transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 760;
    transition: transform .13s var(--ease-spring), color .18s ease;
  }

  .model-choice.is-selected { color: white; }
  .model-choice:first-child { grid-column: 1; grid-row: 1; }
  .model-choice:nth-child(2) { grid-column: 2; grid-row: 1; }
  .model-switch.is-swapped .model-choice:first-child { transform: translateX(calc(100% + 4px)); }
  .model-switch.is-swapped .model-choice:nth-child(2) { transform: translateX(calc(-100% - 4px)); }

  .switch-glow {
    position: absolute;
    z-index: 1;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(157,135,255,.36), rgba(105,230,255,.16));
    border: 1px solid rgba(194,181,255,.28);
    box-shadow: 0 0 18px rgba(157,135,255,.16), inset 0 1px rgba(255,255,255,.12);
    transition: transform .13s var(--ease-spring);
  }

  .model-switch.is-swapped .switch-glow { transform: translateX(calc(100% + 1px)); }

  .quantum-caption {
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    z-index: 40;
    width: max-content;
    max-width: 220px;
    padding: 5px 8px;
    color: var(--violet-bright);
    background: rgba(9,10,24,.92);
    border: 1px solid rgba(157,135,255,.18);
    border-radius: 7px;
    font-family: ui-monospace, monospace;
    font-size: 9px;
    opacity: 0;
    transform: translate(-50%, -4px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  .quantum-area:hover .quantum-caption,
  .quantum-caption.is-visible { opacity: 1; transform: translate(-50%, 0); }

  .top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

  .icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--muted);
    background: rgba(255,255,255,.035);
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .notice-button > span:first-child { transition: transform .35s var(--ease-spring); }
  .notice-button:hover > span:first-child { transform: rotate(36deg) scale(1.2); color: var(--gold); }
  .notice-button.is-sneezing > span:first-child { animation: sneeze .5s var(--ease-spring); }

  .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    color: #0a0b19;
    background: var(--rose);
    border: 2px solid #0b0c1b;
    border-radius: 50%;
    font-size: 8px;
    font-weight: 900;
  }

  .notification-badge.is-sneezing { animation: badge-sneeze .55s var(--ease-spring) forwards; }

  .update-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 13px;
    color: #ded9ff;
    background: linear-gradient(135deg, rgba(157,135,255,.18), rgba(105,230,255,.08));
    border: 1px solid rgba(157,135,255,.24);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 760;
    white-space: nowrap;
    box-shadow: inset 0 1px rgba(255,255,255,.08);
    transition: transform .2s var(--ease-spring), box-shadow .2s ease, border-color .2s ease;
  }

  .update-button:hover { transform: translateY(-1px); border-color: rgba(105,230,255,.38); box-shadow: 0 8px 24px rgba(105,230,255,.08), inset 0 1px rgba(255,255,255,.12); }
  .update-button:hover .update-spark { animation: spin .7s var(--ease-spring); }

  .workspace-shell { display: grid; grid-template-columns: 282px minmax(0, 1fr); min-height: 0; }

  .sidebar {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 14px 12px 10px;
    overflow: visible;
    background: linear-gradient(180deg, rgba(13,14,31,.82), rgba(9,10,23,.66));
    border-right: 1px solid var(--line);
  }

  .main-stage {
    position: relative;
    z-index: 10;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(157,135,255,.3) transparent;
    background:
      radial-gradient(circle at 50% 0%, rgba(113, 91, 245, .08), transparent 37%),
      linear-gradient(180deg, rgba(12,13,30,.38), rgba(7,8,19,.5));
  }

  .main-stage::-webkit-scrollbar { width: 7px; }
  .main-stage::-webkit-scrollbar-thumb { background: rgba(157,135,255,.28); border-radius: 99px; }

  .view { position: relative; min-height: calc(100% - 45px); padding: clamp(30px, 5vh, 58px) clamp(26px, 5vw, 72px) 42px; animation: view-arrive .48s var(--ease-spring) both; }
  .view.is-active { display: block; }

  .parody-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 45px;
    padding: 10px 24px;
    color: var(--quiet);
    border-top: 1px solid var(--line);
    font-family: ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: .03em;
  }

  .parody-footer span { display: inline-flex; align-items: center; gap: 8px; }
  .parody-footer i { width: 5px; height: 5px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 9px var(--mint); }
  .parody-footer button { padding: 5px 8px; color: var(--quiet); background: transparent; border-radius: 7px; font: inherit; }
  .parody-footer button:hover { color: var(--violet-bright); background: rgba(157,135,255,.07); }

  .mobile-nav { display: none; }
}

@layer components {
  .hatch-button {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px;
    color: #eeebff;
    background: linear-gradient(135deg, rgba(157,135,255,.2), rgba(105,230,255,.075));
    border: 1px solid rgba(157,135,255,.24);
    border-radius: 11px;
    text-align: left;
    font-size: 12px;
    font-weight: 750;
    box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.13);
    overflow: hidden;
    transition: transform .22s var(--ease-spring), border-color .2s ease;
  }

  .hatch-button::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(95deg, transparent 15%, rgba(255,255,255,.15), transparent 50%);
    transform: translateX(-110%);
    transition: transform .6s ease;
  }

  .hatch-button:hover { transform: translateY(-1px); border-color: rgba(105,230,255,.38); }
  .hatch-button:hover::after { transform: translateX(110%); }
  .hatch-button.is-hatching .egg-icon { animation: egg-crack .55s var(--ease-spring); }
  .egg-icon { position: relative; z-index: 1; color: var(--cyan); font-size: 18px; }
  .hatch-button > span:not(.egg-icon) { position: relative; z-index: 1; }
  .key-hint { color: var(--quiet); font-family: ui-monospace, monospace; font-size: 9px; font-weight: 500; }

  .search-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin: 10px 0 13px;
    padding: 0 10px;
    color: var(--quiet);
    background: rgba(255,255,255,.026);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
  }

  .search-field:focus-within { border-color: rgba(105,230,255,.3); background: rgba(105,230,255,.035); box-shadow: 0 0 22px rgba(105,230,255,.05); }
  .search-icon { font-size: 17px; transform: rotate(-18deg); }
  .search-field:focus-within .search-icon { color: var(--cyan); animation: search-oracle 1.5s ease-in-out infinite; }
  .search-field input { width: 100%; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 11px; }
  .search-field input::placeholder { color: #666981; }
  .moth-counter { position: absolute; right: 7px; color: var(--gold); font-size: 11px; letter-spacing: 2px; }

  .thread-section { min-height: 0; }
  .section-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 7px; }
  .section-heading h2 { color: #85879d; font-family: ui-monospace, monospace; font-size: 9px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }
  .tiny-button { padding: 2px 5px; color: #6f7188; background: transparent; border-radius: 5px; font-size: 11px; letter-spacing: 1px; }
  .tiny-button:hover { color: var(--gold); background: rgba(255,215,111,.07); }

  .thread-list { display: grid; gap: 4px; }

  .thread-slot {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px;
    align-items: center;
    min-height: 48px;
    border-radius: 11px;
    transition: background .2s ease, box-shadow .2s ease;
  }

  .thread-slot:hover { background: rgba(255,255,255,.038); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }

  .thread-main {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 48px;
    padding: 5px 2px 5px 7px;
    color: var(--muted);
    background: transparent;
    border-radius: 10px;
    text-align: left;
  }

  .thread-glyph {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: inset 0 1px rgba(255,255,255,.08);
  }

  .glyph-cyan { color: var(--cyan); background: rgba(105,230,255,.09); }
  .glyph-rose { color: var(--rose); background: rgba(255,124,186,.09); }
  .glyph-gold { color: var(--gold); background: rgba(255,215,111,.09); }
  .glyph-violet { color: var(--violet-bright); background: rgba(157,135,255,.1); }

  .thread-copy { display: block; min-width: 0; }
  .thread-copy strong,
  .thread-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .thread-copy strong { color: #c8c7d7; font-size: 10px; font-weight: 700; }
  .thread-copy small { margin-top: 3px; color: #666980; font-size: 8.5px; }
  .thread-main:hover .thread-copy strong { color: var(--ink); }

  .runaway-dog {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 56px;
    height: 27px;
    padding: 2px 5px;
    color: var(--cyan);
    background: rgba(105,230,255,.065);
    border: 1px solid rgba(105,230,255,.13);
    border-radius: 99px;
    font-family: ui-monospace, monospace;
    font-size: 8px;
    transition: left .54s var(--ease-spring), top .54s var(--ease-spring), transform .28s var(--ease-spring), width .28s var(--ease-spring), background .2s ease, box-shadow .2s ease;
    will-change: left, top, transform;
  }

  .runaway-dog:hover { background: rgba(105,230,255,.12); box-shadow: 0 0 18px rgba(105,230,255,.09); }
  .runaway-dog.is-startled { transform: scale(.92) rotate(-4deg); }
  .runaway-dog.is-running { position: fixed; width: 80px; height: 31px; z-index: 500; background: rgba(10,13,28,.93); box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 0 24px rgba(105,230,255,.16); }
  .runaway-dog.is-running .dog-sprite { animation: dog-bounce .19s steps(2) infinite; }
  .runaway-dog.is-running .dog-tail { animation-duration: .11s; }
  .runaway-dog.is-tired .dog-sprite { animation: dog-pant .55s ease-in-out infinite; }
  .runaway-dog.is-caught { color: var(--gold); background: rgba(255,215,111,.12); border-color: rgba(255,215,111,.24); animation: caught-wiggle .55s var(--ease-spring); }
  .dog-label { min-width: 22px; }

  .dog-sprite { position: relative; display: inline-block; width: 26px; height: 18px; flex: 0 0 auto; transform-origin: center; }
  .dog-sprite i { position: absolute; display: block; background: currentColor; }
  .dog-body { left: 7px; top: 7px; width: 13px; height: 8px; border-radius: 5px 6px 5px 4px; }
  .dog-head { left: 17px; top: 3px; width: 8px; height: 9px; border-radius: 5px 6px 4px 5px; }
  .dog-ear { left: 18px; top: 1px; width: 4px; height: 5px; border-radius: 4px 1px 3px 1px; transform: rotate(-23deg); opacity: .78; }
  .dog-eye { left: 23px; top: 5px; width: 1.5px; height: 1.5px; background: #070814 !important; border-radius: 50%; }
  .dog-tail { left: 3px; top: 4px; width: 7px; height: 3px; border-radius: 99px; transform: rotate(-42deg); transform-origin: right; animation: tail-wag .22s ease-in-out infinite alternate; }
  .dog-leg { top: 13px; width: 2.5px; height: 5px; border-radius: 0 0 2px 2px; }
  .leg-one { left: 10px; }
  .leg-two { left: 18px; animation-delay: -.1s; }
  .dog-rose { color: var(--rose); }
  .dog-gold { color: var(--gold); }
  .dog-violet { color: var(--violet-bright); }

  .empty-search { padding: 8px 10px; color: var(--gold); background: rgba(255,215,111,.05); border-radius: 9px; font-size: 9px; line-height: 1.5; }

  .primary-nav { display: grid; gap: 3px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
  .nav-item { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; min-height: 34px; padding: 0 8px; color: #85879e; background: transparent; border-radius: 9px; text-align: left; font-size: 11px; font-weight: 650; transition: color .2s ease, background .2s ease, transform .2s var(--ease-spring); }
  .nav-item > span:first-child { font-size: 15px; text-align: center; }
  .nav-item small { color: #5e6076; font-family: ui-monospace, monospace; font-size: 7.5px; }
  .nav-item:hover { color: #deddea; background: rgba(255,255,255,.04); transform: translateX(2px); }
  .nav-item.is-active { color: white; background: linear-gradient(90deg, rgba(157,135,255,.13), rgba(157,135,255,.035)); box-shadow: inset 2px 0 var(--violet); }
  .nav-item.is-active > span:first-child { color: var(--violet-bright); text-shadow: 0 0 12px rgba(157,135,255,.5); }

  .sidebar-bottom { display: grid; gap: 1px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
  .utility-button { display: flex; align-items: center; gap: 9px; min-height: 28px; padding: 0 9px; color: #74768d; background: transparent; border-radius: 8px; text-align: left; font-size: 9.5px; }
  .utility-button span { width: 17px; color: #8587a1; text-align: center; }
  .utility-button:hover { color: #d5d4e2; background: rgba(255,255,255,.035); }

  .kicker { display: block; color: var(--violet-bright); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; font-weight: 720; letter-spacing: .13em; }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 9px;
    color: #b5b3ca;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-radius: 99px;
    font-family: ui-monospace, monospace;
    font-size: 8.5px;
    letter-spacing: .03em;
  }

  .live-dot { width: 6px; height: 6px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 9px var(--mint); animation: live-pulse 2s ease-in-out infinite; }

  .view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; max-width: 1160px; margin: 0 auto 30px; }
  .view-header h1 { margin: 8px 0 7px; font-size: clamp(34px, 4vw, 54px); line-height: .98; letter-spacing: -.055em; }
  .view-header p { max-width: 610px; color: var(--muted); font-size: 13px; line-height: 1.65; }

  .soft-button,
  .glow-button {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
  }

  .soft-button { color: #aaa9bd; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
  .soft-button:hover { color: var(--ink); background: rgba(255,255,255,.075); }
  .glow-button { color: #f2efff; background: linear-gradient(135deg, rgba(157,135,255,.28), rgba(105,230,255,.12)); border: 1px solid rgba(157,135,255,.28); box-shadow: 0 8px 28px rgba(157,135,255,.09); }
  .glow-button:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(157,135,255,.16); }

  .section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; grid-column: 1 / -1; margin-bottom: 3px; }
  .section-title-row h2 { margin-top: 5px; font-size: 17px; letter-spacing: -.025em; }
  .section-title-row.compact { align-items: center; margin-bottom: 16px; }
  .section-title-row.compact h2 { font-size: 15px; }
}

@layer views {
  .hero-copy { position: relative; z-index: 2; max-width: 800px; margin: 0 auto; text-align: center; }
  .hero-copy h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: .96; letter-spacing: -.065em; text-wrap: balance; }
  .hero-copy h1 span { color: transparent; background: linear-gradient(90deg, #f8f6ff 2%, var(--violet-bright) 44%, var(--cyan)); -webkit-background-clip: text; background-clip: text; }
  .hero-copy p { max-width: 590px; margin: 17px auto 0; color: #a7a6ba; font-size: 13px; line-height: 1.65; }

  .hero-orbit { position: absolute; top: 31px; left: 50%; width: min(700px, 75%); height: 220px; border: 1px solid rgba(157,135,255,.07); border-radius: 50%; transform: translateX(-50%) rotate(-7deg); pointer-events: none; }
  .hero-orbit::before { content: ""; position: absolute; inset: 36px 100px; border: 1px solid rgba(105,230,255,.055); border-radius: 50%; }
  .hero-moon { position: absolute; top: 21px; right: 15%; width: 9px; height: 9px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 18px var(--gold); animation: moon-orbit 9s ease-in-out infinite alternate; }
  .orbit-dot { position: absolute; width: 4px; height: 4px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 10px var(--cyan); }
  .orbit-dot.dot-a { left: 13%; bottom: 41px; }
  .orbit-dot.dot-b { right: 32%; bottom: 13px; background: var(--rose); box-shadow: 0 0 10px var(--rose); }

  .spell-composer {
    position: relative;
    z-index: 3;
    max-width: 760px;
    margin: 30px auto 0;
    padding: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(25,26,52,.92), rgba(15,16,34,.91));
    border: 1px solid rgba(157,135,255,.2);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0,0,0,.25), 0 0 42px rgba(157,135,255,.055), inset 0 1px rgba(255,255,255,.07);
    transition: border-color .25s ease, box-shadow .25s ease, transform .3s var(--ease-spring);
  }

  .spell-composer:focus-within { border-color: rgba(105,230,255,.32); box-shadow: 0 26px 70px rgba(0,0,0,.3), 0 0 48px rgba(105,230,255,.075), inset 0 1px rgba(255,255,255,.08); transform: translateY(-2px); }
  .composer-aura { position: absolute; inset: -100% 30%; background: rgba(157,135,255,.16); filter: blur(45px); transform: rotate(20deg); pointer-events: none; }
  .spell-composer textarea { position: relative; z-index: 1; display: block; width: 100%; min-height: 62px; resize: none; padding: 6px 7px; color: #eeedf8; background: transparent; border: 0; outline: 0; font-size: 13px; line-height: 1.5; }
  .spell-composer textarea::placeholder { color: #777991; }
  .composer-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.055); }
  .composer-tools { display: flex; align-items: center; gap: 5px; }
  .composer-tool { display: grid; place-items: center; width: 28px; height: 28px; color: #85879e; background: transparent; border-radius: 8px; font-size: 17px; }
  .composer-tool:hover { color: var(--cyan); background: rgba(105,230,255,.06); transform: rotate(-7deg); }
  .mode-chip { margin-left: 5px; padding: 5px 7px; color: #777991; background: rgba(255,255,255,.03); border-radius: 7px; font: 8px ui-monospace, monospace; }
  .cast-button { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 11px; color: #090a18; background: linear-gradient(135deg, #d5ccff, var(--cyan)); border-radius: 10px; font-size: 10px; font-weight: 850; box-shadow: 0 7px 18px rgba(105,230,255,.12); }
  .cast-button i { font-style: normal; transition: transform .25s var(--ease-spring); }
  .cast-button:hover i { transform: translate(3px, -3px) rotate(-20deg); }
  .cast-button.is-casting { animation: cast-comet .7s var(--ease-spring); }

  .spell-reply { max-width: 700px; margin: 12px auto 0; padding: 11px 14px; color: #b9b7cc; background: rgba(105,230,255,.04); border: 1px solid rgba(105,230,255,.12); border-radius: 12px; font-size: 11px; line-height: 1.55; animation: reply-arrive .5s var(--ease-spring); }
  .spell-reply strong { color: var(--cyan); }

  .mischief-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; max-width: 1000px; margin: clamp(34px, 6vh, 62px) auto 0; }
  .magic-card { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 92px; padding: 13px; color: var(--ink); background: linear-gradient(145deg, rgba(22,23,45,.7), rgba(14,15,31,.72)); border: 1px solid var(--line); border-radius: 15px; text-align: left; box-shadow: inset 0 1px rgba(255,255,255,.035); overflow: hidden; transition: transform .28s var(--ease-spring), border-color .2s ease, background .2s ease; }
  .magic-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 0%, rgba(255,255,255,.065), transparent 36%); opacity: 0; transition: opacity .2s ease; }
  .magic-card:hover { transform: translateY(-4px) rotateX(2deg); border-color: var(--line-bright); background: rgba(27,28,53,.78); }
  .magic-card:hover::after { opacity: 1; }
  .card-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 39px; height: 39px; color: var(--cyan); background: rgba(105,230,255,.07); border: 1px solid rgba(105,230,255,.1); border-radius: 12px; font-size: 17px; }
  .card-copy { position: relative; z-index: 1; display: block; min-width: 0; }
  .card-copy > * { display: block; }
  .card-copy small { color: #6e7087; font: 7.5px ui-monospace, monospace; letter-spacing: .08em; }
  .card-copy strong { margin-top: 4px; color: #d8d7e4; font-size: 11.5px; }
  .card-copy em { margin-top: 4px; overflow: hidden; color: #74768d; font-size: 8.5px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
  .card-arrow { position: relative; z-index: 1; color: #606278; }
  .card-reality .card-icon { color: var(--violet-bright); background: rgba(157,135,255,.08); }
  .reality-icon { animation: reality-spin 7s linear infinite; }
  .card-button .card-icon { color: var(--rose); background: rgba(255,124,186,.07); }
  .card-meter { position: relative; z-index: 1; width: 4px; height: 42px; overflow: hidden; background: rgba(255,255,255,.045); border-radius: 99px; }
  .card-meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 68%; background: linear-gradient(var(--cyan), var(--violet)); border-radius: inherit; animation: meter-breathe 2.5s ease-in-out infinite alternate; }

  /* Projects */
  .project-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; max-width: 1160px; margin: 0 auto; }
  .project-card { position: relative; display: grid; grid-template-columns: 145px minmax(0,1fr); align-items: center; min-height: 180px; padding: 22px; overflow: hidden; color: var(--ink); background: linear-gradient(145deg, rgba(23,24,48,.78), rgba(12,13,29,.79)); border: 1px solid var(--line); border-radius: 20px; text-align: left; transition: transform .35s var(--ease-spring), border-color .25s ease, box-shadow .25s ease; }
  .project-card::before { content: ""; position: absolute; width: 170px; height: 170px; left: -40px; top: -60px; border-radius: 50%; background: var(--project-glow, var(--violet)); opacity: .08; filter: blur(35px); }
  .project-card:hover { transform: translateY(-6px) rotateX(3deg); border-color: rgba(157,135,255,.24); box-shadow: 0 22px 45px rgba(0,0,0,.25); }
  .project-moon { --project-glow: var(--cyan); --planet-a: var(--cyan); --planet-b: var(--gold); }
  .project-button { --project-glow: var(--rose); --planet-a: var(--rose); --planet-b: var(--violet); }
  .project-garden { --project-glow: var(--mint); --planet-a: var(--mint); --planet-b: var(--cyan); }
  .project-haunted { --project-glow: var(--violet); --planet-a: var(--violet-bright); --planet-b: #e9edff; }
  .folder-world { position: relative; display: block; width: 122px; height: 118px; perspective: 400px; }
  .folder-back, .folder-front { position: absolute; left: 8px; width: 108px; border-radius: 8px 13px 14px 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--project-glow) 42%, #20223f), #181a36); border: 1px solid color-mix(in srgb, var(--project-glow) 23%, transparent); box-shadow: inset 0 1px rgba(255,255,255,.08); }
  .folder-back { bottom: 17px; height: 67px; transform-origin: bottom; transition: transform .4s var(--ease-spring); }
  .folder-back::before { content: ""; position: absolute; top: -10px; left: 7px; width: 43px; height: 15px; background: inherit; border: inherit; border-bottom: 0; border-radius: 7px 7px 0 0; }
  .folder-front { bottom: 10px; z-index: 5; height: 58px; transform: skewX(-3deg); filter: brightness(.95); }
  .project-card:hover .folder-back { transform: rotateX(-18deg) translateY(5px); }
  .planet { position: absolute; z-index: 3; display: block; border-radius: 50%; box-shadow: inset -5px -5px 8px rgba(0,0,0,.28), 0 0 18px currentColor; transition: transform .55s var(--ease-spring), opacity .3s ease; }
  .planet-one { left: 30px; top: 52px; width: 27px; height: 27px; color: var(--planet-a); background: currentColor; }
  .planet-two { left: 76px; top: 64px; width: 15px; height: 15px; color: var(--planet-b); background: currentColor; }
  .orbit-ring { position: absolute; z-index: 2; left: 13px; top: 42px; width: 95px; height: 48px; border: 1px solid color-mix(in srgb, var(--project-glow) 45%, transparent); border-radius: 50%; opacity: 0; transform: rotate(-16deg) scale(.6); transition: transform .55s var(--ease-spring), opacity .3s ease; }
  .project-card:hover .planet-one { transform: translateY(-47px) rotate(22deg); }
  .project-card:hover .planet-two { transform: translate(8px,-39px); }
  .project-card:hover .orbit-ring { opacity: .8; transform: translateY(-32px) rotate(-16deg) scale(1); }
  .project-copy { position: relative; z-index: 7; }
  .project-copy > * { display: block; }
  .project-copy small { color: color-mix(in srgb, var(--project-glow) 68%, #9799ad); font: 8px ui-monospace, monospace; letter-spacing: .08em; }
  .project-copy strong { max-width: 260px; margin-top: 8px; color: #efedf8; font-size: 19px; line-height: 1.1; letter-spacing: -.03em; }
  .project-copy em { margin-top: 9px; color: #73758c; font-size: 9px; font-style: normal; }
  .project-postcard { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 680px; min-height: 48px; margin: 18px auto 0; padding: 10px 18px; color: #9998ad; background: rgba(255,255,255,.025); border: 1px dashed rgba(255,255,255,.11); border-radius: 13px; text-align: center; font-size: 10px; }
  .project-postcard > span { color: var(--gold); }
  .project-postcard.is-writing { animation: postcard-pop .5s var(--ease-spring); }

  /* Plugipedia */
  .plug-header { align-items: center; }
  .power-readout { display: flex; align-items: center; gap: 9px; min-width: 142px; padding: 10px 12px; color: #898ba1; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 11px; font: 9px ui-monospace, monospace; }
  .power-readout i { width: 8px; height: 8px; background: #505267; border-radius: 50%; transition: background .3s ease, box-shadow .3s ease; }
  .power-readout.is-powered i { background: var(--mint); box-shadow: 0 0 14px var(--mint); animation: live-pulse 1s ease-in-out infinite; }

  .plug-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 15px; max-width: 1240px; margin: 0 auto; }
  .plug-catalog, .socket-lab { padding: 19px; background: rgba(15,16,34,.65); border: 1px solid var(--line); border-radius: 20px; box-shadow: inset 0 1px rgba(255,255,255,.035); }
  .mini-search { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 9px; color: #67697f; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 9px; }
  .mini-search:focus-within { border-color: rgba(105,230,255,.25); }
  .mini-search input { width: 112px; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 9px; }
  .mini-search input::placeholder { color: #606278; }

  .plug-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .plug-card { display: grid; grid-template-columns: 53px minmax(0,1fr); align-items: center; gap: 8px; min-height: 90px; padding: 9px; color: var(--ink); background: rgba(255,255,255,.023); border: 1px solid rgba(255,255,255,.055); border-radius: 12px; text-align: left; transition: transform .23s var(--ease-spring), background .2s ease, border-color .2s ease, box-shadow .2s ease; }
  .plug-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.045); border-color: rgba(105,230,255,.16); }
  .plug-card.is-selected { background: linear-gradient(135deg, rgba(105,230,255,.1), rgba(157,135,255,.07)); border-color: rgba(105,230,255,.34); box-shadow: 0 0 24px rgba(105,230,255,.06), inset 0 0 0 1px rgba(105,230,255,.07); }
  .plug-card.is-filtered { display: none; }
  .plug-card > span:last-child > * { display: block; }
  .plug-card strong { color: #dedde8; font-size: 10px; }
  .plug-card small { margin-top: 4px; color: #7d7f95; font-size: 7.7px; line-height: 1.2; }
  .plug-card em { margin-top: 4px; color: #5f6177; font-size: 6.8px; font-style: normal; line-height: 1.2; }
  .cosmic-plug { background: linear-gradient(135deg, rgba(157,135,255,.07), rgba(255,124,186,.04)); }

  .plug-visual { position: relative; display: block; width: 48px; height: 57px; color: #a8a9bd; filter: drop-shadow(0 8px 9px rgba(0,0,0,.3)); transition: transform .25s var(--ease-spring), color .2s ease; }
  .plug-card:hover .plug-visual { transform: rotate(-5deg) scale(1.06); color: var(--cyan); }
  .plug-card.is-selected .plug-visual { color: var(--cyan); animation: plug-charge .8s ease-in-out infinite alternate; }
  .plug-visual i { position: absolute; display: block; background: currentColor; }
  .plug-core { left: 9px; top: 20px; width: 30px; height: 26px; border-radius: 8px 8px 11px 11px; background: linear-gradient(145deg, currentColor, color-mix(in srgb, currentColor 60%, #181a32)) !important; box-shadow: inset 0 2px rgba(255,255,255,.22); }
  .plug-visual .cord { left: 21px; top: 43px; width: 6px; height: 15px; border-radius: 0 0 5px 5px; opacity: .55; }
  .prong { width: 4px; height: 19px; top: 3px; border-radius: 2px 2px 0 0; opacity: .9; }
  .plug-a .p1 { left: 15px; } .plug-a .p2 { right: 15px; }
  .plug-c .prong { width: 5px; border-radius: 99px 99px 0 0; } .plug-c .p1 { left: 14px; } .plug-c .p2 { right: 14px; }
  .plug-g .plug-core { left: 7px; width: 34px; } .plug-g .p1 { left: 11px; top: 11px; transform: rotate(-12deg); } .plug-g .p2 { right: 11px; top: 11px; transform: rotate(12deg); } .plug-g .p3 { left: 22px; top: 0; }
  .plug-usb .plug-core { left: 12px; top: 19px; width: 24px; height: 28px; } .plug-usb .p1 { left: 14px; top: 8px; width: 20px; height: 12px; border-radius: 5px 5px 2px 2px; background: transparent !important; border: 3px solid currentColor; }
  .plug-hdmi .plug-core { left: 8px; } .plug-hdmi .p1 { left: 11px; top: 6px; width: 27px; height: 15px; clip-path: polygon(10% 0,90% 0,100% 100%,0 100%); }
  .plug-xlr .plug-core { left: 6px; top: 16px; width: 36px; height: 32px; border-radius: 50%; } .plug-xlr .prong { top: 22px; width: 4px; height: 4px; background: #17192f; border-radius: 50%; z-index: 2; } .plug-xlr .p1 { left: 15px; } .plug-xlr .p2 { left: 29px; } .plug-xlr .p3 { left: 22px; top: 33px; }
  .plug-jack .plug-core { left: 12px; top: 29px; width: 24px; height: 18px; } .plug-jack .p1 { left: 20px; top: 0; width: 8px; height: 31px; border-radius: 5px 5px 1px 1px; box-shadow: inset 0 -5px rgba(20,22,42,.5); }
  .plug-banana .plug-core { color: var(--gold); transform: rotate(8deg); } .plug-banana .p1 { left: 20px; top: 2px; width: 8px; height: 20px; border-radius: 6px 6px 1px 1px; background: var(--gold); } .plug-banana .cord { background: var(--gold); }
  .plug-cosmic { color: var(--violet-bright); } .plug-cosmic .plug-core { left: 7px; width: 34px; clip-path: polygon(50% 0,100% 25%,87% 100%,13% 100%,0 25%); } .plug-cosmic .p1 { left: 10px; top: 7px; transform: rotate(-20deg); } .plug-cosmic .p2 { left: 22px; top: 0; } .plug-cosmic .p3 { right: 10px; top: 7px; transform: rotate(20deg); }

  .socket-lab { position: relative; overflow: hidden; }
  .socket-lab::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 200px; height: 200px; background: var(--violet); border-radius: 50%; filter: blur(75px); opacity: .055; pointer-events: none; }
  .socket-lab h2 { margin-top: 5px; font-size: 17px; }
  .plug-article { margin-top: 14px; padding: 13px; background: linear-gradient(145deg, rgba(157,135,255,.065), rgba(105,230,255,.025)); border: 1px solid rgba(157,135,255,.12); border-radius: 12px; box-shadow: inset 0 1px rgba(255,255,255,.035); transition: transform .3s var(--ease-spring), border-color .25s ease; }
  .plug-article.is-updating { transform: translateY(-2px) rotateX(2deg); border-color: rgba(105,230,255,.27); }
  .plug-article-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .plug-article-heading span { color: #777991; font: 6.7px ui-monospace, monospace; letter-spacing: .08em; }
  .plug-article-heading i { padding: 3px 5px; color: var(--gold); background: rgba(255,215,111,.06); border-radius: 5px; font: 6.5px ui-monospace, monospace; white-space: nowrap; }
  .plug-article h3 { margin: 8px 0 5px; color: #e8e5f2; font-family: ui-serif, Georgia, serif; font-size: 19px; font-weight: 650; letter-spacing: -.025em; }
  .plug-article > p { color: #8c8da2; font-size: 8.3px; line-height: 1.52; }
  .plug-article dl { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; margin-top: 10px; }
  .plug-article dl div { min-width: 0; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.045); }
  .plug-article dt { color: #62647a; font: 6.5px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
  .plug-article dd { margin-top: 3px; color: #aaa9bc; font-size: 7.5px; line-height: 1.35; }
  .plug-instruction { margin: 12px 0; min-height: 34px; padding: 9px 10px; color: #818399; background: rgba(255,255,255,.025); border: 1px dashed var(--line); border-radius: 9px; font: 8.5px ui-monospace, monospace; line-height: 1.5; }
  .plug-instruction strong { color: var(--cyan); }
  .socket-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .socket-target { position: relative; display: grid; justify-items: start; min-height: 92px; padding: 12px; overflow: hidden; color: var(--ink); background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.055); border-radius: 12px; text-align: left; transition: transform .24s var(--ease-spring), border-color .2s ease, background .2s ease; }
  .socket-target::after { content: "••"; position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; color: #3f4155; border: 1px solid #333548; border-radius: 50%; text-align: center; font-size: 8px; letter-spacing: 1px; line-height: 14px; }
  .socket-target > span { color: #9698ad; font-size: 25px; transition: transform .3s var(--ease-spring), color .2s ease; }
  .socket-target strong { margin-top: 7px; color: #c8c7d5; font-size: 9.5px; }
  .socket-target small { margin-top: 3px; color: #62647a; font-size: 7px; }
  .socket-target:hover { transform: translateY(-2px); background: rgba(255,255,255,.045); border-color: rgba(255,215,111,.16); }
  .socket-target:hover > span { transform: scale(1.15) rotate(-5deg); color: var(--gold); }
  .socket-target.is-ready { border-color: rgba(105,230,255,.2); box-shadow: inset 0 0 18px rgba(105,230,255,.025); }
  .socket-target.is-powered { animation: powered-pop .7s var(--ease-spring); border-color: rgba(124,247,202,.3); }
  .socket-target.is-powered > span { color: var(--mint); text-shadow: 0 0 18px currentColor; }
  .socket-target.reaction-lamp > span { color: var(--gold); animation: lamp-sun 1.5s ease-in-out; }
  .socket-target.reaction-moon > span { animation: moon-phases .8s steps(4) 2; }
  .socket-target.reaction-kettle > span { animation: kettle-shake .16s ease-in-out 7; }
  .socket-target.reaction-synth > span { animation: synth-bounce .2s ease-in-out 6 alternate; }
  .lab-message { position: relative; z-index: 2; min-height: 38px; margin-top: 12px; padding: 10px 11px; color: #9d9caf; background: linear-gradient(90deg, rgba(157,135,255,.07), transparent); border-left: 2px solid var(--violet); border-radius: 4px 9px 9px 4px; font-size: 8.5px; line-height: 1.5; }

  /* Profile */
  .profile-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; max-width: 1100px; margin: 0 auto; }
  .identity-card, .stats-card, .mood-card, .account-prank-card { background: linear-gradient(145deg, rgba(23,24,48,.75), rgba(13,14,30,.78)); border: 1px solid var(--line); border-radius: 20px; box-shadow: inset 0 1px rgba(255,255,255,.035); }
  .identity-card { display: grid; grid-template-columns: 240px minmax(0,1fr); align-items: center; min-height: 340px; padding: 28px; overflow: hidden; }
  .familiar { position: relative; width: 190px; height: 230px; margin: 0 auto; cursor: pointer; transform-style: preserve-3d; transition: transform .5s var(--ease-spring); }
  .familiar:hover { transform: translateY(-7px) rotateY(-4deg); }
  .familiar-face { position: absolute; z-index: 3; left: 25px; top: 42px; width: 140px; height: 152px; background: radial-gradient(circle at 40% 25%, #e4dcff, #9584dd 55%, #554885); border-radius: 50% 50% 45% 45% / 46% 46% 57% 57%; box-shadow: inset 12px 9px 22px rgba(255,255,255,.2), inset -14px -15px 25px rgba(22,19,60,.35), 0 24px 45px rgba(0,0,0,.3), 0 0 45px rgba(157,135,255,.2); }
  .familiar-face::after { content: ""; position: absolute; left: 36px; bottom: -24px; width: 68px; height: 50px; background: inherit; border-radius: 12px 12px 40px 40px; transform: rotate(5deg); filter: brightness(.84); }
  .familiar-ear { position: absolute; z-index: 2; top: 30px; width: 66px; height: 76px; background: #7565ba; clip-path: polygon(50% 0,100% 100%,0 82%); filter: drop-shadow(0 8px 13px rgba(0,0,0,.25)); }
  .ear-left { left: 17px; transform: rotate(-20deg); }
  .ear-right { right: 17px; transform: scaleX(-1) rotate(-20deg); }
  .familiar-eye { position: absolute; z-index: 2; top: 59px; display: grid; place-items: center; width: 27px; height: 31px; overflow: hidden; background: #f8fbff; border-radius: 50%; box-shadow: inset 0 -3px 7px rgba(95,80,150,.2); }
  .familiar-eye b { display: block; width: 10px; height: 13px; background: #17162a; border: 3px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 8px rgba(105,230,255,.6); transition: transform .08s linear; }
  .eye-left { left: 35px; }
  .eye-right { right: 35px; }
  .familiar-smile { position: absolute; left: 57px; top: 102px; width: 28px; height: 14px; border-bottom: 3px solid #3c315d; border-radius: 50%; }
  .familiar-hat { position: absolute; z-index: 6; left: 70px; top: 2px; display: grid; place-items: center; width: 50px; height: 50px; color: var(--gold); background: rgba(11,12,28,.88); border: 1px solid rgba(255,215,111,.24); border-radius: 50% 50% 45% 45%; box-shadow: 0 0 24px rgba(255,215,111,.15); font-size: 23px; transform: rotate(-7deg); transition: transform .4s var(--ease-spring); }
  .familiar:hover .familiar-hat { transform: translateY(-8px) rotate(7deg); }
  .aura-ring { position: absolute; z-index: 0; border: 1px solid rgba(157,135,255,.23); border-radius: 50%; }
  .ring-one { inset: 10px 0 5px; animation: aura-rotate 12s linear infinite; }
  .ring-two { inset: 28px -10px 23px; border-color: rgba(105,230,255,.12); animation: aura-rotate 9s linear infinite reverse; }
  .ring-one::before, .ring-two::before { content: "✦"; position: absolute; top: 12%; left: 5%; color: var(--violet-bright); font-size: 12px; text-shadow: 0 0 10px currentColor; }

  .identity-copy { position: relative; z-index: 4; }
  .status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; color: #9ae8c8; background: rgba(124,247,202,.06); border: 1px solid rgba(124,247,202,.12); border-radius: 99px; font: 8px ui-monospace, monospace; }
  .status-pill i { width: 5px; height: 5px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 8px var(--mint); }
  .identity-copy h2 { max-width: 390px; margin: 15px 0 10px; font-size: 28px; line-height: 1.05; letter-spacing: -.045em; }
  .identity-copy p { max-width: 430px; min-height: 66px; color: #9292a8; font-size: 11px; line-height: 1.65; }
  .identity-copy .soft-button { margin-top: 13px; }
  .stats-card, .mood-card { padding: 22px; }
  .dice-button { display: grid; place-items: center; width: 38px; height: 38px; color: var(--gold); background: rgba(255,215,111,.06); border: 1px solid rgba(255,215,111,.12); border-radius: 11px; font-size: 22px; transition: transform .4s var(--ease-spring); }
  .dice-button:hover { transform: rotate(145deg) scale(1.1); }
  .stat-list { display: grid; gap: 2px; }
  .stat-list div { display: flex; align-items: center; justify-content: space-between; min-height: 37px; padding: 0 4px; border-bottom: 1px solid rgba(255,255,255,.045); }
  .stat-list dt { color: #85869a; font-size: 9.5px; }
  .stat-list dd { color: #e0ddeb; font: 11px ui-monospace, monospace; }
  .stat-list.is-rolling dd { animation: stat-roll .35s steps(4); }
  .stat-list.is-soaring dd { color: var(--mint); text-shadow: 0 0 12px rgba(124,247,202,.25); animation: stat-soar .72s var(--ease-spring) both; }
  .stat-list.is-soaring div:nth-child(2) dd { animation-delay: .07s; }
  .stat-list.is-soaring div:nth-child(3) dd { animation-delay: .14s; }
  .stat-list.is-soaring div:nth-child(4) dd { animation-delay: .21s; }
  .stat-list.is-soaring div:nth-child(5) dd { animation-delay: .28s; }

  .account-prank-card {
    --account-accent: var(--violet);
    position: relative;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(280px,.82fr) minmax(360px,1.18fr);
    gap: 14px;
    padding: 14px;
    overflow: hidden;
    transition: border-color .3s ease, box-shadow .3s ease;
  }
  .account-prank-card::before { content: ""; position: absolute; top: -130px; left: 20%; width: 330px; height: 260px; background: var(--account-accent); border-radius: 50%; filter: blur(100px); opacity: .08; pointer-events: none; transition: background .3s ease; }
  .account-prank-card.account-andrew { --account-accent: var(--gold); border-color: rgba(255,215,111,.16); }
  .account-prank-card.account-jason { --account-accent: var(--cyan); border-color: rgba(105,230,255,.16); }
  .account-prank-card.account-tibo { --account-accent: var(--rose); border-color: rgba(255,124,186,.19); }
  .account-prank-card.account-sam { --account-accent: var(--mint); border-color: rgba(124,247,202,.16); }
  .account-prank-card.is-generating { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--account-accent) 35%, transparent), 0 0 36px color-mix(in srgb, var(--account-accent) 10%, transparent); }

  .password-generator, .account-event-panel { position: relative; z-index: 2; padding: 18px; background: rgba(7,8,21,.43); border: 1px solid rgba(255,255,255,.055); border-radius: 14px; }
  .password-generator h2 { margin: 7px 0 7px; font-size: 21px; letter-spacing: -.035em; }
  .password-generator > p { max-width: 480px; color: #85879d; font-size: 9px; line-height: 1.55; }
  .password-output-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 15px; }
  #fakePassword { display: flex; align-items: center; min-width: 0; min-height: 42px; padding: 0 11px; overflow: hidden; color: #c9c7d9; background: #090a18; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .025em; text-overflow: ellipsis; white-space: nowrap; box-shadow: inset 0 2px 8px rgba(0,0,0,.3); }
  .is-generating #fakePassword { color: var(--account-accent); animation: password-glitch .14s steps(2) infinite; }
  .password-button { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 13px; overflow: hidden; color: #080916; background: linear-gradient(135deg, #d6ceff, var(--cyan)); border-radius: 10px; font-size: 9px; box-shadow: 0 9px 24px rgba(105,230,255,.11); transition: transform .22s var(--ease-spring), box-shadow .2s ease; }
  .password-button:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(105,230,255,.17); }
  .password-button:disabled { cursor: wait; opacity: .72; }
  .password-button > span { font-size: 17px; }
  .password-button strong { font-size: 8.5px; white-space: nowrap; }
  .entropy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; color: #62647a; font: 7px ui-monospace, monospace; }
  .entropy-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: #7b9d91; }
  .entropy-row i { width: 5px; height: 5px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 8px var(--mint); }

  .account-event-panel { min-width: 0; transition: transform .38s var(--ease-spring), border-color .25s ease; }
  .account-prank-card.is-generating .account-event-panel { transform: rotateX(5deg) translateY(3px); border-color: color-mix(in srgb, var(--account-accent) 25%, transparent); }
  .account-event-header { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
  .account-avatar { display: grid; place-items: center; width: 34px; height: 34px; color: var(--account-accent); background: color-mix(in srgb, var(--account-accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--account-accent) 20%, transparent); border-radius: 10px; font-size: 17px; font-weight: 850; box-shadow: 0 0 16px color-mix(in srgb, var(--account-accent) 8%, transparent); }
  .account-event-title { display: block; min-width: 0; }
  .account-event-title small, .account-event-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-event-title small { color: #64667c; font: 6.8px ui-monospace, monospace; letter-spacing: .1em; }
  .account-event-title strong { margin-top: 4px; color: #d6d5e2; font-size: 10px; }
  .account-badge { padding: 4px 6px; color: var(--account-accent); background: color-mix(in srgb, var(--account-accent) 7%, transparent); border: 1px solid color-mix(in srgb, var(--account-accent) 15%, transparent); border-radius: 6px; font: 6.8px ui-monospace, monospace; white-space: nowrap; }
  .account-event-stream { display: grid; align-content: start; gap: 5px; min-height: 116px; max-height: 154px; margin-top: 10px; overflow: hidden; }
  .account-event-line { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 39px; padding: 6px 8px; color: #8c8ea3; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.04); border-radius: 9px; animation: account-event-arrive .42s var(--ease-spring) both; }
  .account-event-line > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; color: var(--account-accent); background: color-mix(in srgb, var(--account-accent) 7%, transparent); border-radius: 7px; font-size: 10px; }
  .account-event-line p { min-width: 0; }
  .account-event-line p strong, .account-event-line p small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-event-line p strong { color: #bbbacc; font-size: 8px; }
  .account-event-line p small { margin-top: 3px; color: #686a80; font-size: 7px; }
  .account-event-line > em { color: #696b81; font: 6.5px ui-monospace, monospace; font-style: normal; }
  .account-event-line.is-idle { opacity: .75; }
  .account-event-line.is-email { animation-name: email-arrive; }
  .account-event-line.is-message { border-color: rgba(255,124,186,.11); background: rgba(255,124,186,.025); }

  .tibo-reset-zone:not([hidden]) { display: grid; grid-template-columns: minmax(0,1fr) 145px; grid-template-rows: auto auto 1fr; gap: 7px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); animation: account-event-arrive .5s var(--ease-spring); }
  .reset-usage-row { display: flex; align-items: center; justify-content: space-between; color: #72748b; font: 7px ui-monospace, monospace; letter-spacing: .07em; }
  .reset-usage-row strong { color: var(--rose); font-size: 11px; }
  .reset-usage-meter { position: relative; height: 6px; overflow: hidden; background: rgba(255,255,255,.04); border-radius: 99px; }
  .reset-usage-meter i { display: block; width: 1%; height: 100%; background: linear-gradient(90deg, var(--rose), var(--gold)); border-radius: inherit; box-shadow: 0 0 12px var(--rose); transition: width .5s var(--ease-spring); }
  .tibo-reset-button { position: relative; grid-column: 2; grid-row: 1 / 4; align-self: center; display: grid; place-items: center; align-content: center; width: 136px; height: 136px; padding: 16px; color: #170812; background: radial-gradient(circle at 40% 30%, #ffb1ce, var(--rose) 45%, #a92f68 100%); border: 7px solid #312036; border-radius: 50%; box-shadow: 0 12px 0 #160f1c, 0 18px 35px rgba(0,0,0,.4), 0 0 32px rgba(255,124,186,.18), inset 0 3px 4px rgba(255,255,255,.45); transform: translateY(-4px); transition: transform .12s ease, box-shadow .12s ease; }
  .tibo-reset-button:hover { transform: translateY(-7px) scale(1.03); box-shadow: 0 15px 0 #160f1c, 0 23px 42px rgba(0,0,0,.45), 0 0 45px rgba(255,124,186,.25), inset 0 3px 4px rgba(255,255,255,.45); }
  .tibo-reset-button:active { transform: translateY(7px) scale(.97); box-shadow: 0 2px 0 #160f1c, 0 7px 18px rgba(0,0,0,.4), inset 0 2px 7px rgba(84,8,46,.35); }
  .tibo-reset-button strong { position: relative; z-index: 2; font-size: 14px; line-height: .9; letter-spacing: -.03em; }
  .tibo-reset-button small { position: relative; z-index: 2; margin-top: 7px; font: 6.5px ui-monospace, monospace; opacity: .7; }
  .reset-button-rings { position: absolute; inset: -13px; border: 1px dashed rgba(255,124,186,.35); border-radius: 50%; animation: aura-rotate 9s linear infinite; }
  .reset-button-rings::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255,215,111,.16); border-radius: inherit; }
  .sam-message { display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: center; gap: 8px; min-height: 48px; padding: 7px 9px; color: #aaa9bb; background: rgba(255,255,255,.025); border: 1px solid rgba(255,124,186,.08); border-radius: 10px; }
  .sam-message > span { display: grid; place-items: center; width: 25px; height: 25px; color: #0a0b18; background: var(--mint); border-radius: 8px; font-size: 9px; font-weight: 900; }
  .sam-message p strong, .sam-message p small { display: block; }
  .sam-message p strong { color: #aaa9ba; font-size: 7px; }
  .sam-message p small { margin-top: 3px; color: #77798e; font-size: 7px; line-height: 1.3; }
  .sam-message.is-speaking { animation: sam-message-pop .45s var(--ease-spring); }

  .profile-parody-note { position: relative; z-index: 2; grid-column: 1 / -1; padding: 4px 8px 1px; color: #5f6176; font: 7px ui-monospace, monospace; line-height: 1.5; }
  .profile-parody-note strong { color: #85879b; }
  .mood-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 30px; }
  .mood-card h2 { margin-top: 6px; font-size: 18px; }
  .mood-card p { grid-column: 1 / -1; color: #7d7e93; font-size: 9px; }
  .mood-options { display: flex; gap: 6px; }
  .mood-options button { min-height: 32px; padding: 0 12px; color: #85879c; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 9px; font-size: 9px; }
  .mood-options button:hover { color: var(--ink); }
  .mood-options button.is-selected { color: #0b0c1b; background: var(--violet-bright); border-color: transparent; font-weight: 800; }
}

@layer effects {
  .toast-region { position: fixed; z-index: 1000; right: 25px; bottom: 22px; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
  .toast { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; min-height: 56px; padding: 10px 13px; color: #d8d7e4; background: rgba(17,18,39,.94); border: 1px solid rgba(157,135,255,.22); border-radius: 14px; box-shadow: 0 16px 45px rgba(0,0,0,.4), inset 0 1px rgba(255,255,255,.07); backdrop-filter: blur(18px); animation: toast-in .5s var(--ease-spring) both; }
  .toast.is-leaving { animation: toast-out .3s ease forwards; }
  .toast-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--gold); background: rgba(255,215,111,.08); border-radius: 9px; }
  .toast strong, .toast small { display: block; }
  .toast strong { font-size: 10px; }
  .toast small { margin-top: 3px; color: #83859b; font-size: 8.5px; line-height: 1.3; }

  .paw-layer, .particle-layer { position: fixed; z-index: 490; inset: 0; overflow: hidden; pointer-events: none; }
  .paw-print { position: fixed; color: rgba(105,230,255,.55); font-size: 12px; transform: rotate(var(--paw-rot)); animation: paw-fade 1.4s ease forwards; }
  .particle { position: fixed; z-index: 900; color: var(--particle-color, var(--gold)); font-size: var(--particle-size, 13px); text-shadow: 0 0 9px currentColor; pointer-events: none; animation: particle-flight var(--particle-duration, 1s) var(--ease-spring) forwards; }

  .magic-dialog {
    width: min(510px, calc(100vw - 28px));
    padding: 0;
    color: var(--ink);
    background: linear-gradient(150deg, rgba(27,28,57,.98), rgba(12,13,30,.98));
    border: 1px solid rgba(157,135,255,.28);
    border-radius: 22px;
    box-shadow: 0 35px 100px rgba(0,0,0,.7), 0 0 70px rgba(157,135,255,.09), inset 0 1px rgba(255,255,255,.08);
    animation: dialog-arrive .45s var(--ease-spring);
  }
  .magic-dialog::backdrop { background: rgba(2,3,10,.74); backdrop-filter: blur(12px); animation: backdrop-in .25s ease; }
  .magic-dialog form { position: relative; padding: 28px; overflow: hidden; }
  .magic-dialog form::before { content: ""; position: absolute; top: -100px; right: -90px; width: 240px; height: 240px; background: var(--violet); border-radius: 50%; filter: blur(80px); opacity: .11; pointer-events: none; }
  .dialog-sigil { position: relative; display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px; color: var(--cyan); background: rgba(105,230,255,.07); border: 1px solid rgba(105,230,255,.15); border-radius: 16px; box-shadow: 0 0 28px rgba(105,230,255,.09); font-size: 27px; }
  .dialog-kicker { color: var(--violet-bright); font: 8px ui-monospace, monospace; letter-spacing: .13em; }
  .magic-dialog h2 { max-width: 410px; margin: 8px 0 12px; font-size: 28px; line-height: 1.04; letter-spacing: -.045em; }
  .magic-dialog p { color: #9998ad; font-size: 11px; line-height: 1.6; }
  .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; }
  .dialog-actions button { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 10px; font-weight: 750; }
  .dialog-secondary { color: #a7a6b9; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
  .dialog-primary { color: #080916; background: linear-gradient(135deg, #d8d0ff, var(--cyan)); box-shadow: 0 9px 25px rgba(105,230,255,.11); }
  .dialog-footnote { display: block; margin-top: 15px; color: #5f6177; font: 8px ui-monospace, monospace; text-align: center; }
  .uninstall-progress { position: relative; height: 39px; margin-top: 18px; overflow: hidden; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 9px; }
  .uninstall-progress i { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, rgba(157,135,255,.25), rgba(105,230,255,.28)); animation: pretend-progress 2.3s var(--ease-spring) forwards; }
  .uninstall-progress span { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; color: #c8c7d6; font: 8.5px ui-monospace, monospace; }
  .help-dialog ul { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
  .help-dialog li { position: relative; padding: 10px 12px 10px 31px; color: #9a9aad; background: rgba(255,255,255,.025); border-radius: 9px; font-size: 10px; line-height: 1.45; }
  .help-dialog li::before { content: "✦"; position: absolute; left: 11px; color: var(--gold); }

  .toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 59px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
  .toggle-row span strong, .toggle-row span small { display: block; }
  .toggle-row span strong { color: #d4d3df; font-size: 10px; }
  .toggle-row span small { margin-top: 4px; color: #74768c; font-size: 8px; }
  .toggle-row input { position: absolute; opacity: 0; }
  .toggle-row > i { position: relative; flex: 0 0 auto; width: 40px; height: 22px; background: #292b42; border: 1px solid rgba(255,255,255,.08); border-radius: 99px; transition: background .2s ease, box-shadow .2s ease; }
  .toggle-row > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #85879b; border-radius: 50%; transition: transform .25s var(--ease-spring), background .2s ease; }
  .toggle-row input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 3px; }
  .toggle-row input:checked + i { background: rgba(157,135,255,.3); box-shadow: 0 0 14px rgba(157,135,255,.11); }
  .toggle-row input:checked + i::after { background: var(--violet-bright); transform: translateX(18px); box-shadow: 0 0 8px rgba(194,181,255,.4); }

  .fall-piece { --fall-x: 0vw; --fall-rotate: 0deg; --fall-delay: 0s; transform-origin: 50% 20%; transition: transform 1.35s cubic-bezier(.58,.02,.84,.25), opacity .75s ease, filter .75s ease; transition-delay: var(--fall-delay); }
  .topbar.fall-piece { --fall-x: 7vw; --fall-rotate: 5deg; --fall-delay: .12s; }
  .sidebar.fall-piece { --fall-x: -12vw; --fall-rotate: -13deg; --fall-delay: .28s; }
  .main-stage.fall-piece { --fall-x: 14vw; --fall-rotate: 8deg; --fall-delay: .4s; }
  .app-shell.is-falling { overflow: visible; background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; }
  .app-shell.is-falling::after { display: none; }
  .app-shell.is-falling .fall-piece { transform: translate3d(var(--fall-x), 125vh, 0) rotate(var(--fall-rotate)) scale(.94); opacity: .2; filter: blur(2px); pointer-events: none; }

  .falling-sky { position: fixed; z-index: 800; inset: 0; overflow: hidden; opacity: 0; pointer-events: none; background: radial-gradient(circle at 50% 18%, rgba(105,230,255,.16), transparent 17%), radial-gradient(circle at 20% 100%, rgba(157,135,255,.27), transparent 36%), linear-gradient(#070919, #101531 58%, #38285d 130%); transition: opacity .55s ease; }
  .falling-sky.is-visible { opacity: 1; pointer-events: auto; }
  .falling-sky::before, .falling-sky::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.5px); background-size: 76px 76px; opacity: .28; animation: falling-stars 6s linear infinite; }
  .falling-sky::after { background-size: 131px 131px; background-position: 34px 22px; opacity: .16; animation-duration: 10s; }
  .fall-moon { position: absolute; top: 8%; right: 12%; width: 110px; height: 110px; background: radial-gradient(circle at 35% 30%, #fffbd9, #e3c9ff 48%, #7e70c4 100%); border-radius: 50%; box-shadow: 0 0 80px rgba(194,181,255,.3), inset -18px -15px 28px rgba(75,60,140,.24); animation: fall-moon-float 5s ease-in-out infinite alternate; }
  .fall-moon::before, .fall-moon::after { content: ""; position: absolute; background: rgba(92,76,150,.17); border-radius: 50%; }
  .fall-moon::before { width: 25px; height: 25px; left: 22px; top: 38px; }
  .fall-moon::after { width: 14px; height: 14px; right: 24px; top: 20px; }
  .fall-copy { position: absolute; top: 15%; left: clamp(24px, 8vw, 120px); max-width: 460px; }
  .fall-copy span, .fall-copy strong, .fall-copy small { display: block; }
  .fall-copy span { color: var(--cyan); font: 9px ui-monospace, monospace; letter-spacing: .16em; }
  .fall-copy strong { margin-top: 10px; font-size: clamp(30px, 5vw, 60px); line-height: .94; letter-spacing: -.055em; }
  .fall-copy small { margin-top: 14px; color: #aaa8c3; font-size: 12px; }
  .cancel-update { position: absolute; z-index: 4; left: 50%; bottom: 12%; display: grid; grid-template-columns: 44px auto; grid-template-rows: auto auto; align-items: center; column-gap: 11px; min-width: 260px; min-height: 66px; padding: 10px 18px; color: #080916; background: linear-gradient(135deg, #fff6cf, var(--cyan)); border-radius: 16px; box-shadow: 0 20px 55px rgba(0,0,0,.35), 0 0 40px rgba(105,230,255,.19); transform: translateX(-50%); animation: parachute 2.4s ease-in-out infinite; }
  .cancel-update > span { grid-row: 1 / 3; font-size: 30px; }
  .cancel-update strong { align-self: end; text-align: left; font-size: 13px; }
  .cancel-update small { align-self: start; text-align: left; font-size: 8px; opacity: .7; }
  .fall-debris span { position: absolute; top: -50px; color: #aaa8c6; font-size: 20px; animation: debris-fall var(--debris-time) linear var(--debris-delay) infinite; opacity: .7; }

  .app-shell.is-minimized { transform: scale(.12) translate(-250vw, 230vh) rotate(12deg); filter: saturate(1.5); }
  .app-shell.is-max-magic { animation: maximum-magic 1.8s ease-in-out; }
  body.moonlight-off .aurora, body.moonlight-off .cosmos { opacity: .08; }
  body.gravity-free .magic-card:nth-child(2n), body.gravity-free .project-card:nth-child(2n) { animation: gravity-free-a 3.7s ease-in-out infinite alternate; }
  body.gravity-free .magic-card:nth-child(2n + 1), body.gravity-free .project-card:nth-child(2n + 1) { animation: gravity-free-b 4.2s ease-in-out infinite alternate; }
  body.reverent button:active::after { content: "✦"; position: absolute; color: var(--gold); animation: reverent-click .6s var(--ease-spring); }
  body.mood-cozy { --violet: #d79873; --violet-bright: #ffd1ad; --cyan: #ffe095; --rose: #ff9eaa; }
  body.mood-feral { --violet: #d854ff; --violet-bright: #f4adff; --cyan: #71ff86; --rose: #ff4a7b; }

  @keyframes aurora-drift { to { transform: translate(8vw, 5vh) scale(1.12); } }
  @keyframes glass-sheen { 0%,75% { transform: translateX(-110%); } 92%,100% { transform: translateX(110%); } }
  @keyframes orb-breathe { 0%,100% { transform: rotate(0) scale(1); } 50% { transform: rotate(14deg) scale(1.06); } }
  @keyframes sneeze { 35% { transform: translate(-4px,2px) rotate(-20deg); } 60% { transform: translate(5px,-3px) rotate(30deg) scale(1.3); } }
  @keyframes badge-sneeze { 55% { transform: translate(22px,-15px) rotate(35deg) scale(.6); opacity: .3; } 100% { transform: translate(40px,4px) scale(0); opacity: 0; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes egg-crack { 25% { transform: rotate(-12deg) scale(1.2); } 55% { transform: rotate(15deg) scale(.8); } 80% { transform: translateY(-6px) scale(1.3); } }
  @keyframes search-oracle { 50% { transform: rotate(18deg) scale(1.16); } }
  @keyframes tail-wag { to { transform: rotate(42deg); } }
  @keyframes dog-bounce { to { transform: translateY(-2px) rotate(-2deg); } }
  @keyframes dog-pant { 50% { transform: scaleY(.93) translateY(1px); } }
  @keyframes caught-wiggle { 20% { transform: rotate(-6deg) scale(1.12); } 45% { transform: rotate(6deg) scale(1.08); } 70% { transform: rotate(-3deg); } }
  @keyframes live-pulse { 50% { opacity: .45; transform: scale(.75); } }
  @keyframes view-arrive { from { opacity: 0; transform: translateY(13px) scale(.99); } }
  @keyframes moon-orbit { to { transform: translate(-80px,18px) scale(.7); } }
  @keyframes cast-comet { 35% { transform: translate(10px,-12px) rotate(-20deg) scale(.75); } 70% { transform: translate(80px,-45px) rotate(-35deg) scale(.2); opacity: 0; } 71% { transform: translate(-18px,12px) scale(.3); } }
  @keyframes reply-arrive { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
  @keyframes reality-spin { to { transform: rotate(360deg); } }
  @keyframes meter-breathe { to { height: 88%; filter: brightness(1.4); } }
  @keyframes postcard-pop { 35% { transform: rotate(-1deg) scale(1.02); } }
  @keyframes plug-charge { to { filter: drop-shadow(0 0 11px currentColor); transform: translateY(-2px); } }
  @keyframes powered-pop { 30% { transform: scale(.94) rotate(-2deg); } 65% { transform: scale(1.04) rotate(1deg); } }
  @keyframes lamp-sun { 30% { transform: scale(1.8) rotate(10deg); text-shadow: 0 0 40px var(--gold); } }
  @keyframes moon-phases { 25% { transform: rotate(90deg) scale(.8); } 50% { transform: rotate(180deg) scale(1.25); } 75% { transform: rotate(270deg) scale(.9); } 100% { transform: rotate(360deg); } }
  @keyframes kettle-shake { 50% { transform: translateX(-3px) rotate(-5deg); } }
  @keyframes synth-bounce { to { transform: translateY(-6px) scaleY(1.2); } }
  @keyframes aura-rotate { to { transform: rotate(360deg); } }
  @keyframes stat-roll { 30% { transform: translateY(-8px); opacity: .2; } 60% { transform: translateY(6px); } }
  @keyframes stat-soar { from { opacity: .1; transform: translateY(18px) scale(.7); } 65% { transform: translateY(-4px) scale(1.12); } }
  @keyframes password-glitch { 50% { transform: translateX(2px); filter: brightness(1.6); } }
  @keyframes account-event-arrive { from { opacity: 0; transform: translateY(-9px) scale(.97); } }
  @keyframes email-arrive { from { opacity: 0; transform: translate(35px,-18px) rotate(4deg); } 70% { transform: translate(-3px,1px) rotate(-1deg); } }
  @keyframes sam-message-pop { 35% { transform: scale(1.035) rotate(-.6deg); border-color: rgba(255,124,186,.25); } }
  @keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(.94); } }
  @keyframes toast-out { to { opacity: 0; transform: translateX(35px) scale(.96); } }
  @keyframes paw-fade { to { opacity: 0; transform: translateY(10px) rotate(var(--paw-rot)) scale(.5); } }
  @keyframes particle-flight { from { opacity: 1; transform: translate(0,0) rotate(0) scale(.7); } to { opacity: 0; transform: translate(var(--particle-x), var(--particle-y)) rotate(var(--particle-rotate)) scale(1.25); } }
  @keyframes dialog-arrive { from { opacity: 0; transform: translateY(22px) scale(.94) rotateX(-8deg); } }
  @keyframes backdrop-in { from { opacity: 0; } }
  @keyframes pretend-progress { 0% { width: 0; } 70% { width: 83%; } 100% { width: 100%; } }
  @keyframes falling-stars { to { transform: translateY(76px); } }
  @keyframes fall-moon-float { to { transform: translate(-14px,18px) rotate(8deg); } }
  @keyframes parachute { 50% { transform: translateX(-50%) translateY(-8px) rotate(1deg); } }
  @keyframes debris-fall { from { transform: translateY(-10vh) rotate(0); } to { transform: translateY(120vh) rotate(460deg); } }
  @keyframes maximum-magic { 0%,100% { filter: hue-rotate(0); } 35% { filter: hue-rotate(110deg) saturate(1.7); transform: scale(1.01); } 70% { filter: hue-rotate(250deg) saturate(1.5); } }
  @keyframes gravity-free-a { to { transform: translateY(-8px) rotate(.8deg); } }
  @keyframes gravity-free-b { to { transform: translateY(7px) rotate(-.7deg); } }
  @keyframes reverent-click { to { transform: translateY(-24px) scale(1.8); opacity: 0; } }
  @keyframes moth-flight { 0% { transform: translate(0,0) rotate(0); } 40% { transform: translate(8px,-7px) rotate(30deg); } 100% { transform: translate(-4px,2px) rotate(-20deg); } }
}

@layer responsive {
  @media (max-width: 1120px) {
    .workspace-shell { grid-template-columns: 250px minmax(0, 1fr); }
    .sidebar { padding-inline: 9px; }
    .thread-slot { grid-template-columns: minmax(0,1fr) 48px; }
    .runaway-dog { width: 44px; }
    .dog-label { display: none; }
    .mischief-grid { grid-template-columns: 1fr 1fr; }
    .mischief-grid .magic-card:last-child { grid-column: 1 / -1; }
    .plug-layout { grid-template-columns: 1fr; }
    .socket-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .profile-layout { grid-template-columns: 1fr; }
    .mood-card { grid-column: auto; }
    .account-prank-card { grid-template-columns: 1fr; }
  }

  @media (max-width: 900px) {
    body { overflow: auto; }
    .app-shell { display: block; height: auto; min-height: calc(100vh - 16px); margin: 8px; width: calc(100vw - 16px); padding-bottom: 64px; overflow: hidden; }
    .topbar { display: grid; grid-template-columns: auto 1fr auto; min-height: 58px; padding: 8px 12px; }
    .window-controls, .unstable-badge, .quantum-caption, .notice-button { display: none; }
    .back-button { grid-column: 1; }
    .brand-lockup { grid-column: 2; justify-self: center; }
    .quantum-area { grid-column: 1 / 3; grid-row: 2; justify-self: stretch; }
    .model-switch { width: 100%; }
    .top-actions { grid-column: 3; grid-row: 1 / 3; }
    .workspace-shell { display: block; }
    .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .hatch-button, .search-field { margin: 0; }
    .thread-section { grid-column: 1 / -1; margin-top: 12px; }
    .thread-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
    .thread-list::-webkit-scrollbar { display: none; }
    .thread-slot { flex: 0 0 250px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
    .primary-nav, .sidebar-bottom { display: none; }
    .main-stage { overflow: visible; }
    .view { min-height: auto; padding: 38px 24px 46px; }
    .mobile-nav { position: fixed; z-index: 200; left: 20px; right: 20px; bottom: 14px; display: grid; grid-template-columns: repeat(4,1fr); min-height: 54px; padding: 5px; background: rgba(18,19,40,.9); border: 1px solid rgba(255,255,255,.11); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.4); backdrop-filter: blur(18px); }
    .mobile-nav-item { display: grid; place-items: center; align-content: center; gap: 2px; color: #72748b; background: transparent; border-radius: 11px; }
    .mobile-nav-item span { font-size: 16px; }
    .mobile-nav-item small { font-size: 7.5px; }
    .mobile-nav-item.is-active { color: var(--violet-bright); background: rgba(157,135,255,.11); }
    .project-grid { grid-template-columns: 1fr; }
    .project-card { min-height: 160px; }
    .identity-card { grid-template-columns: 200px minmax(0,1fr); }
    .familiar { transform: scale(.86); transform-origin: center; }
    .familiar:hover { transform: scale(.88) translateY(-4px); }
  }

  @media (max-width: 650px) {
    .topbar { gap: 6px; }
    .back-button span:last-child, .brand-name { display: none; }
    .brand-lockup { justify-self: start; }
    .update-button span:nth-child(2) { display: none; }
    .update-button { width: 36px; justify-content: center; padding: 0; }
    .sidebar { grid-template-columns: 1fr; }
    .search-field { margin-top: 8px; }
    .view { padding: 31px 16px 40px; }
    .hero-copy h1 { font-size: clamp(37px, 13vw, 55px); }
    .hero-copy p { font-size: 11px; }
    .spell-composer { margin-top: 24px; }
    .mischief-grid { grid-template-columns: 1fr; }
    .mischief-grid .magic-card:last-child { grid-column: auto; }
    .section-title-row { align-items: flex-start; }
    .section-title-row .soft-button { min-width: 80px; white-space: normal; }
    .view-header { align-items: flex-start; flex-direction: column; gap: 18px; }
    .view-header h1 { font-size: 38px; }
    .project-card { grid-template-columns: 110px minmax(0,1fr); min-height: 150px; padding: 14px; }
    .folder-world { transform: scale(.8); transform-origin: left center; }
    .project-copy strong { font-size: 16px; }
    .plug-catalog, .socket-lab { padding: 14px; }
    .plug-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .plug-card { grid-template-columns: 44px minmax(0,1fr); }
    .plug-visual { transform: scale(.82); transform-origin: left center; }
    .socket-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .identity-card { grid-template-columns: 1fr; padding: 20px; }
    .identity-copy { text-align: center; }
    .identity-copy p { margin-inline: auto; }
    .familiar { height: 210px; transform: scale(.8); transform-origin: center top; }
    .familiar:hover { transform: scale(.82) translateY(-4px); }
    .mood-card { display: block; }
    .mood-options { margin: 16px 0 12px; }
    .password-output-row { grid-template-columns: 1fr; }
    .password-button { justify-content: center; }
    .account-event-header { grid-template-columns: 34px minmax(0,1fr); }
    .account-badge { grid-column: 1 / -1; justify-self: start; }
    .tibo-reset-zone:not([hidden]) { grid-template-columns: 1fr; }
    .tibo-reset-button { grid-column: 1; grid-row: auto; justify-self: center; }
    .parody-footer { justify-content: center; text-align: center; }
    .parody-footer button { display: none; }
    .fall-moon { width: 70px; height: 70px; }
    .fall-copy { top: 20%; }
    .cancel-update { bottom: 14%; }
    .magic-dialog form { padding: 22px; }
    .magic-dialog h2 { font-size: 24px; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions button { width: 100%; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
    .aurora { display: none; }
    .app-shell.is-falling .fall-piece { transform: translateY(18px); opacity: .08; }
    .runaway-dog.is-running { transform: translateX(24px); }
  }
}
