/* RFS Notes — tokens, the desktop, the menu bar, the window frame and the dock.
   Panes, editor and dialogs live in app.css. */

@font-face { font-family: "Stack Sans Text"; src: url("/fonts/stack-sans-text.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Stack Sans Text"; src: url("/fonts/stack-sans-text-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Stack Sans Notch"; src: url("/fonts/stack-sans-notch.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: light;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Stack Sans Text", "Segoe UI", system-ui, sans-serif;
  --display: "Stack Sans Notch", -apple-system, BlinkMacSystemFont, "Stack Sans Text", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Surfaces */
  --desk-1: #b9c9df; --desk-2: #e8d8c4; --desk-3: #f1c79f;
  --menubar: rgba(246, 246, 248, .72);
  --menubar-ink: #1d1d1f;
  --window: #ffffff;
  --window-line: rgba(0, 0, 0, .16);
  --sidebar: rgba(236, 234, 230, .8);
  --sidebar-solid: #ecebe7;
  --list: #faf9f7;
  --editor: #ffffff;
  --toolbar: rgba(250, 250, 250, .9);
  --hover: rgba(0, 0, 0, .05);
  --press: rgba(0, 0, 0, .09);
  --line: rgba(0, 0, 0, .09);
  --line-2: rgba(0, 0, 0, .16);
  --popover: rgba(250, 250, 252, .94);

  /* Ink */
  --ink: #1d1d1f;
  --ink-2: #4b4b50;
  --ink-3: #6e6e73;
  --ink-4: #a1a1a6;

  /* The one accent: marigold, the colour of a legal pad's header. Text on accent fills is dark ink. */
  --accent: #b87a00;
  --accent-fill: #e2a62c;
  --accent-ink: #8a5a00;
  --accent-soft: rgba(184, 122, 0, .14);
  --select: rgba(226, 166, 44, .32);
  --select-quiet: rgba(0, 0, 0, .065);
  --focus: #0a6cff;
  --mark: #ffe58a;
  --gist: #f8f5ee;
  --clip-bg: #f6f4ef;
  --link: #1f5fc7;
  --menubar-solid: #efeeea;
  --popover-solid: #fbfbfb;

  /* Meaning */
  --good: #1f8a4c; --good-soft: rgba(31, 138, 76, .12); --good-ink: #156b3a;
  --warn: #c98a12; --warn-soft: rgba(201, 138, 18, .16); --warn-ink: #7f5100;
  --bad: #c4372c; --bad-soft: rgba(196, 55, 44, .12); --bad-ink: #9e2a21;
  --quiet: #8e8e93;

  /* Decision states */
  --st-exploring: #6e6e73; --st-testing: #2f6fdd; --st-committed: #1f8a4c; --st-parked: #a1a1a6;

  /* Theme tints, used only for a theme's glyph and its charts */
  --t-ai-models: #7a5af5; --t-ai-infrastructure: #4f56e3; --t-developer-tools: #2a7f9e; --t-work-and-enterprise: #1f6fb2;
  --t-government-and-defense: #3a4a8c; --t-industry-and-robotics: #d0531f; --t-energy-and-climate: #1f8a4c; --t-space: #138a7c;
  --t-finance: #a76f00; --t-health-and-bio: #c2337a; --t-consumer-and-education: #c4285a;

  --shadow-window: 0 0 0 .5px rgba(0, 0, 0, .22), 0 22px 70px rgba(0, 0, 0, .28), 0 8px 22px rgba(0, 0, 0, .12);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .14), 0 10px 32px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
  --radius-window: 12px;
  --radius: 8px;
  --menubar-h: 28px;
  --toolbar-h: 52px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --desk-1: #1b2233; --desk-2: #2b2230; --desk-3: #3a2a22;
  --menubar: rgba(28, 28, 30, .72);
  --menubar-solid: #232325;
  --sidebar-solid: #2a2a2c;
  --popover-solid: #2c2c2e;
  --menubar-ink: #f2f2f4;
  --window: #1e1e20;
  --window-line: rgba(255, 255, 255, .14);
  --sidebar: rgba(44, 44, 46, .78);
  --list: #242425;
  --editor: #1e1e1f;
  --toolbar: rgba(36, 36, 38, .92);
  --hover: rgba(255, 255, 255, .06);
  --press: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --popover: rgba(44, 44, 48, .95);
  --ink: #f2f2f4;
  --ink-2: #c7c7cc;
  --ink-3: #9a9aa0;
  --ink-4: #6e6e73;
  --accent: #e9b44c;
  --accent-fill: #e9b44c;
  --accent-ink: #edc06a;
  --accent-soft: rgba(233, 180, 76, .18);
  --select: rgba(233, 180, 76, .28);
  --select-quiet: rgba(255, 255, 255, .08);
  --focus: #4d9bff;
  --mark: #7a5c00;
  --gist: #262524;
  --clip-bg: #282726;
  --link: #6ea8ff;
  --good: #4cc27a; --good-soft: rgba(76, 194, 122, .15); --good-ink: #7fdba1;
  --warn: #e3a33c; --warn-soft: rgba(227, 163, 60, .17); --warn-ink: #f2c46e;
  --bad: #f06a5f; --bad-soft: rgba(240, 106, 95, .15); --bad-ink: #ff958c;
  --st-exploring: #9a9aa0; --st-testing: #6ea0ff; --st-committed: #4cc27a; --st-parked: #6e6e73;
  --t-ai-models: #a68cff; --t-ai-infrastructure: #8d93ff; --t-developer-tools: #5cc0dd; --t-work-and-enterprise: #5aa9ec;
  --t-government-and-defense: #8d9be0; --t-industry-and-robotics: #ff8a52; --t-energy-and-climate: #4cc27a; --t-space: #3fcfbb;
  --t-finance: #e6b13c; --t-health-and-bio: #f06aa8; --t-consumer-and-education: #f0668e;
  --shadow-window: 0 0 0 .5px rgba(0, 0, 0, .6), 0 22px 70px rgba(0, 0, 0, .55), 0 8px 22px rgba(0, 0, 0, .3);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .5), 0 10px 32px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; font: 13px/1.4 var(--ui); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  user-select: none; -webkit-user-select: none;
}
h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; background: none; border: 0; padding: 0; }
a { color: inherit; }
svg { display: block; flex: none; }
.icon { width: 18px; height: 18px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The desktop: an original wallpaper of soft overlapping light, drawn in CSS so it needs no image. */
.desktop {
  position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(1100px 700px at 12% 18%, color-mix(in srgb, var(--desk-1) 92%, white) 0%, transparent 62%),
    radial-gradient(900px 640px at 88% 12%, color-mix(in srgb, var(--desk-3) 88%, white) 0%, transparent 60%),
    radial-gradient(1200px 820px at 70% 100%, var(--desk-2) 0%, transparent 65%),
    linear-gradient(160deg, var(--desk-1), var(--desk-2) 55%, var(--desk-3));
}
.desktop::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(115deg, transparent 0 120px, rgba(255, 255, 255, .05) 120px 240px);
}
:root[data-theme="dark"] .desktop::after { background: repeating-linear-gradient(115deg, transparent 0 120px, rgba(255, 255, 255, .02) 120px 240px); }

/* Menu bar */
.menubar {
  position: fixed; inset: 0 0 auto; z-index: 900; display: flex; align-items: center; height: var(--menubar-h);
  padding: 0 10px; background: var(--menubar); color: var(--menubar-ink);
  -webkit-backdrop-filter: saturate(1.8) blur(30px); backdrop-filter: saturate(1.8) blur(30px);
  box-shadow: 0 .5px 0 rgba(0, 0, 0, .12); font-size: 13px;
}
.menubar-menus { display: flex; align-items: center; height: 100%; }
.menubar-item { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 5px; white-space: nowrap; }
.menubar-item:hover, .menubar-item[aria-expanded="true"] { background: var(--press); }
.menubar-brand { padding: 0 10px 0 8px; }
.menubar-brand .mark { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(180deg, #ff8a3d, #f05a1a); box-shadow: inset 0 -5px 0 #fffdf6; }
.menubar-app { font-weight: 700; }
.menubar-status { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.menubar-status .menubar-item .icon { width: 16px; height: 16px; }
.menubar-clock { font-variant-numeric: tabular-nums; }

/* Menus (menu bar dropdowns and context menus share one look) */
.menu {
  position: fixed; z-index: 1000; min-width: 220px; max-width: 320px; padding: 5px;
  border-radius: 9px; background: var(--popover); box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: saturate(1.8) blur(24px); backdrop-filter: saturate(1.8) blur(24px);
  color: var(--ink); font-size: 13px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 24px; padding: 0 10px 0 8px;
  border-radius: 5px; text-align: left; white-space: nowrap;
}
.menu-item .icon { width: 15px; height: 15px; color: var(--ink-3); }
.menu-item .menu-check { width: 14px; display: inline-grid; place-items: center; }
.menu-item kbd { margin-left: auto; padding-left: 18px; color: var(--ink-3); font: inherit; letter-spacing: .04em; }
.menu-item:hover:not([aria-disabled="true"]), .menu-item:focus-visible { outline: none; background: var(--focus); color: #fff; }
.menu-item:hover:not([aria-disabled="true"]) .icon, .menu-item:hover:not([aria-disabled="true"]) kbd,
.menu-item:focus-visible .icon, .menu-item:focus-visible kbd { color: rgba(255, 255, 255, .85); }
.menu-item[aria-disabled="true"] { color: var(--ink-4); }
.menu-item.danger:not(:hover) { color: var(--bad); }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--line-2); }
.menu-label { padding: 4px 10px 2px; color: var(--ink-3); font-size: 11.5px; font-weight: 600; }

/* The window */
.window {
  position: absolute; z-index: 10; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-radius: var(--radius-window); background: var(--window); box-shadow: var(--shadow-window); overflow: hidden;
  overflow: clip; /* clips like hidden, but is not a scroll box that scrollIntoView can move */
  transform-origin: 50% 100%;
}
.window.is-zoomed { border-radius: 0; }
.window.is-minimizing { transition: transform .16s cubic-bezier(.5, 0, .75, 0), opacity .16s; opacity: 0; pointer-events: none; }
.window.is-restoring { animation: restore .16s cubic-bezier(.2, .9, .3, 1); }
@keyframes restore { from { transform: translateY(40%) scale(.2); opacity: 0; } }
.window.is-closed { display: none; }

.traffic { position: absolute; z-index: 25; top: 20px; left: 18px; display: flex; gap: 8px; }
.traffic button { position: relative; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18); }
.traffic .t-close { background: #ff5f57; }
.traffic .t-min { background: #febc2e; }
.traffic .t-zoom { background: #28c840; }
.traffic svg { position: absolute; inset: 0; width: 12px; height: 12px; opacity: 0; color: rgba(0, 0, 0, .55); }
.traffic:hover svg, .traffic button:focus-visible svg { opacity: 1; }
.window.is-keymove:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.window:not(.is-active) .traffic button { background: #d6d6d8; }
:root[data-theme="dark"] .window:not(.is-active) .traffic button { background: #4a4a4e; }

.resize { position: absolute; z-index: 6; }
.resize-e { top: 8px; right: -3px; bottom: 8px; width: 7px; cursor: ew-resize; }
.resize-s { left: 8px; right: 8px; bottom: -3px; height: 7px; cursor: ns-resize; }
.resize-w { top: 8px; left: -3px; bottom: 8px; width: 7px; cursor: ew-resize; }
.resize-se { right: -3px; bottom: -3px; width: 14px; height: 14px; cursor: nwse-resize; }
.resize-sw { left: -3px; bottom: -3px; width: 14px; height: 14px; cursor: nesw-resize; }
.resize-n { top: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.resize-ne { top: -3px; right: -3px; width: 14px; height: 14px; cursor: nesw-resize; }
.resize-nw { top: -3px; left: -3px; width: 14px; height: 14px; cursor: nwse-resize; }
.window.is-zoomed .resize { display: none; }

/* Dock */
.dock-wrap { position: fixed; z-index: 800; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; pointer-events: none; }
.dock {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 8px; pointer-events: auto;
  border-radius: 20px; background: rgba(255, 255, 255, .32); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .5), 0 0 0 .5px rgba(0, 0, 0, .14), 0 10px 30px rgba(0, 0, 0, .14);
  -webkit-backdrop-filter: saturate(1.8) blur(26px); backdrop-filter: saturate(1.8) blur(26px);
}
:root[data-theme="dark"] .dock { background: rgba(40, 40, 44, .4); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12), 0 0 0 .5px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35); }
.dock-item { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; }
.dock-item:active { filter: brightness(.85); }
.dock-item .app-mark, .dock-item .dock-glyph { width: 48px; height: 48px; }
.dock-glyph { display: grid; place-items: center; border-radius: 12px; color: #fff; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1); }
.dock-glyph .icon { width: 26px; height: 26px; }
.dock-sep { width: 1px; height: 40px; margin: 0 4px 4px; background: rgba(0, 0, 0, .16); }
:root[data-theme="dark"] .dock-sep { background: rgba(255, 255, 255, .16); }
.dock-item.is-running::after { content: ""; position: absolute; bottom: -4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--menubar-ink); opacity: .7; }
.dock-tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); padding: 3px 9px;
  border-radius: 6px; background: var(--popover); box-shadow: var(--shadow-pop); color: var(--ink); font-size: 12.5px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.dock-item:hover .dock-tip, .dock-item:focus-visible .dock-tip { opacity: 1; }
.dock-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #3a3a3c; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
