/* Apple-inspired UI — system font, frosted glass, soft depth, blue accent */
:root {
  --bg: #1d1d1f;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --blue: #0a84ff;
  --blue-press: #0071e3;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --sep: rgba(60, 60, 67, .14);
  --glass: rgba(246, 246, 248, .72);
  --glass-dark: rgba(40, 40, 44, .55);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.25, .8, .25, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.04);          /* fallback: gentle settle, almost no overshoot */
  --smooth: cubic-bezier(.32, .72, 0, 1);            /* Apple's standard ease-out */
}
/* Real spring curves where supported (sampled from SwiftUI-style springs: response 0.42 s / damping 0.82, and 0.5 s / 1.0) */
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0.0, 0.0337, 0.1156, 0.2226, 0.3389, 0.4538, 0.5605, 0.6554, 0.7369, 0.8048, 0.8599, 0.9035, 0.9371, 0.9622, 0.9804, 0.9931, 1.0016, 1.0069, 1.0097, 1.0109, 1.011, 1.0104, 1.0093, 1.0081, 1.0068, 1.0055, 1.0044, 1.0034, 1.0026, 1.0019, 1.0013, 1.0009, 1.0006, 1.0003, 1.0001, 1.0, 1.0, 0.9999, 0.9999, 0.9999, 0.9999, 0.9999, 0.9999, 0.9999, 0.9999, 0.9999, 1.0, 1.0, 1);
    --smooth: linear(0.0, 0.0238, 0.0816, 0.1582, 0.2431, 0.3294, 0.4129, 0.4909, 0.562, 0.6256, 0.6819, 0.731, 0.7736, 0.8101, 0.8412, 0.8677, 0.89, 0.9088, 0.9246, 0.9377, 0.9487, 0.9578, 0.9653, 0.9716, 0.9767, 0.9809, 0.9844, 0.9873, 0.9896, 0.9916, 0.9931, 0.9944, 0.9955, 0.9963, 0.997, 0.9976, 0.998, 0.9984, 0.9987, 0.999, 0.9992, 0.9993, 0.9995, 0.9996, 0.9996, 0.9997, 0.9998, 0.9998, 1); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(10, 132, 255, .6); outline-offset: 2px; }

/* ───────── Desk stage ───────── */
.stage { position: fixed; inset: 0; cursor: grab; touch-action: none; }
.stage:active { cursor: grabbing; }
.stage.pointer { cursor: pointer; }
.stage canvas { display: block; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 90% at 50% 45%, transparent 62%, rgba(12, 12, 13, .45) 120%); }   /* a soft lens falloff, not a dark frame */
.grain { display: none; }

.hud {
  position: fixed; top: 20px; z-index: 5; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; border: 0;
  background: var(--glass-dark); color: var(--ink);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18), 0 8px 24px rgba(0, 0, 0, .3);
  transition: transform .3s var(--spring), background .2s;
}
.hud:hover { background: rgba(70, 70, 76, .6); transform: scale(1.08); }
.hud:active { transform: scale(.94); }
.hud { top: calc(20px + env(safe-area-inset-top)); }
.hud-left { left: calc(20px + env(safe-area-inset-left)); } .hud-right { right: calc(20px + env(safe-area-inset-right)); }
.hud.muted #soundWaves { display: none; }
body { transition: background-color .7s var(--ease); }
.vignette, .hud, .hint { transition: background .7s var(--ease), color .7s var(--ease), box-shadow .7s var(--ease);   max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis;
}
.hint {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); margin: 0; z-index: 4;
  padding: 8px 16px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--glass-dark); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .15);
  white-space: nowrap; transition: opacity .5s; pointer-events: none;
}
/* frosted pill like the hint, so it never blends into the wall behind it */
.skip { padding: 8px 14px; border-radius: 99px; color: #5aaeff !important; background: var(--glass-dark);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .15), 0 6px 18px rgba(0, 0, 0, .25); }
.skip:hover { text-decoration: none !important; background: rgba(70, 70, 76, .6); }
.skip { position: fixed; right: calc(20px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 4; font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 500; }

/* Top nav — same blue + font as the "open portfolio" link, on the same frosted glass as the hint pill */
.topnav {
  position: fixed; top: calc(24px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; gap: 2px; padding: 4px; border-radius: 99px;
  background: var(--glass-dark); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .15), 0 8px 24px rgba(0, 0, 0, .25);
}
.topnav a {
  padding: 8px 16px; border-radius: 99px; font-family: var(--font); font-size: 13px; font-weight: 500;
  color: #5aaeff; text-decoration: none; letter-spacing: -.01em; transition: background .2s;   /* brighter than --blue: ≥4.5:1 on the glass over the warm wall */
}
.topnav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.topnav a:focus-visible { outline: 2px solid rgba(10, 132, 255, .6); outline-offset: 1px; }
/* short screens (landscape phones, small browser windows): compact pills hug the edges so the scene stays visible */
@media (max-height: 620px) {
  .topnav { top: 10px; padding: 3px; }
  .topnav a { padding: 6px 13px; font-size: 12.5px; }
  .hud { top: 10px; width: 38px; height: 38px; }
  .hint { bottom: 10px; padding: 6px 13px; font-size: 12px; }
  .skip { bottom: 14px; font-size: 12px; }
}
/* narrow phones: compact nav and HUD so the pill never overlaps the round buttons */
@media (max-width: 420px) {
  .hud { width: 40px; height: 40px; }
  .hud-left { left: calc(12px + env(safe-area-inset-left)); } .hud-right { right: calc(12px + env(safe-area-inset-right)); }
  .topnav { padding: 3px; gap: 0; }
  .topnav a { padding: 7px 11px; font-size: 13px; }
}
@media (max-width: 340px) { .topnav a { padding: 7px 8px; font-size: 12px; } }
.tooltip {
  position: fixed; z-index: 6; pointer-events: none; padding: 6px 11px; border-radius: 8px;
  background: rgba(30, 30, 32, .82); color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .15), 0 6px 18px rgba(0, 0, 0, .35);
  transform: translate(14px, 16px) scale(.96); opacity: 0; transition: opacity .15s, transform .2s var(--ease);
}
.tooltip.show { opacity: 1; transform: translate(14px, 16px) scale(1); }

/* ───────── Loader (boot screen) ───────── */
.loader { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #000; transition: opacity .9s var(--ease); }
.loader.done { opacity: 0; pointer-events: none; }
.loader-inner { display: grid; gap: 44px; justify-items: center; }
.loader-name { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; border: 3px solid #f5f5f7;
  font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -.02em; color: #f5f5f7; }
.loader-bar { width: 180px; height: 5px; background: #3a3a3c; border-radius: 3px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: #f5f5f7; border-radius: 3px; transition: width .4s var(--ease); }
.loader-quote { margin-top: -26px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: #a1a1a6; animation: quoteIn 1.2s var(--ease) both .3s; }
@keyframes quoteIn { from { opacity: 0; transform: translateY(6px); } }
.loader-pct { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.loader { padding: 24px; }
.loader.ready .loader-bar, .loader.ready .loader-quote { display: none; }
.loader.ready { overflow-y: auto; place-items: safe center; }
.loader.ready .loader-inner { gap: 26px; padding: 12px 0; }
.loader.ready .loader-name { width: 60px; height: 60px; font-size: 23px; border-width: 2.5px; }
.intro { display: grid; justify-items: center; gap: 20px; margin-top: -10px; max-width: 340px; text-align: center; animation: quoteIn .6s var(--ease) both; }
.intro-title { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: #f5f5f7; }
.intro-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; text-align: left; }
.intro-tips li { display: flex; align-items: center; gap: 14px; font-size: 15px; color: #a1a1a6; }
.intro-tips b { color: #f5f5f7; font-weight: 600; }
.intro-tips svg { width: 26px; height: 26px; flex: none; fill: none; stroke: #f5f5f7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.intro-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 13px 34px; border: 0; border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 30px rgba(10, 132, 255, .35); transition: transform .2s var(--spring), filter .2s; }
.intro-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.intro-go:hover { filter: brightness(1.08); } .intro-go:active { transform: scale(.96); }
.intro-quiet { margin-top: -8px; border: 0; background: none; color: #a1a1a6; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-height: 560px) { .loader-inner { gap: 18px; } .intro { gap: 12px; } .intro-tips { gap: 8px; } .intro-title { font-size: 21px; } }

/* "Tap the laptop" pointer for first-time visitors — positioned over the laptop every frame by main.js */
.coach { position: fixed; z-index: 4; left: 0; top: 0; pointer-events: none; display: grid; justify-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; transition: opacity .25s; }
.coach span { padding: 7px 13px; border-radius: 999px; background: var(--blue); box-shadow: 0 6px 20px rgba(10, 132, 255, .45); }
.coach i { width: 0; height: 0; border: 7px solid transparent; border-top-color: var(--blue); border-bottom: 0; }
.coach { animation: coachBob 1.6s ease-in-out infinite; }
@keyframes coachBob { 50% { translate: 0 -6px; } }

/* recovery if the GPU drops the 3D scene */
.glitch { position: fixed; inset: 0; z-index: 21; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(0, 0, 0, .85); text-align: center; }
.glitch p { margin: 0; font-size: 17px; }
.glitch button { padding: 11px 28px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.glitch a { color: #a1a1a6; font-size: 13px; }

/* ───────── Desktop — macOS 27-style "Liquid Glass" (opens when the laptop boots) ─────────
   Refined glass: less transparent by default, darker edges + brighter highlights, deeper window
   shadows, a unified toolbar, and a sidebar that runs to the window edge. Light + dark appearances. */
.os {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; animation: fadein .45s var(--ease);
  /* a clean, dark surround: only the Mac display shows — no part of the 3D laptop around it */
  background: radial-gradient(120% 90% at 50% 45%, #1b1b1e 0%, #0b0b0c 70%);
  /* light appearance tokens */
  --g-win: rgba(250, 250, 252, .86);
  --g-side: rgba(236, 236, 242, .62);
  --g-bar: rgba(255, 255, 255, .55);
  --g-hi: rgba(255, 255, 255, .9);          /* specular highlight on the top edge */
  --g-edge: rgba(0, 0, 0, .14);             /* darkened outer edge */
  --g-fill: rgba(120, 120, 128, .12);
  --g-fill-2: rgba(120, 120, 128, .2);
  --t1: #1d1d1f; --t2: #6e6e73; --t3: #86868b;
  --sep: rgba(60, 60, 67, .14);
  --card: rgba(255, 255, 255, .7);
  --accent: #0a84ff;
}
.os.dark {
  --g-win: rgba(34, 34, 38, .84);
  --g-side: rgba(52, 52, 58, .5);
  --g-bar: rgba(40, 40, 44, .55);
  --g-hi: rgba(255, 255, 255, .22);
  --g-edge: rgba(0, 0, 0, .55);
  --g-fill: rgba(120, 120, 128, .24);
  --g-fill-2: rgba(120, 120, 128, .34);
  --t1: #f5f5f7; --t2: #aeaeb2; --t3: #8e8e93;
  --sep: rgba(255, 255, 255, .1);
  --card: rgba(255, 255, 255, .06);
}
@keyframes fadein { from { opacity: 0; } }
.os-screen {
  position: relative; width: min(1180px, 100%); height: min(760px, 100%);
  border-radius: 18px 18px 10px 10px; overflow: hidden; color: var(--t1);   /* MacBook display: rounded top corners, tighter bottom */
  /* a current MacBook display: thin black bezel, aluminium edge, rounded corners, notch (below) */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 0 0 10px #050506, 0 0 0 11px #2c2c2f, 0 0 0 12px #151517, 0 50px 120px rgba(0, 0, 0, .7);
  /* wallpaper: Sijo's photo (same crop focus as the 3D laptop screen); the gradient shows until it loads */
  background: var(--wallpaper, none) var(--wall-pos, 0% 40%) / cover no-repeat, linear-gradient(135deg, #4b3fd1, #e46aa0);
  animation: wake .7s var(--ease);
  transition: filter .7s var(--ease);
}
.os.dark .os-screen { filter: brightness(.72) saturate(1.1); }
.os.dark .os-screen > * { filter: brightness(1.38); }   /* keep the glass UI itself at full brightness */
@keyframes wake { from { transform: scale(.94); opacity: 0; filter: blur(8px); } }

/* shared glass recipe */
.glass {
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--g-hi), inset 0 0 0 .5px var(--g-hi), 0 0 0 .5px var(--g-edge);
}

/* Menu bar — fully transparent in macOS 27; text sits straight on the wallpaper */
.menubar {
  position: absolute; z-index: 4; inset: 0 0 auto 0; height: 30px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mb-left button, .mb-logo { border: 0; background: none; color: inherit; padding: 3px 10px; border-radius: 999px; cursor: default; white-space: nowrap; }
.mb-left button:hover, .mb-left button.on { background: rgba(255, 255, 255, .22); }
.mb-logo { font-weight: 800; font-size: 13px; letter-spacing: -.03em; }
.mb-app { font-weight: 700 !important; }
.mb-right { gap: 14px; padding-right: 6px; }
.mb-right svg { display: block; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .35)); }

.mb-icon { display: grid; place-items: center; border: 0; background: none; color: inherit; padding: 3px 6px; border-radius: 999px; cursor: default; }
button.mb-icon:hover { background: rgba(255, 255, 255, .22); }
.mb-menu {
  position: absolute; z-index: 8; min-width: 230px; padding: 5px; border-radius: 14px; color: var(--t1); font-size: 13px;
  background: var(--g-win); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge), 0 14px 40px rgba(0, 0, 0, .28);
  animation: menuIn .12s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-3px); } }
.mb-menu button { width: 100%; display: flex; justify-content: space-between; gap: 24px; padding: 5px 10px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: default; }
.mb-menu button:hover:not(:disabled), .mb-menu button:focus-visible { background: var(--accent); color: #fff; outline: none; }
.mb-menu button:disabled { color: var(--t3); }
.mb-menu kbd { font: inherit; color: var(--t3); }
.mb-menu button:hover:not(:disabled) kbd { color: rgba(255, 255, 255, .8); }
.mb-menu hr { border: 0; border-top: .5px solid var(--sep); margin: 4px 8px; }
.spotlight { position: absolute; inset: 0; z-index: 9; display: flex; justify-content: center; padding-top: 14%; background: rgba(0, 0, 0, .12); }
.sp-panel { width: min(600px, calc(100% - 32px)); align-self: flex-start; border-radius: 26px; overflow: hidden; color: var(--t1);
  background: var(--g-win); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge), 0 30px 80px rgba(0, 0, 0, .35); animation: open .25s var(--spring); }
.sp-field { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: var(--t2); }
.sp-field input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: 22px; font-weight: 400; color: var(--t1); letter-spacing: -.01em; }
.sp-field input::placeholder { color: var(--t3); }
.sp-results { list-style: none; margin: 0; padding: 0 8px 8px; max-height: 320px; overflow: auto; }
.sp-results:empty { display: none; }
.sp-results li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; cursor: default; }
.sp-results li.sel { background: var(--accent); color: #fff; }
.sp-results li .sp-ico { width: 28px; height: 28px; flex: none; }
.sp-results li small { margin-left: auto; color: inherit; opacity: .6; font-size: 12px; }
.toast { position: absolute; z-index: 9; left: 50%; bottom: 112px; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--t1); background: var(--g-win); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge), 0 10px 30px rgba(0, 0, 0, .25); animation: menuIn .2s var(--ease); }
.card.soon { cursor: default; }
button.card { width: 100%; padding: 0; border: 0; text-align: left; font: inherit; cursor: pointer; }
/* case-study viewer: the Figma page, full width of the window */
.win-body.case-mode { padding: 60px 0 0; }
.win-body.case-mode, .case, .case img { touch-action: pan-x pan-y pinch-zoom; }   /* phones: pinch to read the small print */
.case-hint { display: none; margin: 0; padding: 8px 16px; font-size: 12px; color: var(--t3); }
@media (pointer: coarse) { .case-hint { display: block; } }
.case img { display: block; width: 100%; height: auto; background: var(--g-fill); }
/* ── Notch (desktop/tablet only — phones have their own) ── */
.notch { position: absolute; z-index: 20; top: 0; left: 50%; transform: translateX(-50%); width: clamp(64px, 7.4%, 120px); height: 30px;   /* MacBook Air: 7.4% of the width, menu-bar tall */
  background: #050506; border-radius: 0 0 11px 11px; pointer-events: none; }
.notch::before, .notch::after { content: ""; position: absolute; top: 0; width: 8px; height: 8px; background: radial-gradient(circle at 0 100%, transparent 7.5px, #050506 8px); }
.notch::before { left: -8px; } .notch::after { right: -8px; transform: scaleX(-1); }
.notch i { position: absolute; left: 50%; top: 10px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a3a5c, #0b0f18 60%); box-shadow: 0 0 0 1.5px #111216; }
.dock-zone { display: none; }

/* ── Full-screen case study (like a full-screen Mac app): the display takes the whole browser window ── */
.os.case-fs { padding: 0; background: #000; }
.os.case-fs .os-screen { width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; box-shadow: none; background: #121214; }
@media (min-width: 761px) {
  .os.case-fs .os-screen.case-fs .win { top: 30px !important; }   /* the strip beside the notch, as on a MacBook in full screen */
  .os-screen.case-fs .fs-bar { padding-top: 10px; }
}
/* move the mouse to the bottom edge to reveal the dock (macOS full-screen behaviour) */
@media (hover: hover) {
  .os-screen.case-fs .dock-zone { display: block; position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 14px; }
  .os-screen.case-fs .dock { transform: translate(-50%, 24px); transition: opacity .25s var(--ease), transform .3s var(--ease); }
  .os-screen.case-fs.dock-peek .dock { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
}
.os-screen.case-fs .menubar, .os-screen.case-fs .widget, .os-screen.case-fs .dock { opacity: 0; pointer-events: none; }
.menubar, .widget, .dock { transition: opacity .3s var(--ease); }
.os-screen.case-fs .win { top: 0 !important; bottom: 0 !important; left: 0 !important; width: 100% !important; max-height: none !important;
  transform: none; border-radius: 0; box-shadow: none; animation: none; transition: none; }   /* (transform not !important so the full-screen zoom can animate it) */
.os-screen.case-fs .side-wrap, .os-screen.case-fs .win-bar { display: none; }
.win-body.case-mode { padding: 0; }
.fs-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--g-win); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border-bottom: .5px solid var(--sep); }
.fs-bar .lights { flex: none; margin-right: 4px; }
.fs-bar .lights .yellow:disabled { background: #c9c9cf; cursor: default; }
.fs-title { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; white-space: nowrap; overflow: hidden; }
.fs-title b { font-size: 14px; font-weight: 700; color: var(--t1); }
.fs-title small { font-size: 12px; color: var(--t3); overflow: hidden; text-overflow: ellipsis; }
.fs-btn { flex: none; display: inline-grid; place-items: center; min-width: 32px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--accent); background: var(--g-fill); cursor: pointer; transition: background .15s; }
.fs-btn:hover { background: var(--g-fill-2); }
.fs-nav { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t3); font-variant-numeric: tabular-nums; }
.fs-nav .fs-btn { padding: 0; width: 30px; font-size: 16px; }
.fs-share { padding: 0; width: 32px; color: var(--t2); }
.case-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 40px 32px 48px; }
.case-end span { width: 100%; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--t3); }
.case-next { border: 0; background: none; padding: 0; font: inherit; font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -.02em; color: var(--t1); cursor: pointer; }
.case-next:hover { color: var(--accent); }
@media (max-width: 600px) {
  .fs-bar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .fs-title small, .fs-share, .fs-nav span { display: none; }
  .fs-bar .lights button { width: 12px; height: 12px; }
  .case-next { font-size: 26px; }
}
.card.soon:hover { transform: none; }
.card .more.muted { color: var(--t3); }

/* Widget */
.widget {
  position: absolute; z-index: 1; top: 50px; right: 24px; width: 236px; padding: 16px 18px;
  border-radius: 26px; color: var(--t1); background: var(--g-bar);
}
.widget small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--t2); }
.widget b { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.02em; }
.widget span { font-size: 13px; color: var(--t2); }
.widget .status { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; font-weight: 500; color: var(--t1); }
.widget .status i { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, .3); }

/* Window — larger, concentric corners; deeper shadow; sidebar to the edge */
.win {
  position: absolute; z-index: 2; left: 50%; top: 46px; bottom: 116px; transform: translateX(-50%);
  width: min(880px, calc(100% - 48px)); max-height: 600px; margin: auto 0;
  display: flex; border-radius: 26px; overflow: hidden; background: var(--g-win);
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge), 0 30px 80px rgba(0, 0, 0, .38), 0 8px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  animation: open .5s var(--spring);
  transition: width .35s var(--ease), height .35s var(--ease), top .35s var(--ease), left .35s var(--ease), border-radius .35s, background .7s var(--ease);
}
.win.max { width: 100%; max-height: none; top: 30px; bottom: 108px; left: 0; transform: none; border-radius: 0 0 22px 22px; }
.win.min { transform-origin: 50% 100%; animation: minimize .42s cubic-bezier(.55, 0, .7, .3) forwards; }
@keyframes open { from { transform: translate(-50%, 4%) scale(.94); opacity: 0; } }
@keyframes minimize { 60% { opacity: 1; } to { transform: translate(-50%, 78%) scale(.08, .04); opacity: 0; } }   /* shrinks down into the dock */

.side-wrap {
  width: 212px; flex: none; display: flex; flex-direction: column; padding: 8px;
}
.side-wrap > .lights { padding: 10px 10px 14px; }
.sidebar {
  flex: 1; display: flex; flex-direction: column; padding: 8px; border-radius: 18px; overflow: auto;
  background: var(--g-side);
  box-shadow: inset 0 1px 0 var(--g-hi), inset 0 0 0 .5px var(--g-hi), 0 1px 3px rgba(0, 0, 0, .08);
}
.lights { display: flex; gap: 8px; }
.lights button { width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18), inset 0 1px 1px rgba(255, 255, 255, .45); color: rgba(0, 0, 0, .55); font-size: 9px; line-height: 13px; font-weight: 700; }
.lights .red { background: #ff5f57; } .lights .yellow { background: #febc2e; } .lights .green { background: #28c840; }
.lights button::after { opacity: 0; position: absolute; inset: 0; display: grid; place-items: center; }
.lights:hover .red::after { content: "×"; opacity: 1; font-size: 11px; }
.lights:hover .yellow::after { content: "–"; opacity: 1; }
.lights:hover .green::after { content: "+"; opacity: 1; font-size: 10px; }
.sidebar h4 { margin: 6px 10px 6px; font-size: 11px; font-weight: 600; color: var(--t3); }
.side-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 0; border-radius: 10px; background: none;
  font-size: 13px; color: var(--t1); cursor: pointer; text-align: left; transition: background .15s; }
.side-item svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.side-item:hover { background: var(--g-fill); }
.side-item.active { background: var(--g-fill-2); font-weight: 600; }
.side-profile { display: flex; gap: 10px; align-items: center; padding: 14px 8px 4px; margin-top: auto; border-top: .5px solid var(--sep); }
.side-profile .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, #5e5ce6, #ff6482); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.side-profile b { display: block; font-size: 12px; }
.side-profile span { font-size: 11px; color: var(--t3); }

.win-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
/* unified toolbar: title + glass capsule tools, content scrolls underneath */
.win-bar {
  position: absolute; z-index: 2; inset: 0 0 auto 0; height: 60px; padding: 0 18px 0 26px;
  display: flex; align-items: center; justify-content: space-between; cursor: default; user-select: none; touch-action: none;
  background: linear-gradient(var(--g-win) 55%, transparent);
}
.win-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--t1); }
.tb-tools { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--g-bar);
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge), 0 2px 8px rgba(0, 0, 0, .08); }
.tb-btn { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 999px; color: var(--t2); }
.win-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 72px 40px 40px; font-size: 15px; line-height: 1.5; color: var(--t1); }
.win-body h1 { font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin: 0 0 6px; }
.win-body h3 { font-size: 13px; font-weight: 600; color: var(--t3); margin: 26px 0 10px; }
.win-body p { margin: 0 0 14px; color: var(--t2); }
.win-body .lead { font-size: 19px; line-height: 1.45; color: var(--t1); font-weight: 500; letter-spacing: -.015em; }
.sub { font-size: 15px; color: var(--t2); margin: 0 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.chip { font-size: 13px; font-weight: 500; padding: 6px 13px; border-radius: 999px; background: var(--g-fill); color: var(--t1); box-shadow: inset 0 1px 0 var(--g-hi); }


.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card { display: block; text-decoration: none; color: inherit; border-radius: 22px; overflow: hidden; background: var(--card);
  box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge); transition: transform .35s var(--spring), box-shadow .3s; }
.card:hover { transform: translateY(-3px) scale(1.01); box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge), 0 18px 44px rgba(0, 0, 0, .16); }
.card .cover { height: 130px; position: relative; overflow: hidden; }
.card .cover::before { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 40px; right: -30px; bottom: -60px; background: rgba(255, 255, 255, .35); transform: rotate(18deg); }
.card .cover::after { content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; left: 22px; top: 22px; background: rgba(255, 255, 255, .5); }
.card .meta { padding: 14px 18px 18px; }
.card .meta small { font-size: 12px; font-weight: 600; color: var(--t3); }
.card .meta b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.015em; margin-top: 2px; color: var(--t1); }
.card .meta p { font-size: 13.5px; margin: 6px 0 0; color: var(--t2); line-height: 1.45; }
.card .more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 500; }

.list { list-style: none; padding: 0; margin: 0 0 24px; border-radius: 18px; background: var(--card); overflow: hidden; box-shadow: inset 0 1px 0 var(--g-hi), 0 0 0 .5px var(--g-edge); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; }
.list li + li { border-top: .5px solid var(--sep); }
.list b { display: block; font-weight: 600; font-size: 15px; color: var(--t1); }
.list span { color: var(--t2); font-size: 13px; }
.list .yr { font-size: 13px; color: var(--t3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 14px rgba(10, 132, 255, .3); transition: filter .2s, transform .2s var(--spring); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn.alt { background: var(--g-fill); color: var(--accent); box-shadow: inset 0 1px 0 var(--g-hi); }
.btn.alt:hover { background: var(--g-fill-2); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.big-link { display: inline-block; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--accent); text-decoration: none; margin: 4px 0 18px; }
.big-link:hover { text-decoration: underline; }

/* Dock — glass shelf with layered-glass icons */
.dock {
  position: absolute; z-index: 3; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: 6px; padding: 7px 9px 6px;
  border-radius: 26px; background: var(--g-bar);
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--g-hi), inset 0 0 0 .5px var(--g-hi), 0 0 0 .5px var(--g-edge), 0 14px 40px rgba(0, 0, 0, .25);
}
/* each dock item: icon + its name underneath (always visible, for easier navigation) */
.dock-item { position: relative; width: 56px; display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: none; cursor: pointer;
  text-decoration: none; transform-origin: 50% 100%; transition: transform .18s var(--ease), margin .18s var(--ease); }
.dock-item { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .28)); }
.dock-item .app, .sp-ico {
  position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C87 0 100 13 100 50S87 100 50 100 0 87 0 50 13 0 50 0Z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C87 0 100 13 100 50S87 100 50 100 0 87 0 50 13 0 50 0Z'/%3E%3C/svg%3E") center / 100% 100%;
}
.dock-item .app::after, .sp-ico::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .55), inset 0 -3px 8px rgba(0, 0, 0, .18); pointer-events: none; }
.dock-item .app::before, .sp-ico::before { content: ""; position: absolute; inset: 0; background: linear-gradient(170deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 50%); } /* glass sheen layer */
.dock-item .app svg, .sp-ico svg { position: relative; width: 62%; height: 62%; filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .22)); }
.dock-item .app { width: 52px; height: 52px; flex: none; }
.dock-item .name { margin-top: 7px; max-width: 100%; font-size: 11px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--t1); pointer-events: none; }
.dock-item.running::after { content: ""; position: absolute; left: 50%; top: 54px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--t1); opacity: .6; }
.dock-item.bounce { animation: bounce .9s cubic-bezier(.3, 0, .3, 1); }   /* the macOS launch bounce: two hops, the second smaller */
@keyframes bounce { 22% { translate: 0 -18px; } 44% { translate: 0 0; } 62% { translate: 0 -8px; } 80% { translate: 0 0; } }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--sep); }

@media (max-aspect-ratio: 1/1) { .os-screen { --wall-pos: 9% 55%; } }   /* portrait: keep his face in view */
@media (max-width: 760px) {
  .os { padding: 0; }
  .notch { display: none; }
  .menubar { padding-top: env(safe-area-inset-top); height: calc(30px + env(safe-area-inset-top)); }
  .mb-right > svg, .mb-right > .mb-icon:not(button) { display: none; }   /* Wi-Fi, battery, Control Centre: no room on a phone */
  #clock { white-space: nowrap; }
  .side-item svg { display: none; }
  .side-item { padding: 7px 12px; }
  .os-screen { border-radius: 0; height: 100%; box-shadow: none; }
  .widget { display: none; }
  .mb-left button:not(.mb-app):not(.mb-logo) { display: none; }
  .win, .win.max { width: 100%; max-height: none; top: calc(30px + env(safe-area-inset-top)); bottom: calc(94px + env(safe-area-inset-bottom)); left: 0; transform: none; border-radius: 22px; flex-direction: column; }
  @keyframes open { from { opacity: 0; transform: translateY(16px); } }
  .side-wrap { width: auto; flex-direction: row; align-items: center; padding: 8px 8px 0; gap: 8px; }
  .side-wrap > .lights { padding: 0 6px; }
  .sidebar { flex-direction: row; gap: 4px; padding: 5px; overflow-x: auto; border-radius: 999px; }
  .sidebar { -webkit-mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }   /* fade = "scroll for more" */
  .sidebar h4, .side-profile { display: none; }
  .side-item { width: auto; white-space: nowrap; border-radius: 999px; }
  .win-bar { position: relative; height: 48px; padding: 0 16px; background: none; }
  .win-body { padding: 4px 20px 28px; }
  .win-body h1 { font-size: 28px; }
  .cards { grid-template-columns: 1fr; }
  .dock { gap: 3px; padding: 5px 6px; height: auto; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: calc(100% - 16px); border-radius: 22px; }
  .dock-item { width: min(42px, calc((100vw - 58px) / 8)); }   /* 8 icons always fit, even at 320 px */
  .dock-item .app { width: 100%; height: auto; aspect-ratio: 1; }
  .dock-item .name { margin-top: 5px; font-size: min(9.5px, 2.55vw); letter-spacing: -.03em; max-width: none; overflow: visible; text-overflow: clip; }   /* whole names, even at 320 px */
  .dock-item.running::after { top: calc(100% - 15px); }
  
  .dock-sep { margin: 4px 2px; }
  .hint { font-size: 11px; bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
button.card .cover::before, button.card .cover::after { display: none; }   /* real covers: no decorative shapes */
/* like macOS: menus that would sit behind the notch are dropped on narrower displays (shortcuts still work) */
@media (min-width: 761px) and (max-width: 1100px) { .mb-left [data-menu="window"], .mb-left [data-menu="help"] { display: none; } }
@media (min-width: 761px) and (max-width: 900px) { .mb-left [data-menu="view"], .mb-left [data-menu="go"] { display: none; } }
/* the "Designer" widget only shows on a clear desktop — there's never room beside an open window */
.os-screen:has(#win:not([hidden])) .widget { display: none; }
