/* =========================================================================
   Desktop — the portfolio as a macOS desktop (Figma: Portfolio et al,
   frames 191:2 "Home v2" and 198:2 "case study opens in Preview").

   The desktop is a fixed 1440×900 stage, scaled to fit the browser
   (scripts/desktop.js sets --scale), so every position below is a
   design-file coordinate.
   ========================================================================= */

:root {
  --wall: #5184b5; /* sky, shown while the photo loads */
  --ink: #1d1d1f;
  --ink-2: rgba(29, 29, 31, 0.75);
  --grey: #8e8e93;
  --blue: #0a84ff;
  --select: #0a64d6;
  --display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --hand: "Cedarville Cursive", "Bradley Hand", cursive;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Inter, system-ui, sans-serif;

  /* Motion — strong ease-outs, drawer curve for windows */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--wall);
  isolation: isolate;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
/* Wallpaper: hills and one cloud, fixed to the window so it also fills the margins around the scaled stage */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(13, 31, 20, 0) 60%, rgba(13, 31, 20, 0.28)),
    var(--wall) url("assets/desktop/home/wall-hills.jpg") 50% 100% / cover no-repeat;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Stage ---------- */
.viewport { position: fixed; inset: 0; overflow: hidden; overflow: clip; }
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1440px;
  height: 900px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center;
  overflow: hidden;
  overflow: clip; /* the wallpaper overflows; clip (unlike hidden) can't be scrolled by focus */
}

/* ---------- Menu bar ---------- */
.menubar {
  position: absolute; inset: 0 0 auto 0; height: 32px; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 14px 0 10px; font-size: 13px; font-weight: 500;
}
.menubar { display: none; } /* the home scene has no menu bar; phones bring it back as a status bar */
.menubar-left, .menubar-right, .mb-menus { display: flex; align-items: center; }
.menubar-right { gap: 4px; }
.mb-item { padding: 4px 9px; border-radius: 5px; line-height: 16px; white-space: nowrap; }
.mb-app { font-weight: 700; }
.mb-icon { display: inline-flex; align-items: center; height: 24px; padding: 0 7px; }
.mb-apple { display: inline-flex; align-items: center; padding: 3px 10px; transition: background-color 120ms ease; }
.mb-apple[aria-expanded="true"] { background: rgba(0, 0, 0, 0.1); }
.mb-clock { font-variant-numeric: tabular-nums; }

/* ---------- Apple menu ---------- */
.menu {
  position: absolute; left: 10px; top: 36px; width: 268px; z-index: 60;
  padding: 5px; border-radius: 10px;
  background: rgba(246, 246, 246, 0.86);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transform-origin: 12px 0;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.menu[data-state="closed"] { opacity: 0; transform: scale(0.97); }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 4px 10px; border-radius: 5px; font-size: 13px; font-weight: 500; line-height: 16px; text-align: left;
}
.menu-item kbd { font: 400 12px var(--font); color: #86868b; }
.menu-item:not(.is-disabled):hover, .menu-item:focus-visible { background: #2f7bf6; color: #fff; outline: none; }
.menu-item:not(.is-disabled):hover kbd, .menu-item:focus-visible kbd { color: rgba(255, 255, 255, 0.8); }
.menu-item.is-disabled { color: rgba(29, 29, 31, 0.4); }
.menu-sep { height: 9px; position: relative; }
.menu-sep::after { content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 1px; background: rgba(0, 0, 0, 0.1); }

/* ---------- Home scene (Figma 607:76) ---------- */
.scene { position: absolute; inset: 0; pointer-events: none; user-select: none; }
.bird, .doodle { position: absolute; }
.bird--1 { left: 1231.1px; top: 140px; }
.bird--2 { left: 1124.1px; top: 189px; }
.bird--3 { left: 1124.1px; top: 69px; }
.bird--4 { left: 1001.95px; top: 100px; }
.doodle--loop { left: 188px; top: 433px; }
.doodle--coil { left: 1179.35px; top: 360.56px; translate: -50% -50%; rotate: 10deg; }

/* Intro card: frosted glass over the sky */
.intro {
  position: absolute; left: 48px; top: 88px; z-index: 2; width: 332px; padding: 12px; border-radius: 20px;
  display: flex; flex-direction: column; gap: 12px;
  font-family: var(--display); font-variation-settings: "opsz" 14; color: #fff;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 30px rgba(10, 26, 56, 0.12);
}
.intro p, .intro h2 { margin: 0; }
.intro-who { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.intro-avatar { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #fff; outline: 1px solid rgba(0, 0, 0, 0.1); outline-offset: -1px; }
.intro-avatar-crop { position: absolute; left: 5px; top: 5px; width: 29.736px; height: 40px; overflow: hidden; }
.intro-avatar-crop img { position: absolute; left: -25.89%; top: -5.28%; width: 154.31%; height: 114.72%; max-width: none; }
.intro-status { display: grid; grid-template-columns: 8px 120px; column-gap: 16px; row-gap: 4px; font-size: 12px; line-height: 16px; }
.intro-dot { grid-row: 1 / 3; margin-top: 4px; }
.intro-tz { color: #e2e2e3; }
.intro-text { display: flex; flex-direction: column; gap: 8px; }
.intro-name { font-size: 14px; line-height: 20px; font-weight: 600; text-transform: uppercase; }
.intro-bio { font-size: 12px; line-height: 16px; color: #e2e2e3; text-wrap: pretty; }
.intro-tags { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: #e2e2e3; }
.intro-links { display: flex; gap: 8px; }
.intro-links a {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 20px;
  background: #6693ca; font-size: 12px; line-height: 16px; font-weight: 500; color: #fff;
  transition-property: background-color, scale; transition-duration: 150ms, 160ms; transition-timing-function: ease, var(--ease-out);
}
.intro-links a::after { content: ""; position: absolute; inset: -8px -2px; } /* taller hit area */
.intro-links a { position: relative; }
.intro-links a:active { scale: 0.96; }
@media (hover: hover) and (pointer: fine) { .intro-links a:hover { background: #5583bd; } }

/* "hi, that's me" pointing back at the card */
.hi-note { position: absolute; left: 0; top: 0; z-index: 3; margin: 0; pointer-events: none; }
.hi-note span { position: absolute; left: 431.42px; top: 114.63px; translate: -50% -50%; rotate: 4deg; white-space: nowrap; font-family: var(--hand); font-size: 24px; line-height: normal; color: #fff; }
.hi-note img { position: absolute; left: 368px; top: 126px; }

/* Headline and chips */
.headline {
  position: absolute; left: calc(50% + 18px); top: 366px; width: 766px; margin: 0; translate: -50% 0; z-index: 1;
  font-family: var(--display); font-optical-sizing: auto;
  font-size: 96px; line-height: 102px; font-weight: 400; letter-spacing: 0; text-align: center; color: #fff;
  white-space: nowrap;
}
.chips { margin: 0; padding: 0; list-style: none; }
.chip {
  position: absolute; z-index: 2; translate: -50% -50%; padding: 9px 16px; border-radius: 10px; white-space: nowrap;
  font-family: var(--display); font-variation-settings: "opsz" 14; font-size: 17px; line-height: normal; font-weight: 500; color: #1c1a24;
  filter: drop-shadow(0 6px 8px rgba(10, 26, 56, 0.18));
}
.chip--ai { left: 832.64px; top: 339.48px; rotate: 6deg; background: #e7e0ff; }
.chip--interaction { left: 458.93px; top: 526.2px; rotate: -5deg; background: #dcebff; }
.chip--proto { left: 1001.91px; top: 515.55px; rotate: 5deg; background: #f2f0ef; }

/* ---------- Depth and hover (motion lives in scripts/depth.js) ---------- */
/* The WebGL wallpaper fades in over the CSS one, which stays as the fallback */
.wall3d { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 600ms ease; }
.wall3d.is-ready { opacity: 1; }
/* Scene layers shift against the pointer by depth; --px/--py/--rx/--ry are set per frame */
.pz { transform: perspective(1200px) translate3d(var(--px, 0px), var(--py, 0px), 0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.bird { transform-origin: 50% 60%; will-change: transform; }
.headline .hw { display: inline-block; white-space: nowrap; }
.headline .hl { display: inline-block; will-change: transform; }

/* Intro card: tilts under the pointer (JS) and catches a highlight where the pointer is */
.intro { transition: background-color 200ms ease, box-shadow 300ms var(--ease-out); }
.intro::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.22), transparent 70%);
  transition: opacity 250ms ease;
}
.intro-avatar { transition: scale 300ms cubic-bezier(0.34, 1.4, 0.64, 1), rotate 300ms cubic-bezier(0.34, 1.4, 0.64, 1); }
.hi-note span, .hi-note img, .chip, .doodle { transition-property: scale, rotate, translate, filter; transition-duration: 380ms; transition-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); }
.hi-note span, .chip, .doodle { pointer-events: auto; }
.chip { cursor: default; }
@keyframes ping { from { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55); } to { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0); } }
.intro-dot { border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  .intro:hover { background-color: rgba(255, 255, 255, 0.15); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 18px 44px rgba(10, 26, 56, 0.2); }
  .intro:hover::before { opacity: 1; }
  .intro:hover .intro-dot { animation: ping 1.4s var(--ease-out) infinite; }
  .intro-avatar:hover { scale: 1.1; rotate: -6deg; }
  .intro:hover ~ .hi-note img, .hi-note span:hover ~ img { translate: -5px 3px; }
  .hi-note span:hover { scale: 1.08; rotate: 0deg; }
  .chip:hover { scale: 1.1; rotate: 0deg; filter: drop-shadow(0 12px 16px rgba(10, 26, 56, 0.24)); }
  .doodle--loop:hover { scale: 1.12; rotate: -14deg; }
  .doodle--coil:hover { scale: 1.12; rotate: -8deg; }
}
.dock-app > :first-child { transform-origin: 50% 100%; }

/* Finder tag dots: the file's tags, stacked like macOS */
.ftags { display: inline-flex; vertical-align: -1px; margin-right: 4px; }
.ftag { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px #fff; }
.ftag + .ftag { margin-left: -4px; }
.ftag--ai { background: #ff9f0a; } .ftag--mobile { background: #0a84ff; } .ftag--game { background: #30d158; }
.file.is-selected .ftag { box-shadow: 0 0 0 1px var(--select); }

/* Voice Wave, played live */
.now-wave.is-live { background: none; }
.now-wave i { position: absolute; width: 3px; border-radius: 1.5px; background: #1d1d1f; opacity: .25; will-change: transform, opacity; }
.now-dot { display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; background: #ff3b30; vertical-align: middle; animation: rec 2s ease-in-out infinite; }
@keyframes rec { 50% { opacity: .35; } }

/* ---------- Windows (shared) ---------- */
.window {
  position: absolute; overflow: hidden; background: #fff; border-radius: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 22px 60px rgba(0, 0, 0, 0.32);
  z-index: 10;
  transition: box-shadow 200ms var(--ease-out);
}
.window.is-front { z-index: 20; }
.window:not(.is-front) { box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(0, 0, 0, 0.2); }
/* Traffic lights: glyphs appear on all three when the pointer enters the group */
.lights { position: absolute; left: 18px; top: 19px; display: flex; gap: 8px; z-index: 3; }
.light { position: relative; display: block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14); }
.light--close { background: #ff5f57; }
.light--min { background: #febc2e; }
.light--zoom { background: #28c840; }
.light::after { content: ""; position: absolute; inset: 0; background: center / 8px 8px no-repeat; opacity: 0; transition: opacity 100ms ease; }
.light--close::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 1.5l5 5M6.5 1.5l-5 5' stroke='%234d0000' stroke-opacity='.75' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.light--min::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 4h6' stroke='%235a3a00' stroke-opacity='.8' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.lights:hover .light::after, .light:focus-visible::after { opacity: 1; }
.light--zoom::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' fill='none' stroke='%23004d00' stroke-opacity='.75' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.7 3.3l2-2M4.9 1.3h1.8v1.8M3.3 4.7l-2 2M1.3 4.9v1.8h1.8'/%3E%3C/svg%3E"); }
.window.is-zoomed .light--zoom::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' fill='none' stroke='%23004d00' stroke-opacity='.75' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.7 1.3l-2 2M4.7 1.5v1.8h1.8M1.3 6.7l2-2M3.3 6.5V4.7H1.5'/%3E%3C/svg%3E"); }
.window:not(.is-front) .light { background: #d1d1d6; }
[data-drag] { cursor: default; }
/* Zoom: the window grows to fill the desktop between the menu bar and the dock.
   Only frame properties animate; the content reflows to the new size. */
.window.is-resizing { transition: left 360ms var(--ease-drawer), top 360ms var(--ease-drawer), width 360ms var(--ease-drawer), height 360ms var(--ease-drawer), box-shadow 200ms var(--ease-out); }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- Finder ---------- */
.finder { left: 424px; top: 92px; width: 960px; height: 600px; }
.f-sidebar { position: absolute; left: 0; top: 0; width: 196px; height: 100%; background: rgba(237, 237, 239, 0.92); box-shadow: inset -0.5px 0 0 rgba(0, 0, 0, 0.12); padding-top: 56px; }
.f-group { margin: 0 0 7px 18px; font-size: 11px; font-weight: 600; color: var(--grey); }
.f-list { display: grid; gap: 2px; margin: 0 10px 18px; }
.f-list + .f-group { margin-top: 0; }
.f-row { display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; text-align: left; width: 100%; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .f-row:hover { background: rgba(0, 0, 0, 0.05); } }
.f-row.is-active { background: rgba(0, 0, 0, 0.08); }
.f-row img { flex: none; }
.f-tag img { margin: 0 2px; }
.folder { position: relative; flex: none; width: 16px; height: 13px; }
.folder::before { content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 4px; border-radius: 1.5px; background: #2f7df6; }
.folder::after { content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 11px; border-radius: 2px; border: 1.4px solid #2f7df6; background: rgba(237,237,239,1); }

.f-main { position: absolute; left: 196px; top: 0; right: 0; bottom: 0; }
.f-toolbar { position: relative; height: 52px; box-shadow: inset 0 -0.5px 0 rgba(0, 0, 0, 0.1); }
.f-nav { position: absolute; left: 16px; top: 20px; }
.f-nav--fwd { left: 44px; opacity: .35; }
.f-title { position: absolute; left: 70px; top: 16px; margin: 0; font-size: 15px; font-weight: 700; line-height: 18px; }
.f-tools { position: absolute; right: 20px; top: 14px; display: flex; gap: 20px; align-items: center; }
button.f-nav { display: grid; place-items: center; width: 20px; height: 24px; margin: -6px; border-radius: 5px; transition: background-color 120ms ease; }
button.f-nav:not(:disabled):hover { background: rgba(0, 0, 0, 0.06); }
button.f-nav:disabled img { opacity: .35; }
.f-sub { position: absolute; left: 112px; top: 19px; font-size: 12px; color: var(--grey); white-space: nowrap; }
.seg { display: flex; width: 64px; padding: 2px; border-radius: 6px; background: rgba(0, 0, 0, 0.05); justify-content: space-between; }
.seg-on, .seg-off { width: 28px; height: 20px; border-radius: 5px; display: grid; place-items: center; }
.seg-on { background: #fff; box-shadow: 0 .5px .75px rgba(0,0,0,.12); grid-template-columns: 5px 5px; gap: 2px; place-content: center; }
.seg-on i { width: 5px; height: 5px; border-radius: 1px; background: #3c3c43; }
.seg-off { grid-template-rows: repeat(3, 1.2px); gap: 2.2px; place-content: center; }
.seg-off b { width: 12px; height: 1.2px; border-radius: .75px; background: rgba(60, 60, 67, .6); }
.tool-search { width: 28px; height: 20px; border-radius: 5px; background: #f2f2f2; display: grid; place-items: center; box-shadow: 0 .5px .75px rgba(0,0,0,.12); }

.f-grid { position: absolute; left: 21.5px; top: 73.5px; display: flex; gap: 8px; }
.file {
  position: relative; width: 136px; height: 138px; border-radius: 8px; padding: 6px 6px 0;
  display: flex; flex-direction: column; align-items: center;
  transition: transform 160ms var(--ease-out), opacity 200ms var(--ease-out), filter 200ms var(--ease-out);
}
.file:active { transform: scale(0.97); }
.file.is-selected { background: rgba(0, 0, 0, 0.07); }
.file[data-dim="true"] { opacity: .3; filter: grayscale(.8); }
/* five files share a 764px row: thumbs keep their 140×104 art and scale as a unit */
.thumb { position: relative; width: 140px; height: 104px; border-radius: 6px; overflow: hidden; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18)); flex: none; zoom: 0.886; }
.thumb img { position: absolute; }
.thumb--mentra { background: #7d939a; }
.thumb--mentra img { left: -25.77px; top: 0; width: 191.53px; height: 104px; object-fit: cover; }
.thumb--eye { background: #fe5f40; }
.thumb--eye img { width: 37.24px; height: 80.85px; object-fit: cover; top: 6.85px; }
.thumb--eye img:nth-child(1) { left: 9.84px; } .thumb--eye img:nth-child(2) { left: 50.7px; top: 18.18px; } .thumb--eye img:nth-child(3) { left: 91.55px; }
.thumb--flo { background: #0f3a1f; }
.thumb--flo img { left: 29.41px; top: 6.81px; width: 81.17px; height: 175.7px; object-fit: cover; border-radius: 6.37px 6.37px 0 0; }
.thumb--bb { background: #949494; }
.thumb--ltoc { background: #4a83bd; }
.thumb--ltoc img, .d-hero--ltoc img { left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.d-hero--ltoc { background: #4a83bd; }
/* Coming soon: the work stays visible as a shape, not readable yet */
.file[data-soon] .thumb img, .d-hero.is-soon img { filter: blur(6px) saturate(.9); transform: scale(1.08); }
.d-hero.is-soon img { filter: blur(12px) saturate(.9); }
.d-hero.is-soon::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.12); }
.soon-tag {
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.16);
  color: #1d1d1f; font-size: 11px; font-weight: 600; line-height: 14px; letter-spacing: 0.01em;
}
.d-hero .soon-tag { z-index: 2; padding: 6px 14px; font-size: 13px; line-height: 16px; animation: none; transform: translate(-50%, -50%); }
.thumb--bb img { left: -25.77px; top: 0; width: 191.53px; height: 104px; object-fit: cover; }
.fname {
  margin-top: 10px; width: 132px; padding: 1px 6px; border-radius: 4px;
  font-size: 12px; font-weight: 500; line-height: 14px; text-align: center;
}
.file.is-selected .fname { background: var(--select); color: #fff; }

.f-detail {
  position: absolute; left: 27.5px; right: 27.5px; top: 225.5px; bottom: 114.5px; border-radius: 10px;
  background: #f5f5f7; padding: 16px 14px; display: flex; gap: 20px;
  transition: bottom 360ms var(--ease-drawer);
}
.finder.is-zoomed .f-detail { bottom: 48px; }
.d-hero { position: relative; flex: none; height: 100%; aspect-ratio: 300 / 228; border-radius: 8px; overflow: hidden; background: #7d939a; }
.d-hero img { position: absolute; }
.d-hero--mentra img { left: -19.98%; top: 0; width: 139.96%; height: 100%; object-fit: cover; }
.d-hero--bb img { left: -19.98%; top: 0; width: 139.96%; height: 100%; object-fit: cover; }
.d-hero--eye { background: #fe5f40; }
.d-hero--eye img { width: 27.33%; height: 78.07%; object-fit: cover; top: 10.96%; }
.d-hero--eye img:nth-child(1) { left: 6.67%; } .d-hero--eye img:nth-child(2) { left: 36.33%; top: 17.54%; } .d-hero--eye img:nth-child(3) { left: 66%; }
.d-hero--flo { background: #0f3a1f; }
.d-hero--flo img { left: 26.67%; top: 9.65%; width: 46.67%; height: 132.89%; object-fit: cover; border-radius: 11px 11px 0 0; }
.d-hero > * { animation: d-in 220ms var(--ease-out) both; }
.d-info { flex: 1; min-width: 0; max-width: 380px; padding-top: 4px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.d-info > * { animation: d-in 220ms var(--ease-out) both; }
.d-info > :nth-child(2) { animation-delay: 30ms; } .d-info > :nth-child(3) { animation-delay: 60ms; } .d-info > :nth-child(4) { animation-delay: 90ms; }
@keyframes d-in { from { opacity: 0; transform: translateY(4px); } }
.d-name { margin: 0 0 -12px; font-size: 22px; font-weight: 700; }
.d-desc { margin: 0; font-size: 13px; line-height: 19px; color: var(--ink-2); }
.d-meta { margin: 0; display: grid; grid-template-columns: 48px auto; column-gap: 32px; row-gap: 8px; font-size: 12px; }
.d-meta dt { color: var(--grey); } .d-meta dd { margin: 0; font-weight: 500; white-space: nowrap; }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d-link { padding: 5px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.06); color: var(--ink); font-size: 13px; font-weight: 500; transition: transform 160ms var(--ease-out), background-color 120ms ease; }
.d-link:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .d-link:hover { background: rgba(0, 0, 0, 0.1); } }
.d-open {
  padding: 5px 12px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 500;
  transition: transform 160ms var(--ease-out), filter 120ms ease;
}
.d-open:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .d-open:hover { filter: brightness(1.06); } }
.d-open[aria-disabled="true"] { background: rgba(0, 0, 0, 0.06); color: #6e6e73; cursor: default; filter: none; transform: none; }
.f-count { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center; font-size: 11px; color: var(--grey); }

/* ---------- Finder: Art in Gallery view ---------- */
.finder[data-view="art"] :is(.f-grid, .f-detail, .f-count) { display: none; }
.f-gallery {
  position: absolute; left: 0; right: 0; top: 52px; bottom: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr) 168px;
}
.g-stage { grid-column: 1; grid-row: 1; display: grid; place-items: center; padding: 28px; min-height: 0; container-type: size; }
.g-stage > * { width: min(420px, 100cqw, 100cqh * var(--r, 1)); height: auto; aspect-ratio: var(--r, 1); object-fit: cover; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); background: #f2f2f2; animation: g-in 200ms var(--ease-out) both; }
.g-stage.is-instant > * { animation: none; }
@keyframes g-in { from { opacity: 0; transform: scale(0.985); } }
.g-film {
  grid-column: 1; grid-row: 2; display: flex; gap: 12px; padding: 20px 20px 12px; overflow-x: auto; overflow-y: hidden;
  box-shadow: inset 0 0.5px 0 rgba(0, 0, 0, 0.08); scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent);
}
.g-film::-webkit-scrollbar { display: none; }
.g-thumb { flex: none; width: 76px; display: grid; justify-items: center; align-content: start; gap: 8px; padding-top: 2px; transition: transform 160ms var(--ease-out); }
.g-thumb:active { transform: scale(0.97); }
.g-thumb-img { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #eee; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1); }
.g-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.g-thumb[aria-selected="true"] .g-thumb-img { box-shadow: 0 0 0 3px var(--blue); }
.g-play { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M9 7l6 4-6 4z' fill='%23fff'/%3E%3C/svg%3E") center / 22px no-repeat; }
.g-label { width: 84px; font-size: 11px; line-height: 13px; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-thumb[aria-selected="true"] .g-label { color: var(--select); font-weight: 600; }
.g-insp { grid-column: 2; grid-row: 1 / 3; background: #f7f7f8; box-shadow: inset 0.5px 0 0 rgba(0, 0, 0, 0.1); padding: 22px 20px; overflow-y: auto; }
.g-insp > * { animation: d-in 200ms var(--ease-out) both; }
.g-insp.is-instant > * { animation: none; }
.g-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.g-kind { margin: 6px 0 0; font-size: 12px; color: var(--grey); }
.g-desc { margin: 14px 0 0; font-size: 13px; line-height: 19px; color: var(--ink-2); }
.g-meta { margin: 22px 0 0; padding-bottom: 18px; display: grid; grid-template-columns: 82px 1fr; row-gap: 9px; font-size: 12px; box-shadow: inset 0 -0.5px 0 rgba(0, 0, 0, 0.1); }
.g-meta dt { color: var(--grey); } .g-meta dd { margin: 0; font-weight: 500; }
.g-actions { display: flex; gap: 8px; margin-top: 18px; }
.g-btn { padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; background: rgba(0, 0, 0, 0.06); transition: transform 160ms var(--ease-out), background-color 120ms ease; }
.g-btn:active { transform: scale(0.97); }
.g-btn--primary { background: var(--blue); color: #fff; }
.g-hint { margin: 14px 0 0; font-size: 11px; color: var(--grey); }

/* ---------- Quick Look ---------- */
.ql {
  position: absolute; left: 380px; top: 72px; width: 680px; height: 740px; z-index: 65; transform-origin: 0 0;
  border-radius: 14px; overflow: hidden; color: #fff;
  background: rgba(28, 28, 30, 0.96); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 28px 70px rgba(0, 0, 0, 0.45);
}
.ql-bar { position: relative; height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.ql-close { display: grid; transition: transform 160ms var(--ease-out); }
.ql-close:active { transform: scale(0.92); }
.ql-title { position: absolute; left: 80px; right: 80px; margin: 0; text-align: center; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-media { position: absolute; left: 30px; top: 58px; width: 620px; height: 620px; display: grid; place-items: center; container-type: size; }
.ql-media > * { width: min(100cqw, 100cqh * var(--r, 1)); height: auto; aspect-ratio: var(--r, 1); object-fit: cover; border-radius: 6px; display: block; }
.ql-arrow { position: absolute; top: 354px; display: grid; opacity: .85; transition: opacity 120ms ease, transform 160ms var(--ease-out); }
.ql-arrow:active { transform: scale(0.92); }
.ql-arrow--prev { left: 44px; } .ql-arrow--next { right: 40px; }
.ql-count { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }

/* ---------- Notes app ---------- */
.notes { left: 200px; top: 64px; width: 1040px; height: 690px; display: grid; grid-template-columns: 210px 300px minmax(0, 1fr); }
.n-folders { position: relative; background: rgba(235, 235, 237, 0.96); box-shadow: inset -0.5px 0 0 rgba(0, 0, 0, 0.12); padding-top: 56px; }
.n-drag { position: absolute; left: 90px; right: 0; top: 0; height: 48px; }
.n-group { margin: 0 0 6px 18px; font-size: 11px; font-weight: 600; color: var(--grey); }
.n-folder-list { display: grid; gap: 2px; margin: 0 10px 22px; }
.n-folder { display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; text-align: left; width: 100%; }
.n-folder svg { flex: none; }
.n-folder span:last-child { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--grey); font-variant-numeric: tabular-nums; }
.n-folder[aria-current="true"] { background: rgba(0, 0, 0, 0.08); }
@media (hover: hover) and (pointer: fine) { .n-folder:not([aria-current="true"]):hover { background: rgba(0, 0, 0, 0.04); } }
.n-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 18px; }
.n-tag { padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.06); font-size: 12px; font-weight: 500; transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.n-tag:active { transform: scale(0.96); }
.n-tag[aria-pressed="true"] { background: #e2a500; color: #fff; }
.n-list { position: relative; display: flex; flex-direction: column; min-height: 0; box-shadow: inset -0.5px 0 0 rgba(0, 0, 0, 0.1); }
.n-list-top { padding: 14px 14px 6px; }
.n-search { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.05); }
.n-search input { flex: 1; min-width: 0; border: 0; background: none; font: 13px var(--font); color: var(--ink); outline: none; }
.n-search input::placeholder { color: var(--grey); }
.n-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.n-done, .n-back, .n-chips { display: none; }
.n-items { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.n-section { margin: 12px 10px 6px; font-size: 11px; font-weight: 600; color: var(--grey); }
.n-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; position: relative; }
.n-item + .n-item::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 0.5px; background: rgba(0, 0, 0, 0.08); }
.n-item[aria-selected="true"], .n-item[aria-selected="true"] + .n-item::before { }
.n-item[aria-selected="true"] { background: #ffe58a; }
.n-item[aria-selected="true"]::before, .n-item[aria-selected="true"] + .n-item::before { opacity: 0; }
.n-item-title { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-item-sub { display: flex; gap: 8px; margin-top: 3px; font-size: 12px; }
.n-item-sub b { font-weight: 500; white-space: nowrap; }
.n-item-sub span { color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-item[aria-selected="true"] .n-item-sub b, .n-item[aria-selected="true"] .n-item-sub span { color: #5c4a00; }
.n-empty { margin: 30px 20px; font-size: 13px; color: var(--grey); text-align: center; }
.n-editor { position: relative; display: flex; flex-direction: column; min-height: 0; background: #fff; }
.n-tools { height: 52px; flex: none; display: flex; align-items: center; padding: 0 20px; box-shadow: inset 0 -0.5px 0 rgba(0, 0, 0, 0.08); }
.n-tool-icons { display: flex; gap: 20px; }
.n-hist { display: grid; place-items: center; width: 24px; height: 24px; margin: 0 14px 0 -6px; border-radius: 5px; transition: background-color 120ms ease; }
.n-hist:disabled img { opacity: .35; }
@media (hover: hover) and (pointer: fine) { .n-hist:not(:disabled):hover { background: rgba(0, 0, 0, 0.06); } }
.n-body { flex: 1; overflow-y: auto; padding: 16px max(44px, calc((100% - 680px) / 2)) 40px; }
.n-body > * { animation: d-in 180ms var(--ease-out) both; }
.n-body.is-instant > * { animation: none; }
.n-date { margin: 0 0 20px; text-align: center; font-size: 12px; color: var(--grey); }
.n-title { margin: 0; font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -0.01em; }
.n-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; font-size: 13px; font-weight: 500; color: var(--grey); }
.n-meta .n-hash { color: #b78300; }
.n-text { margin: 20px 0 0; font-size: 15px; line-height: 23px; }
.n-quote { margin: 26px 0 0; padding: 16px 20px; border-radius: 10px; background: #fff6d6; box-shadow: inset 3px 0 0 #e2a500; }
.n-quote p { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; }
.n-quote cite { display: block; margin-top: 10px; font-size: 12px; font-style: normal; color: #8c6a00; }
.n-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 4px 0 0; }
.n-links .n-link { margin-top: 14px; }
.n-link { display: inline-block; margin-top: 22px; font-size: 14px; font-weight: 600; color: #8c6a00; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .n-link:hover { color: #6b5100; } }
.n-scrap { margin: 18px 0 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.n-current { margin: 26px 0 0; display: grid; grid-template-columns: 90px 1fr; row-gap: 10px; font-size: 14px; }
.n-current dt { color: var(--grey); } .n-current dd { margin: 0; font-weight: 500; }
.n-foot { margin: 0; padding: 10px; text-align: center; font-size: 11px; color: #aeaeb2; }

/* ---------- Minimized windows in the dock ---------- */
.dock-min { overflow: visible; transition: max-width 240ms var(--ease-out), opacity 240ms var(--ease-out), margin 240ms var(--ease-out); max-width: 58px; }
.dock-min.is-collapsed { max-width: 0; opacity: 0; margin: 0 -2px; }
.min-card { position: relative; width: 58px; height: 40px; margin: 10px 0 14px; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.25); pointer-events: none; }
.min-card > .window { position: absolute !important; left: 0 !important; top: 0 !important; transform-origin: 0 0; box-shadow: none; animation: none !important; pointer-events: none; }
.min-badge { position: absolute; right: -2px; bottom: 10px; width: 18px; height: 18px; border-radius: 5px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.min-badge > * { width: 100%; height: 100%; display: block; }

/* ---------- Preview ---------- */
.preview { left: 330px; top: 56px; width: 1040px; height: 752px; transform-origin: 0 0; }
.p-sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: 212px; background: #ececee; box-shadow: inset -0.5px 0 0 rgba(0,0,0,.14); }
.p-file { position: absolute; left: 18px; top: 60px; margin: 0; font-size: 12px; font-weight: 500; color: var(--grey); }
.p-thumbs { position: absolute; left: 0; right: 0; top: 86px; bottom: 0; overflow-y: auto; padding: 8px 30px 24px; box-shadow: inset 0 .5px 0 rgba(0,0,0,.1); scrollbar-width: thin; }
.p-thumb { display: grid; justify-items: center; gap: 7px; width: 100%; padding: 10px 10px 8px; border-radius: 8px; margin-bottom: 4px; }
.p-thumb img { width: 132px; height: 74.25px; object-fit: cover; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.12); }
.p-thumb span { font-size: 11px; color: #6e6e73; min-width: 18px; padding: 1px 5px; border-radius: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.p-thumb[aria-current="true"] { background: rgba(0, 0, 0, 0.08); }
.p-thumb[aria-current="true"] span { background: var(--select); color: #fff; }
.p-main { position: absolute; left: 212px; top: 0; right: 0; bottom: 0; }
.p-toolbar { position: relative; height: 52px; display: flex; align-items: center; padding: 0 16px; gap: 14px; background: #f6f6f7; box-shadow: inset 0 -0.5px 0 rgba(0,0,0,.14); color: #3c3c43; }
.p-sideicon { display: inline-flex; }
.p-title { display: grid; line-height: 1.2; }
.p-title strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.p-title span { font-size: 11px; color: var(--grey); font-variant-numeric: tabular-nums; }
.p-tools { margin-left: auto; display: flex; gap: 6px; }
.p-tool { width: 30px; height: 28px; display: grid; place-items: center; border-radius: 6px; transition: background-color 120ms ease, transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .p-tool:hover { background: rgba(0,0,0,.06); } }
.p-tool:active { transform: scale(0.94); }
.p-pages { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; overflow-y: auto; background: #e3e3e6; padding: 14px 0 40px; display: grid; justify-items: center; gap: 14px; outline: none; scrollbar-width: thin; }
.preview.is-zoomed .p-page { width: calc(1120px * var(--zoom, 1)); }
.p-page { width: calc(800px * var(--zoom, 1)); aspect-ratio: 16 / 9; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: width 220ms var(--ease-out); }
.p-page img { width: 100%; height: 100%; display: block; }

.p-done { display: none; }

/* ---------- Dock ---------- */
.dock {
  --dock-s: 1;
  position: absolute; left: 50%; top: 804.62px; transform: translateX(-50%) scale(var(--dock-s)); z-index: 40;
  display: flex; align-items: flex-end; gap: 10px; padding: 10px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(10, 26, 56, 0.16);
}
.dock-app { position: relative; display: flex; flex-direction: column; align-items: center; width: 52px; transition: transform 160ms var(--ease-out); }
.dock-app:active { transform: scale(0.96); }
.dock-app > img { width: 52px; height: 57.379px; }
.dock-app--preview { animation: dock-in 320ms var(--ease-drawer) both; }
@keyframes dock-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.icon { position: relative; display: block; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.22); }
.icon--notes::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 15px; background: linear-gradient(#ffe36b, #f5be14); }
.icon--notes i { position: absolute; left: 8px; width: 42px; height: 1.2px; background: #c7c7cc; }
.icon--notes i:nth-child(1) { top: 23px; } .icon--notes i:nth-child(2) { top: 30px; } .icon--notes i:nth-child(3) { top: 37px; } .icon--notes i:nth-child(4) { top: 44px; width: 28px; }
.icon--art { background: radial-gradient(circle at 50% 40%, #eef5dc, #cfe1a2); }
.icon--art img { position: absolute; left: -26px; top: -12px; width: 110px; height: 110px; object-fit: contain; }
.icon--about { background: #f3efe6; box-shadow: inset 0 0 0 2px #fff, 0 1.5px 3px rgba(0, 0, 0, 0.22); }
.icon--about img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.icon--about { isolation: isolate; }
.icon--music, .icon--mail { background: transparent; box-shadow: none; }
.icon--music img, .icon--mail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icon--resume { background: transparent; box-shadow: none; filter: drop-shadow(0 1.5px 1.5px rgba(0,0,0,.22)); }
.icon--resume::before { content: ""; position: absolute; left: 11px; top: 4px; width: 36px; height: 48px; border-radius: 3px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.icon--resume i { position: absolute; left: 16px; width: 26px; height: 1.6px; border-radius: 1px; background: #b0b0b5; }
.icon--resume i:nth-child(1) { top: 12px; width: 16px; } .icon--resume i:nth-child(2) { top: 17px; } .icon--resume i:nth-child(3) { top: 22px; } .icon--resume i:nth-child(4) { top: 27px; } .icon--resume i:nth-child(5) { top: 32px; } .icon--resume i:nth-child(6) { top: 37px; }
.icon--resume b { position: absolute; left: 16px; top: 40px; width: 16px; height: 7px; border-radius: 1.5px; background: #e5483b; }
.icon--preview { background: linear-gradient(#f7f7f8, #dcdce0); }
.icon--preview::before { content: ""; position: absolute; left: 12px; top: 10px; width: 30px; height: 36px; border-radius: 3px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.icon--preview i { position: absolute; left: 26px; top: 24px; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #3a7bd5; background: rgba(90,200,250,.25); }
.icon--preview i::after { content: ""; position: absolute; right: -9px; bottom: -8px; width: 10px; height: 4px; border-radius: 2px; background: #3a3a3c; transform: rotate(45deg); }
.dock-sep { width: 1px; height: 40px; background: rgba(255, 255, 255, 0.5); align-self: center; }
.tooltip {
  position: absolute; top: 770px; z-index: 45; padding: 3px 9px; border-radius: 6px; white-space: nowrap;
  font-size: 13px; font-weight: 500; background: rgba(242, 242, 242, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 0.5px solid rgba(0, 0, 0, 0.12); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%); pointer-events: none;
  transition: opacity 120ms var(--ease-out), transform 120ms var(--ease-out);
}
.tooltip[data-state="hidden"] { opacity: 0; transform: translate(-50%, 3px); }
.tooltip[data-instant] { transition-duration: 0ms; }

/* ---------- Sleep ---------- */
.sleep { position: absolute; inset: 0; z-index: 90; background: #000; display: grid; place-items: end center; padding-bottom: 60px; color: rgba(255,255,255,.35); font-size: 13px; transition: opacity 600ms ease; }
.sleep[data-state="off"] { opacity: 0; }

/* ---------- First-visit entrance (rare: allowed a little delight) ---------- */
.motion [data-enter] { animation: rise 520ms var(--ease-drawer) both; animation-delay: calc(var(--i) * 60ms + 80ms); }
.motion .dock { animation: dock-rise 520ms var(--ease-drawer) 300ms both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes dock-rise { from { opacity: 0; transform: translate(-50%, 24px) scale(var(--dock-s)); } }

/* =========================================================================
   Phone — the desktop reflows into a phone home screen made of the same
   parts: status bar, widgets, the Work folder as a card, a floating dock.
   Preview opens full screen. The stage stops scaling (desktop.js).
   ========================================================================= */
@media (max-width: 699px) {
  body { overflow: auto; overflow-x: clip; }
  .preview-open body { overflow: hidden; }
  .viewport { position: static; overflow: visible; }
  .stage {
    position: relative; left: auto; top: auto; transform: none;
    width: 100%; height: auto; min-height: 100svh;
    padding: calc(52px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start;
    overflow: visible; overflow-x: clip;
  }

  /* Status bar */
  .menubar {
    display: flex; position: fixed; height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0 6px;
    background: rgba(255, 255, 255, 0.5); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  }
  .mb-menus, .mb-app, .menubar-right > .mb-item:first-child { display: none; }
  .mb-apple { padding: 6px 12px; }
  .menu { position: fixed; left: 8px; top: calc(44px + env(safe-area-inset-top)); width: min(268px, calc(100vw - 16px)); }
  .menu-item { padding: 8px 10px; font-size: 15px; }

  /* Home scene, stacked */
  .intro { position: relative; left: auto; top: auto; width: auto; grid-column: 1 / -1; order: -3; }
  .intro-links { flex-wrap: wrap; }
  .intro-links a { padding: 7px 12px; font-size: 14px; }
  .intro-status { grid-template-columns: 8px auto; }
  .hi-note { display: none; }
  .headline br { display: none; }
  .headline {
    position: relative; left: auto; top: auto; width: auto; translate: none; grid-column: 1 / -1; order: -2;
    margin: 36px 0 8px; font-size: clamp(44px, 13vw, 60px); line-height: 1.04; text-align: left; white-space: normal;
    text-wrap: balance;
  }
  .chips { position: relative; grid-column: 1 / -1; order: -1; display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 40px; }
  .chip { position: relative; left: auto !important; top: auto !important; translate: none; font-size: 15px; }
  .scene { position: absolute; overflow: hidden; height: 560px; }
  .bird, .doodle--loop { display: none; }
  .doodle--coil { left: auto; right: -12px; top: 360px; width: 96px; height: auto; translate: none; }

  /* Work folder as a card */
  .finder {
    position: relative; left: auto !important; top: auto !important; width: auto; height: auto;
    grid-column: 1 / -1; border-radius: 18px; z-index: 1; display: flex; flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  }
  .f-main { display: contents; }
  .f-toolbar { order: 1; height: auto; padding: 18px 16px 4px; box-shadow: none; }
  .f-nav, .f-tools { display: none; }
  .f-title { position: static; font-size: 24px; line-height: 1.2; }
  .f-sidebar {
    order: 2; position: static; width: auto; height: auto; padding: 8px 16px 4px; background: none; box-shadow: none;
    display: flex; flex-wrap: wrap; gap: 8px;
  }
  .f-sidebar .lights, .f-group, .f-sidebar a.f-row, .folder { display: none; }
  .f-list { display: contents; }
  .f-row {
    width: auto; height: 34px; padding: 0 14px; border-radius: 999px; gap: 6px;
    background: rgba(0, 0, 0, 0.05); font-size: 14px;
  }
  .f-row.is-active { background: var(--ink); color: #fff; }
  .f-tag img { margin: 0; }
  .f-grid { order: 3; position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 10px 4px; }
  .file { width: auto; height: auto; padding: 8px 4px 10px; }
  .fname { width: auto; max-width: 100%; }
  .f-detail { order: 4; position: static; width: auto; height: auto; margin: 4px 12px 12px; padding: 12px; flex-direction: column; gap: 14px; }
  .d-hero { width: 100%; height: auto; aspect-ratio: 300 / 228; }
  .d-hero--mentra img, .d-hero--bb img { left: -20%; width: 140%; height: 100%; }
  .d-info { width: auto; gap: 16px; padding: 0 2px 4px; }
  .d-open { padding: 9px 16px; font-size: 15px; border-radius: 10px; }
  .f-count { order: 5; position: static; padding: 0 0 14px; }

  /* Dock */
  .dock { --dock-s: 0.8; background: rgba(60, 100, 150, 0.55); position: fixed; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); transform-origin: 50% 100%; }
  .dock-app--trash, .dock-app--preview, .dock-sep { display: none; }
  .tooltip { display: none; }

  /* Preview — full screen */
  .window.preview { position: fixed; inset: 0; left: 0 !important; top: 0 !important; width: 100%; height: 100%; border-radius: 0; border: 0; z-index: 70; }
  .p-sidebar, .p-sideicon, .p-tool[data-zoom] { display: none; }
  .p-main { left: 0; }
  .p-toolbar { height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 16px; gap: 6px; }
  .p-title strong { font-size: 15px; }
  .p-done { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--blue); font-size: 16px; font-weight: 600; }
  .p-done:active { opacity: 0.6; }
  .p-pages { top: calc(56px + env(safe-area-inset-top)); padding: 12px 12px calc(40px + env(safe-area-inset-bottom)); gap: 12px; grid-template-columns: minmax(0, 1fr); }
  .p-page { width: 100%; }
  .sleep { position: fixed; }

  /* No window management on phones: one thing at a time */
  .lights, .dock-min { display: none !important; }

  /* Art: the Work card becomes the gallery */
  .finder[data-view="art"] { left: auto; top: auto; width: auto; height: auto; }
  .finder[data-view="art"] .f-sidebar { order: 2; }
  .f-sub { display: none; }
  .f-gallery { order: 3; position: static; display: flex; flex-direction: column; }
  .g-stage { padding: 12px 16px 4px; height: min(92vw, 380px); }
  .g-stage > * { width: min(100cqw, 100cqh * var(--r, 1)); }
  .g-film { padding: 14px 16px 6px; box-shadow: none; }
  .g-insp { background: none; box-shadow: none; padding: 8px 16px 18px; overflow: visible; }
  .g-hint { display: none; }
  .g-actions { margin-top: 14px; }
  .g-btn { padding: 9px 16px; font-size: 15px; border-radius: 10px; }

  /* Quick Look: full screen */
  .ql { position: fixed; left: 0; top: 0; width: 100%; height: 100%; border-radius: 0; z-index: 80; }
  .ql-bar { height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .ql-media { left: 12px; right: 12px; top: calc(60px + env(safe-area-inset-top)); bottom: 60px; width: auto; height: auto; }
  .ql-arrow { top: 50%; }
  .ql-arrow--prev { left: 16px; } .ql-arrow--next { right: 16px; }

  /* Notes: full-screen list, tap a note to read it */
  .window.notes { position: fixed; inset: 0; left: 0 !important; top: 0 !important; width: 100%; height: 100%; border-radius: 0; border: 0; z-index: 70; display: block; }
  .n-folders { display: none; }
  .n-list, .n-editor { position: absolute; inset: 0; }
  .notes[data-pane="list"] .n-editor { display: none; }
  .notes[data-pane="editor"] .n-list { display: none; }
  .n-list-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 6px 16px; }
  .n-search { flex: 1; height: 34px; }
  .n-search input { font-size: 16px; }
  .n-done { display: inline-flex; order: 2; height: 34px; align-items: center; padding: 0 4px; color: #b78300; font-size: 16px; font-weight: 600; }
  .n-chips { display: flex; gap: 8px; padding: 6px 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .n-chips .n-tag { padding: 7px 13px; font-size: 14px; flex: none; }
  .n-item { padding: 12px 12px; }
  .n-item-title { font-size: 16px; }
  .n-item-sub { font-size: 14px; }
  .n-tools { height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; justify-content: space-between; }
  .n-hist { display: none; }
  .n-back { display: inline-flex; color: #b78300; font-size: 17px; font-weight: 500; }
  .n-body { padding: 16px 20px 40px; }
  .n-text { font-size: 17px; line-height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  /* hover responses stay (small and pointer-driven), without the overshoot */
  .intro-avatar, .hi-note span, .hi-note img, .chip, .doodle { transition-timing-function: var(--ease-out); }
  .now-dot { animation: none; }
  .motion [data-enter], .motion .dock, .d-info > *, .d-hero > *, .dock-app--preview { animation: none; }
  .file, .p-page { transition: opacity 150ms ease; }
}
