/* ==========================================================================
   Desktop Portfolio — original theme
   Fonts: Space Grotesk (UI) + Instrument Serif (display accents)
   Wide screens get a desktop OS; small screens get a phone OS. One theme.
   ========================================================================== */

:root {
  --ui: "Space Grotesk", "Inter", system-ui, sans-serif;
  --display: "Instrument Serif", Georgia, serif;

  --ink: #eef2f7;
  --ink-dim: rgba(238, 242, 247, 0.62);
  --panel: rgba(18, 22, 30, 0.86);
  --panel-solid: #12161e;
  --panel-border: rgba(255, 255, 255, 0.14);
  --accent: #7fb4ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --radius: 14px;

  /* the custom pixel cursor, kept in one place so anything interactive
     can opt in without falling back to the OS pointer */
  --cursor-arrow: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24"><path d="M3 2 L21 11 L13 13 L10 21 Z" fill="%23181818" stroke="%23ffffff" stroke-width="1.6" stroke-linejoin="round"/></svg>') 1 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--ui);
  background: #0a0e14;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Custom pixel-style cursor (original SVG) */
body, #stage, .window, button, a, .icon, .dock-app, .swatch, .np-bar.seekable,
.stickies-app, .stickies-app *, .sticky, .sticky * {
  cursor: var(--cursor-arrow), auto;
}

::selection { background: rgba(127, 180, 255, 0.35); }

button { font-family: inherit; color: inherit; background: none; border: none; }

/* ==========================================================================
   Wallpapers (applied on <body> via data-wallpaper; shared by both shells)
   ========================================================================== */

/* dusk → aurora night: teal + violet ribbons over deep navy, faint stars */
body[data-wallpaper="dusk"] #desktop, body[data-wallpaper="dusk"] #phone {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><g fill='white'><circle cx='24' cy='40' r='1'/><circle cx='90' cy='18' r='0.7'/><circle cx='150' cy='70' r='1.1'/><circle cx='210' cy='30' r='0.8'/><circle cx='60' cy='120' r='0.7'/><circle cx='190' cy='140' r='1'/><circle cx='120' cy='190' r='0.8'/><circle cx='240' cy='210' r='0.7'/><circle cx='30' cy='230' r='1'/></g></svg>") repeat,
    radial-gradient(55% 40% at 72% 12%, rgba(110, 231, 200, 0.20), transparent 65%),
    radial-gradient(45% 55% at 22% 8%,  rgba(178, 140, 255, 0.28), transparent 65%),
    radial-gradient(70% 40% at 50% 30%, rgba(90, 140, 255, 0.12), transparent 70%),
    linear-gradient(180deg, #1b2a52 0%, #131c3a 45%, #080c1c 100%);
}

/* sunset → golden hour: low sun glow, warm bands fading to plum */
body[data-wallpaper="sunset"] #desktop, body[data-wallpaper="sunset"] #phone {
  background:
    radial-gradient(30% 24% at 50% 62%, rgba(255, 214, 140, 0.85), rgba(255, 150, 96, 0.35) 55%, transparent 78%),
    radial-gradient(90% 45% at 50% 78%, rgba(216, 106, 90, 0.5), transparent 75%),
    linear-gradient(180deg, #241543 0%, #4e2358 34%, #93415f 58%, #d4795c 78%, #f0b06a 100%);
}

/* tide: midnight blue, a pearlescent wave and fine static grain */
body[data-wallpaper="tide"] #desktop, body[data-wallpaper="tide"] #phone {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 10px),
    radial-gradient(75% 50% at 8% 106%, rgba(72, 199, 211, 0.42), transparent 65%),
    radial-gradient(60% 44% at 88% 18%, rgba(104, 111, 255, 0.38), transparent 68%),
    radial-gradient(48% 30% at 50% 58%, rgba(188, 125, 255, 0.18), transparent 75%),
    linear-gradient(145deg, #07152b 0%, #10294b 48%, #080d1d 100%);
}

/* moss → misty forest: sun shaft through green haze */
body[data-wallpaper="moss"] #desktop, body[data-wallpaper="moss"] #phone {
  background:
    radial-gradient(45% 55% at 78% 6%,  rgba(220, 255, 190, 0.22), transparent 60%),
    radial-gradient(60% 45% at 30% 25%, rgba(110, 190, 150, 0.16), transparent 65%),
    radial-gradient(80% 60% at 50% 110%, rgba(10, 40, 28, 0.9), transparent 90%),
    linear-gradient(180deg, #38604c 0%, #23453a 48%, #0a1712 100%);
}

/* mono → studio noir: soft top beam, vignette, warm-grey base */
body[data-wallpaper="mono"] #desktop, body[data-wallpaper="mono"] #phone {
  background:
    radial-gradient(50% 38% at 50% -5%, rgba(255, 255, 255, 0.14), transparent 70%),
    radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, #34373f 0%, #212329 52%, #0d0e11 100%);
}

/* ==========================================================================
   Lock screen (shared)
   ========================================================================== */

#lockscreen {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 9vh 24px calc(8vh + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(127, 180, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #1c2f55 0%, #0e1730 55%, #0a0e1c 100%);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
#lockscreen.hide { opacity: 0; transform: scale(1.04); pointer-events: none; }

.lock-center { text-align: center; }
.lock-clock {
  font-size: clamp(56px, 9vw, 108px);
  font-weight: 300; letter-spacing: -0.03em;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}
.lock-date {
  margin-top: 4px;
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim);
}

.lock-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lock-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 34px;
  background: linear-gradient(145deg, #7fb4ff, #b48cf2);
  color: #0b1020;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.lock-name { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.lock-role {
  margin-top: -8px;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim);
}
.lock-cta {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  animation: bob 2.4s ease-in-out infinite;
}
.lock-cta svg { width: 13px; height: 13px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ==========================================================================
   Grain overlay (shared)
   ========================================================================== */

#grain {
  position: fixed; inset: -2px; z-index: 8000; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
  background-size: 220px 220px;
  opacity: 0.16; mix-blend-mode: overlay;
}

/* ==========================================================================
   Desktop chrome
   ========================================================================== */

#desktop {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  opacity: 0; transition: opacity 0.5s ease 0.15s;
}
#desktop.show { opacity: 1; }

/* --- Menu bar --- */
#menubar {
  position: relative; z-index: 500;
  height: 34px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  font-size: 12.5px;
  background: rgba(10, 13, 20, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 14px; }
.mb-logo { font-size: 14px; color: var(--accent); }
.mb-name { font-weight: 600; }
.mb-menus { display: flex; gap: 4px; }
.mb-menu { position: relative; }
.mb-trigger {
  padding: 4px 9px; border-radius: 6px;
  color: var(--ink-dim); font-size: 12.5px;
}
.mb-menu.open .mb-trigger, .mb-trigger:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.mb-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
  display: none; flex-direction: column; padding: 6px;
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border); border-radius: 10px;
  box-shadow: var(--shadow);
}
.mb-menu.open .mb-dropdown { display: flex; }
.mb-item {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 12.5px; text-align: left; white-space: nowrap;
}
.mb-item:hover { background: rgba(127, 180, 255, 0.18); }
.mb-item .kbd { color: var(--ink-dim); font-size: 11px; }
.mb-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, 0.18); }
.mb-clock { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.mb-icon { font-size: 13px; color: var(--ink-dim); }
.mb-icon:hover { color: var(--ink); }

.wp-swatches { display: flex; gap: 6px; align-items: center; }
.swatch {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease;
}
.swatch:hover { transform: scale(1.25); }
.swatch.active { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 1px; }
.swatch[data-wp="dusk"]   { background: linear-gradient(135deg, #b28cff 0%, #1b2a52 55%, #080c1c 100%); }
.swatch[data-wp="sunset"] { background: linear-gradient(160deg, #4e2358 0%, #d4795c 60%, #f0b06a 100%); }
.swatch[data-wp="tide"]   { background: linear-gradient(145deg, #48c7d3 0%, #686fff 48%, #080d1d 100%); }
.swatch[data-wp="moss"]   { background: linear-gradient(160deg, #6ebe96 0%, #23453a 60%, #0a1712 100%); }
.swatch[data-wp="mono"]   { background: linear-gradient(160deg, #6a6e78 0%, #212329 60%, #0d0e11 100%); }

/* ==========================================================================
   Stage: icons + widgets
   ========================================================================== */

#stage { position: relative; flex: 1; overflow: hidden; }

/* icons are absolutely placed and draggable; the layer itself is click-through
   so the empty desktop behind it stays interactive */
#iconLayer { position: absolute; inset: 0; pointer-events: none; }

.icon {
  position: absolute;
  pointer-events: auto;
  width: 92px; padding: 10px 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-radius: 10px; border: 1px solid transparent;
  text-align: center;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.icon:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.1); }
.icon.dragging {
  z-index: 60;
  background: rgba(127, 180, 255, 0.16);
  border-color: rgba(127, 180, 255, 0.45);
  transform: scale(1.06);
  transition: none;
}
.icon.settling { transition: left 0.14s ease, top 0.14s ease; }
.icon-glyph { font-size: 34px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45)); }
.icon-label {
  font-size: 11.5px; line-height: 1.2; color: var(--ink);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.icon-sub { font-size: 9.5px; color: var(--ink-dim); }

/* --- Widgets --- */
.widget {
  position: absolute;
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.wx-card {
  top: 26px; right: 26px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
}
.wx-emoji { font-size: 30px; }
.wx-temp { font-size: 20px; font-weight: 600; }
.wx-loc { font-size: 11px; color: var(--ink-dim); letter-spacing: 0.08em; text-transform: uppercase; }

.now-playing {
  right: 26px; top: 116px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; width: 250px;
}
.np-art {
  width: 42px; height: 42px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(145deg, #b48cf2, #7fb4ff); color: #0b1020;
}
.now-playing.playing .np-art { animation: spin 5s linear infinite; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
.np-meta { flex: 1; min-width: 0; }
.np-label { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.np-track { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar { margin-top: 6px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.np-bar.seekable { height: 5px; margin-top: 5px; }
.np-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.5s linear; }
.np-btn { font-size: 13px; color: var(--ink-dim); flex: none; }
.np-btn:hover { color: var(--ink); }
.np-next { font-size: 11px; }

/* beat visualiser — collapsed until playback starts */
.np-viz-wrap { height: 0; overflow: hidden; transition: height 0.28s ease; }
.playing .np-viz-wrap { height: 30px; }
.np-viz { display: block; width: 100%; height: 26px; margin-top: 4px; }

/* ==========================================================================
   Windows
   ========================================================================== */

.window {
  position: absolute; min-width: 320px;
  display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
.window.closing { animation: unpop 0.18s ease forwards; }
@keyframes unpop { to { opacity: 0; transform: scale(0.94) translateY(8px); } }
.window.minimized { display: none; }

.w-titlebar {
  flex: none; height: 38px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none; touch-action: none;
}
.w-dots { display: flex; gap: 7px; }
.w-dot { width: 12px; height: 12px; border-radius: 50%; border: none; padding: 0; }
.w-dot.close { background: #ff5f57; }
.w-dot.min   { background: #febc2e; }
.w-dot.zoom  { background: #28c840; }
.w-dot:hover { filter: brightness(1.2); }
.w-title {
  flex: 1; text-align: center; margin-right: 50px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* resize handles (invisible hit areas on edges + corner grip) */
.w-rz { position: absolute; z-index: 5; }
.w-rz-r  { top: 38px; right: -3px; width: 8px; bottom: 14px; cursor: ew-resize; }
.w-rz-b  { left: 14px; right: 14px; bottom: -3px; height: 8px; cursor: ns-resize; }
.w-rz-se {
  right: -2px; bottom: -2px; width: 18px; height: 18px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 55%, rgba(255, 255, 255, 0.35) 55%, rgba(255, 255, 255, 0.35) 62%, transparent 62%,
      transparent 72%, rgba(255, 255, 255, 0.35) 72%, rgba(255, 255, 255, 0.35) 79%, transparent 79%);
  border-bottom-right-radius: var(--radius);
}

.w-body { flex: 1; overflow: auto; overscroll-behavior: contain; }
.w-body::-webkit-scrollbar { width: 8px; }
.w-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 4px; }

/* ==========================================================================
   App content styles (shared by desktop windows and phone sheets)
   ========================================================================== */

/* --- Case studies --- */
.cs-tabs {
  display: flex; gap: 2px; padding: 10px 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky; top: 0; background: var(--panel-solid); z-index: 2;
  overflow-x: auto; scrollbar-width: none;
}
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-tab {
  padding: 9px 14px 11px; border-radius: 9px 9px 0 0;
  text-align: left; color: var(--ink-dim); flex: none;
}
.cs-tab .t-num { font-size: 9px; letter-spacing: 0.18em; color: var(--accent); display: block; }
.cs-tab .t-name { font-size: 12.5px; font-weight: 500; }
.cs-tab.active { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.cs-tab:disabled { opacity: 0.4; }

.cs-page { padding: 26px 28px 34px; display: none; }
.cs-page.active { display: block; }
.cs-kicker { font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent); }
.cs-title { font-family: var(--display); font-size: 34px; font-weight: 400; margin: 8px 0 4px; letter-spacing: -0.01em; }
.cs-subtitle { font-size: 14px; color: var(--ink-dim); max-width: 52ch; line-height: 1.55; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 20px; }
.cs-tag {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18); color: var(--ink-dim);
}
.cs-banner {
  height: 190px; border-radius: 12px; margin-bottom: 22px;
  display: grid; place-items: center; font-size: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cs-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 24px; }
.cs-metric {
  padding: 14px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-metric .num { font-family: var(--display); font-size: 26px; color: var(--accent); }
.cs-metric .lbl { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); margin-top: 3px; }
.cs-section-title {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-dim); margin: 22px 0 10px;
}
.cs-copy { font-size: 13.5px; line-height: 1.7; color: rgba(238, 242, 247, 0.85); max-width: 62ch; }
.cs-finding {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 13px; line-height: 1.55; color: rgba(238, 242, 247, 0.85);
}
.cs-finding .fx { color: var(--accent); flex: none; }
.cs-empty { padding: 34px 30px; }

/* --- Photos --- */
.pho-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px; padding: 22px;
}
.pho-item { text-align: center; transition: transform 0.18s ease; }
.pho-item:hover { transform: rotate(-2deg) scale(1.05); }
.pho-frame {
  aspect-ratio: 1; border-radius: 6px;
  display: grid; place-items: center; font-size: 40px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 6px 20px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.pho-frame .pho-fill { width: 100%; height: 100%; border-radius: 3px; display: grid; place-items: center; }
.pho-frame .pho-img { width: 100%; height: 100%; border-radius: 3px; object-fit: cover; display: block; }
.pho-name { margin-top: 8px; font-size: 11px; color: var(--ink-dim); }

/* --- Bookshelf --- */
.shelf { padding: 26px 24px; }
.shelf-row {
  display: flex; align-items: flex-end; gap: 5px;
  padding: 0 8px 0; min-height: 150px;
  border-bottom: 6px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 26px;
  overflow-x: auto;
}
.book {
  writing-mode: vertical-rl;
  display: flex; align-items: center; justify-content: center;
  width: 34px; padding: 12px 0; flex: none;
  border-radius: 4px 4px 0 0;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  color: rgba(10, 14, 20, 0.85);
  transition: transform 0.15s ease;
}
.book:hover { transform: translateY(-8px); }
.shelf-note { font-size: 12px; color: var(--ink-dim); line-height: 1.6; }

/* --- Stickies --- */
.stickies-app { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.stickies-tools {
  flex: none;
  display: flex; justify-content: flex-end; gap: 7px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stickies-tool {
  min-width: 34px; height: 30px; padding: 0 10px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.stickies-tool:hover { background: rgba(255, 255, 255, 0.14); }
.stickies-wrap { position: relative; flex: 1; min-height: 260px; padding: 22px; overflow: hidden; }
.sticky {
  position: absolute;
  width: 168px; min-height: 150px; padding: 14px;
  font-size: 12.5px; line-height: 1.5; color: #2b2417;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt, -1.5deg));
  user-select: none; touch-action: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.sticky.dragging {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45);
  transform: rotate(var(--tilt, -1.5deg)) scale(1.04);
  z-index: 10;
}
.sticky-title {
  display: block; margin-bottom: 6px;
  font-weight: 700;
  padding-right: 34px;
  cursor: var(--cursor-arrow), auto;
}
.sticky-body { min-height: 84px; cursor: var(--cursor-arrow), auto; }
.sticky-title:focus, .sticky-body:focus { outline: none; }
.sticky-control {
  position: absolute; top: 7px; right: 8px;
  width: 18px; height: 18px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 13px; line-height: 1;
  color: rgba(43, 36, 23, 0.45);
}
.sticky-drag {
  right: 30px;
  cursor: var(--cursor-arrow), auto;
}
.sticky-delete {
  font-size: 14px;
  color: rgba(43, 36, 23, 0.42);
  cursor: var(--cursor-arrow), auto;
}
.sticky-control:hover {
  background: rgba(43, 36, 23, 0.08);
  color: rgba(43, 36, 23, 0.72);
}
.sticky.dragging .sticky-drag { cursor: var(--cursor-arrow), auto; }

/* --- Notebook --- */
.notebook { padding: 26px 30px 34px; }
.nb-entry { padding: 14px 0; border-bottom: 1px dashed rgba(255,255,255,0.1); }
.nb-date { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.nb-title { font-family: var(--display); font-size: 20px; margin: 4px 0 6px; }
.nb-body { font-size: 13px; line-height: 1.65; color: rgba(238,242,247,0.8); max-width: 58ch; }

/* --- About --- */
.about { padding: 28px 30px 34px; }
.about .a-hero { font-family: var(--display); font-size: 30px; line-height: 1.25; max-width: 24ch; }
.about .a-hero em { color: var(--accent); }
.about p { margin-top: 14px; font-size: 13.5px; line-height: 1.7; color: rgba(238,242,247,0.82); max-width: 56ch; }
.a-section-title {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-dim); margin: 24px 0 10px;
}
.a-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.a-chip {
  font-size: 12px; padding: 7px 13px; border-radius: 999px;
  background: rgba(127, 180, 255, 0.1);
  border: 1px solid rgba(127, 180, 255, 0.28);
}
.a-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.a-social {
  font-size: 12px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2); color: var(--ink); text-decoration: none;
}
.a-social:hover { border-color: var(--accent); color: var(--accent); }
.a-photos-cta {
  margin-top: 24px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
}
.a-photos-cta:hover { background: rgba(127, 180, 255, 0.14); }
.a-credit { font-size: 11.5px !important; line-height: 1.6; color: var(--ink-dim) !important; margin-top: 6px !important; }

/* --- Wallpaper picker (phone settings app) --- */
.wp-picker { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wp-card {
  height: 130px; border-radius: 14px;
  display: flex; align-items: flex-end; padding: 12px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.wp-card.active { border-color: var(--accent); }
.wp-card[data-wp="dusk"] {
  background:
    radial-gradient(60% 45% at 70% 15%, rgba(110, 231, 200, 0.25), transparent 65%),
    radial-gradient(50% 60% at 22% 10%, rgba(178, 140, 255, 0.32), transparent 65%),
    linear-gradient(180deg, #1b2a52, #080c1c);
}
.wp-card[data-wp="sunset"] {
  background:
    radial-gradient(34% 26% at 50% 58%, rgba(255, 214, 140, 0.9), transparent 75%),
    linear-gradient(180deg, #241543 0%, #93415f 55%, #f0b06a 100%);
}
.wp-card[data-wp="tide"] {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 10px),
    radial-gradient(70% 55% at 8% 110%, rgba(72, 199, 211, 0.55), transparent 65%),
    radial-gradient(65% 55% at 88% 10%, rgba(104, 111, 255, 0.48), transparent 68%),
    linear-gradient(145deg, #07152b, #10294b 55%, #080d1d);
}
.wp-card[data-wp="moss"] {
  background:
    radial-gradient(50% 55% at 75% 8%, rgba(220, 255, 190, 0.25), transparent 60%),
    linear-gradient(180deg, #38604c, #0a1712);
}
.wp-card[data-wp="mono"] {
  background:
    radial-gradient(55% 40% at 50% -5%, rgba(255, 255, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #34373f, #0d0e11);
}
.wp-picker-note { grid-column: 1 / -1; font-size: 12px; color: var(--ink-dim); }

/* --- Terminal --- */
.term {
  min-height: 100%;
  padding: 16px 18px 22px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.6;
  background: rgba(6, 9, 14, 0.55);
  cursor: text;
}
.tm { white-space: pre-wrap; word-break: break-word; }
.tm-cmd { color: var(--ink); }
.tm-dim { color: var(--ink-dim); }
.tm-err { color: #ff8b84; }
.tm-ok  { color: #7ee38a; }
.tm-accent { color: var(--accent); }
.tm-file { color: var(--ink); }
.tm-dir  { color: #7ee38a; font-weight: 600; }
.term a { color: var(--accent); }

.term-row { display: flex; gap: 8px; align-items: baseline; }
.term-prompt { color: var(--accent); flex: none; white-space: nowrap; }
.term-input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none; padding: 0;
  font: inherit; color: var(--ink);
  caret-color: var(--accent);
}

/* --- Paint --- */
.paint-wrap {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px 16px; height: 100%;
}
.paint-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pt-color {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease;
}
.pt-color:hover { transform: scale(1.18); }
.pt-color.active { border-color: #fff; transform: scale(1.18); box-shadow: 0 0 0 2px rgba(127, 180, 255, 0.5); }
.pt-size {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.pt-size i { display: block; border-radius: 50%; background: var(--ink); }
.pt-size.active { background: rgba(127, 180, 255, 0.25); border-color: var(--accent); }
.pt-btn {
  padding: 7px 12px; border-radius: 9px; font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.pt-btn:hover { background: rgba(255, 255, 255, 0.14); }
.pt-btn.active { background: rgba(127, 180, 255, 0.25); border-color: var(--accent); }
.pt-btn.pt-primary { border-color: var(--accent); color: var(--accent); }
.pt-btn.pt-primary:hover { background: rgba(127, 180, 255, 0.16); }
.pt-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.18); }
.paint-canvas {
  /* locked to the 1920×1080 backing store's ratio so strokes are never distorted */
  aspect-ratio: 16 / 9;
  width: 100%; height: auto;
  max-height: 100%; margin: 0 auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  touch-action: none;
  cursor: crosshair;
}
.paint-hint { font-size: 11px; color: var(--ink-dim); text-align: center; }

/* --- Media player --- */
.mp {
  display: grid;
  grid-template-columns: 1fr 218px;
  grid-template-rows: 1fr auto;
  height: 100%; min-height: 0;
  background: #090c13;
}

.mp-stage { position: relative; min-height: 0; overflow: hidden; }
.mp-viz { display: block; width: 100%; height: 100%; }
.mp-np {
  position: absolute; left: 0; right: 0; bottom: 16px;
  text-align: center; pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}
.mp-np-title { font-family: var(--display); font-size: 25px; letter-spacing: 0.01em; }
.mp-np-artist {
  margin-top: 2px;
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim);
}

.mp-lib {
  display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
}
.mp-lib-head {
  padding: 12px 14px;
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mp-lib-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }

.mp-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; text-align: left;
  border-left: 2px solid transparent;
}
.mp-row:hover { background: rgba(255, 255, 255, 0.06); }
.mp-row.active { background: rgba(127, 180, 255, 0.14); border-left-color: var(--accent); }
.mp-row-n {
  font-size: 10px; color: var(--ink-dim); flex: none;
  font-variant-numeric: tabular-nums;
}
.mp-row.active .mp-row-n { color: var(--accent); }
.mp-row-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mp-row-title {
  font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-row-artist {
  font-size: 10px; color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* little equaliser that only animates on the playing row */
.mp-row-eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; opacity: 0; flex: none; }
.mp-row.playing .mp-row-eq { opacity: 1; }
.mp-row-eq i { width: 2px; height: 4px; background: var(--accent); border-radius: 1px; }
.mp-row.playing .mp-row-eq i { animation: eq 0.9s ease-in-out infinite; }
.mp-row.playing .mp-row-eq i:nth-child(2) { animation-delay: 0.25s; }
.mp-row.playing .mp-row-eq i:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.mp-controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.25);
}
.mp-btn { font-size: 15px; color: var(--ink-dim); flex: none; }
.mp-btn:hover { color: var(--ink); }
.mp-play { font-size: 19px; color: var(--ink); }
.mp-time {
  font-size: 10.5px; color: var(--ink-dim); flex: none;
  font-variant-numeric: tabular-nums;
}
.mp-seek {
  flex: 1; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  cursor: var(--cursor-arrow), auto;
}
.mp-seek-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7fb4ff, #b48cf2);
  transition: width 0.5s linear;
}

@media (max-width: 820px) {
  /* minmax keeps the visualiser from collapsing if the sheet's height
     resolves late or short */
  .mp { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 1fr) 150px auto; }
  .mp-lib { border-left: none; border-top: 1px solid rgba(255, 255, 255, 0.09); }
  .mp-np-title { font-size: 21px; }
  .mp-controls { padding: 10px 12px; gap: 9px; }
}

/* --- Notepad (text editor) --- */
.ed { display: flex; height: 100%; min-height: 0; font-size: 13px; }

.ed-side {
  width: 168px; flex: none;
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}
.ed-new {
  padding: 11px 12px; text-align: left; font-size: 12px;
  color: var(--accent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ed-new:hover { background: rgba(127, 180, 255, 0.12); }
.ed-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ed-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 9px 12px; text-align: left;
  border-left: 2px solid transparent;
}
.ed-item:hover { background: rgba(255, 255, 255, 0.05); }
.ed-item.active { background: rgba(127, 180, 255, 0.14); border-left-color: var(--accent); }
.ed-item-title {
  font-size: 12px; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-item-date { font-size: 10px; color: var(--ink-dim); }

.ed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-top {
  display: flex; gap: 6px; align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ed-title {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font: inherit; font-weight: 500; color: var(--ink);
  padding: 5px 7px; border-radius: 6px;
}
.ed-title:focus { background: rgba(255, 255, 255, 0.07); }
.ed-btn {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ed-btn:hover { background: rgba(255, 255, 255, 0.1); }
.ed-btn.armed { background: rgba(255, 95, 87, 0.28); border-color: #ff5f57; color: #fff; }

.ed-area {
  flex: 1; width: 100%; min-height: 0;
  resize: none; outline: none; border: none;
  padding: 16px 18px;
  background: transparent; color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7;
  caret-color: var(--accent);
}
.ed-area::placeholder { color: rgba(238, 242, 247, 0.3); }

.ed-bar {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 12px;
  font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 820px) {
  .ed-side { width: 118px; }
  .ed-area { padding: 14px; }
}

/* --- Dino run --- */
.dino-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 20px; }
.dino-canvas {
  width: 100%; max-width: 600px; height: auto;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0f16;
  touch-action: none;
  image-rendering: pixelated;
}
.dino-hud { display: flex; gap: 20px; font-size: 12px; color: var(--ink-dim); letter-spacing: 0.08em; }
.dino-hud b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dino-hint { font-size: 11px; color: var(--ink-dim); text-align: center; }
.dino-pad { display: none; gap: 10px; }
.dino-pad button {
  padding: 12px 26px; border-radius: 12px; font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  user-select: none; touch-action: none;
}
.dino-pad button:active { background: rgba(127, 180, 255, 0.3); }
@media (pointer: coarse) { .dino-pad { display: flex; } }

/* --- Snake --- */
.snake-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; }
.snake-wrap canvas {
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: #0b0f16;
  max-width: 100%; touch-action: none;
}
.snake-hud { display: flex; gap: 20px; font-size: 12px; color: var(--ink-dim); letter-spacing: 0.08em; }
.snake-hud b { color: var(--ink); }
.snake-hint { font-size: 11px; color: var(--ink-dim); text-align: center; }

.snake-pad {
  display: none;
  grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 46px);
  gap: 8px; margin-top: 4px;
}
.snake-pad button {
  border-radius: 12px; font-size: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.snake-pad button:active { background: rgba(127, 180, 255, 0.3); }
.snake-pad .sp-up    { grid-column: 2; grid-row: 1; }
.snake-pad .sp-left  { grid-column: 1; grid-row: 2; }
.snake-pad .sp-down  { grid-column: 2; grid-row: 2; }
.snake-pad .sp-right { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .snake-pad { display: grid; } }

/* ==========================================================================
   Dock (desktop)
   ========================================================================== */

#dock {
  position: relative; z-index: 600; flex: none;
  display: flex; justify-content: center;
  padding: 0 16px 14px;
}
.dock-inner {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 12px;
  background: rgba(14, 18, 26, 0.6); backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.dock-app {
  position: relative;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 24px;
  transition: transform 0.16s ease;
}
.dock-app:hover { transform: translateY(-10px) scale(1.18); }
.dock-app::after {
  content: attr(data-label);
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 7px; white-space: nowrap;
  font-size: 11px; background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.dock-app:hover::after { opacity: 1; }
.dock-app .dot {
  position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  opacity: 0;
}
.dock-app.running .dot { opacity: 1; }
.dock-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: rgba(255, 255, 255, 0.14); }

/* ==========================================================================
   Phone shell (small screens)
   ========================================================================== */

#phone {
  display: none;
  position: fixed; inset: 0; z-index: 1;
  flex-direction: column;
  opacity: 0; transition: opacity 0.5s ease 0.15s;
  padding-top: env(safe-area-inset-top, 0px);
}
#phone.show { opacity: 1; }

/* --- Status bar --- */
.ph-status {
  flex: none; height: 40px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ps-name { color: var(--ink-dim); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; font-size: 10px; }
.ps-icons { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: 1px; color: var(--ink-dim); }
.ps-batt {
  width: 22px; height: 11px; border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 1.5px; display: block;
}
.ps-batt-fill { display: block; height: 100%; width: 72%; border-radius: 1.5px; background: var(--accent); }

/* --- Home screen --- */
.ph-home {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px 20px;
}
.ph-greet { margin: 6px 2px 18px; }
.phg-hello { font-family: var(--display); font-size: 32px; letter-spacing: -0.01em; }
.phg-hello em { color: var(--accent); font-style: italic; }
.phg-role { margin-top: 2px; font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim); }

.ph-widgets { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.phw {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border); border-radius: 16px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}
.phw .now-playing-inline { display: flex; align-items: center; gap: 12px; width: 100%; }

/* phone reuses .np-* / .wx-* pieces inside .phw */
.phw .wx-emoji { font-size: 26px; }
.phw .wx-temp { font-size: 18px; }
.phw.playing .np-art { animation: spin 5s linear infinite; border-radius: 50%; }

/* --- App grid --- */
.ph-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px 10px;
}
.ph-app { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.ph-app-tile {
  width: 58px; height: 58px; border-radius: 16px;
  display: grid; place-items: center; font-size: 27px;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}
.ph-app:active .ph-app-tile { transform: scale(0.9); }
.ph-app-label {
  font-size: 10.5px; color: var(--ink);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- Phone dock --- */
.ph-dock {
  flex: none;
  padding: 0 14px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center;
}
.phd-inner {
  display: flex; gap: 14px;
  max-width: 100%;
  padding: 11px 16px;
  background: rgba(14, 18, 26, 0.6); backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 26px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.phd-inner .ph-app-tile { width: 48px; height: 48px; font-size: 22px; }
.phd-inner .ph-app-label { display: none; }

/* narrow handsets — keep five tiles on one row */
@media (max-width: 380px) {
  .phd-inner { gap: 9px; padding: 10px 11px; }
  .phd-inner .ph-app-tile { width: 44px; height: 44px; font-size: 20px; }
}

.ph-homebar {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 4px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* --- Sheets (full-screen phone apps) --- */
#sheetLayer { position: absolute; inset: 0; pointer-events: none; z-index: 700; }
.sheet {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  pointer-events: auto;
  background: rgba(12, 15, 22, 0.97); backdrop-filter: blur(22px);
  padding-top: env(safe-area-inset-top, 0px);
  animation: sheetUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheetUp { from { transform: translateY(6%); opacity: 0; } }
.sheet.closing { animation: sheetDown 0.24s ease forwards; }
@keyframes sheetDown { to { transform: translateY(8%); opacity: 0; } }

.sheet-head {
  flex: none; height: 52px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sheet-back {
  display: flex; align-items: center; gap: 3px;
  font-size: 14px; color: var(--accent);
  padding: 8px 10px;
}
.sheet-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 600; color: var(--ink-dim);
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Phone-size content adjustments */
@media (max-width: 820px) {
  .cs-page { padding: 22px 18px 30px; }
  .cs-title { font-size: 28px; }
  .cs-banner { height: 150px; }
  .notebook, .about { padding: 22px 20px 30px; }
  .stickies-wrap { justify-content: center; }
}

/* ==========================================================================
   Shell switching
   ========================================================================== */

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
  #desktop { display: none !important; }
  #phone { display: flex; }
}
