/* ST4CKLESS DASHBOARD — styles
   Colors come from config.js (accentColor). You normally don't need to edit this file. */

:root {
  --accent: #00e5ff;
  --accent-rgb: 0, 229, 255;
  --bg: #030608;
  --panel: rgba(6, 14, 18, 0.72);
  --text: #d6f6ff;
  --muted: rgba(var(--accent-rgb), 0.55);
  --line: rgba(var(--accent-rgb), 0.28);
  --glow: 0 0 12px rgba(var(--accent-rgb), 0.45);
  --font: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

::selection { background: rgba(var(--accent-rgb), 0.35); }

button, input, textarea { font: inherit; color: inherit; }

/* ---------- Background effects ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; }
.fx-grid {
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
.fx-scan {
  z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.18) 3px);
  opacity: 0.5;
}
.fx-scan::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(var(--accent-rgb), 0.05), transparent);
  animation: scanMove 7s linear infinite;
}
.fx-vignette { z-index: 49; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.75)); }

@keyframes scanMove { from { top: -120px; } to { top: 100%; } }

/* ---------- Boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  padding: 28px 32px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.6s ease;
}
#boot.hide { opacity: 0; pointer-events: none; }
#boot-log {
  font-size: 12px; line-height: 1.45;
  color: rgba(var(--accent-rgb), 0.85);
  white-space: pre-wrap; word-break: break-all;
  text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.6);
}
#boot-log .ok { color: #fff; }
#boot-log .dim { opacity: 0.45; }
#boot-log.fade { transition: opacity 0.4s; opacity: 0; }

#boot-logo {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
#boot-logo.show { opacity: 1; }
#boot-name {
  font-size: clamp(36px, 9vw, 96px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.8), 0 0 60px rgba(var(--accent-rgb), 0.4);
  text-transform: uppercase;
  text-align: center;
}
#boot-name.glitch { animation: glitch 0.25s steps(2) 3; }
#boot-bar { width: min(360px, 70vw); height: 2px; background: rgba(var(--accent-rgb), 0.15); }
#boot-bar span { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: var(--glow); transition: width 1.1s cubic-bezier(.6,.1,.2,1); }
#boot-logo.show #boot-bar span { width: 100%; }
#boot-tag { color: var(--muted); letter-spacing: 0.4em; text-transform: uppercase; font-size: 12px; text-align: center; }
#boot-skip { position: absolute; bottom: 18px; right: 24px; font-size: 11px; color: rgba(var(--accent-rgb), 0.35); }

@keyframes glitch {
  0%   { transform: translate(0); text-shadow: -3px 0 #ff2e63, 3px 0 var(--accent); }
  50%  { transform: translate(-4px, 2px); text-shadow: 3px 0 #ff2e63, -3px 0 var(--accent); }
  100% { transform: translate(3px, -1px); text-shadow: -2px 0 #ff2e63, 2px 0 var(--accent); }
}

/* ---------- Layout ---------- */
#app {
  position: relative; z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top top" "left center right";
  gap: 12px;
  padding: 12px;
}
.topbar { grid-area: top; }
.col-left { grid-area: left; }
.col-center { grid-area: center; }
.col-right { grid-area: right; }

.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.col::-webkit-scrollbar { display: none; }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  min-height: 0;
}
.panel.grow { flex: 1 1 0; min-height: 160px; }

/* corner brackets */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border-color: var(--accent); border-style: solid; filter: drop-shadow(0 0 4px var(--accent));
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}
.panel-head .code { color: var(--muted); letter-spacing: 0.1em; }
.panel-body { padding: 12px; min-height: 0; }
.panel-body.fill { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }

/* reveal animation (runs after boot) */
body.booting .panel { opacity: 0; }
body.ready .panel {
  animation: panelIn 0.7s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
body.ready .panel > * { animation: contentIn 0.5s ease both; animation-delay: calc(var(--i, 0) * 90ms + 400ms); }

@keyframes panelIn {
  0%   { opacity: 0; clip-path: inset(50% 0 50% 0); }
  15%  { opacity: 1; }
  100% { opacity: 1; clip-path: inset(-20px -20px -20px -20px); }
}
@keyframes contentIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Top bar ---------- */
.topbar { flex-direction: row; align-items: center; gap: 18px; padding: 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); animation: pulse 2s ease-in-out infinite; }
.brand-name { font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); text-shadow: var(--glow); }
.brand-tag { color: var(--muted); font-size: 11px; }
.ticker { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: inline-flex; gap: 60px; white-space: nowrap; color: var(--muted); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; animation: tick 40s linear infinite; }
.ticker-track span::before { content: "// "; color: var(--accent); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.status { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.pill { border: 1px solid var(--accent); color: var(--accent); padding: 2px 8px; font-size: 10px; letter-spacing: 0.15em; }
.pill.off { border-color: #ff2e63; color: #ff2e63; }
.mono-dim { color: var(--muted); }

@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Clock / stats ---------- */
.clock { font-size: 44px; font-weight: 300; letter-spacing: 0.04em; color: #fff; text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.7); line-height: 1; }
.date { color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.label { color: var(--muted); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; }
.value { color: var(--text); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.stats li { display: flex; justify-content: space-between; gap: 10px; }
.stats li span:first-child { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.stats li span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 3px; background: rgba(var(--accent-rgb), 0.15); margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--accent); box-shadow: var(--glow); transition: width 0.6s; }

.weather { display: flex; align-items: center; gap: 14px; }
.w-temp { font-size: 38px; font-weight: 300; color: #fff; text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.6); }

canvas { display: block; width: 100%; height: 100%; }

/* ---------- Terminal ---------- */
.terminal { padding: 12px 14px; cursor: text; }
#term-out { flex: 1 1 auto; overflow-y: auto; line-height: 1.55; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#term-out .cmd { color: #fff; }
#term-out .cmd .prompt { margin-right: 8px; }
#term-out .info { color: var(--accent); }
#term-out .muted { color: var(--muted); }
#term-out .err { color: #ff5c7a; }
#term-out a { color: var(--accent); }
.term-line { display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.prompt { color: var(--accent); white-space: nowrap; text-shadow: var(--glow); }
#term-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; caret-color: var(--accent); }

/* ---------- Keyboard ---------- */
.keyboard { display: flex; flex-direction: column; gap: 5px; user-select: none; }
.kb-row { display: flex; gap: 5px; }
.key {
  flex: 1 1 0; min-width: 0; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: rgba(var(--accent-rgb), 0.03);
  color: rgba(var(--accent-rgb), 0.8); font-size: 11px; cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, color 0.25s, transform 0.08s;
  padding: 0; overflow: hidden;
}
.key:hover { border-color: var(--accent); }
.key.on { background: var(--accent); color: #000; box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.9); transition: none; transform: translateY(1px); }
.key.w15 { flex-grow: 1.5; } .key.w2 { flex-grow: 2; } .key.w25 { flex-grow: 2.5; } .key.w6 { flex-grow: 6.5; }

/* ---------- Globe ---------- */
.globe-wrap { height: 210px; padding: 0; }

/* ---------- Links ---------- */
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 4px; border: 1px solid var(--line); text-decoration: none; color: var(--text);
  background: rgba(var(--accent-rgb), 0.03); transition: all 0.2s; min-width: 0;
}
.link b { font-size: 18px; color: var(--accent); font-weight: 600; transition: all 0.2s; }
.link span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link:hover, .link:focus-visible { background: rgba(var(--accent-rgb), 0.14); border-color: var(--accent); box-shadow: inset 0 0 18px rgba(var(--accent-rgb), 0.25); outline: none; }
.link:hover b { text-shadow: var(--glow); color: #fff; }

/* ---------- Notes / To-do ---------- */
.tabs { justify-content: flex-start; }
.tabs .code { margin-left: auto; }
.tab { background: none; border: 0; padding: 0 10px 0 0; cursor: pointer; color: var(--muted); letter-spacing: inherit; text-transform: inherit; font-size: inherit; }
.tab.active { color: var(--accent); text-shadow: var(--glow); }
.tab-page { display: none; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.tab-page.active { display: flex; }
#notes { flex: 1; resize: none; background: transparent; border: 0; outline: none; line-height: 1.6; color: var(--text); }
#notes::placeholder, #todo-input::placeholder { color: rgba(var(--accent-rgb), 0.35); }
.todo-form input { width: 100%; background: rgba(var(--accent-rgb), 0.04); border: 1px solid var(--line); padding: 7px 9px; outline: none; }
.todo-form input:focus { border-color: var(--accent); }
.todo-list { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.todo-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.todo-list li.done .t { text-decoration: line-through; color: var(--muted); }
.todo-list .t { flex: 1; word-break: break-word; }
.todo-list input[type=checkbox] { accent-color: var(--accent); }
.todo-list button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.todo-list button:hover { color: #ff5c7a; }

/* ---------- Login screen ---------- */
body.locked { overflow: hidden; }
body.locked #app, body.locked #boot { visibility: hidden; }

#login {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, #061015 0%, #000 75%);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}
#login.exit { opacity: 0; transform: scale(1.08); filter: blur(6px); pointer-events: none; }
#login.denied {
  --accent: #ff2e63; --accent-rgb: 255, 46, 99;
  --muted: rgba(var(--accent-rgb), 0.55);
  --line: rgba(var(--accent-rgb), 0.28);
  --glow: 0 0 12px rgba(var(--accent-rgb), 0.45);
}

#login-rain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }

.login-box {
  position: relative;
  width: min(400px, 100%);
  padding: 26px 28px 18px;
  background: rgba(3, 10, 12, 0.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 60px rgba(var(--accent-rgb), 0.12), inset 0 0 40px rgba(var(--accent-rgb), 0.05);
  text-align: center;
  animation: loginIn 0.9s cubic-bezier(.2,.8,.2,1) both;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.login-box::before, .login-box::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border-color: var(--accent); border-style: solid; filter: drop-shadow(0 0 5px var(--accent));
}
.login-box::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.login-box::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
#login.denied .login-box { animation: shake 0.45s ease; }

@keyframes loginIn {
  0% { opacity: 0; clip-path: inset(50% 0 50% 0); }
  20% { opacity: 1; }
  100% { opacity: 1; clip-path: inset(-30px -30px -30px -30px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}

/* scanner rings + lock */
.scanner { width: 132px; height: 132px; display: block; margin: 0 auto 10px; overflow: visible; }
.scanner circle, .scanner path, .scanner rect { fill: none; stroke: var(--accent); transition: stroke 0.3s; }
.scanner .r-ticks { stroke-width: 6; stroke-dasharray: 1.5 8.1; opacity: 0.45; transform-origin: center; animation: spin 30s linear infinite; }
.scanner .r-arcs { stroke-width: 2; stroke-dasharray: 90 36 20 36; opacity: 0.85; transform-origin: center; animation: spin 6s linear infinite reverse; filter: drop-shadow(0 0 3px var(--accent)); }
.scanner .r-track { stroke-width: 3; opacity: 0.15; }
.scanner .r-prog { stroke-width: 3; stroke-dasharray: 415; stroke-dashoffset: 415; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1.2s cubic-bezier(.6,.1,.2,1); filter: drop-shadow(0 0 4px var(--accent)); }
.scanner .lock { stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--accent)); }
.scanner .shackle { transition: transform 0.5s cubic-bezier(.3,1.6,.5,1); }
.scanner .lock circle { fill: var(--accent); stroke: none; }

#login.checking .r-arcs { animation-duration: 0.8s; }
#login.checking .r-prog { stroke-dashoffset: 300; transition-duration: 0.7s; }
#login.granted .r-prog { stroke-dashoffset: 0; }
#login.granted .shackle { transform: translateY(-9px); }
#login.granted .r-ticks { animation-duration: 3s; opacity: 0.9; }

@keyframes spin { to { transform: rotate(360deg); } }

.login-title {
  font-size: 15px; font-weight: 800; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent); text-shadow: var(--glow); min-height: 1.4em;
}
.login-sub { margin-top: 4px; font-size: 11px; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; }

#login-form { margin-top: 22px; display: grid; gap: 12px; text-align: left; }
.field {
  position: relative; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
  transition: border-color 0.2s;
}
.field::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: var(--accent); box-shadow: var(--glow); transition: width 0.35s ease;
}
.field:focus-within::after { width: 100%; }
.field-label { color: var(--accent); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; white-space: nowrap; width: 58px; }
.field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; caret-color: var(--accent); letter-spacing: 0.06em; padding: 2px 0; }
.field input:disabled { opacity: 0.4; }
.eye { background: none; border: 0; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; padding: 2px 4px; }
.eye:hover { color: var(--accent); }

.login-msg { min-height: 1.5em; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.login-msg.err { color: #ff5c7a; }
.login-msg.ok { color: var(--accent); text-shadow: var(--glow); }

.login-btn {
  position: relative; overflow: hidden;
  padding: 11px; border: 1px solid var(--accent); background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent); letter-spacing: 0.35em; text-transform: uppercase; font-weight: 600;
  cursor: pointer; transition: color 0.25s, box-shadow 0.25s;
}
.login-btn span { position: relative; z-index: 1; }
.login-btn::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateX(-101%); transition: transform 0.3s ease;
}
.login-btn:hover:not(:disabled)::before, .login-btn:focus-visible::before { transform: translateX(0); }
.login-btn:hover:not(:disabled), .login-btn:focus-visible { color: #000; box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.5); outline: none; }
.login-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.login-foot {
  display: flex; justify-content: space-between; margin-top: 18px; padding-top: 10px;
  border-top: 1px dashed var(--line); font-size: 10px; color: var(--muted); letter-spacing: 0.15em;
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1200px) {
  body { overflow: auto; }
  #app {
    height: auto; min-height: 100vh;
    grid-template-columns: 290px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "top top" "left center" "right right";
  }
  .col-center { min-height: 640px; }
  .col-right { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .col-right .panel.grow { min-height: 260px; }
}

@media (max-width: 760px) {
  #app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "left" "center" "right";
    padding: 10px 16px;
  }
  .col { overflow: visible; }
  .col-center { min-height: 0; }
  .col-center .panel.grow { min-height: 380px; }
  .keyboard-panel, .ticker, .brand-tag { display: none; }
  .clock { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-scan::after, .ticker-track, .brand-dot { animation: none; }
}
