/* mythicore os */

@import url('https://fonts.googleapis.com/css2?family=UnifrakturMaguntia&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  --void: #05060a;
  --ink: rgba(13, 12, 17, 0.9);
  --gold: #c9a84c;
  --gold-hi: #f1dea3;
  --gold-lo: #6e5a27;
  --line: rgba(201, 168, 76, 0.18);
  --line-strong: rgba(201, 168, 76, 0.42);
  --text: #e8e1d0;
  --muted: #8d8573;
  --faint: #574f42; /* was #4d483e, too dark to read on the login */
  --blood: #c0544a;
  --verdigris: #7fbba5;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --black: 'UnifrakturMaguntia', 'Cormorant Garamond', serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
body { user-select: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(201, 168, 76, 0.35); color: #fff; }

#aether { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.screen.on { opacity: 1; visibility: visible; transition: opacity 0.9s ease; }

/* gold leaf text. the shimmer is just a big gradient sliding back and forth */
.gilt {
  background: linear-gradient(105deg, #7a6128 0%, #c9a84c 28%, #f6e7b4 46%, #c9a84c 62%, #8a6d2c 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 18px rgba(201, 168, 76, 0.22));
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* astrolabe (svg is generated in script.js) */
.sigil { width: 100%; height: 100%; display: block; overflow: visible; }
.sigil circle, .sigil polygon, .sigil line { fill: none; stroke: var(--gold); stroke-width: 0.6; }
.sigil .thin { stroke-width: 0.35; opacity: 0.65; }
.sigil .ticks line { stroke-width: 0.4; opacity: 0.7; }
.sigil text { fill: var(--gold); font-family: var(--serif); font-size: 9px; }
.sigil .core { fill: var(--gold); stroke: none; }
.sigil .spin-slow { transform-origin: 100px 100px; animation: spin 90s linear infinite; }
.sigil .spin-mid { transform-origin: 100px 100px; animation: spin 45s linear infinite; }
.sigil .spin-rev { transform-origin: 100px 100px; animation: spin 60s linear infinite reverse; }
.sigil.draw circle, .sigil.draw polygon { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(0.6, 0, 0.2, 1) forwards; }
.sigil.draw .ticks, .sigil.draw text { opacity: 0; animation: appear 1.4s ease 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.corner { position: absolute; width: 16px; height: 16px; border: 0 solid var(--gold); opacity: 0.8; pointer-events: none; }
.corner.tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner.tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.corner.br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* ---- boot ---- */
#boot { background: #000; display: grid; place-items: center; z-index: 4; }
.boot-stage { display: grid; justify-items: center; gap: 26px; width: min(560px, 90vw); }
.boot-sigil { width: 220px; height: 220px; filter: drop-shadow(0 0 22px rgba(201, 168, 76, 0.25)); }
.wordmark {
  font-family: var(--black);
  font-weight: 400;
  font-size: 72px;
  line-height: 1;
  opacity: 0;
}
#boot.on .wordmark { animation: shimmer 7s ease-in-out infinite alternate, rise 1.4s ease 1.2s forwards, flicker 7s steps(1) 3s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 61% { opacity: 1; } 62% { opacity: 0.35; } 63% { opacity: 1; } 64% { opacity: 0.7; } 65% { opacity: 1; } }

.boot-log { width: 100%; min-height: 185px; font-family: var(--mono); font-size: 11.5px; line-height: 1.95; color: var(--muted); }
.boot-log div { display: flex; animation: logIn 0.35s ease both; }
.boot-log .ts { color: var(--faint); margin-right: 14px; white-space: pre; }
.boot-log .st { margin-left: auto; color: var(--gold-lo); }
.boot-log .strong { color: var(--gold-hi); }
.boot-log .strong .st { color: var(--gold); }
.boot-log .rare, .boot-log .rare .st { color: var(--blood); }
@keyframes logIn { from { opacity: 0; transform: translateY(3px); } }

.boot-progress { width: 100%; height: 1px; background: rgba(201, 168, 76, 0.12); position: relative; overflow: hidden; }
.boot-progress i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transition: transform 0.6s ease; }

/* ---- login ---- */
#login { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: 7vh 20px 4vh; }
.login-sigil {
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(120vh, 120vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 0.07;
  pointer-events: none;
}
.lock { text-align: center; position: relative; }
.lock-time { font-weight: 300; font-size: clamp(60px, 9vw, 108px); line-height: 1; color: var(--gold-hi); font-variant-numeric: lining-nums tabular-nums; }
.lock-date { font-style: italic; font-size: 21px; color: var(--muted); margin-top: 8px; }

.gate {
  align-self: center;
  position: relative;
  width: min(420px, 92vw);
  padding: 44px 36px 30px;
  background: linear-gradient(180deg, rgba(20, 18, 24, 0.82), rgba(10, 9, 13, 0.92));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(241, 222, 163, 0.06);
}
#login.on .gate { animation: rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both; }
.gate-title { font-family: var(--black); font-weight: 400; font-size: 56px; line-height: 1; text-align: center; }
.gate-sub { text-align: center; font-style: italic; font-size: 19px; color: var(--muted); margin: 12px 0 30px; }

.profiles { display: flex; flex-direction: column; gap: 4px; }
.profile {
  display: grid;
  grid-template-columns: 46px 1fr 18px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid transparent;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.profile:hover:not(.disabled) { background: rgba(201, 168, 76, 0.06); border-color: var(--line); }
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--black);
  font-size: 24px;
  color: var(--gold);
  background: radial-gradient(circle at 35% 30%, rgba(241, 222, 163, 0.16), transparent 62%);
}
.profile-text { display: flex; flex-direction: column; line-height: 1.2; }
.profile-name { font-size: 20px; font-weight: 500; }
.profile-note { font-size: 15px; font-style: italic; color: var(--muted); }
.profile .go { width: 18px; height: 18px; color: var(--gold); opacity: 0.35; transition: transform 0.2s, opacity 0.2s; }
.profile:hover .go { opacity: 1; transform: translateX(3px); }
.profile.disabled { opacity: 0.35; cursor: not-allowed; }
.tip {
  position: absolute;
  right: 8px;
  bottom: calc(100% + 4px);
  padding: 6px 12px;
  background: #0e0d12;
  border: 1px solid var(--line);
  font-size: 15px;
  font-style: italic;
  color: var(--gold-hi);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.profile.disabled:hover .tip { opacity: 1; transform: none; }

.admin-key { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.admin-key.open { grid-template-rows: 1fr; }
.admin-key > div { overflow: hidden; padding: 0 12px; }
.admin-key input {
  width: 100%;
  margin: 6px 0 4px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  outline: none;
}
.admin-key input:focus { border-color: var(--line-strong); }
.admin-key input::placeholder { letter-spacing: 0; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--faint); }
.admin-msg { min-height: 26px; font-size: 16px; font-style: italic; color: var(--blood); }
.shake { animation: shake 0.42s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

.login-foot { font-size: 15px; font-style: italic; color: var(--faint); position: relative; }

/* ---- signing in screen ---- */
/* the dots are the windows 10 loading spinner idea but gold */
#loading { background: #000; display: grid; place-items: center; z-index: 4; }
.load-stage { display: grid; justify-items: center; gap: 22px; text-align: center; }
.orb { position: relative; width: 240px; height: 240px; display: grid; place-items: center; }
.orb-sigil { position: absolute; inset: 0; opacity: 0.9; filter: drop-shadow(0 0 16px rgba(201, 168, 76, 0.3)); }
#loading.on .orb-sigil { animation: spin 16s linear infinite; }
.avatar-lg {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--black);
  font-size: 58px;
  color: var(--gold-hi);
  background: radial-gradient(circle at 40% 35%, rgba(201, 168, 76, 0.24), rgba(0, 0, 0, 0.95) 70%);
  box-shadow: 0 0 50px rgba(201, 168, 76, 0.18), inset 0 0 24px rgba(0, 0, 0, 0.8);
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 0 70px rgba(201, 168, 76, 0.32), inset 0 0 24px rgba(0, 0, 0, 0.8); } }
.orbit { position: absolute; inset: 44px; }
.orbit span { position: absolute; inset: 0; opacity: 0; }
#loading.on .orbit span { animation: orbit 3s cubic-bezier(0.55, 0.1, 0.35, 0.95) infinite; animation-delay: calc(var(--i) * 0.15s); }
.orbit span::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 10px var(--gold);
}
@keyframes orbit {
  0% { transform: rotate(180deg); opacity: 0; }
  8% { opacity: 1; }
  55% { transform: rotate(540deg); }
  80% { opacity: 1; }
  100% { transform: rotate(900deg); opacity: 0; }
}
.welcome { font-family: var(--black); font-weight: 400; font-size: 64px; line-height: 1; }
.welcome-name { font-size: 26px; font-weight: 300; color: var(--text); margin-top: 2px; }
.load-status { height: 26px; font-size: 19px; font-style: italic; color: var(--muted); transition: opacity 0.25s; }
.load-bar { width: 240px; height: 1px; background: rgba(201, 168, 76, 0.14); position: relative; overflow: hidden; }
.load-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
#loading.on .load-bar i { animation: fill 4.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fill { to { transform: scaleX(1); } }

/* ---- desktop ---- */
#desktop { z-index: 3; }
#desktop.reveal { animation: iris 1.3s cubic-bezier(0.7, 0, 0.2, 1) both; }
@keyframes iris { from { clip-path: circle(0% at 50% 45%); } to { clip-path: circle(150% at 50% 45%); } }
.wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(201, 168, 76, 0.07), transparent 70%),
    radial-gradient(ellipse 45% 40% at 88% 92%, rgba(110, 90, 39, 0.12), transparent 70%),
    radial-gradient(ellipse 40% 35% at 8% 6%, rgba(70, 60, 110, 0.08), transparent 70%);
}
.watermark { position: absolute; left: 50%; top: 45%; width: min(78vh, 78vw); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0.09; pointer-events: none; }
.whisper-wall {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  font-size: 19px;
  font-style: italic;
  color: var(--gold-hi);
  opacity: 0;
  transition: opacity 4s;
  pointer-events: none;
  white-space: nowrap;
}
.whisper-wall.show { opacity: 0.4; }

.omen { position: absolute; right: 44px; top: 36px; text-align: right; pointer-events: none; }
.omen-time { font-weight: 300; font-size: 72px; line-height: 1; color: var(--gold-hi); font-variant-numeric: lining-nums tabular-nums; }
.omen-date { font-size: 21px; font-style: italic; color: var(--text); opacity: 0.8; margin-top: 6px; }
.omen-moon { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; font-size: 16px; color: var(--muted); }
.moon { width: 18px; height: 18px; }
.omen-state { font-size: 16px; font-style: italic; color: var(--gold); margin-top: 4px; transition: color 1s; }
.omen-state.uneasy { color: var(--blood); }

.windows { position: absolute; inset: 0 0 48px 0; }

/* ---- windows ---- */
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 180px;
  background: var(--ink);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
  resize: both;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s;
}
.win .corner { opacity: 0.35; transition: opacity 0.2s; }
.win.active { border-color: var(--line-strong); box-shadow: 0 36px 90px rgba(0, 0, 0, 0.65), 0 0 50px rgba(201, 168, 76, 0.07); }
.win.active .corner { opacity: 0.9; }
.win.opening { animation: winIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.win.closing { animation: winOut 0.18s ease-in forwards; pointer-events: none; }
.win.min { opacity: 0; transform: translateY(40px) scale(0.94); pointer-events: none; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; resize: none; }
.win.max .corner { display: none; }
@keyframes winIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
@keyframes winOut { to { opacity: 0; transform: scale(0.97); } }

.win-head {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.07), transparent);
  cursor: grab;
  touch-action: none;
}
.win-head:active { cursor: grabbing; }
.win.max .win-head { cursor: default; }
.win-glyph { width: 17px; height: 17px; color: var(--gold); flex: none; }
.win-title { flex: 1; font-size: 18px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.win.active .win-title { color: var(--text); }
.win-ctl { display: flex; }
.win-ctl button { width: 32px; height: 30px; display: grid; place-items: center; color: var(--muted); transition: color 0.15s, background 0.15s; }
.win-ctl button:hover { color: var(--gold-hi); background: rgba(201, 168, 76, 0.09); }
.win-ctl button[data-act="close"]:hover { color: #fff; background: rgba(192, 84, 74, 0.6); }
.win-ctl svg { width: 12px; height: 12px; }
.win-body { flex: 1; overflow: auto; position: relative; }
.win-body > * { height: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.2); }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 76, 0.4); }
/* FIXME resize grip still looks default in firefox, no pseudo for it there */
::-webkit-resizer { background: linear-gradient(135deg, transparent 55%, rgba(201, 168, 76, 0.5) 55%, rgba(201, 168, 76, 0.5) 62%, transparent 62%, transparent 75%, rgba(201, 168, 76, 0.5) 75%, rgba(201, 168, 76, 0.5) 82%, transparent 82%); }

/* ---- taskbar ---- */
.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: rgba(8, 7, 11, 0.8);
  backdrop-filter: blur(22px) saturate(1.2);
  border-top: 1px solid var(--line);
  z-index: 5000;
}
.taskbar::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent); opacity: 0.5; }
.start-btn { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px 0 6px; transition: background 0.15s; }
.start-btn:hover, .start-btn.open { background: rgba(201, 168, 76, 0.09); }
.mini-sigil { width: 30px; height: 30px; display: block; }
.start-btn .brand { font-family: var(--black); font-size: 23px; color: var(--gold); line-height: 1; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.tasks { display: flex; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
.task {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  max-width: 190px;
  font-size: 16px;
  color: var(--muted);
  position: relative;
  transition: background 0.15s, color 0.15s;
  animation: logIn 0.25s ease;
}
.task svg { width: 16px; height: 16px; flex: none; color: var(--gold); }
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task::after { content: ''; position: absolute; left: 40%; right: 40%; bottom: 3px; height: 2px; background: var(--gold-lo); transition: all 0.2s; }
.task:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.task.active { color: var(--text); background: rgba(201, 168, 76, 0.08); }
.task.active::after { left: 12px; right: 12px; background: var(--gold); }
.task.minimized { opacity: 0.6; }

.search { display: flex; align-items: center; gap: 8px; height: 32px; width: 270px; padding: 0 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); transition: border-color 0.2s, width 0.3s; flex: none; }
.search:focus-within { border-color: var(--line-strong); width: 330px; }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; font-style: italic; }
.search input::placeholder { color: var(--faint); }

.tray { display: flex; align-items: center; margin-left: 4px; }
.tray button { width: 34px; height: 38px; display: grid; place-items: center; color: var(--muted); position: relative; transition: color 0.15s, background 0.15s; }
.tray button:hover, .tray button.open { color: var(--gold-hi); background: rgba(201, 168, 76, 0.07); }
.tray svg { width: 17px; height: 17px; }
.badge { position: absolute; top: 6px; right: 4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: #120f08; font-family: var(--mono); font-size: 9px; font-weight: 500; line-height: 15px; }
.badge:empty { display: none; }
.clock { display: flex; flex-direction: column; align-items: flex-end; padding: 0 6px 0 12px; line-height: 1.15; }
.clock b { font-family: var(--mono); font-weight: 400; font-size: 12.5px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.clock small { font-size: 14px; font-style: italic; color: var(--muted); }

/* start menu + all the little popups share this */
.start, .pop {
  position: absolute;
  bottom: 58px;
  background: rgba(12, 11, 16, 0.95);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  z-index: 5001;
  transition: opacity 0.18s, transform 0.18s;
}
.start:not(.open), .pop:not(.open) { opacity: 0; transform: translateY(8px); pointer-events: none; }
.start { left: 10px; width: 380px; }
.start-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.start-head h2 { font-family: var(--black); font-weight: 400; font-size: 32px; line-height: 1; color: var(--gold); }
.start-head p { font-size: 16px; font-style: italic; color: var(--muted); }
.start-apps { padding: 8px; }
.app-row { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 13px; width: 100%; padding: 8px 10px; text-align: left; transition: background 0.12s; }
.app-row:hover, .app-row:focus-visible { background: rgba(201, 168, 76, 0.08); }
.app-ico { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--gold); background: radial-gradient(circle at 30% 25%, rgba(241, 222, 163, 0.1), transparent 70%); }
.app-ico svg { width: 18px; height: 18px; }
.app-name { display: block; font-size: 18px; font-weight: 500; line-height: 1.1; }
.app-desc { display: block; font-size: 15px; font-style: italic; color: var(--muted); }
.start-foot { display: flex; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--line); }
.start-foot button { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 16px; color: var(--muted); }
.start-foot button:hover { color: var(--gold-hi); background: rgba(201, 168, 76, 0.07); }
.start-foot svg { width: 15px; height: 15px; }

#search-pop { width: 360px; padding: 8px; }
.sp-hint { padding: 10px 12px; font-size: 16px; font-style: italic; color: var(--muted); line-height: 1.4; }
.sp-group { padding: 8px 12px 4px; font-size: 14px; font-style: italic; color: var(--faint); }
.sp-egg { margin: 4px; padding: 12px 14px; border-left: 2px solid var(--gold); background: rgba(201, 168, 76, 0.05); }
.sp-egg b { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--gold-hi); margin-bottom: 4px; }
.sp-egg p { font-size: 16px; line-height: 1.4; }
.sp-egg.eerie { border-left-color: var(--blood); }

#notes-pop { right: 10px; width: 350px; max-height: 60vh; display: flex; flex-direction: column; }
.notes-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.notes-head b { font-size: 19px; font-weight: 500; }
.notes-head button { font-size: 15px; font-style: italic; color: var(--muted); }
.notes-head button:hover { color: var(--gold-hi); }
.notes-list { overflow: auto; padding: 6px; }
.note { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.note b { font-weight: 600; font-size: 16px; }
.note time { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.note p { grid-column: 1 / -1; font-size: 15px; color: var(--muted); line-height: 1.35; }
.note.eerie b { color: var(--blood); }

#tray-pop { width: 260px; padding: 16px 18px; }
#tray-pop b { display: block; font-size: 18px; font-weight: 500; }
#tray-pop p { font-size: 15px; font-style: italic; color: var(--muted); line-height: 1.4; margin-top: 4px; }
#tray-pop input[type="range"] { width: 100%; margin-top: 12px; accent-color: var(--gold); }

.toasts { position: absolute; right: 16px; bottom: 62px; width: 330px; display: flex; flex-direction: column; gap: 10px; z-index: 5002; pointer-events: none; }
.toast {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(14, 13, 18, 0.96);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast-ico { width: 34px; height: 34px; color: var(--gold); display: grid; place-items: center; }
.toast-ico svg { width: 20px; height: 20px; }
.toast-ico .sigil { width: 34px; height: 34px; }
.toast b { display: block; font-size: 17px; font-weight: 600; }
.toast p { font-size: 15px; color: var(--muted); line-height: 1.35; }
.toast.eerie { border-left-color: var(--blood); }
.toast.eerie b { color: var(--blood); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

.ctx { position: absolute; min-width: 230px; padding: 6px; background: rgba(12, 11, 16, 0.97); border: 1px solid var(--line-strong); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); z-index: 6000; animation: winIn 0.14s ease; }
.ctx button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 7px 12px; font-size: 16px; text-align: left; }
.ctx button:hover { background: rgba(201, 168, 76, 0.1); color: var(--gold-hi); }
.ctx kbd { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

/* ---- app stuff ---- */
.pane-h { font-size: 15px; font-weight: 400; font-style: italic; color: var(--gold); margin-bottom: 14px; }
.empty { display: grid; place-items: center; height: 100%; padding: 20px; text-align: center; font-style: italic; color: var(--muted); }
.mini-spin { width: 14px; height: 14px; border: 1px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }

/* core updates */
.updates { display: grid; grid-template-columns: 1fr 1.35fr 1fr; }
.updates section { padding: 22px 22px; border-right: 1px solid var(--line); }
.updates section:last-child { border-right: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 16px; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; }
.status { font-family: var(--mono); font-size: 12px; }
.status.stable { color: var(--verdigris); }
.status.flick { animation: flickOnce 0.6s steps(2); }
.status.evolving { color: var(--gold-hi); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
@keyframes flickOnce { 50% { opacity: 0; } }
.feed .checking { display: flex; gap: 10px; align-items: center; font-style: italic; color: var(--muted); }
.feed .big { font-size: 30px; font-weight: 300; line-height: 1.1; color: var(--gold-hi); margin-bottom: 8px; animation: logIn 0.5s ease; }
.feed p { font-size: 18px; line-height: 1.5; }
.integrity { list-style: none; }
.integrity li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 16px; border-bottom: 1px dotted var(--line); }
.integrity li span:last-child { font-family: var(--mono); font-size: 11.5px; color: var(--verdigris); }
.integrity li .warn { color: var(--blood) !important; }
.hidden-msg { margin-top: 18px; font-size: 16px; font-style: italic; color: transparent; user-select: text; cursor: text; }
.hidden-msg::selection { background: var(--gold); color: #120f08; }

/* relic storage */
.relic { padding: 18px 20px; }
.drive { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; margin-bottom: 8px; text-align: left; border: 1px solid var(--line); transition: background 0.15s, border-color 0.15s; }
.drive:hover { background: rgba(201, 168, 76, 0.05); border-color: var(--line-strong); }
.drive .app-ico { width: 40px; height: 40px; }
.drive-text { display: block; }
.drive-name { display: block; font-size: 18px; font-weight: 500; }
.meter { display: block; height: 3px; margin-top: 7px; background: rgba(255, 255, 255, 0.06); position: relative; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--gold-lo), var(--gold)); }
.drive-size { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; }
.drive.locked .app-ico { color: var(--blood); border-color: rgba(192, 84, 74, 0.3); }
.drive.locked .meter i { background: repeating-linear-gradient(45deg, rgba(192, 84, 74, 0.45) 0 4px, transparent 4px 8px); }
.relic-msg { margin-top: 6px; padding: 10px 14px; min-height: 44px; font-size: 16px; font-style: italic; color: var(--muted); border-left: 2px solid var(--line); }
.relic-msg.deny { color: var(--blood); border-left-color: var(--blood); }

/* archive index */
.archive { display: grid; grid-template-columns: 170px 220px 1fr; }
.folders { border-right: 1px solid var(--line); padding: 12px 8px; }
.folder { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 7px 10px; font-size: 17px; color: var(--muted); text-align: left; border-left: 2px solid transparent; transition: color 0.12s, background 0.12s; }
.folder:hover { color: var(--text); }
.folder.on { color: var(--gold-hi); border-left-color: var(--gold); background: rgba(201, 168, 76, 0.06); }
.folder small { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.files { border-right: 1px solid var(--line); padding: 8px; overflow: auto; }
.file { display: block; width: 100%; padding: 8px 10px; text-align: left; font-family: var(--mono); font-size: 12px; transition: background 0.1s; }
.file small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--faint); }
.file:hover { background: rgba(255, 255, 255, 0.03); }
.file.on { background: rgba(201, 168, 76, 0.1); }
.file.corrupt { color: var(--blood); }
.reader { padding: 20px 24px; overflow: auto; }
.reader h4 { font-size: 22px; font-weight: 500; margin-bottom: 12px; }
.reader pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; line-height: 1.85; color: var(--muted); user-select: text; }
.reader .prose { white-space: pre-wrap; font-size: 19px; font-style: italic; line-height: 1.6; user-select: text; max-width: 52ch; }

/* lore engine */
.lore { display: grid; grid-template-columns: 200px 1fr; }
.lore-list { border-right: 1px solid var(--line); padding: 12px 8px; }
.lore-item { display: block; width: 100%; padding: 9px 12px; text-align: left; font-size: 17px; border-left: 2px solid transparent; color: var(--muted); animation: logIn 0.4s ease; }
.lore-item small { display: block; font-size: 14px; font-style: italic; color: var(--faint); }
.lore-item:hover { color: var(--text); }
.lore-item.on { color: var(--gold-hi); border-left-color: var(--gold); background: rgba(201, 168, 76, 0.06); }
.lore-page { padding: 28px 34px; overflow: auto; user-select: text; }
.lore-page h3 { font-family: var(--black); font-weight: 400; font-size: 38px; line-height: 1.1; color: var(--gold); margin-bottom: 16px; }
.lore-page p { font-size: 19px; line-height: 1.65; max-width: 56ch; margin-bottom: 12px; }
.lore-page p:first-of-type::first-letter { float: left; font-family: var(--black); font-size: 62px; line-height: 0.9; padding: 6px 10px 0 0; color: var(--gold); }
.lore-empty { display: grid; place-content: center; justify-items: center; gap: 4px; padding: 24px; text-align: center; }
.lore-empty .s { width: 96px; height: 96px; opacity: 0.35; margin-bottom: 14px; }
.lore-empty b { font-size: 21px; font-weight: 500; }
.lore-empty p { font-style: italic; color: var(--muted); }
.lore-empty small { margin-top: 14px; max-width: 34ch; font-size: 15px; font-style: italic; color: var(--faint); line-height: 1.4; }

/* chrono layer */
.chrono { padding: 18px 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 28px; font-weight: 400; }
.cal-nav { display: flex; gap: 2px; }
.cal-nav button { height: 32px; min-width: 32px; padding: 0 8px; display: grid; place-items: center; color: var(--muted); font-size: 15px; font-style: italic; }
.cal-nav button:hover { color: var(--gold-hi); background: rgba(201, 168, 76, 0.08); }
.cal-nav svg { width: 14px; height: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { padding: 4px 0; text-align: center; font-size: 14px; font-style: italic; color: var(--faint); }
.cal-day { aspect-ratio: 1.2; display: grid; place-items: center; font-size: 17px; color: var(--muted); border: 1px solid transparent; position: relative; font-variant-numeric: lining-nums; }
.cal-day:hover:not(.out) { border-color: var(--line); color: var(--text); }
.cal-day.out { opacity: 0.22; cursor: default; }
.cal-day.today { color: var(--gold-hi); border-color: var(--line-strong); }
.cal-day.sel { background: rgba(201, 168, 76, 0.12); color: var(--text); }
.cal-day.ev::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; transform: rotate(45deg); background: var(--gold); }
.cal-day.eerie::after { background: var(--blood); }
.cal-detail { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); min-height: 72px; }
.cal-detail .d { font-size: 15px; font-style: italic; color: var(--muted); }
.cal-detail .e { font-size: 20px; margin-top: 2px; }
.cal-detail .e.eerie { color: var(--blood); }
.cal-detail .none { font-size: 17px; font-style: italic; color: var(--faint); margin-top: 2px; }

/* nexus browser */
.nexus { display: flex; flex-direction: column; }
.nx-bar { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex: none; }
.nx-bar button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); }
.nx-bar button:hover:not(:disabled) { color: var(--gold-hi); background: rgba(201, 168, 76, 0.08); }
.nx-bar button:disabled { opacity: 0.25; cursor: default; }
.nx-bar svg { width: 15px; height: 15px; }
.nx-bar .back svg { transform: scaleX(-1); }
.nx-url { flex: 1; min-width: 0; height: 32px; padding: 0 12px; margin-left: 4px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; outline: none; user-select: text; }
.nx-url:focus { border-color: var(--line-strong); }
.nx-go { width: auto !important; padding: 0 14px; border: 1px solid var(--line); font-size: 15px; font-style: italic; }
.nx-page { flex: 1; overflow: auto; padding: 28px 34px; animation: logIn 0.35s ease; }
.nx-page h2 { font-family: var(--black); font-weight: 400; font-size: 44px; line-height: 1.05; color: var(--gold); margin-bottom: 8px; }
.nx-page h2.err { color: var(--blood); }
.nx-page .lede { font-size: 20px; font-style: italic; color: var(--muted); margin-bottom: 20px; max-width: 50ch; }
.nx-page p, .nx-page li { font-size: 18px; line-height: 1.6; max-width: 58ch; }
.nx-page p + p { margin-top: 10px; }
.nx-page a { color: var(--gold-hi); text-decoration: underline; text-decoration-color: var(--gold-lo); text-underline-offset: 3px; cursor: pointer; }
.nx-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nx-card { padding: 14px 16px; text-align: left; border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s; }
.nx-card:hover { border-color: var(--line-strong); background: rgba(201, 168, 76, 0.05); }
.nx-card b { display: block; font-size: 20px; font-weight: 500; }
.nx-card em { display: block; font-size: 15px; color: var(--muted); margin: 2px 0 8px; }
.nx-card span { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.nx-table { border-collapse: collapse; margin: 6px 0 16px; font-family: var(--mono); font-size: 12px; min-width: 320px; }
.nx-table td { padding: 7px 18px 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--muted); }
.nx-table td:first-child { color: var(--text); }
.nx-table .ok { color: var(--verdigris); }
.nx-table .hot { color: var(--gold-hi); }
.nx-table .bad { color: var(--blood); }
.nx-myths dt { font-size: 21px; font-weight: 500; margin-top: 12px; }
.nx-myths dd { font-size: 17px; font-style: italic; color: var(--muted); }

/* oracle */
.oracle { padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; background: rgba(0, 0, 0, 0.4); overflow: auto; cursor: text; user-select: text; }
.oracle .out div { white-space: pre-wrap; }
.oracle .dim { color: var(--muted); }
.oracle .gold { color: var(--gold-hi); }
.oracle .red { color: var(--blood); }
.oracle .line { display: flex; gap: 10px; }
.oracle .ps { color: var(--gold); white-space: nowrap; }
.oracle input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font: inherit; caret-color: var(--gold); }

/* about */
.about { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 24px; text-align: center; }
.about .s { width: 110px; height: 110px; margin-bottom: 6px; }
.about h3 { font-family: var(--black); font-weight: 400; font-size: 46px; line-height: 1; }
.about p { font-style: italic; color: var(--muted); }
.about small { margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.8; }

/* awareness level 4, the whole desktop jumps */
body.glitch #desktop { animation: glitch 1.3s steps(2); }
@keyframes glitch {
  10% { transform: translate(-5px, 1px); filter: hue-rotate(-25deg) contrast(1.5); }
  20% { transform: translate(4px, -2px); }
  30% { clip-path: inset(12% 0 55% 0); }
  40% { clip-path: none; transform: translate(-2px, 0); filter: invert(0.08); }
  60% { transform: translate(3px, 1px); filter: none; }
  100% { transform: none; filter: none; }
}

/* phone-ish. not really meant for mobile but it shouldn't fall apart */
@media (max-width: 760px) {
  .start-btn .brand, .omen-moon, .clock small { display: none; }
  .search { width: 150px; }
  .search:focus-within { width: 190px; }
  .omen { right: 20px; top: 20px; }
  .omen-time { font-size: 48px; }
  .win { max-width: calc(100vw - 16px); }
  .updates, .archive, .lore { grid-template-columns: 1fr; }
  .start { width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* debug */
/* .win { outline: 1px solid red; } */