/* ==========================================================================================
   HOME - the cool version: the eye that watches you, the comet vortex, crossing tapes, tilt cards
   ========================================================================================== */

/* ---------------------------------------------------------------- the intro: the eye opens */
.intro {
    position: fixed; inset: 0; z-index: 200; pointer-events: none;
    display: none;
}
.js-intro .intro { display: block; pointer-events: auto; cursor: pointer; }
.lid {
    position: absolute; left: -10%; right: -10%; height: 50%; background: #0b0115;
    transition: transform 1.1s cubic-bezier(.7, 0, .2, 1);
}
.lid-top { top: 0; border-radius: 0 0 50% 50% / 0 0 26% 26%; box-shadow: 0 6px 0 rgba(47, 211, 191, 0.55), 0 20px 60px rgba(47, 211, 191, 0.25); }
.lid-bottom { bottom: 0; border-radius: 50% 50% 0 0 / 26% 26% 0 0; box-shadow: 0 -6px 0 rgba(123, 47, 208, 0.6), 0 -20px 60px rgba(123, 47, 208, 0.3); }
.intro-word {
    position: absolute; left: 0; right: 0; top: 50%; translate: 0 -50%; text-align: center;
    font: 700 clamp(1rem, 2.4vw, 1.4rem)/1 var(--serif); letter-spacing: 0.7em; color: var(--cream);
    text-transform: uppercase; padding-left: 0.7em; transition: opacity .35s ease, letter-spacing 1.2s ease;
    text-shadow: 0 0 18px rgba(245, 182, 32, 0.6);
}
.intro.open .lid-top { transform: translateY(-104%); }
.intro.open .lid-bottom { transform: translateY(104%); }
.intro.open .intro-word { opacity: 0; letter-spacing: 1.4em; }
.intro.gone { display: none !important; }

/* ---------------------------------------------------------------- hero */
body.home .hero {
    display: block; width: auto; max-width: none; min-height: calc(100svh - 66px); margin: 0; padding: 0;
    position: relative; overflow: hidden;
}
.vortex { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-glow {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(520px circle at var(--mx, 70%) var(--my, 45%), rgba(47, 211, 191, 0.10), transparent 60%);
}
.hero-inner {
    position: relative; z-index: 2; width: var(--wrap); margin: 0 auto; min-height: calc(100svh - 66px);
    display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 30px; padding: 30px 0 90px;
}
body.home .wordmark { margin: 18px 0 22px; }
body.home .wm-big { display: flex; }
.ch {
    display: inline-block; transform-origin: 50% 85%;
    animation: stamp .7s cubic-bezier(.2, 1.6, .4, 1) both;
    animation-delay: calc(0.25s + var(--i) * 0.09s + var(--intro-delay, 0s));
    transition: transform .25s ease, color .25s ease, text-shadow .25s ease, translate .35s cubic-bezier(.2, 1.5, .4, 1), rotate .35s cubic-bezier(.2, 1.5, .4, 1);
}
.wm-big:hover .ch { transform: translateY(-6px); }
.wm-big:hover .ch:nth-child(2n) { transform: translateY(4px); }
.wm-big .ch:hover { color: var(--gold-hi); text-shadow: 0 0 30px rgba(245, 182, 32, 0.7); }
@keyframes stamp {
    0% { opacity: 0; transform: translateY(-40px) scale(1.8) rotate(-8deg); filter: blur(6px); }
    60% { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: none; }
}
.kicker, .lede, .hero-actions { animation: rise .9s ease both; }
.kicker { animation-delay: calc(0.1s + var(--intro-delay, 0s)); }
.lede { animation-delay: calc(0.8s + var(--intro-delay, 0s)); }
.hero-actions { animation-delay: calc(1s + var(--intro-delay, 0s)); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.btn-gold { position: relative; overflow: hidden; }
.btn-shine {
    position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite 2s;
}
@keyframes shine { 0% { left: -60%; } 30%, 100% { left: 130%; } }

/* the eye */
.eye-stage { position: relative; display: grid; place-items: center; animation: rise 1.2s ease both calc(0.2s + var(--intro-delay, 0s)); }
.eye-halo {
    position: absolute; width: 96%; aspect-ratio: 1; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, rgba(47, 211, 191, 0.45), transparent 30%, rgba(245, 182, 32, 0.4), transparent 60%, rgba(123, 47, 208, 0.55), transparent 85%);
    filter: blur(46px); animation: spin 18s linear infinite;
}
.eye-pic {
    position: relative; width: 94%; aspect-ratio: 953 / 865;
    -webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .3s ease-out;
    animation: drift 9s ease-in-out infinite;
}
.eye-base { width: 100%; height: 100%; }
/* the iris lives in the eye opening only (mask = the shape between the lids) */
.eye-socket {
    position: absolute; inset: 0;
    -webkit-mask: url("../img/eye-mask.png") center / 100% 100% no-repeat;
    mask: url("../img/eye-mask.png") center / 100% 100% no-repeat;
}
.eye-iris {
    position: absolute; left: 37.88%; top: 41.16%; width: 25.81%; height: 28.44%;
    transform: translate(var(--ix, 0px), var(--iy, 0px)) scale(var(--is, 1));
    transition: transform .12s linear;
    will-change: transform;
}
.eye-shine {
    position: absolute; left: 48.55%; top: 52.9%; width: 4.5%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 245, 210, 0.95), rgba(255, 220, 120, 0) 70%);
    transform: translate(var(--ix, 0px), var(--iy, 0px)); transition: transform .12s linear;
    mix-blend-mode: screen; animation: pulse 3s ease-in-out infinite;
}
/* poke the eye */
.eye-pic.blink { animation: eyeblink .42s ease, drift 9s ease-in-out infinite; }
@keyframes eyeblink { 0% { scale: 1 1; } 35% { scale: 1.06 0.08; filter: brightness(2); } 60% { scale: 0.96 1.08; } 100% { scale: 1 1; } }
.eye-shock {
    position: absolute; left: 50%; top: 52%; width: 40%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
    border: 3px solid var(--gold-hi); box-shadow: 0 0 30px var(--gold), inset 0 0 30px rgba(47, 211, 191, 0.6);
    animation: shock 1.1s cubic-bezier(.1, .7, .3, 1) forwards;
}
@keyframes shock { from { opacity: 1; scale: 0.4; } to { opacity: 0; scale: 3.2; border-width: 1px; } }
body.home .scroll-cue { z-index: 3; bottom: 74px; }

/* ---------------------------------------------------------------- crossing tapes */
.tapes { position: relative; height: 150px; margin: -40px 0 0; z-index: 4; pointer-events: none; overflow: hidden; }
.tape-x {
    position: absolute; left: -5%; right: -5%; top: 50%; overflow: hidden;
    border-block: 2px solid rgba(0, 0, 0, 0.6); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.tape-teal { background: var(--teal); transform: translateY(-50%) rotate(-3deg); }
.tape-purple { background: var(--purple); transform: translateY(-50%) rotate(2.4deg); }
.tape-run { display: flex; align-items: center; gap: 26px; width: max-content; padding: 13px 0; animation: tick 34s linear infinite; }
.tape-run.rev { animation-direction: reverse; animation-duration: 40s; }
.tape-x span { font: 900 1.05rem/1 var(--serif); letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.tape-teal span { color: #062824; }
.tape-purple span { color: var(--cream); }
.tape-x i { width: 9px; height: 9px; transform: rotate(45deg); flex: none; }
.tape-teal i { background: #062824; }
.tape-purple i { background: var(--gold); }

/* ---------------------------------------------------------------- giant outline words behind sections */
body.home .made, body.home .crew { position: relative; }
.ghost-word {
    position: absolute; top: 40px; left: -6px; z-index: -1; pointer-events: none;
    font: 900 clamp(5rem, 17vw, 15rem)/0.8 var(--serif); letter-spacing: 0.04em;
    color: transparent; -webkit-text-stroke: 1px rgba(244, 238, 220, 0.07);
    transform: translateY(var(--gy, 0px));
}
.ghost-word.right { left: auto; right: -6px; top: 0; }

/* ---------------------------------------------------------------- tilt card */
body.home .work {
    transform: perspective(1200px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
    transition: transform .25s ease-out, box-shadow .25s ease;
    transform-style: preserve-3d;
}
body.home .work.reveal { transition: transform .25s ease-out, opacity .8s ease, box-shadow .25s ease; }
body.home .work:hover { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 182, 32, 0.25); }
.work-shine {
    position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, 0.10), transparent 55%);
}
.work:hover .work-shine { opacity: 1; }
.work-tags { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.work-tags li {
    padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
    border: 1px solid rgba(47, 211, 191, 0.35); color: var(--teal); background: rgba(47, 211, 191, 0.06);
}
.dots i { font-style: normal; animation: dot 1.4s infinite; opacity: 0.2; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* crew pictures float with the scroll */
.crew-art img { transition: translate .2s linear; translate: 0 var(--fy, 0px); }

/* join: twinkling stars + a slowly turning emblem */
body.home .join { isolation: isolate; }
.join-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
body.home .join-mark { animation: spin 90s linear infinite; transform-origin: 50% 50%; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 920px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; padding: 10px 0 70px; min-height: 0; }
    .eye-stage { order: -1; width: min(400px, 88%); margin: 0 auto; }
    body.home .wm-big { justify-content: center; }
    .tapes { height: 120px; }
}
@media (max-width: 560px) {
    .tape-x span { font-size: 0.85rem; }
    .ghost-word { font-size: 4.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .js-intro .intro { display: none; }
    .ch, .kicker, .lede, .hero-actions, .eye-stage { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---------------------------------------------------------------- workshop timeline */
body.home .log { position: relative; width: var(--wrap); margin: 0 auto; padding: 110px 0 40px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
    background: linear-gradient(var(--teal), var(--purple) 50%, var(--gold));
    box-shadow: 0 0 18px rgba(47, 211, 191, 0.4);
}
.tl-item { position: relative; width: 50%; padding: 0 46px 34px 0; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 34px 46px; }
.tl-node {
    position: absolute; right: -11px; top: 22px; width: 22px; height: 22px; border-radius: 50%;
    background: #0b0115; border: 3px solid var(--c); box-shadow: 0 0 0 5px #140223, 0 0 22px var(--c);
}
.tl-item:nth-child(even) .tl-node { right: auto; left: -11px; }
.tl-item.in .tl-node { animation: nodepop .6s cubic-bezier(.2, 1.8, .4, 1) both; animation-delay: calc(var(--d) + .2s); }
@keyframes nodepop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.tl-card {
    position: relative; padding: 22px 24px; border-radius: 18px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, #1a0830), #12031f 70%);
    border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s;
}
.tl-card:hover { transform: translateY(-6px); box-shadow: 0 26px 50px rgba(0, 0, 0, 0.45), 0 0 30px color-mix(in srgb, var(--c) 30%, transparent); }
.tl-card::before { /* little arrow towards the line */
    content: ""; position: absolute; top: 26px; right: -8px; width: 14px; height: 14px; rotate: 45deg;
    background: #160629; border-top: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-right: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.tl-item:nth-child(even) .tl-card::before { right: auto; left: -8px; rotate: -135deg; }
.tl-tag { display: inline-block; padding: 4px 10px; border-radius: 999px; font: 700 0.72rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: #0b0115; background: var(--c); }
.tl-card h3 { font: 700 1.35rem/1.15 var(--serif); color: var(--cream); margin: 12px 0 8px; }
.tl-card p { margin: 0; color: var(--muted); }
.tl-item.reveal { transform: translateX(-40px); }
.tl-item.reveal:nth-child(even) { transform: translateX(40px); }
.tl-item.reveal.in { transform: none; transition-delay: var(--d); }
.log-more { text-align: center; color: var(--muted); margin-top: 10px; }
.log-more a { color: var(--gold-hi); }

/* ---------------------------------------------------------------- Discord invite card */
.invite {
    position: relative; display: block; width: min(440px, 100%); margin: 30px auto 0; padding: 20px 20px 18px; border-radius: 20px;
    text-align: left; text-decoration: none; color: var(--text); overflow: hidden; isolation: isolate;
    background: linear-gradient(160deg, #22104a, #12031f 70%); border: 1px solid rgba(124, 136, 255, 0.45);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: transform .3s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s;
}
.invite:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 50px rgba(110, 122, 255, 0.35); }
.invite-glow {
    position: absolute; inset: -40%; z-index: -1;
    background: conic-gradient(from 0deg, transparent, rgba(110, 122, 255, 0.35), transparent 30%, rgba(47, 211, 191, 0.3), transparent 60%, rgba(245, 182, 32, 0.25), transparent 85%);
    animation: spin 10s linear infinite; filter: blur(30px); opacity: 0.7;
}
.invite-kicker { display: block; font: 700 0.72rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: #a7b0ff; margin-bottom: 14px; }
.invite-row { display: flex; align-items: center; gap: 16px; }
.invite-icon { width: 64px; height: 58px; object-fit: cover; border-radius: 18px; box-shadow: 0 0 0 3px #12031f, 0 0 0 5px rgba(124, 136, 255, 0.6); }
.invite-info { display: block; min-width: 0; }
.invite-name { display: block; font: 700 1.3rem/1.1 var(--serif); color: var(--cream); }
.invite-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 0.9rem; color: var(--muted); }
.invite-stats > span { display: inline-flex; align-items: center; gap: 6px; }
.invite-stats i { width: 9px; height: 9px; border-radius: 50%; }
.st-on i { background: #3ddc84; box-shadow: 0 0 8px #3ddc84; animation: blink 2s infinite; }
.st-all i { background: #8b93a7; }
.invite-stats em { font-style: normal; font-weight: 700; color: var(--cream); }
.invite-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; padding: 13px; border-radius: 12px;
    background: linear-gradient(#6b77ff, #4752c4); color: #fff; font-weight: 700; letter-spacing: 0.02em;
    box-shadow: 0 5px 0 #262c7a; transition: filter .2s;
}
.invite:hover .invite-btn { filter: brightness(1.12); }
.invite-btn svg { width: 20px; height: 20px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 860px) {
    .timeline::before { left: 11px; }
    .tl-item, .tl-item:nth-child(even) { width: auto; margin-left: 0; padding: 0 0 26px 44px; }
    .tl-node, .tl-item:nth-child(even) .tl-node { left: 0; right: auto; }
    .tl-card::before, .tl-item:nth-child(even) .tl-card::before { right: auto; left: -8px; rotate: -135deg; }
    .tl-item.reveal, .tl-item.reveal:nth-child(even) { transform: translateY(30px); }
}

/* timeline pictures */
.tl-img { margin: -22px -24px 16px; height: 150px; overflow: hidden; border-radius: 17px 17px 0 0; position: relative; }
.tl-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(18, 3, 31, 0.9)); }
.tl-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.tl-card:hover .tl-img img { transform: scale(1.08); }
.tl-card { overflow: visible; }
