/* Tokens, reset, type, form controls. Theme values are rewritten at runtime
   by js/lib/theme.js from the user's settings. */

:root {
  --accent: #1e9bff;
  --accent-rgb: 30, 155, 255;
  --accent-ink: #ffffff;
  --tint-rgb: 255, 255, 255;
  --glass-a: 0.34;
  --glass-blur: 16px;
  --gloss: 0.55;
  --shadow-a: 0.22;

  --ink: #0b2540;
  --ink-rgb: 11, 37, 64;
  --ink-2: rgba(11, 37, 64, 0.74);
  --ink-3: rgba(11, 37, 64, 0.52);
  --hair: rgba(11, 37, 64, 0.1);
  --field: rgba(255, 255, 255, 0.6);
  --field-line: rgba(11, 37, 64, 0.14);
  --emboss: 0 1px 0 rgba(255, 255, 255, 0.45);

  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', 'Segoe UI', system-ui, sans-serif;
  --font-pixel: 'Silkscreen', 'Courier New', monospace;

  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;

  --light: 150deg;
  --lx: 30%;
  --ly: 0%;

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dock-w: 96px;
  --gap: 18px;

  color-scheme: light;
}

:root[data-ink='light'] {
  --ink: #f4faff;
  --ink-rgb: 244, 250, 255;
  --ink-2: rgba(244, 250, 255, 0.8);
  --ink-3: rgba(244, 250, 255, 0.58);
  --hair: rgba(255, 255, 255, 0.14);
  --field: rgba(255, 255, 255, 0.1);
  --field-line: rgba(255, 255, 255, 0.24);
  --gloss: 0.22;
  --shadow-a: 0.5;
  --emboss: 0 1px 2px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: calc(15px * var(--scale, 1));
  -webkit-text-size-adjust: 100%;
  background: #4fb4f2;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.45;
  background: linear-gradient(#1673d6, #8fd6ff);
  overflow: hidden;
  text-shadow: var(--emboss);
  -webkit-font-smoothing: antialiased;
}

#wallpaper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
}

#glass-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: 1.85rem; font-weight: 900; }
h2 { font-size: 1.35rem; font-weight: 900; }
h3 { font-size: 1.08rem; font-weight: 800; }
h4 { font-size: 0.95rem; font-weight: 800; }
p { margin: 0 0 0.6em; }
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--accent); font-weight: 800; cursor: pointer; }
[data-ink='light'] a.link, [data-ink='light'] .link { color: color-mix(in srgb, var(--accent) 55%, white); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 14px 0; }
::selection { background: rgba(var(--accent-rgb), 0.35); }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.tiny { font-size: 0.8rem; }
.small { font-size: 0.9rem; }
.big { font-size: 1.15rem; }
.bold { font-weight: 800; }
.pixel-font { font-family: var(--font-pixel); letter-spacing: 0.02em; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-s { gap: 6px; }
.gap-l { gap: 18px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.stack > * + * { margin-top: var(--gap); }

/* Form controls ---------------------------------------------------------- */

.field {
  width: 100%;
  font: inherit;
  color: var(--ink);
  text-shadow: none;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 14px;
  padding: 0.68em 0.95em;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 30, 60, 0.08), 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.field::placeholder { color: var(--ink-3); }
.field:focus {
  border-color: rgba(var(--accent-rgb), 0.8);
  box-shadow: inset 0 2px 5px rgba(0, 30, 60, 0.06), 0 0 0 4px rgba(var(--accent-rgb), 0.22);
  background: color-mix(in srgb, var(--field) 70%, white 10%);
}
textarea.field { resize: vertical; min-height: 5.5em; line-height: 1.5; }
select.field {
  appearance: none;
  padding-right: 2.4em;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
[data-ink='light'] select.field option { color: #0b2540; }

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row + .form-row { margin-top: 14px; }
.label { font-weight: 800; font-size: 0.86rem; color: var(--ink-2); }
.hint { font-size: 0.8rem; color: var(--ink-3); }

/* Glossy capsule toggle */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 50px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 30, 60, 0.28), rgba(0, 30, 60, 0.12));
  box-shadow: inset 0 2px 5px rgba(0, 20, 40, 0.3), 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: background 0.25s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 25%, #e7f3ff 45%, #b9d4ec 100%);
  box-shadow: 0 2px 5px rgba(0, 30, 60, 0.35), inset 0 -2px 3px rgba(0, 40, 80, 0.15);
  transition: transform 0.35s var(--spring);
}
.switch input:checked + .switch-track {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 75%, white), var(--accent));
  box-shadow: inset 0 2px 5px rgba(0, 30, 80, 0.3), 0 0 12px rgba(var(--accent-rgb), 0.4);
}
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(var(--accent-rgb), 0.5); outline-offset: 2px; }

/* Aqua slider */
input[type='range'].range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
}
input[type='range'].range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 30, 60, 0.25), rgba(0, 30, 60, 0.1));
  box-shadow: inset 0 2px 4px rgba(0, 20, 40, 0.28), 0 1px 0 rgba(255, 255, 255, 0.55);
}
input[type='range'].range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 30, 60, 0.25), rgba(0, 30, 60, 0.1));
  box-shadow: inset 0 2px 4px rgba(0, 20, 40, 0.28);
}
input[type='range'].range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 28%, #fff 0 18%, color-mix(in srgb, var(--accent) 45%, white) 40%, var(--accent) 100%);
  box-shadow: 0 3px 8px rgba(0, 30, 70, 0.35), inset 0 -3px 4px rgba(0, 30, 80, 0.2);
}
input[type='range'].range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 28%, #fff 0 18%, color-mix(in srgb, var(--accent) 45%, white) 40%, var(--accent) 100%);
  box-shadow: 0 3px 8px rgba(0, 30, 70, 0.35);
}
input[type='color'].swatch-input {
  width: 42px;
  height: 42px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
input[type='color'].swatch-input::-webkit-color-swatch-wrapper { padding: 0; }
input[type='color'].swatch-input::-webkit-color-swatch {
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--ink-rgb), 0.25) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), rgba(var(--ink-rgb), 0.22));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.55); outline-offset: 2px; }

/* Boot splash */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 12%, #9be7ff 35%, #1e9bff 75%, #0a5fb8);
  box-shadow: 0 10px 30px rgba(0, 60, 140, 0.35), inset 0 -6px 12px rgba(0, 40, 100, 0.35);
  animation: boot-bob 1.2s var(--ease) infinite alternate;
}
@keyframes boot-bob { to { transform: translateY(-14px) scale(1.04); } }

[data-motion='reduced'] *,
[data-motion='reduced'] *::before,
[data-motion='reduced'] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
