/* One screen: a macOS desktop. Copy sits on the empty left of the wallpaper,
   the app (menu bar panel, windows, Dock) fills the right. */
:root {
  --wall: #2A1F5C;
  --wall-blue: rgba(52, 110, 160, .85);
  --wall-green: rgba(44, 104, 80, .9);
  --wall-purple: rgba(120, 72, 160, .75);
  --ink: #1A1438;
  --paper: #fff;
  --text-on-wall: #fff;
  --muted-on-wall: rgba(255, 255, 255, .78);
  --accent: #3B2D80;
  --ok: #2E8B57;

  --font-display: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mac: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --font-doc: Menlo, "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--wall);
  color: var(--text-on-wall);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}
.mac { font-family: var(--font-mac); }
[hidden] { display: none !important; }

/* ---------- Desktop ---------- */
.desktop {
  position: relative;
  overflow: hidden;
  min-height: max(100svh, 860px);
  display: flex;
  flex-direction: column;
  background-color: var(--wall);
  background-image:
    radial-gradient(ellipse 60% 70% at 88% 8%, var(--wall-blue), transparent 70%),
    radial-gradient(ellipse 55% 60% at 4% 100%, var(--wall-green), transparent 70%),
    radial-gradient(ellipse 50% 50% at 96% 96%, var(--wall-purple), transparent 70%);
}
.wallpaper-hit { position: absolute; inset: 0; }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .07); pointer-events: none; }
.ring-1 { right: -260px; top: -200px; width: 900px; height: 900px; }
.ring-2 { right: -160px; top: -100px; width: 700px; height: 700px; }
.ring-3 { right: -60px; top: 0; width: 500px; height: 500px; }

/* ---------- Menu bar ---------- */
.menubar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 30px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
  background: rgba(20, 14, 48, .32);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  font-size: 13px;
}
.menubar-left { display: flex; gap: 20px; white-space: nowrap; overflow: hidden; min-width: 0; }
.menubar-left b { font-weight: 700; }
.app-menus { display: flex; gap: 20px; }
.menubar-right { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.menubar-item { display: flex; align-items: center; justify-content: center; width: 28px; height: 22px; border-radius: 5px; }
.menubar-item.is-pressed { background: rgba(255, 255, 255, .3); }

/* ---------- Hero copy ---------- */
.hero {
  position: relative;
  z-index: 1;
  pointer-events: none;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  max-width: 580px;
  padding: 80px 24px 150px clamp(24px, 6vw, 96px);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 44px; height: 44px; }
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 5.4vw, 72px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.035em;
  max-width: 12ch;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(10, 6, 40, .35);
}
.lede { margin: 0; font-size: 19px; line-height: 1.55; color: var(--muted-on-wall); max-width: 36ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-top: 6px; pointer-events: auto; }
.download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(8, 4, 30, .3);
  transition: background .15s ease, transform .15s ease;
}
.download:hover { background: #E9E5FA; transform: translateY(-1px); }
.download:focus-visible { outline: 3px solid #B9AEF0; outline-offset: 3px; }
.cta-meta { font-size: 14px; color: rgba(255, 255, 255, .7); }

/* ---------- Desktop icons ---------- */
.desk-icon {
  position: absolute;
  z-index: 5;
  right: 24px;
  top: 50px;
  width: 96px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.desk-icon-2 { top: 160px; }
.desk-icon:hover svg { filter: brightness(1.04) drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.desk-icon:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.desk-label { font-size: 12px; font-weight: 500; padding: 1px 6px; border-radius: 4px; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.desk-icon.is-selected .desk-label { background: #2F63D8; text-shadow: none; }

/* ---------- MenuRun panel ---------- */
.panel {
  position: absolute;
  z-index: 9;   /* below windows, so a dragged window can pass over it */
  top: 38px;
  right: 166px;
  width: 400px;
  max-width: calc(100% - 16px);
  background: rgba(244, 244, 248, .94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(8, 4, 30, .5), 0 0 0 .5px rgba(0, 0, 0, .3);
  overflow: hidden;
  color: #1d1d24;
}
.phead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; font-weight: 600; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.grow { flex: 1; }
.plist { padding: 4px 0; }
.prow { display: flex; gap: 10px; padding: 9px 14px; align-items: flex-start; }
.prow + .prow { border-top: 1px solid rgba(0, 0, 0, .07); }
.tile { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--tile-bg); color: var(--tile-fg); }
.pname { width: 70px; flex: 0 0 70px; font-size: 12px; font-weight: 600; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dests { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dline { display: flex; align-items: center; gap: 8px; height: 28px; }
.dname { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 5px; font-size: 11px; color: #6b6b78; white-space: nowrap; overflow: hidden; }
.chip { font-family: var(--font-mono); font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.chip-ok { background: #DEF0E6; color: #21613F; }
.chip-build { background: #E3EAF7; color: #264C8C; }
.chip-install { background: #F6EBDB; color: #7A4710; }
.pbtn { width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #4b4b58; }

/* ---------- Windows ---------- */
.window {
  position: absolute;
  right: 60px;   /* resting spot before main.js takes over positioning */
  top: 330px;
  z-index: 10;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(8, 4, 30, .5), 0 0 0 .5px rgba(0, 0, 0, .4);
}
.window.is-front { box-shadow: 0 30px 80px rgba(8, 4, 30, .6), 0 0 0 .5px rgba(0, 0, 0, .45); }
.win-log { width: 460px; max-width: calc(100% - 32px); }
.win-doc { width: 460px; max-width: calc(100% - 32px); background: var(--paper); }
.win-sim { width: 260px; overflow: visible; border-radius: 0; box-shadow: none; }
.win-sim.is-front { box-shadow: none; }

.tbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  background: #ECECEF;
  border-bottom: 1px solid #D6D6DC;
  font-size: 12.5px;
  font-weight: 600;
  color: #3b3b47;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dragging .tbar, .dragging .phone { cursor: grabbing; }
.tbar-dark { background: #2B2833; border-bottom: 0; color: #C9C6D9; font-size: 11.5px; height: 28px; }
.tbar-bare { background: transparent; border: 0; padding: 0 10px; color: rgba(255, 255, 255, .85); font-size: 11.5px; }
.tbar-title { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tbar-spacer { width: 52px; }
.sim-name { flex: 1; text-align: right; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

.light { width: 12px; height: 12px; border-radius: 6px; display: inline-block; border: 0; padding: 0; flex: 0 0 12px; }
.light.close { background: #FF5F57; cursor: pointer; display: flex; align-items: center; justify-content: center; color: transparent; }
.light.close:hover, .light.close:focus-visible { color: rgba(0, 0, 0, .6); }
.light.close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.light.min { background: #FEBC2E; }
.light.zoom { background: #28C840; }
.window:not(.is-front) .light { background: #CFCFD4; }
.window:not(.is-front) .tbar-dark .light { background: #4A4752; }

.log {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.8;
  background: #17141F;
  color: #C9C6D9;
  padding: 12px 14px;
  white-space: pre;
  overflow: hidden;
}
.log .src { color: #8E86B8; }
.log .ok { color: #7FD1A4; }

.doc {
  height: 420px;
  max-height: 60svh;
  overflow: auto;
  padding: 18px 22px;
  font-family: var(--font-doc);
  font-size: 12px;
  line-height: 1.6;
  color: #1d1d24;
}
.doc-h1 { font-size: 13px; font-weight: 700; color: #16172B; }
.doc-h2 { color: var(--accent); font-weight: 700; padding-top: 14px; }
.doc p { margin: 2px 0 0; }
.todo { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.todo li { display: flex; gap: 9px; }
.todo li::before { content: "- [ ]"; color: #8A8A96; flex: 0 0 auto; white-space: pre; }
.todo li.done { color: #6b6b78; }
.todo li.done::before { content: "- [x]"; color: var(--ok); }

/* Simulator */
.phone {
  width: 260px;
  height: 540px;
  border-radius: 48px;
  background: #111;
  padding: 11px;
  box-shadow: 0 30px 70px rgba(8, 4, 30, .55), inset 0 0 0 2px #3a3a40;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.screen { position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: #F3F6FB; display: flex; flex-direction: column; color: #12172A; }
.island { position: absolute; left: 50%; top: 10px; width: 80px; height: 23px; margin-left: -40px; border-radius: 12px; background: #111; }
.statusbar { padding: 14px 26px 0; font-size: 12px; font-weight: 600; }
.app-head { padding: 26px 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.app-head span { font-size: 11px; color: #6b7590; font-weight: 600; }
.app-head b { font-size: 26px; letter-spacing: -.02em; }
.map { margin: 4px 14px; height: 140px; border-radius: 16px; background: #DCE8F6; overflow: hidden; }
.routes { margin: 10px 14px 0; background: #fff; border-radius: 14px; }
.routes div { display: flex; justify-content: space-between; padding: 11px 14px; font-size: 12px; }
.routes div + div { border-top: 1px solid #EEF1F6; }

/* ---------- Dock ---------- */
.dock {
  position: absolute;
  z-index: 950;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 9px 4px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: 0 10px 30px rgba(8, 4, 30, .3);
}
.dock-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dock-btn { border: 0; padding: 0; background: transparent; cursor: pointer; transition: transform .15s ease; }
.dock-btn:hover { transform: translateY(-6px) scale(1.08); }
.dock-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 12px; }
.dock-tile { width: 46px; height: 46px; border-radius: 11px; background: var(--tile); display: flex; align-items: center; justify-content: center; }
.dock-sim { background: #1E2A44; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.dock-textedit { background: #F4F1E8; }
.dock-sep { width: 1px; height: 40px; margin: 0 4px 10px; background: rgba(255, 255, 255, .35); }
.run-dot { width: 4px; height: 4px; border-radius: 2px; background: transparent; }
.run-dot.on { background: rgba(255, 255, 255, .85); }

/* ---------- Narrow screens: copy, then panel, then windows ---------- */
@media (max-width: 899px) {
  .desktop { min-height: 1240px; }
  .hide-narrow { display: none !important; }
  .app-menus { display: none; }
  .hero { flex: 0 0 auto; padding: 56px 120px 36px 20px; gap: 18px; }
  .lede { font-size: 17px; }
  .desk-icon { right: 12px; top: 54px; }
  .desk-icon-2 { top: 160px; }
  .panel { position: relative; top: auto; right: auto; margin: 0 16px; width: auto; max-width: 440px; }
  .dock { gap: 6px; padding: 6px 7px 3px; }
  .dock-tile { width: 40px; height: 40px; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .download, .dock-btn { transition: none; }
  .dock-btn:hover, .download:hover { transform: none; }
}
