*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

  /* Layout: one dark stage. 3D logo forges at center, then docks at the top; links are forged under it, single column. */
  :root {
    --void: #07040d;
    --card: #110a1f;
    --ink: #f2ecff;
    --muted: #a99bc4;
    --violet: #8b2cf5;
    --violet-deep: #4b1283;
    --brand: #7b30ca;
    --line: rgba(167, 112, 255, .32);
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --logo-space: 180px;
    --vh: 100vh;
    color-scheme: dark;
  }
  html, body { background: var(--void); color: var(--ink); }
  body { font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  html.intro body { overflow: hidden; }

  #gl { position: absolute; inset: 0 0 auto 0; width: 100%; height: var(--vh); display: block; z-index: 0; touch-action: pan-y; }

  .panel {
    position: relative; z-index: 1;
    max-width: 460px; margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: var(--logo-space) 40px;
    display: flex; flex-direction: column; gap: 22px;
  }
  .fallback { width: 104px; margin: 0 auto -6px; }
  .head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
  .name { margin: 0; font-size: clamp(28px, 7.5vw, 34px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; text-wrap: balance; }
  .name span { display: inline-block; white-space: pre; }
  .role { margin: 0; color: var(--muted); font-size: 15px; text-wrap: balance; }
  .role b { color: #c9a3ff; font-weight: 600; }

  .links { display: flex; flex-direction: column; gap: 12px; }
  .link {
    --cut: 12px;
    position: relative; display: flex; align-items: center; gap: 14px;
    min-height: 64px; padding: 12px 18px;
    color: var(--ink); text-decoration: none;
    background: var(--line);
    clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
    transition: background .2s ease, transform .2s ease;
  }
  .link::before {
    content: ""; position: absolute; inset: 1px; z-index: 0;
    background: var(--card);
    clip-path: polygon(calc(var(--cut) - .5px) 0, calc(100% - var(--cut) + .5px) 0, 100% calc(var(--cut) - .5px), 100% calc(100% - var(--cut) + .5px), calc(100% - var(--cut) + .5px) 100%, calc(var(--cut) - .5px) 100%, 0 calc(100% - var(--cut) + .5px), 0 calc(var(--cut) - .5px));
    transition: background .2s ease;
  }
  .link > * { position: relative; z-index: 1; }
  a.link:hover, a.link:focus-visible { background: #b685ff; transform: translateY(-1px); }
  a.link:hover::before { background: #170d2a; }
  a.link:focus-visible { outline: none; }
  .link.primary { background: #a46bff; }
  .link.primary::before { background: var(--brand); }
  a.link.primary:hover::before { background: #8a3fe0; }

  .ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; color: #c9a3ff; }
  .primary .ico { color: #fff; }
  .ico svg { width: 22px; height: 22px; }
  .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .txt strong { font-weight: 600; font-size: 16px; }
  .txt small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
  .primary .txt small { color: #e6d6ff; }
  .go { width: 18px; height: 18px; flex: none; opacity: .6; }
  .copy {
    flex: none; font: 600 13px/1 var(--font); color: var(--ink);
    background: transparent; border: 1px solid var(--line); padding: 9px 12px; cursor: pointer;
  }
  .copy:hover, .copy:focus-visible { border-color: #b685ff; outline: none; }

  .foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding-top: 6px; }
  .ghost { font: 500 13px/1 var(--font); color: var(--muted); background: none; border: 0; padding: 8px 0; cursor: pointer; }
  .ghost:hover, .ghost:focus-visible { color: var(--ink); outline: none; text-decoration: underline; text-underline-offset: 4px; }

  #skip {
    position: fixed; z-index: 6;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    right: max(16px, calc(env(safe-area-inset-right, 0px) + 16px));
    font: 500 13px/1 var(--font); letter-spacing: .04em; color: var(--muted);
    background: rgba(17, 10, 31, .6); border: 1px solid var(--line); padding: 9px 14px; cursor: pointer;
  }
  #skip:hover, #skip:focus-visible { color: var(--ink); border-color: #b685ff; outline: none; }
  html:not(.intro) #skip { display: none; }

  /* Reveal choreography: only hidden while JS is running the intro. */
  html.boot:not(.ready) .reveal { opacity: 0; }
  html.boot:not(.ready) .panel { pointer-events: none; } /* hidden links must not catch taps meant for the block */
  /* whole reveal (name, role, links, footer) settles within ~1s */
  .ready .name span { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 18ms); }
  .ready .role { animation: fade .35s ease both .2s; }
  .ready .link { animation: forge .45s cubic-bezier(.7, 0, .2, 1) both; animation-delay: calc(.2s + var(--i) * 60ms); }
  .ready .link > * { animation: fade .3s ease both; animation-delay: calc(.45s + var(--i) * 60ms); }
  .ready .foot { animation: fade .35s ease both .65s; }
  @keyframes rise { from { opacity: 0; transform: translateY(.5em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes forge {
    0% { transform: scale(0, .04); filter: brightness(3.5); }
    45% { transform: scale(1, .04); filter: brightness(3); }
    100% { transform: none; filter: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ready .name span, .ready .role, .ready .link, .ready .link > *, .ready .foot { animation: none; }
  }

  /* v2: paper stage before the click */
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; }
  [hidden] { display: none !important; }
  html.intro:not(.started), html.intro:not(.started) body { background: #f6f4f9; }
  html:not(.started) #skip { display: none; }
  html:not(.dark) #skip { color: #3d3352; background: rgba(255, 255, 255, .75); border-color: rgba(61, 51, 82, .25); }
  #hint {
    position: fixed; z-index: 6; left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 13vh);
    display: flex; align-items: center; gap: 12px;
    font: 500 15px/1 var(--font); letter-spacing: .02em; color: #3d3352;
    background: none; border: 0; padding: 10px 14px; cursor: pointer;
    transition: opacity .3s ease;
  }
  #hint:focus-visible { outline: 2px solid #8b2cf5; outline-offset: 2px; }
  #hint .dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #8b2cf5; }
  #hint .dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #8b2cf5; animation: ping 1.6s ease-out infinite; }
  @keyframes ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
  html.started #hint { opacity: 0; pointer-events: none; }
  @media (prefers-reduced-motion: reduce) { #hint .dot::after { animation: none; } }
