/* Tihvert Desktop – suunnittelutunnisteet. Kaikki värit/mitat täällä, jotta ne voi sovittaa käsin. */
:root {
  --bg: #0b0b10;
  --panel: #13131a;
  --panel-2: #181822;
  --border: #24242e;
  --border-strong: #34344a;
  --text: #e6e6ee;
  --muted: #8a8a99;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.18);
  --teal: #2dd4bf;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 4px;
  --taskbar-h: 52px;
  --app-h: 100vh;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@supports (height: 100dvh) {
  :root { --app-h: 100dvh; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
a { color: var(--teal); }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow, .mono { font-family: var(--font-mono); letter-spacing: .08em; font-size: 12px; color: var(--muted); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: fixed; left: 8px; top: -60px; z-index: 1000; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius);
}
.skip-link:focus { top: calc(8px + env(safe-area-inset-top)); }

/* Aurora: kaksi sumeaa kerrosta, CSS-only, pysähtyy reduced-motionissa */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(60vmax 40vmax at 50% 110%, rgba(79, 70, 229, 0.10), transparent 70%); }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(90px); will-change: transform;
}
.aurora::before {
  left: -22vmax; top: -30vmax; opacity: 0.16;
  background: radial-gradient(circle at 40% 40%, var(--accent), transparent 65%);
  animation: drift-a 60s ease-in-out infinite alternate;
}
.aurora::after {
  right: -28vmax; bottom: -34vmax; opacity: 0.12;
  background: radial-gradient(circle at 50% 50%, var(--teal), transparent 62%);
  animation: drift-b 72s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.1); } }
@keyframes drift-b { to { transform: translate3d(-12vmax, -9vmax, 0) scale(1.08); } }

/* Painikkeet ja lomakkeet */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.btn:hover { border-color: var(--accent); }
.btn:active { background: var(--accent-soft); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }

input[type=text], input[type=search], input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px;
  background: #0e0e14; border: 1px solid var(--border-strong); border-radius: var(--radius);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #6b6b7b; }
label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }

.toasts {
  position: fixed; z-index: 2000; left: 12px; right: 12px; bottom: calc(var(--taskbar-h) + 12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: min(460px, 100%); padding: 10px 14px;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--teal);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

@media (pointer: coarse) {
  input[type=text], input[type=search], input[type=password], input[type=date], select, textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
