*{box-sizing:border-box} :root{color-scheme:dark;--bg:#101722;--panel:#182332;--panel2:#202d3e;--line:#2b394b;--text:#edf2f8;--muted:#9aa9ba;--accent:#9fc4ff;--accent-ink:#10213a;--green:#8dd7b0;--amber:#e7c78a} body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}button,input,textarea,select{font:inherit}button{cursor:pointer}.app-shell{max-width:720px;min-height:100vh;margin:0 auto;padding-bottom:calc(82px + env(safe-area-inset-bottom))}.topbar{height:76px;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:rgba(16,23,34,.96);position:sticky;top:0;z-index:5}.brand{display:flex;align-items:center;gap:10px}.brand-mark{width:38px;height:38px;border-radius:12px;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-weight:800;font-size:13px}.brand-name{font-size:12px;font-weight:800;letter-spacing:1.6px}.brand-subtitle{font-size:11px;color:var(--muted);margin-top:3px}.connection{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:7px}.status-dot{width:7px;height:7px;border-radius:50%;background:var(--green)}.status-dot.offline{background:var(--amber)}main{padding:25px 19px 30px}.screen{display:none;animation:fade .18s ease}.screen.active{display:block}@keyframes fade{from{opacity:.5;transform:translateY(3px)}to{opacity:1;transform:none}}.eyebrow{font-size:10px;letter-spacing:1.8px;color:var(--muted);font-weight:750;margin-bottom:9px}h1{font-size:32px;letter-spacing:-1px;margin:0 0 8px;font-weight:750}h2{font-size:18px;margin:0;font-weight:700}h3{font-size:15px;margin:0 0 8px}.intro{font-size:14px;line-height:1.55;color:var(--muted);margin:0 0 22px}.stats{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin:22px 0 27px}.stat-card,.project-card,.note-card,.settings-card,.empty-panel,.info-panel{background:var(--panel);border:1px solid var(--line);border-radius:16px}.stat-card{padding:15px}.stat-label{display:block;font-size:9px;letter-spacing:1.5px;color:var(--muted);font-weight:750}.stat-card strong{display:block;font-size:28px;margin-top:6px}.section-heading{display:flex;justify-content:space-between;align-items:center;margin:0 0 12px}.text-button{border:0;background:none;color:var(--accent);font-size:12px;font-weight:650;padding:8px}.card-list{display:grid;gap:10px}.project-card{padding:15px;display:flex;gap:12px;align-items:flex-start}.project-symbol{width:39px;height:39px;border-radius:12px;background:var(--panel2);display:grid;place-items:center;color:var(--accent);font-size:17px;flex-shrink:0}.project-main{min-width:0;flex:1}.project-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.project-title{font-size:14px;font-weight:700;overflow-wrap:anywhere}.project-description{font-size:12px;line-height:1.45;color:var(--muted);margin:5px 0 10px}.project-meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.status{font-size:10px;padding:5px 8px;border-radius:20px;background:var(--panel2);color:var(--accent)}.date{font-size:10px;color:var(--muted)}.card-actions{display:flex;gap:6px;margin-top:10px}.mini-button{border:1px solid var(--line);background:transparent;color:var(--muted);padding:6px 9px;border-radius:8px;font-size:10px}.quick-note{width:100%;display:flex;align-items:center;gap:12px;text-align:left;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px;color:var(--text)}.quick-note .plus{font-size:23px;color:var(--accent)}.quick-note strong,.quick-note small{display:block}.quick-note strong{font-size:13px}.quick-note small{font-size:11px;color:var(--muted);margin-top:4px}.chevron{margin-left:auto;color:var(--muted);font-size:22px}.privacy-note{font-size:10px;line-height:1.5;color:var(--muted);margin-top:20px;display:flex;gap:8px}.privacy-note span{color:var(--green)}.screen-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.primary-button{border:0;border-radius:11px;background:var(--accent);color:var(--accent-ink);font-size:12px;font-weight:750;padding:11px 14px;white-space:nowrap}.filter-row{display:flex;gap:7px;overflow:auto;padding:1px 0 15px;margin-bottom:4px}.filter{border:1px solid var(--line);background:transparent;color:var(--muted);border-radius:20px;padding:7px 12px;font-size:11px;white-space:nowrap}.filter.active{background:var(--panel2);border-color:#536a86;color:var(--text)}.note-list{display:grid;gap:10px}.note-card{padding:14px}.note-card h3{font-size:14px;margin:0 0 6px}.note-card p{font-size:12px;color:var(--muted);line-height:1.5;white-space:pre-wrap;margin:0 0 10px}.note-foot{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:10px}.empty-panel{text-align:center;padding:30px 20px;margin:12px 0}.empty-icon{font-size:32px;color:var(--accent);margin-bottom:12px}.empty-panel p,.info-panel p,.settings-card p{font-size:12px;color:var(--muted);line-height:1.6;margin:7px 0 0}.small-pill{display:inline-block;background:var(--panel2);color:var(--muted);font-size:10px;padding:5px 8px;border-radius:20px}.info-panel{padding:15px;margin-top:12px}.info-panel strong{font-size:13px}.settings-card{padding:16px;margin:13px 0}.setting-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}.setting-row:last-child{border-bottom:0}.setting-row strong,.setting-row small{display:block}.setting-row strong{font-size:12px}.setting-row small{font-size:10px;color:var(--muted);margin-top:4px;line-height:1.4}.secondary-button{background:var(--panel2);border:1px solid var(--line);border-radius:10px;color:var(--text);padding:10px 12px;font-size:11px;font-weight:650}.full{width:100%;margin-top:10px}.warning-note{background:#302a20;border:1px solid #594a30;color:#e7c78a;padding:13px;border-radius:12px;font-size:11px;line-height:1.5}.version{text-align:center;color:#718094;font-size:9px;letter-spacing:1.5px;margin-top:22px}.bottom-nav{position:fixed;z-index:10;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,720px);padding:9px 8px calc(9px + env(safe-area-inset-bottom));background:rgba(20,29,42,.97);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);backdrop-filter:blur(16px)}.nav-item{border:0;background:transparent;color:#8291a4;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:9px;padding:4px}.nav-item.selected{color:var(--accent)}.nav-icon{font-size:20px;line-height:22px}.modal{width:min(92vw,460px);border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text);padding:20px;max-height:88vh}.modal::backdrop{background:rgba(0,0,0,.65);backdrop-filter:blur(3px)}.modal form{display:grid;gap:15px}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.modal-head h2{font-size:21px}.close-button{border:0;background:var(--panel2);color:var(--text);width:32px;height:32px;border-radius:50%;font-size:21px}label{display:grid;gap:7px;font-size:11px;color:var(--muted);font-weight:650}input,textarea,select{width:100%;background:#111a26;border:1px solid var(--line);border-radius:10px;color:var(--text);padding:12px;font-size:14px;outline:none}textarea{resize:vertical;line-height:1.5}input:focus,textarea:focus,select:focus{border-color:var(--accent)}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.toast{position:fixed;z-index:20;bottom:calc(90px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%,12px);background:#eaf2ff;color:#14243b;padding:10px 15px;border-radius:20px;font-size:11px;font-weight:700;opacity:0;pointer-events:none;transition:.2s;max-width:90%;text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}.empty-list{padding:25px 15px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:14px;font-size:12px;line-height:1.5}@media(min-width:600px){main{padding:34px 30px}.topbar{padding-left:30px;padding-right:30px}}


/* Full-screen samurai gateway */
.hub-gateway{position:fixed;inset:0;z-index:1000;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:calc(24px + env(safe-area-inset-top)) 24px calc(26px + env(safe-area-inset-bottom));background:radial-gradient(ellipse at 50% 48%,#151012 0%,#08090c 48%,#020304 100%);color:#e8ddd0;isolation:isolate;transition:background 1s ease,opacity .55s ease}
.hub-gateway::before{content:"";position:absolute;inset:0;z-index:-2;opacity:.42;background:radial-gradient(ellipse at 50% 33%,rgba(94,18,22,.17),transparent 42%),radial-gradient(ellipse at 50% 100%,rgba(45,45,52,.16),transparent 44%)}
.gateway-title{font-family:Georgia,serif;font-size:12px;letter-spacing:.42em;color:#9e8b80;margin-top:clamp(12px,4vh,42px);text-align:center;text-shadow:0 0 18px rgba(125,20,24,.35)}
.gateway-awaken{position:relative;display:block;width:min(88vw,430px);height:min(58vh,440px);min-height:270px;margin:clamp(12px,3vh,30px) auto 0;padding:0;border:0;background:transparent;touch-action:manipulation;isolation:isolate;z-index:2}
.gateway-sprite{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;filter:brightness(.58) contrast(1.28) saturate(.78) drop-shadow(0 22px 24px rgba(0,0,0,.92));transition:opacity .65s ease,transform .85s cubic-bezier(.2,.7,.2,1),filter .8s ease}
.gateway-sprite.resting-sprite{opacity:1;animation:deep-meditate 6s ease-in-out infinite}
.gateway-sprite.awake-sprite{opacity:0;transform:translateY(18px) scale(.94);filter:brightness(.82) contrast(1.3) drop-shadow(0 20px 28px rgba(0,0,0,.95))}
.gateway-aura{position:absolute;inset:26% 18% 10%;border-radius:50%;background:radial-gradient(ellipse,rgba(91,10,15,.14),rgba(0,0,0,0) 72%);filter:blur(24px);z-index:-1;transition:all .8s ease}
.gateway-tap-hint{position:absolute;bottom:1px;left:50%;transform:translateX(-50%);font-size:9px;letter-spacing:.32em;color:#76665f;white-space:nowrap;text-shadow:0 2px 8px #000;opacity:.8;transition:opacity .3s}
.gateway-prompt{font-family:Georgia,serif;font-style:italic;font-size:14px;letter-spacing:.04em;color:#766d68;text-align:center;margin-top:2px;transition:opacity .35s,transform .35s}
.gateway-smoke{position:absolute;z-index:-1;pointer-events:none;width:90vw;height:50vh;filter:blur(38px);opacity:.17;background:radial-gradient(ellipse at 20% 50%,rgba(105,105,116,.42),transparent 48%),radial-gradient(ellipse at 75% 45%,rgba(64,65,75,.55),transparent 46%);animation:smoke-drift 15s ease-in-out infinite alternate}
.smoke-one{top:16%;left:-38%}.smoke-two{bottom:2%;right:-40%;animation-delay:-7s;opacity:.12}
.gateway-embers{position:absolute;inset:0;pointer-events:none;opacity:.34;background-image:radial-gradient(circle,rgba(179,42,34,.8) 1px,transparent 2px),radial-gradient(circle,rgba(112,35,32,.65) 1px,transparent 2px);background-size:113px 157px,181px 211px;background-position:12px 30px,78px 91px;mask-image:linear-gradient(transparent,#000 20%,#000 85%,transparent)}
.gateway-menu{width:min(100%,430px);margin-top:clamp(2px,1vh,12px);opacity:0;visibility:hidden;transform:translateY(20px);transition:opacity .65s ease,transform .75s ease,visibility .7s;pointer-events:none;text-align:center}
.gateway-question{font-family:Georgia,serif;font-size:13px;letter-spacing:.32em;color:#c4ada0;margin:0 0 17px;text-shadow:0 0 16px rgba(155,29,29,.3)}
.gateway-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.gateway-choice{min-height:52px;border:1px solid rgba(112,54,52,.55);border-radius:3px;background:linear-gradient(145deg,rgba(26,23,25,.94),rgba(7,8,10,.98));color:#d6c4b5;text-align:left;padding:10px 13px;font-family:Georgia,serif;font-size:14px;letter-spacing:.04em;box-shadow:inset 0 0 18px rgba(100,18,20,.07),0 8px 18px rgba(0,0,0,.28);transition:background .18s,border-color .18s,transform .18s}
.gateway-choice span{display:inline-block;margin-right:9px;color:#9c4b43;font-size:10px;letter-spacing:.12em}
.gateway-choice:active,.gateway-choice.selected{border-color:#a33b35;background:linear-gradient(145deg,rgba(72,20,22,.96),rgba(14,10,12,.99));transform:translateY(-2px);box-shadow:0 0 22px rgba(141,27,28,.22)}
.gateway-overview{grid-column:1/-1;text-align:center}
.gateway-footer{margin-top:17px;font-size:8px;letter-spacing:.25em;color:#5e5552}
.hub-gateway.awakening{background:#000}
.hub-gateway.awakening .gateway-smoke{opacity:.72;filter:blur(25px);transform:scale(1.35)}
.hub-gateway.awakening .gateway-sprite{opacity:0;transform:scale(.9);filter:brightness(0) blur(8px)}
.hub-gateway.awakening .gateway-prompt,.hub-gateway.awakening .gateway-title{opacity:0;transform:translateY(-10px)}
.hub-gateway.awake .resting-sprite{opacity:0;animation:none;transform:translateY(12px) scale(.94)}
.hub-gateway.awake .awake-sprite{opacity:1;transform:translateY(0) scale(1);filter:brightness(.82) contrast(1.35) drop-shadow(0 20px 28px rgba(0,0,0,.95))}
.hub-gateway.awake .gateway-aura{background:radial-gradient(ellipse,rgba(130,13,18,.28),transparent 72%);transform:scale(1.3)}
.hub-gateway.awake .gateway-tap-hint,.hub-gateway.awake .gateway-prompt{opacity:0}
.hub-gateway.awake .gateway-menu{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto}
.hub-gateway.leaving{opacity:0;pointer-events:none}
body.hub-open{overflow:hidden}
@keyframes deep-meditate{0%,100%{transform:translateY(0);filter:brightness(.52) contrast(1.35) saturate(.72) drop-shadow(0 22px 24px rgba(0,0,0,.95))}50%{transform:translateY(-3px);filter:brightness(.61) contrast(1.38) saturate(.78) drop-shadow(0 24px 27px rgba(0,0,0,.98))}}
@keyframes smoke-drift{from{transform:translate3d(-2%,0,0) rotate(-4deg)}to{transform:translate3d(4%,-5%,0) rotate(5deg)}}
@media(max-height:700px){.gateway-awaken{height:43vh;min-height:210px}.gateway-menu{margin-top:0}.gateway-choice{min-height:44px;padding:8px 10px}}
@media(min-width:600px){.gateway-awaken{height:min(58vh,500px)}}
@media(prefers-reduced-motion:reduce){.gateway-sprite.resting-sprite,.gateway-smoke{animation:none}.gateway-sprite,.gateway-menu,.hub-gateway{transition:none}}

/* Responsive gaze and perspective sword target */
.sword-aim{position:absolute;inset:0;width:100%;height:100%;z-index:6;overflow:visible;pointer-events:none;opacity:0;transition:opacity .35s ease}
.hub-gateway.awake .sword-aim{opacity:1}
.sword-aim path{stroke-linecap:round;stroke-linejoin:round}
#swordShadow{fill:rgba(0,0,0,.78);filter:blur(5px)}
#swordBlade{fill:url(#bladeGradient);stroke:#b69a84;stroke-width:1.2;filter:drop-shadow(0 0 7px rgba(160,35,30,.45))}
#swordEdge{fill:none;stroke:rgba(255,225,195,.9);stroke-width:1.4}
.hub-gateway.awake .awake-sprite{transform:translate(var(--gaze-x,0px),var(--gaze-y,0px)) scale(1)}
.gateway-choice{position:relative;z-index:5;transform-style:preserve-3d}
.gateway-choice.selected{box-shadow:0 0 0 1px rgba(198,53,45,.5),0 0 30px rgba(165,28,25,.28),inset 0 0 20px rgba(160,28,25,.2)}
@media(prefers-reduced-motion:reduce){.sword-aim{transition:none}}


/* Samurai Gateway 0.5 — deliberate, unhurried pacing */
.hub-gateway{transition:background 2.2s ease,opacity 1.35s ease;}
.gateway-sprite{transition:opacity 1.9s ease,transform 2.1s cubic-bezier(.18,.68,.18,1),filter 2s ease;}
.gateway-sprite.resting-sprite{animation-duration:10s;}
.gateway-smoke{animation-duration:24s;transition:opacity 2.4s ease,filter 2.4s ease,transform 3s ease;}
.gateway-aura{transition:all 2s ease;}
.gateway-tap-hint{transition:opacity 1.1s ease;}
.gateway-prompt{transition:opacity 1.2s ease,transform 1.2s ease;}
.gateway-menu{transition:opacity 1.65s ease 0.65s,transform 1.9s cubic-bezier(.18,.68,.18,1) 0.55s,visibility 0s linear 0s;}
.gateway-question{opacity:0;transform:translateY(9px);transition:opacity 1.2s ease 1.05s,transform 1.5s ease 1.05s;}
.gateway-options .gateway-choice{opacity:0;transform:translateY(12px);transition:opacity 1.1s ease,transform 1.3s cubic-bezier(.18,.68,.18,1),background 1s ease,border-color 1s ease,box-shadow 1s ease;}
.hub-gateway.awake .gateway-question{opacity:1;transform:translateY(0);}
.hub-gateway.awake .gateway-options .gateway-choice{opacity:1;transform:translateY(0);}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(1){transition-delay:1.2s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(2){transition-delay:1.55s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(3){transition-delay:1.9s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(4){transition-delay:2.25s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(5){transition-delay:2.6s}
.gateway-choice:active,.gateway-choice.selected{transition-duration:1.1s;transform:translateY(-2px)}
.sword-aim{transition:opacity 1.2s ease;}
.hub-gateway.awake .awake-sprite{transition:transform 1.7s cubic-bezier(.2,.7,.2,1),filter 1.7s ease,opacity 1.8s ease;}
.hub-gateway.leaving{transition:opacity 1.35s ease;}
@media(prefers-reduced-motion:reduce){.gateway-sprite.resting-sprite,.gateway-smoke{animation:none}.gateway-sprite,.gateway-menu,.hub-gateway,.gateway-question,.gateway-options .gateway-choice,.gateway-smoke,.gateway-aura,.gateway-prompt,.gateway-tap-hint,.sword-aim{transition:none!important}}

/* Samurai Gateway 0.6 — hide the workspace completely until awakening is complete. */
body.hub-open main,
body.hub-open .topbar,
body.hub-open .bottom-nav{visibility:hidden;opacity:0;pointer-events:none}
.hub-gateway{background:#000;transition:background .9s ease,opacity .7s ease}
.gateway-title,.gateway-prompt,.gateway-menu{visibility:hidden}
.hub-gateway.awake .gateway-title,
.hub-gateway.awake .gateway-prompt,
.hub-gateway.awake .gateway-menu{visibility:visible}
.hub-gateway.awakening .gateway-menu{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
.hub-gateway.awakening .gateway-title,
.hub-gateway.awakening .gateway-prompt{opacity:0!important;visibility:hidden!important}
.hub-gateway.awakening{background:#000}
.gateway-smoke{transition:opacity 1s ease,filter 1s ease,transform 1.2s ease;animation-duration:18s}
.gateway-sprite{transition:opacity .7s ease,transform .9s cubic-bezier(.2,.7,.2,1),filter .8s ease}
.gateway-menu{transition:opacity .55s ease .15s,transform .65s cubic-bezier(.18,.68,.18,1) .12s,visibility 0s linear .15s}
.gateway-question{opacity:0;transform:translateY(6px);transition:opacity .5s ease .25s,transform .55s ease .25s}
.gateway-options .gateway-choice{opacity:0;transform:translateY(8px);transition:opacity .45s ease,transform .5s cubic-bezier(.18,.68,.18,1),background .35s ease,border-color .35s ease,box-shadow .35s ease}
.hub-gateway.awake .gateway-question{opacity:1;transform:translateY(0)}
.hub-gateway.awake .gateway-options .gateway-choice{opacity:1;transform:translateY(0)}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(1){transition-delay:.28s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(2){transition-delay:.42s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(3){transition-delay:.56s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(4){transition-delay:.70s}
.hub-gateway.awake .gateway-options .gateway-choice:nth-child(5){transition-delay:.84s}
.sword-aim{z-index:6;transition:opacity .35s ease}
.hub-gateway.awake .awake-sprite{transition:transform .55s cubic-bezier(.2,.7,.2,1),filter .55s ease,opacity .55s ease}
.gateway-choice:active,.gateway-choice.selected{transition-duration:.35s;transform:translateY(-2px)}
.hub-gateway.leaving{transition:opacity .65s ease}
@media(prefers-reduced-motion:reduce){body.hub-open main,body.hub-open .topbar,body.hub-open .bottom-nav{transition:none}.gateway-sprite,.gateway-menu,.hub-gateway,.gateway-question,.gateway-options .gateway-choice,.gateway-smoke,.gateway-aura,.gateway-prompt,.gateway-tap-hint,.sword-aim{transition:none!important}}
