/* The Mac around NotchFlow: wallpaper, menu bar, menus, Dock, windows and notifications.
   Everything here is the "computer"; the notch itself lives in notch.css. */

:root {
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --menubar-h: 34px;
  --menu-bg: rgba(40, 40, 46, 0.72);
  --menu-ink: rgba(255, 255, 255, 0.92);
  --menu-dim: rgba(255, 255, 255, 0.5);
  --menu-hi: #0a63e8;
  --win-bg: rgba(30, 30, 34, 0.86);
  --win-ink: #f3f3f5;
  --win-dim: rgba(243, 243, 245, 0.62);
  --win-rule: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.16);
  --glass-edge: rgba(255, 255, 255, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--sys); -webkit-font-smoothing: antialiased; color: var(--menu-ink); }
button { font: inherit; color: inherit; }
a { color: inherit; }
.noscript { max-width: 560px; margin: 15vh auto; padding: 0 16px; color: #fff; font-family: var(--sys); }

/* ---------- Stage: a real-size desktop when it fits, otherwise a scaled Mac screen ---------- */
#stage { position: fixed; inset: 0; display: grid; place-items: center; background: #000; overflow: hidden; }
#screen {
  position: relative; overflow: hidden; width: 100vw; height: 100vh;
  transform-origin: center center; user-select: none; -webkit-user-select: none;
  background: #0b1530;
}
#screen.scaled { width: 1280px; height: 800px; border-radius: 14px; flex: none; }
#stage.scaled { background: radial-gradient(ellipse at 50% 40%, #1a1a1f, #000 70%); }

/* ---------- Wallpaper: original gradient light, no photography ---------- */
.wallpaper { position: absolute; inset: 0; overflow: hidden; background: #070d24; }
.wallpaper::before, .wallpaper::after { content: ""; position: absolute; inset: -20%; }
.wallpaper::before {
  background:
    radial-gradient(60% 50% at 18% 78%, rgba(27, 161, 226, 0.55), transparent 62%),
    radial-gradient(55% 45% at 82% 70%, rgba(216, 0, 115, 0.42), transparent 60%),
    radial-gradient(45% 40% at 62% 22%, rgba(106, 0, 255, 0.50), transparent 62%),
    radial-gradient(40% 35% at 30% 20%, rgba(0, 80, 239, 0.55), transparent 65%),
    linear-gradient(160deg, #0a1033 0%, #120a35 45%, #1b0b2c 100%);
  filter: saturate(1.15);
  animation: drift 40s ease-in-out infinite alternate;
}
.wallpaper::after {
  background:
    repeating-radial-gradient(ellipse at 50% 120%, rgba(255,255,255,0.012) 0 1px, transparent 1px 64px);
  mix-blend-mode: screen; opacity: 0.5;
}
@keyframes drift { from { transform: translate3d(-1.5%, 0, 0) scale(1.02); } to { transform: translate3d(1.5%, -1%, 0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .wallpaper::before { animation: none; } }

/* ---------- Menu bar ---------- */
.menubar {
  position: absolute; top: 0; left: 0; right: 0; height: var(--menubar-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 10px;
  font-size: 13.5px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  background: linear-gradient(rgba(0,0,0,0.28), rgba(0,0,0,0.12));
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
}
.menubar .side { display: flex; align-items: center; gap: 2px; height: 100%; min-width: 0; }
.menubar .side.right { gap: 4px; }
.mb-item {
  height: 24px; padding: 0 9px; border: 0; background: transparent; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px; cursor: default; white-space: nowrap;
}
.mb-item.app { font-weight: 700; }
.mb-item:hover, .mb-item.open { background: rgba(255, 255, 255, 0.2); }
.mb-item svg { width: 16px; height: 16px; }
.mb-item.icon { padding: 0 7px; }
.mb-mark { display: grid; grid-template-columns: 6px 6px; gap: 1.5px; }
.mb-mark i { width: 6px; height: 6px; display: block; }
.mb-clock { font-variant-numeric: tabular-nums; }
.mb-item.clock { padding: 0 8px; }
.mb-item .batt { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mb-item.icon .mb-mark { margin: 0 1px; }

/* ---------- Menus (also used by status items) ---------- */
.menu {
  position: absolute; z-index: 60; min-width: 230px; padding: 5px;
  background: var(--menu-bg); color: var(--menu-ink); border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.6), 0 14px 40px rgba(0,0,0,0.45);
  backdrop-filter: blur(40px) saturate(1.8); -webkit-backdrop-filter: blur(40px) saturate(1.8);
  font-size: 13.5px; text-shadow: none; animation: menu-in 0.12s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-2px); } }
.menu .mi {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%;
  padding: 4px 10px; border: 0; background: transparent; border-radius: 6px; text-align: left; cursor: default;
  white-space: nowrap; text-decoration: none;
}
.menu .mi:hover:not([disabled]) { background: var(--menu-hi); color: #fff; }
.menu .mi[disabled] { color: var(--menu-dim); }
.menu .mi > span { display: inline-flex; align-items: center; }
.menu .mi kbd { font: inherit; color: var(--menu-dim); letter-spacing: 0.5px; }
.menu .mi:hover kbd { color: rgba(255,255,255,0.8); }
.menu .sep { height: 1px; margin: 5px 10px; background: rgba(255,255,255,0.13); }
.menu .head { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--menu-dim); }
.menu .note { padding: 4px 10px 6px; font-size: 12px; line-height: 1.4; color: var(--menu-dim); white-space: normal; max-width: 290px; }
.menu .check { width: 14px; display: inline-block; }

/* ---------- Desktop icons ---------- */
.desk-icons { position: absolute; top: calc(var(--menubar-h) + 18px); right: 16px; display: grid; gap: 10px; z-index: 2; }
.desk-icon {
  width: 92px; padding: 6px 4px; border: 0; background: transparent; border-radius: 6px;
  display: grid; justify-items: center; gap: 5px; cursor: default; color: #fff;
  font-size: 12px; line-height: 1.25; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.desk-icon:focus-visible, .desk-icon.selected { background: rgba(255,255,255,0.14); outline: none; }
.desk-icon .glyph { width: 56px; height: 56px; display: grid; place-items: center; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35)); }
.desk-icon span { padding: 1px 4px; border-radius: 4px; }
.desk-icon.selected span { background: var(--menu-hi); }

/* ---------- Dock ---------- */
.dock-wrap { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; z-index: 40; pointer-events: none; }
.dock {
  pointer-events: auto; display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px;
  border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-edge);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  backdrop-filter: blur(30px) saturate(1.7); -webkit-backdrop-filter: blur(30px) saturate(1.7);
}
.dock .sep { width: 1px; align-self: stretch; margin: 6px 3px; background: rgba(255,255,255,0.28); }
.dock-app {
  position: relative; display: block; width: 54px; height: 54px; border: 0; padding: 0; background: transparent; cursor: default;
  transition: transform 0.18s cubic-bezier(.2,.8,.3,1.2), margin 0.18s; transform-origin: bottom center;
}
.dock-app:hover { transform: scale(1.32) translateY(-6px); margin: 0 9px; }
.dock-app:active { filter: brightness(0.75); }
.dock-app .icon { width: 100%; height: 100%; border-radius: 13px; display: grid; place-items: center; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.dock-app .icon.bare { box-shadow: none; overflow: visible; }
.dock-app .icon.bare svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)); }
.dock-app .dot { position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255,255,255,0.8); }
.dock-app .tip {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%) scale(0.76); transform-origin: bottom center;
  padding: 4px 10px; border-radius: 7px; background: rgba(40,40,46,0.85); color: #fff; font-size: 13px; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.14); opacity: 0; pointer-events: none; transition: opacity 0.1s;
}
.dock-app:hover .tip { opacity: 1; }
.dock-app.bounce .icon { animation: bounce 0.9s ease 1; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-22px); } 55% { transform: translateY(0); } 72% { transform: translateY(-9px); } }

/* ---------- Windows ---------- */
.window {
  position: absolute; z-index: 10; display: flex; flex-direction: column; overflow: hidden;
  background: var(--win-bg); color: var(--win-ink); border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.13);
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.7), 0 22px 70px rgba(0,0,0,0.55);
  backdrop-filter: blur(50px) saturate(1.6); -webkit-backdrop-filter: blur(50px) saturate(1.6);
}
.windows { position: absolute; inset: 0; pointer-events: none; }
.windows > .window { pointer-events: auto; }
.window.opening { animation: win-in 0.22s cubic-bezier(.2,.9,.3,1.1); }
.window.restoring { animation: win-unmin 0.32s cubic-bezier(.2,.7,.3,1) both; }
.window.zooming { transition: left 0.26s cubic-bezier(.3,.9,.3,1), top 0.26s cubic-bezier(.3,.9,.3,1), width 0.26s cubic-bezier(.3,.9,.3,1), height 0.26s cubic-bezier(.3,.9,.3,1); }
.window.inactive { box-shadow: 0 0 0 0.5px rgba(0,0,0,0.6), 0 12px 40px rgba(0,0,0,0.38); }
.window.inactive .lights button { background: rgba(255,255,255,0.18) !important; }
.window.inactive .titlebar .title { color: rgba(243,243,245,0.4); }
.window.closing { animation: win-out 0.16s ease-in forwards; }
.window.minimizing { animation: win-min 0.32s cubic-bezier(.5,0,.8,.4) forwards; }
@keyframes win-in { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
@keyframes win-out { to { opacity: 0; transform: scale(0.96); } }
/* Minimize flies the window into its Dock icon; --mx/--my are set from the icon's position. */
@keyframes win-min { to { opacity: 0; transform: translate(var(--mx, 0), var(--my, 60vh)) scale(0.08); } }
@keyframes win-unmin { from { opacity: 0; transform: translate(var(--mx, 0), var(--my, 60vh)) scale(0.08); } }
@media (prefers-reduced-motion: reduce) { .window.opening, .window.restoring, .window.closing, .window.minimizing { animation-duration: 0.01s; } .window.zooming { transition: none; } }
.titlebar { height: 44px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px; position: relative; cursor: default; }
.titlebar .title { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--win-dim); pointer-events: none; }
.lights { display: flex; gap: 8px; z-index: 1; }
.lights button {
  width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: default;
  color: rgba(0,0,0,0.6); font: 800 10px/1 var(--sys); box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.25);
}
.lights button:nth-child(1) { background: #ff5f57; }
.lights button:nth-child(2) { background: #febc2e; }
.lights button:nth-child(3) { background: #28c840; }
.lights button span { opacity: 0; margin-top: -1px; }
.lights:hover button span { opacity: 1; }
.window.inactive .lights:hover button:nth-child(1) { background: #ff5f57 !important; }
.window.inactive .lights:hover button:nth-child(2) { background: #febc2e !important; }
.window.inactive .lights:hover button:nth-child(3) { background: #28c840 !important; }
.lights button:active { filter: brightness(0.8); }
.win-body { flex: 1; overflow: auto; min-height: 0; }
.win-body::-webkit-scrollbar { width: 10px; }
.win-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* Document window (Read Me, Privacy, Release Notes) */
.doc { padding: 6px 34px 30px; font-size: 14px; line-height: 1.55; color: var(--win-ink); user-select: text; -webkit-user-select: text; }
.doc h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.4px; margin: 6px 0 6px; }
.doc h2 { font-size: 17px; font-weight: 650; margin: 26px 0 6px; }
.doc p { margin: 8px 0; color: var(--win-dim); }
.doc p strong, .doc li strong { color: var(--win-ink); }
.doc ul { padding-left: 20px; margin: 8px 0; color: var(--win-dim); }
.doc li { margin: 6px 0; }
.doc .lede { font-size: 16px; color: var(--win-ink); }
.doc code { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 5px; }
.doc .show { border: 0; background: transparent; color: #4aa8ff; padding: 0; cursor: pointer; font-size: 13px; }
.doc .show:hover { text-decoration: underline; }
.doc .meta { font-size: 12px; color: var(--win-dim); }
.doc a.show { text-decoration: none; }
.doc h2 .meta { font-weight: 400; }
.doc-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.doc-head h1 { margin: 0; }
.doc .features li { margin: 9px 0; }
.doc .features .show { margin-left: 4px; white-space: nowrap; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: baseline; margin: 18px 0 10px; }
.keys kbd {
  justify-self: start; font: 500 12px var(--sys); padding: 3px 8px; border-radius: 6px; color: var(--win-ink);
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}
.keys span { color: var(--win-dim); }

/* Small panels: Trash, About This Page, About NotchFlow */
.panel { padding: 4px 26px 22px; font-size: 13.5px; line-height: 1.5; color: var(--win-dim); user-select: text; -webkit-user-select: text; }
.panel p { margin: 6px 0; }
.panel strong { color: var(--win-ink); }
.panel .row { display: flex; gap: 8px; margin-top: 14px; }
.about { padding: 0 24px 24px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.about h2 { margin: 8px 0 0; font-size: 20px; font-weight: 700; }
.about p { margin: 6px 0; font-size: 13px; color: var(--win-ink); }
.about .meta { font-size: 11.5px; color: var(--win-dim); }
.about .mac-btn { margin-top: 10px; }

/* Welcome window */
.welcome { padding: 4px 36px 32px; display: grid; gap: 14px; user-select: text; -webkit-user-select: text; }
.welcome .mark { width: 64px; height: 64px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.welcome h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.6px; }
.welcome p { margin: 0; color: var(--win-dim); font-size: 15px; line-height: 1.5; }
.welcome .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.welcome .fine { font-size: 12px; color: var(--win-dim); }
.mac-btn {
  height: 30px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 13px; cursor: default;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.mac-btn:hover { background: rgba(255,255,255,0.16); }
.mac-btn.primary { background: #0a63e8; border-color: #2a7bff; }
.mac-btn.primary:hover { background: #1a6ff0; }

/* Terminal window */
.term { background: rgba(14, 14, 16, 0.94); }
.term .win-body { padding: 10px 14px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #e9e9ea; user-select: text; -webkit-user-select: text; }
.term .prompt { color: #7ee787; }
.term .path { color: #79c0ff; }
.term .out { color: #b4b4b8; white-space: pre-wrap; }
.term .cmt { color: #8b8b92; }
.term .cursor { display: inline-block; width: 7px; height: 14px; background: #e9e9ea; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term .cmd { min-height: 20px; position: relative; padding-right: 64px; }
.term .cmd + .cmd, .term .out + .cmd, .term .cmt + .cmd { margin-top: 2px; }
.term .cmt + .cmt, .term .cmd + .cmt, .term .out + .cmt { margin-top: 8px; }
.term .copy { position: absolute; right: 0; top: 0; margin-left: 10px; font-family: var(--sys); font-size: 11px; border: 1px solid rgba(255,255,255,0.18); background: transparent; color: #ccc; border-radius: 6px; padding: 2px 8px; cursor: default; }
.term .copy:hover { background: rgba(255,255,255,0.08); }

/* ---------- Notification banner ---------- */
.notif {
  position: absolute; top: calc(var(--menubar-h) + 10px); right: 12px; z-index: 70; width: 344px;
  display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 12px 14px; border-radius: 18px;
  background: rgba(46, 46, 52, 0.7); border: 1px solid rgba(255,255,255,0.14); color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(40px) saturate(1.8); -webkit-backdrop-filter: blur(40px) saturate(1.8);
  animation: notif-in 0.45s cubic-bezier(.2,.9,.3,1.15); cursor: default; text-align: left;
}
.notif.out { animation: notif-out 0.3s ease-in forwards; }
@keyframes notif-in { from { opacity: 0; transform: translateX(110%); } }
@keyframes notif-out { to { opacity: 0; transform: translateX(110%); } }
.notif .n-icon { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; display: block; }
.notif .n-icon svg { display: block; }
.notif .n-text { display: grid; gap: 1px; min-width: 0; }
.notif .n-top { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,0.6); }
.notif .n-title { font-size: 13.5px; font-weight: 600; margin-top: 1px; }
.notif .n-body { font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.35; }

/* ---------- Pointer hint toward the notch ---------- */
.hint {
  position: absolute; top: calc(var(--menubar-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 45;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
  animation: hint-in 0.6s ease-out both;
}
.hint .arrow { width: 22px; height: 22px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); animation: nudge 1.6s ease-in-out infinite; }
.hint .label {
  padding: 7px 13px; border-radius: 999px; font-size: 13px; color: #fff;
  background: rgba(20,20,24,0.72); border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.hint.out { animation: hint-out 0.25s ease-in forwards; }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes hint-out { to { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Small screens: say what this is ---------- */
.small-note {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 100; display: none;
  padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45; color: #fff;
  background: rgba(30,30,34,0.92); border: 1px solid rgba(255,255,255,0.14);
}
.small-note a { color: #4aa8ff; }
.small-note { padding-right: 40px; }
.small-note .close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.1); color: #fff; font-size: 16px; line-height: 1; }
body.is-small .small-note { display: block; }
