/* Riadom home — motion layer.
   One cinematic intro per session, a hero scene with depth, a feed of looping
   feature clips, living space cards and board covers. Loops animate transform
   and opacity only and stop off-screen, in hidden tabs, on hover where noted,
   and completely under reduced motion. */
:root {
  --ease-expo:cubic-bezier(.16,1,.3,1);
  --ease-pop:cubic-bezier(.34,1.56,.64,1);
  --ease-drawer:cubic-bezier(.32,.72,0,1);
  --note-shadow:0 1px 0 rgb(34 32 43 / .06),0 8px 18px -10px rgb(34 32 43 / .35);
}

/* ---------- hero ---------- */
.home-hero {margin-bottom:22px}
.home-hero-note {margin:16px 0 0;font-size:13px;color:var(--muted)}
.home-content .home-hero h1 .hw {display:inline-block}
.hero-scene {position:relative;padding:28px 18px 26px;isolation:isolate}
.hero-scene::before {content:"";position:absolute;inset:-40px -60px -50px -40px;z-index:-1;pointer-events:none;
  background:radial-gradient(circle,rgb(107 63 230 / .22) 1.1px,transparent 1.4px) 0 0/22px 22px;
  -webkit-mask:radial-gradient(ellipse 60% 60% at 55% 50%,#000 30%,transparent 75%);mask:radial-gradient(ellipse 60% 60% at 55% 50%,#000 30%,transparent 75%)}
.hs-board {position:relative;z-index:1}
.hs-board .home-live-board {transform-origin:50% 60%}
.hs-float {position:absolute;z-index:2;pointer-events:none}
.hs-bob {display:flex;align-items:center;gap:8px}
.hs-note {z-index:0}
.hs-note .hs-bob {width:96px;height:78px;padding:10px;align-items:flex-start;font:600 12px/1.3 var(--font-ui);color:var(--ink);box-shadow:var(--note-shadow)}
.hs-note-a {top:-10px;left:-34px}
.hs-note-a .hs-bob {background:#ffd84d;rotate:-7deg}
.hs-note-b {right:-26px;bottom:-22px}
.hs-note-b .hs-bob {background:#b8ecd2;rotate:6deg}
.hs-toolbar {left:-4px;top:38%}
.hs-toolbar .hs-bob {flex-direction:column;gap:2px;padding:5px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px rgb(34 32 43 / .06),var(--e2)}
.hs-toolbar span {display:grid;place-items:center;width:32px;height:32px;border-radius:9px;color:var(--ink-2)}
.hs-toolbar span:first-child {background:var(--accent-soft);color:var(--accent)}
.hs-toolbar svg {width:18px;height:18px}
.hs-people {right:36px;top:-6px}
.hs-people .hs-bob,.hs-toast .hs-bob {padding:7px 12px 7px 8px;border-radius:999px;background:#fff;font:600 12px var(--font-ui);color:var(--ink);box-shadow:0 0 0 1px rgb(34 32 43 / .06),var(--e2);white-space:nowrap}
.hs-faces {display:flex}
.hs-faces i {display:grid;place-items:center;width:22px;height:22px;margin-left:-6px;border:2px solid #fff;border-radius:50%;color:#fff;font:700 10px var(--font-ui);font-style:normal}
.hs-faces i:first-child {margin-left:0}
.hs-toast {left:12%;bottom:2px}
.hs-spark {display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--accent);color:#fff}
.hs-spark svg {width:14px;height:14px}
.hs-you {position:absolute;left:0;top:0;z-index:3;display:flex;align-items:flex-start;gap:2px;opacity:0;pointer-events:none;transition:opacity 160ms ease}
.hs-you.on {opacity:1}
.hs-you svg {width:15px;height:15px}
.hs-you span {margin-top:12px;padding:2px 7px;border-radius:999px;background:var(--accent);color:#fff;font:650 11px var(--font-ui)}

@media (prefers-reduced-motion:no-preference) {
  .hs-float .hs-bob {animation:hs-bob var(--bob,6s) ease-in-out infinite alternate}
  .hs-note-a .hs-bob {--bob:6.5s}
  .hs-note-b .hs-bob {--bob:7.3s;animation-delay:-2s}
  .hs-toolbar .hs-bob {--bob:5.6s;animation-delay:-1s}
  .hs-people .hs-bob {--bob:6.1s;animation-delay:-3s}
  .hs-toast .hs-bob {animation:hs-toast 14s var(--ease-expo) infinite}
  .hero-scene[data-paused] .hs-bob {animation-play-state:paused}

  /* One cinematic intro per session. */
  .home-hero[data-intro] h1 .hw {animation:hw-in 900ms var(--ease-expo) both;animation-delay:calc(120ms + var(--i) * 70ms)}
  .home-hero[data-intro] .home-hero-lead {animation:rise-in 800ms 520ms var(--ease-expo) both}
  .home-hero[data-intro] .home-hero-actions > * {animation:pop-in 620ms var(--ease-pop) both}
  .home-hero[data-intro] .home-hero-actions > :nth-child(1) {animation-delay:680ms}
  .home-hero[data-intro] .home-hero-actions > :nth-child(2) {animation-delay:760ms}
  .home-hero[data-intro] .home-hero-note {animation:rise-in 700ms 880ms var(--ease-expo) both}
  .home-hero[data-intro] .hs-board {animation:board-in 1100ms 200ms var(--ease-expo) both}
  .home-hero[data-intro] .hs-note-a {animation:fly-a 1000ms 650ms var(--ease-pop) both}
  .home-hero[data-intro] .hs-note-b {animation:fly-b 1000ms 760ms var(--ease-pop) both}
  .home-hero[data-intro] .hs-toolbar {animation:fly-l 800ms 900ms var(--ease-expo) both}
  .home-hero[data-intro] .hs-people {animation:pop-in 700ms 1000ms var(--ease-pop) both}
  .home-hero[data-intro] ~ .home-news {animation:rise-in 800ms 1050ms var(--ease-expo) both}
}
@keyframes hs-bob {from {transform:translateY(-5px)} to {transform:translateY(5px)}}
@keyframes hs-toast {0%,48% {opacity:0;transform:translateY(14px) scale(.96)} 54%,88% {opacity:1;transform:none} 94%,100% {opacity:0;transform:translateY(-6px)}}
@keyframes hw-in {from {opacity:0;transform:translateY(.55em) rotate(2deg);filter:blur(6px)} to {opacity:1;transform:none;filter:blur(0)}}
@keyframes rise-in {from {opacity:0;transform:translateY(18px)} to {opacity:1;transform:none}}
@keyframes pop-in {from {opacity:0;transform:scale(.8)} to {opacity:1;transform:none}}
@keyframes board-in {from {opacity:0;transform:perspective(1200px) rotateX(14deg) translateY(40px) scale(.94)} to {opacity:1;transform:none}}
@keyframes fly-a {from {opacity:0;transform:translate(-80px,-60px) rotate(-30deg) scale(.6)} to {opacity:1;transform:none}}
@keyframes fly-b {from {opacity:0;transform:translate(80px,70px) rotate(30deg) scale(.6)} to {opacity:1;transform:none}}
@keyframes fly-l {from {opacity:0;transform:translateX(-40px)} to {opacity:1;transform:none}}

/* ---------- motion feed ---------- */
.feed {margin:8px 0 52px}
.feed-head {display:flex;align-items:flex-end;justify-content:space-between;gap:16px 24px;flex-wrap:wrap;margin-bottom:18px}
.feed-head h2 {margin:0 0 4px;font:750 clamp(24px,2.6vw,32px)/1.1 var(--font-display);letter-spacing:-.035em;color:var(--ink)}
.feed-lead {margin:0;max-width:56ch;color:var(--muted);font-size:14px}
.feed-tabs {display:flex;gap:2px;padding:3px;border-radius:12px;background:#ebeaef}
.feed-tab {min-height:32px;padding:0 14px;border-radius:9px;font-weight:600;font-size:13px;color:var(--ink-2);transition:background-color 160ms var(--ease-out),color 160ms,box-shadow 160ms}
.feed-tab:hover {color:var(--ink)}
.feed-tab[aria-selected=true] {background:#fff;color:var(--ink);box-shadow:0 1px 2px rgb(34 32 43 / .1),0 0 0 1px rgb(34 32 43 / .04)}
.feed-tab:focus-visible {outline:2px solid var(--accent);outline-offset:2px}

.feed-grid {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:24px 18px}
.feed-card {grid-column:span 2}
.feed-card {min-width:0;display:flex;flex-direction:column;gap:10px}
.feed-card.wide {grid-column:span 3}
.feed-card[hidden] {display:none}
.feed-media {position:relative;display:block;width:100%;padding:0;border:0;border-radius:18px;overflow:hidden;cursor:zoom-in;
  background:#f6f6f8 radial-gradient(circle,#d6d7de 1px,transparent 1.3px) 0 0/16px 16px;
  box-shadow:0 0 0 1px rgb(34 32 43 / .07),0 14px 30px -22px rgb(34 32 43 / .45);
  transition:transform 260ms var(--ease-expo),box-shadow 260ms var(--ease-expo)}
.feed-stage {aspect-ratio:16/10}
.feed-stage .mc-svg {display:block;width:100%;height:100%}
.mc-t {font-family:var(--font-ui)}
.mc-draw {stroke-dasharray:1 1}
.feed-media:hover {transform:translateY(-3px);box-shadow:0 0 0 1px rgb(107 63 230 / .22),0 22px 40px -24px rgb(34 32 43 / .5)}
.feed-media:active {transform:translateY(-1px) scale(.995);transition-duration:90ms}
.feed-media:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
.feed-progress {position:absolute;left:14px;right:14px;bottom:10px;height:3px;border-radius:3px;background:rgb(34 32 43 / .08);overflow:hidden;opacity:0;transition:opacity 200ms}
.feed-progress > span {display:block;height:100%;background:var(--accent);transform-origin:left center;transform:scaleX(0)}
.feed-card.playing .feed-progress,.feed-media:hover .feed-progress {opacity:1}
.feed-zoom {position:absolute;top:10px;right:10px;display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:rgb(255 255 255 / .92);color:var(--ink);
  box-shadow:0 0 0 1px rgb(34 32 43 / .06),var(--e1);opacity:0;transform:scale(.85);transition:opacity 180ms,transform 220ms var(--ease-pop)}
.feed-zoom svg {width:16px;height:16px}
.feed-media:hover .feed-zoom,.feed-media:focus-visible .feed-zoom {opacity:1;transform:none}
.feed-meta {display:flex;align-items:flex-start;gap:10px;padding:0 4px}
.feed-text {flex:1;min-width:0}
.feed-text h3 {margin:0 0 2px;font:650 15px/1.3 var(--font-ui);color:var(--ink);letter-spacing:-.01em}
.feed-text p {margin:0;font-size:13px;line-height:1.45;color:var(--muted)}
.feed-toggle {flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:999px;color:var(--ink-2);background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
.feed-toggle:hover {color:var(--ink);box-shadow:inset 0 0 0 1px var(--line-strong)}
.feed-toggle svg {width:14px;height:14px}
.feed-toggle[aria-pressed=true] {background:var(--accent);color:#fff;box-shadow:none}
@media (prefers-reduced-motion:no-preference) {
  .feed-card {opacity:0;transform:translateY(26px) scale(.985)}
  .feed-card.in {opacity:1;transform:none;transition:opacity 600ms var(--ease-expo),transform 800ms var(--ease-expo);transition-delay:calc(var(--i) * 55ms)}
  ::view-transition-group(*) {animation-duration:420ms;animation-timing-function:var(--ease-expo)}
}

/* Lightbox player */
.feed-lightbox {position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:24px}
.feed-lightbox[hidden] {display:none}
.feed-lb-backdrop {position:absolute;inset:0;background:rgb(24 22 32 / .55);backdrop-filter:blur(10px) saturate(1.1)}
.feed-lb-panel {position:relative;width:min(980px,100%);padding:14px;border-radius:24px;background:#fff;box-shadow:0 40px 80px -30px rgb(0 0 0 / .5)}
.feed-lb-frame {position:relative;border-radius:16px;overflow:hidden;background:#f6f6f8 radial-gradient(circle,#d6d7de 1px,transparent 1.3px) 0 0/20px 20px}
.feed-lb-frame .feed-stage {aspect-ratio:16/10}
.feed-lb-frame .feed-progress {opacity:1}
.feed-lb-meta {display:flex;align-items:center;gap:16px;padding:14px 6px 4px}
.feed-lb-meta h3 {font-size:18px}
.feed-lb-controls {display:flex;align-items:center;gap:4px}
.feed-lb-count {margin-right:8px;color:var(--faint);font-size:13px;font-variant-numeric:tabular-nums}
.feed-lb-btn {display:grid;place-items:center;width:38px;height:38px;border-radius:12px;color:var(--ink-2)}
.feed-lb-btn:hover {background:var(--hover);color:var(--ink)}
.feed-lb-btn svg {width:18px;height:18px}
.feed-lb-close {position:absolute;top:22px;right:22px;background:rgb(255 255 255 / .92);box-shadow:var(--e1)}
html.feed-lb-open {overflow:hidden}

/* ---------- spaces ---------- */
.spaces-section {margin:8px 0 44px}
.spaces-section .section-heading {margin-bottom:12px}
.spaces-lead {margin:-4px 0 14px;color:var(--muted);font-size:14px}
.spaces-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.space-card {position:relative;display:grid;grid-template-rows:96px auto auto;gap:2px;padding:12px 12px 14px;border-radius:18px;text-align:left;background:#fff;
  box-shadow:0 0 0 1px rgb(34 32 43 / .07),0 10px 24px -20px rgb(34 32 43 / .45);transition:transform 240ms var(--ease-expo),box-shadow 240ms var(--ease-expo)}
.space-card:hover {transform:translateY(-3px);box-shadow:0 0 0 1px rgb(107 63 230 / .2),0 18px 34px -22px rgb(34 32 43 / .5)}
.space-card:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
.sc-art {position:relative;margin-bottom:10px;border-radius:12px;overflow:hidden;background:color-mix(in srgb,var(--tint) 28%,#fff)}
.sc-note {position:absolute;width:42px;height:36px;left:calc(18% + var(--k) * 15%);top:calc(22% + (var(--k) * 7%));rotate:var(--r);box-shadow:var(--note-shadow);transition:transform 320ms var(--ease-pop)}
.space-card:hover .sc-note {transform:translate(calc((var(--k) - 1.5) * 9px),calc(-4px - var(--k) * 2px)) rotate(calc(var(--r) * -1))}
.sc-name {font:650 15px/1.3 var(--font-ui);color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-count {font-size:12.5px;color:var(--muted)}
.space-new {background:transparent;box-shadow:inset 0 0 0 1.5px var(--line-strong);border:0}
.space-new .sc-plus {display:grid;place-items:center;margin-bottom:10px;border-radius:12px;background:var(--accent-soft);color:var(--accent)}
.space-new .sc-plus svg {width:28px;height:28px;transition:transform 300ms var(--ease-pop)}
.space-new:hover {box-shadow:inset 0 0 0 1.5px var(--accent),0 18px 34px -24px rgb(107 63 230 / .5)}
.space-new:hover .sc-plus svg {transform:rotate(90deg) scale(1.1)}

.space-banner {position:relative;overflow:hidden;margin:4px 0 28px;padding:34px 32px;border-radius:24px;background:color-mix(in srgb,var(--tint) 30%,#fff);
  box-shadow:inset 0 0 0 1px rgb(34 32 43 / .05)}
.sb-drift {position:absolute;inset:0;pointer-events:none}
.sb-note {position:absolute;width:64px;height:54px;rotate:var(--r);box-shadow:var(--note-shadow);opacity:.75}
.sb-copy {position:relative;max-width:520px}
.sb-kind {display:inline-block;margin-bottom:8px;padding:3px 10px;border-radius:999px;background:rgb(255 255 255 / .8);font-size:12px;font-weight:600;color:var(--ink-2)}
.home-content[data-home-filter=other] .space-banner h1 {margin:0 0 6px;font:750 clamp(28px,3.4vw,44px)/1.05 var(--font-display);letter-spacing:-.04em}
.sb-copy p {margin:0;color:var(--ink-2)}
@media (prefers-reduced-motion:no-preference) {
  .sb-note {animation:sb-drift var(--d) ease-in-out var(--delay) infinite alternate}
  .space-banner[data-paused] .sb-note {animation-play-state:paused}
}
@keyframes sb-drift {from {transform:translate(-8px,6px)} to {transform:translate(10px,-8px)}}

/* ---------- board cards with covers ---------- */
.board-list[data-layout=grid] {grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}
.board-list[data-layout=grid] .board-row.has-cover {grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto;align-items:start;gap:2px 6px;min-height:0;padding:10px 10px 12px;
  border:0;border-radius:18px;background:#fff;box-shadow:0 0 0 1px rgb(34 32 43 / .07),0 10px 24px -20px rgb(34 32 43 / .45);transition:transform 240ms var(--ease-expo),box-shadow 240ms var(--ease-expo)}
.board-list[data-layout=grid] .board-row.has-cover:hover {transform:translateY(-3px);background:#fff;box-shadow:0 0 0 1px rgb(107 63 230 / .2),0 18px 34px -22px rgb(34 32 43 / .5)}
.board-cover-link {grid-column:1/-1;display:block;margin-bottom:8px;border-radius:12px;overflow:hidden}
.board-cover {display:block;aspect-ratio:16/9;background:#f6f6f8 radial-gradient(circle,#d6d7de 1px,transparent 1.3px) 0 0/12px 12px}
.board-cover svg {display:block;width:100%;height:100%}
.bc-n {transition:transform 380ms var(--ease-pop)}
.board-row.has-cover:hover .bc-n {transform:translate(var(--dx),var(--dy))}
.board-list[data-layout=grid] .board-row.has-cover .board-name {grid-column:1;grid-row:2;padding:2px 4px 0}
.board-list[data-layout=grid] .board-row.has-cover>.board-when {display:block;grid-column:1;grid-row:3;padding:0 4px;font-size:12px;color:var(--muted)}
.board-list[data-layout=grid] .board-row.has-cover>.square {grid-column:2;grid-row:2/4;align-self:center}

/* ---------- footer ---------- */
.home-footer {display:grid;gap:4px;margin-top:56px;padding:26px 0 8px;border-top:1px solid var(--line);color:var(--muted);font-size:13px}
.hf-brand {display:flex;align-items:center;gap:8px;color:var(--ink);font-size:15px}
.home-footer p {margin:0}
.home-footer a {color:var(--accent-ink)}

/* ---------- responsive ---------- */
@media (max-width:1180px) {
  .home-hero {grid-template-columns:minmax(0,1fr)}
  .home-content .home-hero h1 {max-width:16ch}
  .hero-scene {width:min(100%,720px);margin:0 auto}
}
@media (max-width:1100px) {
  .feed-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .feed-card,.feed-card.wide {grid-column:auto}
}
@media (max-width:900px) {
  .hero-scene {padding:22px 8px 20px}
  .hs-toolbar {display:none}
}
@media (max-width:640px) {
  .feed-grid {grid-template-columns:minmax(0,1fr);gap:20px}
  .feed-tabs {width:100%;overflow-x:auto}
  .feed-tab {flex:1;padding:0 10px;white-space:nowrap}
  .hs-note .hs-bob {width:74px;height:60px;font-size:10.5px}
  .hs-note-a {left:-4px;top:-4px}
  .hs-note-b {right:-4px;bottom:-10px}
  .hs-toast {left:4%}
  .hs-people {right:0}
  .spaces-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .space-card {grid-template-rows:72px auto auto}
  .space-banner {padding:24px 20px}
  .feed-lightbox {padding:10px}
  .feed-lb-panel {padding:8px;border-radius:18px}
  .feed-lb-meta {flex-wrap:wrap}
  .feed-lb-close {top:14px;right:14px}
}
@media (prefers-reduced-motion:reduce) {
  .feed-media,.space-card,.board-row.has-cover,.sc-note,.bc-n {transition:none}
}

/* Phone home: compact app bar + sidebar as a slide-in drawer (opened by .home-menu). */
.home-menu,.home-scrim {display:none}
@media (max-width:700px) {
  body[data-screen=home] #app {grid-template-rows:1fr}
  body[data-screen=home] .home-main {margin:var(--phone-top,8px) var(--phone-right,8px) var(--phone-bottom,8px) var(--phone-left,8px)}
  body[data-screen=home] .home-main .home-top {
    position:sticky;top:0;inset:auto;z-index:6;display:flex;align-items:center;gap:8px;
    height:56px;padding:0 10px;background:rgb(255 255 255 / .86);backdrop-filter:blur(14px) saturate(1.4);
    border-bottom:1px solid rgb(28 26 41 / .06)
  }
  body[data-screen=home] .home-main .home-top .brand {display:block;width:96px;height:22px}
  body[data-screen=home] .home-main .home-top .spacer {display:block;flex:1}
  body[data-screen=home] .home-menu {display:inline-grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:12px;background:transparent}
  body[data-screen=home] .home-menu:hover {background:var(--hover,#f1effa)}

  body[data-screen=home] .home-sidebar {
    position:fixed;z-index:40;inset:0 auto 0 0;width:min(86vw,320px);display:flex;flex-direction:column;gap:10px;
    padding:max(14px,var(--phone-safe-top,0px)) 14px max(14px,var(--phone-safe-bottom,0px)) max(14px,var(--phone-safe-left,0px));
    background:#fff;box-shadow:0 0 0 1px rgb(28 26 41 / .06),24px 0 60px rgb(28 26 41 / .18);
    border-radius:0 24px 24px 0;overflow-y:auto;overscroll-behavior:contain;
    transform:translateX(-104%);visibility:hidden;
    transition:transform 380ms cubic-bezier(.32,.72,0,1),visibility 0s linear 380ms
  }
  body[data-screen=home].home-drawer-open .home-sidebar {transform:none;visibility:visible;transition:transform 420ms cubic-bezier(.32,.72,0,1),visibility 0s}
  body[data-screen=home] .home-sidebar .team {padding-right:0;min-height:44px}
  body[data-screen=home] .home-sidebar .team>.square {display:inline-grid}
  body[data-screen=home] .home-nav {display:grid;gap:2px}
  body[data-screen=home] .home-nav .nav-row {width:100%;justify-content:flex-start;font-size:15px;gap:10px;min-height:44px}
  body[data-screen=home] .home-spaces {display:grid;gap:2px;overflow:visible}
  body[data-screen=home] .home-spaces .nav-row {width:100%;max-width:none;font-size:15px}
  body[data-screen=home] .home-spaces .space-empty {display:block}

  body[data-screen=home] .home-scrim {
    display:block;position:fixed;inset:0;z-index:39;background:rgb(28 26 41 / .32);backdrop-filter:blur(2px);
    opacity:0;pointer-events:none;transition:opacity 260ms ease
  }
  body[data-screen=home].home-drawer-open .home-scrim {opacity:1;pointer-events:auto}
}
@media (max-width:700px) and (prefers-reduced-motion:reduce) {
  body[data-screen=home] .home-sidebar,body[data-screen=home] .home-scrim {transition:none}
}

/* ---------- sidebar: the desk next to the board ----------
   Brand, one primary action, search, sections and spaces, festive switch at the foot.
   The current section sits on a small sticky note; spaces carry a sticky marker in their own colour. */
@media (min-width:701px) {
  body[data-screen=home] .home-sidebar {
    position:sticky;top:0;align-self:start;height:100dvh;display:flex;flex-direction:column;gap:16px;
    padding:20px 12px 16px 16px;overflow-y:auto;scrollbar-width:thin
  }
  body[data-screen=home] .home-main .home-top .brand {display:none}
}
body[data-screen=home] .home-sidebar .team {display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:40px;height:auto;margin:0;padding:0}
.side-brand {display:inline-flex;align-items:center;min-height:40px;padding:0 8px;border-radius:12px;background:none;transition:background-color 160ms ease}
.side-brand:hover {background:rgb(107 63 230 / .07)}
.side-brand .brand {display:block;width:118px;height:26px}
body[data-screen=home] .home-sidebar .side-close {display:none}

/* Primary action: a violet bar with a sticky-note plus. */
.side-create {display:flex;align-items:center;gap:2px;padding:4px;border-radius:16px;background:var(--r-violet,#6b3fe6);
  box-shadow:0 1px 2px rgb(28 26 41 / .08),0 10px 24px -10px rgb(107 63 230 / .7)}
.side-create-main {flex:1;display:flex;align-items:center;gap:10px;min-width:0;min-height:40px;padding:0 12px 0 6px;border:0;border-radius:12px;
  background:transparent;color:#fff;font:600 15px/1.2 var(--r-ui);text-align:left;cursor:pointer;transition:background-color 160ms ease}
.side-create-plus {display:grid;place-items:center;width:28px;height:28px;flex:none;border-radius:6px;background:var(--r-sticky,#ffd84d);color:var(--r-ink,#1c1a29);
  rotate:-5deg;box-shadow:0 1px 0 rgb(28 26 41 / .12),0 4px 8px -4px rgb(28 26 41 / .5);transition:rotate 320ms var(--ease-pop)}
.side-create-plus svg {width:18px;height:18px}
body[data-screen=home] .home-sidebar .side-create-more {width:40px;height:40px;flex:0 0 40px;border-radius:12px;background:transparent;color:rgb(255 255 255 / .85)}
body[data-screen=home] .home-sidebar .side-create-more svg {width:20px;height:20px}
.side-create-main:hover,body[data-screen=home] .home-sidebar .side-create-more:hover {background:rgb(255 255 255 / .14);color:#fff}
.side-create-main:hover .side-create-plus {rotate:4deg}
.side-create :focus-visible {outline:2px solid #fff;outline-offset:-3px;box-shadow:none}

/* Search with the «/» hint. */
body[data-screen=home] .home-sidebar .search-row {display:block}
body[data-screen=home] .home-sidebar .home-search {height:40px;gap:8px;padding:0 8px 0 12px;border:1px solid rgb(28 26 41 / .1);border-radius:12px;background:#fff}
body[data-screen=home] .home-sidebar .home-search > svg {width:18px;height:18px}
body[data-screen=home] .home-sidebar .home-search input {font:500 14px var(--r-ui)}
.search-kbd {display:grid;place-items:center;min-width:22px;height:22px;margin:0;padding:0 6px;border:1px solid rgb(28 26 41 / .1);border-radius:6px;
  background:var(--r-paper,#f6f5fb);color:var(--muted);font:600 12px/1 var(--r-ui);transition:opacity 160ms ease}
.home-search:focus-within .search-kbd {opacity:0}

/* Sections. */
body[data-screen=home] .home-sidebar .home-nav {display:grid;gap:2px;margin:0;padding:0;border:0}
body[data-screen=home] .home-sidebar .nav-row {display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:0 8px 0 6px;border-radius:12px;
  background:transparent;box-shadow:none;color:var(--ink-2);font:500 15px/1.2 var(--r-ui);transition:background-color 160ms ease,color 160ms ease}
body[data-screen=home] .home-sidebar .nav-row:hover {background:rgb(28 26 41 / .05);color:var(--ink)}
.nav-icon {display:grid;place-items:center;width:28px;height:28px;flex:none;border-radius:7px;color:var(--muted);
  transition:background-color 220ms ease,rotate 360ms var(--ease-pop),box-shadow 220ms ease}
body[data-screen=home] .home-sidebar .nav-icon svg {width:20px;height:20px;color:inherit}
.nav-label {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.nav-count {flex:none;min-width:22px;padding:3px 7px;border-radius:999px;color:var(--faint);font:600 12px/1 var(--r-ui);font-variant-numeric:tabular-nums;text-align:center}
body[data-screen=home] .home-sidebar .nav-row.current {background:rgb(107 63 230 / .09);color:var(--r-violet-ink,#5530c4);font-weight:600}
body[data-screen=home] .home-sidebar .nav-row.current .nav-icon {background:var(--r-sticky,#ffd84d);color:var(--r-ink,#1c1a29);rotate:-5deg;
  box-shadow:0 1px 0 rgb(28 26 41 / .08),0 4px 8px -4px rgb(28 26 41 / .45)}
body[data-screen=home] .home-sidebar .nav-row.current .nav-count {background:#fff;color:var(--r-violet-ink,#5530c4)}

/* Spaces. */
body[data-screen=home] .home-sidebar .home-spaces {display:grid;gap:8px;overflow:visible}
body[data-screen=home] .home-sidebar .space-label {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 2px 0 8px;
  color:var(--muted);font:600 13px/1.2 var(--r-ui);text-transform:none;letter-spacing:0}
body[data-screen=home] .home-sidebar .space-label .square {width:32px;height:32px;flex-basis:32px;border-radius:10px;background:transparent;color:var(--muted)}
body[data-screen=home] .home-sidebar .space-label .square:hover {background:rgb(28 26 41 / .05);color:var(--ink)}
.space-list {display:grid;gap:2px}
.space-mark {width:14px;height:14px;margin:7px;flex:none;border-radius:3px;background:var(--mark);rotate:-6deg;
  box-shadow:0 1px 0 rgb(28 26 41 / .08),0 3px 6px -3px rgb(28 26 41 / .45)}
.space-list .nav-row:nth-child(even) .space-mark {rotate:5deg}
body[data-screen=home] .home-sidebar .space-empty {display:grid;gap:8px;padding:14px;border:1px dashed rgb(107 63 230 / .28);border-radius:16px;
  background:rgb(255 255 255 / .7);color:var(--muted);font:500 13px/1.45 var(--r-ui)}
.space-empty p {margin:0}
.space-empty-art {position:relative;height:30px}
.space-empty-art i {position:absolute;top:2px;width:24px;height:22px;border-radius:3px;box-shadow:0 1px 0 rgb(28 26 41 / .08),0 4px 8px -5px rgb(28 26 41 / .5)}
.space-empty-art i:nth-child(1) {left:0;background:var(--r-sticky,#ffd84d);rotate:-8deg}
.space-empty-art i:nth-child(2) {left:20px;top:6px;background:#b8ecd2;rotate:5deg}
.space-empty-art i:nth-child(3) {left:40px;background:var(--r-frost,#dcebff);rotate:-3deg}
body[data-screen=home] .home-sidebar .space-empty-action {justify-self:start;min-height:36px;padding:0 12px;border-radius:10px;background:rgb(107 63 230 / .09);
  color:var(--r-violet-ink,#5530c4);font:600 13px var(--r-ui);text-decoration:none;transition:background-color 160ms ease}
body[data-screen=home] .home-sidebar .space-empty-action:hover {background:rgb(107 63 230 / .15)}

/* Foot: the festive switch. */
.side-foot {display:grid;gap:8px;margin-top:auto;padding-top:8px}
.side-foot:empty {display:none}

/* One staggered entrance per visit; afterwards the sidebar redraws without moving. */
@media (prefers-reduced-motion:no-preference) {
  body[data-screen=home] .home-sidebar[data-intro] > * {animation:side-in 560ms var(--ease-expo) both;animation-delay:calc(80ms + var(--i,0) * 60ms)}
  @keyframes side-in {from {opacity:0;transform:translateY(8px)}}
}
@media (prefers-reduced-motion:reduce) {
  .nav-icon,.side-create-plus {transition:none}
}

/* Phone: the same sidebar inside the drawer, with a close button and 44 px targets. */
@media (max-width:700px) {
  body[data-screen=home] .home-sidebar {gap:16px}
  body[data-screen=home] .home-sidebar .side-close {display:inline-grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:12px;background:transparent}
  body[data-screen=home] .home-sidebar .nav-row,.side-create-main,body[data-screen=home] .home-sidebar .home-search {min-height:44px}
  body[data-screen=home] .home-sidebar .side-create-more {width:44px;height:44px;flex-basis:44px}
  body[data-screen=home] .home-sidebar .space-label .square {width:44px;height:44px;flex-basis:44px}
  .search-kbd {display:none}
}
