/* Zephydian website: zephydian.com, a Mac desktop for Zephydian's apps (home.js).
   Builds on demo/demo.css (tokens, the desktop, menu bar, hero type, Dock, .cmd and .hero-btn)
   and site.css (the hint pill, the phone intro). */

:root[data-mode="light"] { --win-bg: rgba(250, 250, 252, 0.78); --win-bar: rgba(255, 255, 255, 0.55); --win-shadow: rgba(0, 0, 0, 0.26); }
:root[data-mode="dark"] { --win-bg: rgba(30, 31, 38, 0.74); --win-bar: rgba(255, 255, 255, 0.05); --win-shadow: rgba(0, 0, 0, 0.55); }

/* ---------- Menu bar: the app in front ---------- */
.mb-left { gap: 16px; }
.mb-menu { text-decoration: none; padding: 2px 6px; margin: 0 -6px; border-radius: 5px; }
.mb-menu:hover, .mb-menu:focus-visible { background: var(--menubar-hover); }

/* ---------- Headline ---------- */
.home-hero h1 { margin: 0; }
/* The website shows no game count (the app's Games tab has one). */
[data-page="home"] #gameCount { display: none; }

/* ---------- Windows ---------- */
.windows { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.app-window {
  position: absolute;
  display: flex; flex-direction: column;
  border-radius: 14px;
  background: var(--win-bg);
  backdrop-filter: blur(32px) saturate(170%); -webkit-backdrop-filter: blur(32px) saturate(170%);
  box-shadow: 0 0 0 0.5px var(--panel-border), 0 26px 70px var(--win-shadow);
  pointer-events: auto;
  transform-origin: 0 0;
  user-select: text; -webkit-user-select: text;
}
.app-window.inactive { box-shadow: 0 0 0 0.5px var(--panel-border), 0 14px 40px color-mix(in srgb, var(--win-shadow) 60%, transparent); }
.app-window.animating { transition: left 260ms cubic-bezier(0.2, 0.9, 0.3, 1), top 260ms cubic-bezier(0.2, 0.9, 0.3, 1), width 260ms cubic-bezier(0.2, 0.9, 0.3, 1), height 260ms cubic-bezier(0.2, 0.9, 0.3, 1); }

.win-bar {
  position: relative; flex: none;
  display: flex; align-items: center; height: 38px; padding: 0 14px;
  border-radius: 14px 14px 0 0; background: var(--win-bar);
  cursor: default; touch-action: none; user-select: none; -webkit-user-select: none;
}
.win-lights { position: relative; z-index: 1; display: flex; gap: 8px; }
.win-light {
  width: 12px; height: 12px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 10px/1 var(--font); color: transparent;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.win-close { background: #ff5f57; }
.win-min { background: #febc2e; }
.win-zoom { background: #28c840; }
/* The symbols show while the pointer is over the lights, as on a Mac. */
.win-lights:hover .win-light, .win-light:focus-visible { color: rgba(0, 0, 0, 0.55); }
.app-window.inactive .win-lights:not(:hover) .win-light { background: var(--fill-strong); box-shadow: none; }
.win-title { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); pointer-events: none; }
.app-window.inactive .win-title { color: var(--text-3); }
.win-grabber { display: none; }

.win-body { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px 24px; overscroll-behavior: contain; }
.win-head { display: flex; align-items: center; gap: 16px; }
.win-icon { flex: none; width: 64px; height: 64px; }
:root[data-mode="light"] .win-icon.dock-img-dark, :root[data-mode="dark"] .win-icon.dock-img-light { display: none; }
.win-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.win-tag { margin: 2px 0 0; font-size: 15px; color: var(--text-2); }
.win-text { margin: 16px 0 0; font-size: 14px; line-height: 1.55; }
.win-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }
.win-list li { display: flex; gap: 10px; }
.win-check { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.win-check .ic { width: 100%; height: 100%; stroke-width: 2.4; }
.win-try { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--fill); font-size: 13px; line-height: 1.45; }
.win-try kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
  background: var(--fill-strong); font: 600 11px var(--font);
}
.win-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.win-actions .cmd { flex: 1 1 100%; min-width: 0; order: 3; }
.win-btn {
  display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 12px;
  background: var(--fill-hover); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none;
}
.win-btn:hover { background: var(--fill-strong); }

/* Resize handles: every edge and corner. */
.win-rs { position: absolute; z-index: 2; }
.win-rs-n, .win-rs-s { left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.win-rs-e, .win-rs-w { top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.win-rs-n { top: -4px; } .win-rs-s { bottom: -4px; } .win-rs-e { right: -4px; } .win-rs-w { left: -4px; }
.win-rs-ne, .win-rs-nw, .win-rs-se, .win-rs-sw { width: 14px; height: 14px; }
.win-rs-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.win-rs-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.win-rs-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.win-rs-se { bottom: -5px; right: -5px; cursor: nwse-resize; }

/* ---------- Dock ---------- */
.dock-contact { background: linear-gradient(180deg, #3ad17a, #1a9c55); }
.dock-contact .ic { stroke-width: 2; }

/* ---------- Phones: a sheet from the bottom ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 24; background: rgba(0, 0, 0, 0.3); }
.windows.sheets { position: fixed; z-index: 25; }
.windows.sheets .app-window {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; height: auto; max-height: 86vh; max-height: 86svh;
  border-radius: 18px 18px 0 0; transform-origin: 50% 100%;
}
.windows.sheets .win-bar { height: 30px; justify-content: center; border-radius: 18px 18px 0 0; }
.windows.sheets .win-lights, .windows.sheets .win-title, .windows.sheets .win-rs { display: none; }
.windows.sheets .win-grabber { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--fill-strong); }
.windows.sheets .win-body { padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); }
.windows.sheets .win-actions .hero-btn, .windows.sheets .win-actions .win-btn { flex: 1 1 40%; justify-content: center; }
.windows.sheets .win-actions .cmd { flex: 1 1 100%; }

/* ---------- Footer ---------- */
.home-foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  padding: 22px 16px 28px; font-size: 13px; color: var(--text-2);
}
.home-foot a { color: var(--text-2); text-decoration: none; }
.home-foot a:hover { color: var(--text); }

@media (max-width: 600px) {
  .mb-left .mb-menu[href^="https://github"] { display: none; }
  #clock { display: none; }
}

/* Reduce Transparency: solid windows. */
@media (prefers-reduced-transparency: reduce) {
  .app-window { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel-solid); }
}
