/* Superamator — Windows classic theme
   Default layout is "stacked" (mobile / no JS): every window is a card in a
   scrolling page. app.js adds html.wm on wide screens to turn the page into
   a desktop with draggable windows. */

:root {
  --face: #c0c0c0;
  --hi: #fff;
  --light: #dfdfdf;
  --shadow: #808080;
  --dark: #0a0a0a;
  --navy: #000080;
  --navy-2: #1084d0;
  --teal: #008080;
  --red: #e4002b;
  --bar-h: 44px;
  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --field: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --font: Tahoma, "MS Sans Serif", "Segoe UI", Geneva, Verdana, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--teal);
  color: #000;
  font: 15px/1.5 var(--font);
  min-height: 100dvh;
}
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
a { color: #0000c0; }
:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- Desktop / stacked page ---------- */
.desktop {
  padding: 12px 12px calc(var(--bar-h) + 16px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}
.icons { display: none; }
.wm-only { display: none !important; }

/* ---------- Window ---------- */
.window {
  display: flex;
  flex-direction: column;
  background: var(--face);
  box-shadow: var(--raised), 2px 2px 0 rgba(0, 0, 0, .35);
  padding: 3px;
  margin-bottom: 16px;
  scroll-margin-top: 12px;
}
.title-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 3px 3px 5px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}
.title-ico { width: 18px; height: 18px; flex: none; }
.title { flex: 1; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-btns { display: none; gap: 2px; }
.title-btns button {
  width: 20px; height: 18px; padding: 0; border: 0;
  display: grid; place-items: center;
  background: var(--face); box-shadow: var(--raised);
}
.title-btns button:active { box-shadow: var(--pressed); }
.title-btns svg { width: 8px; height: 8px; }
.title-btns [data-close] { margin-left: 2px; }

.menu-bar { display: flex; gap: 2px; padding: 2px 2px 3px; font-size: 13px; }
.menu-bar span { padding: 1px 7px; }

.win-body { padding: 16px; overflow: auto; flex: 1; min-height: 0; }
.win-body.flush { padding: 0; background: #fff; box-shadow: var(--field); margin: 0 1px; }

.status-bar { display: flex; gap: 2px; margin-top: 3px; font-size: 12px; }
.status-bar span { padding: 3px 6px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-bar span:first-child { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  min-width: 88px;
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  color: #000;
  text-align: center;
  text-decoration: none;
  line-height: 22px;
}
.btn.default { box-shadow: var(--raised), 0 0 0 1px var(--dark); }
.btn:active { box-shadow: var(--pressed); padding: 7px 13px 5px 15px; }
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px var(--hi); cursor: default; }
.btn:disabled:active { box-shadow: var(--raised); padding: 6px 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row.center { justify-content: center; }
.btn-row.pad { padding: 4px 12px 14px; }

/* ---------- Progress (chunky blocks) ---------- */
.progress {
  display: flex; gap: 2px;
  height: 20px; padding: 3px;
  background: #fff; box-shadow: var(--field);
}
.progress i { flex: 1; background: transparent; }
.progress i.on { background: var(--navy); }

/* ---------- Welcome / hero ---------- */
.hero { display: flex; flex-direction: column; gap: 24px; padding: 20px 16px 22px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.eyebrow svg { width: 21px; height: 18px; animation: beat 1.4s steps(2, jump-none) infinite; }
.hero h1 { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.12; letter-spacing: -.02em; margin: 10px 0 12px; text-wrap: balance; }
.lead { max-width: 46ch; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 18px; }
.facts li { display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; background: #fff; box-shadow: var(--field); font-size: 13px; }
.facts svg { width: 20px; height: 20px; }

.phone {
  flex: none; align-self: center;
  width: 168px; padding: 12px 9px 8px;
  background: #2b2b2b;
  box-shadow: inset -2px -2px #000, inset 2px 2px #6a6a6a, 3px 3px 0 rgba(0, 0, 0, .3);
  animation: float 5s ease-in-out infinite;
}
.phone-screen { background: var(--teal); height: 262px; display: flex; flex-direction: column; box-shadow: inset 1px 1px #000; }
.phone-status { display: flex; justify-content: space-between; padding: 2px 6px; background: #000; color: #fff; font-size: 10px; line-height: 14px; }
.phone-title { background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; margin: 10px 8px 0; }
.phone-app { flex: 0 1 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 8px; padding: 18px 10px 12px; background: var(--face); box-shadow: var(--raised); }
.phone-heart { width: 56px; height: 48px; animation: beat 1.4s steps(2, jump-none) infinite; }
.phone-label { font-size: 12px; min-height: 18px; }
.phone-app .progress { width: 100%; height: 16px; }
.phone-home { width: 34px; height: 5px; margin: 8px auto 0; background: #6a6a6a; }

/* ---------- Notepad ---------- */
.notepad { padding: 10px 12px 16px; white-space: pre-wrap; font: 14px/1.55 "Courier New", Courier, monospace; }

/* ---------- Explorer list ---------- */
.files { padding: 6px; }
.files li { display: flex; gap: 12px; padding: 10px 8px; }
.files li + li { border-top: 1px dotted var(--shadow); }
.files svg { width: 32px; height: 32px; flex: none; margin-top: 2px; }
.files h3 { font-size: 15px; }
.files p { color: #222; }
.empty { padding: 40px 20px; text-align: center; }
.muted { color: #555; margin-top: 6px; }

/* ---------- Wizard ---------- */
.wizard { display: flex; gap: 16px; padding: 12px; }
.wiz-art {
  flex: none; width: 96px; min-height: 200px; position: relative;
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  box-shadow: var(--field);
  display: none; place-items: center;
}
.wiz-art svg { width: 49px; height: 42px; }
.wiz-art b { position: absolute; right: 8px; bottom: 2px; color: #fff; font-size: 44px; line-height: 1; opacity: .9; }
.wiz-main { flex: 1; min-height: 190px; }
.wiz-step { color: #444; font-size: 12px; }
.wiz-main h3 { font-size: 20px; margin: 2px 0 6px; }
.checks { margin-top: 10px; }
.checks li { position: relative; padding: 2px 0 2px 24px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 14px; height: 14px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M0 3h1v1h1v1h1V4h1V3h1V2h1V1h1v2H6v1H5v1H4v1H3v1H2V6H1V5H0z'/%3E%3C/svg%3E") center/9px no-repeat;
  box-shadow: var(--field);
}
.wizard.swap .wiz-main { animation: step-in .25s steps(4) both; }
.wiz-foot { padding: 10px 12px 12px; margin-top: 2px; box-shadow: 0 -1px var(--shadow), 0 -2px var(--hi) inset; border-top: 1px solid var(--shadow); display: grid; gap: 10px; }
.wiz-foot .btn-row { justify-content: flex-end; }

/* ---------- Dialog ---------- */
.dialog { display: flex; gap: 14px; align-items: flex-start; padding: 18px 16px 12px; }
.dialog-ico { width: 36px; height: 36px; flex: none; }
.email { font-size: 17px; font-weight: 700; display: inline-block; margin-top: 8px; word-break: break-all; }

/* ---------- MS-DOS ---------- */
.dos { flex: none; background: #000; color: #c0c0c0; font: 14px/1.4 "Courier New", Courier, monospace; padding: 8px; height: 300px; cursor: text; }
#dosOut { white-space: pre-wrap; }
.dos-line { display: flex; gap: 8px; }
.dos-line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: inherit; font: inherit; padding: 0; caret-color: #c0c0c0; }

/* ---------- Taskbar ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding: 4px 4px calc(2px + env(safe-area-inset-bottom));
  display: flex; align-items: stretch; gap: 4px;
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hi);
}
.start-btn { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 7px; border: 0; background: var(--face); box-shadow: var(--raised); font-size: 14px; }
.start-btn svg { width: 21px; height: 18px; }
.start-btn[aria-expanded="true"], .start-btn:active { box-shadow: var(--pressed); }
.tasks { flex: 1; display: flex; gap: 3px; min-width: 0; }
.task {
  flex: 0 1 170px; min-width: 0; display: flex; align-items: center; gap: 5px;
  padding: 0 8px 0 5px; border: 0; background: var(--face); box-shadow: var(--raised); text-align: left;
}
.task svg { width: 16px; height: 16px; flex: none; }
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.pressed { box-shadow: var(--pressed); font-weight: 700; background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0/2px 2px; }
.tray { display: flex; align-items: center; gap: 8px; padding: 0 9px 0 4px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow); font-size: 13px; }
.lang { border: 0; min-width: 30px; height: 22px; padding: 0 4px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; }

/* ---------- Start menu ---------- */
.start-menu {
  position: fixed; left: 2px; bottom: calc(var(--bar-h) - 2px + env(safe-area-inset-bottom)); z-index: 1001;
  display: flex; min-width: 214px; padding: 3px;
  background: var(--face); box-shadow: var(--raised), 2px 2px 0 rgba(0, 0, 0, .35);
  animation: menu-up .14s steps(4) both;
}
.start-side { width: 26px; background: linear-gradient(0deg, var(--navy), var(--navy-2)); position: relative; }
.start-side span { position: absolute; left: 3px; bottom: 6px; transform-origin: 0 100%; transform: rotate(-90deg) translateY(100%); color: #c0c0c0; font-size: 17px; white-space: nowrap; }
.start-side b { color: #fff; }
.start-menu ul { flex: 1; }
.start-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 18px 7px 8px; border: 0; background: none; text-align: left; }
.start-menu button svg { width: 26px; height: 26px; flex: none; }
.start-menu button:hover, .start-menu button:focus-visible { background: var(--navy); color: #fff; outline: 0; }
.sep { height: 2px; margin: 3px 2px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hi); }

/* ---------- Overlays ---------- */
.boot, .off, .saver { position: fixed; inset: 0; z-index: 2000; background: #000; }
.boot, .off { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; padding: 24px; }
.boot svg { width: 84px; height: 72px; margin-bottom: 14px; animation: beat 1s steps(2, jump-none) infinite; }
.boot-name { font-size: 34px; letter-spacing: -.01em; font-weight: 400; }
.boot-sub { color: #9a9a9a; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.boot-bar { width: 190px; height: 12px; margin-top: 30px; overflow: hidden; background: linear-gradient(90deg, #000, #1a1a4a, #000); }
.boot-bar i { display: block; width: 60px; height: 100%; background: repeating-linear-gradient(90deg, var(--navy-2) 0 10px, transparent 10px 13px); animation: boot-slide 1.1s linear infinite; }
.boot.out { animation: fade-out .3s steps(4) forwards; }
.off p { color: #ff9a2e; font-size: clamp(20px, 5vw, 30px); font-weight: 700; max-width: 16em; margin-bottom: 22px; }
.saver { width: 100%; height: 100%; cursor: none; }

/* ---------- Windowed mode (desktop) ---------- */
html.wm { --bar-h: 34px; }
html.wm body { font-size: 13px; line-height: 1.45; overflow: hidden; height: 100dvh; }
html.wm .desktop { position: fixed; inset: 0 0 var(--bar-h) 0; max-width: none; padding: 0; overflow: hidden; }
html.wm .wm-only { display: revert !important; }
html.wm .window.wm-only { display: none !important; }
html.wm .window.wm-only.open:not(.minimized) { display: flex !important; }

html.wm .icons { display: flex; flex-flow: column wrap; align-content: flex-start; gap: 6px; height: 100%; padding: 10px 6px; }
.icon { width: 84px; padding: 4px 2px; border: 0; background: none; display: grid; justify-items: center; gap: 4px; color: #fff; font-size: 12px; line-height: 1.2; }
.icon svg { width: 32px; height: 32px; }
.icon span { padding: 1px 3px; text-align: center; }
.icon:hover svg { transform: translateY(-2px); }
.icon:focus-visible { outline: 0; }
.icon:focus-visible span, .icon:active span { background: var(--navy); outline: 1px dotted #fff; }

html.wm .window { position: absolute; display: none; width: min(var(--w), calc(100% - 16px)); max-height: calc(100% - 12px); margin: 0; }
html.wm .window.open:not(.minimized) { display: flex; }
html.wm .window.opening { animation: win-open .18s steps(5) both; }
html.wm .window.max { left: 0 !important; top: 0 !important; width: 100%; height: 100%; max-height: none; }
html.wm .window:not(.active) .title-bar { background: linear-gradient(90deg, #808080, #b5b5b5); color: #dcdcdc; }
html.wm .title-bar { min-height: 22px; padding: 2px 2px 2px 4px; touch-action: none; }
html.wm .title { font-size: 12px; }
html.wm .title-ico { width: 16px; height: 16px; }
html.wm .title-btns { display: flex; }
html.wm .title-btns button { width: 16px; height: 14px; }
html.wm .menu-bar { font-size: 12px; }
html.wm .btn { min-width: 76px; min-height: 24px; padding: 2px 12px; line-height: 20px; }
html.wm .btn:active { padding: 3px 11px 1px 13px; }
html.wm .btn:disabled:active { padding: 2px 12px; }
html.wm .hero { flex-direction: row; align-items: center; padding: 26px 24px 28px; gap: 28px; }
html.wm .hero h1 { font-size: 32px; }
html.wm .facts li { font-size: 12px; }
html.wm .notepad { font-size: 13px; }
html.wm .files h3 { font-size: 13px; }
html.wm .wiz-art { display: grid; }
html.wm .wiz-main h3 { font-size: 18px; }
html.wm .email { font-size: 15px; }
html.wm .start-btn { font-size: 12px; padding: 0 7px 0 5px; }
html.wm .start-btn svg { width: 19px; height: 16px; }
html.wm .task { font-size: 12px; }
html.wm .tray { font-size: 12px; }
html.wm .lang { height: 18px; min-width: 24px; font-size: 10px; }
html.wm .start-menu button { padding: 5px 18px 5px 8px; }

/* ---------- Motion ---------- */
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes win-open { from { transform: scale(.55); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes menu-up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes step-in { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes boot-slide { from { transform: translateX(-60px); } to { transform: translateX(190px); } }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }

/* Stacked cards reveal as they scroll in */
html.js:not(.wm) .window { opacity: 0; transform: translateY(18px); transition: opacity .3s steps(4), transform .3s steps(4); }
html.js:not(.wm) .window.seen { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js:not(.wm) .window { opacity: 1; transform: none; }
}
