/* ============================================================================
   calm.css — Calming BEIGE theme + low-motion + high-performance override.
   Loaded LAST (after aurora.css and motion.css) so it has the final word.

   Why this file exists:
   - The site shipped a busy violet/cyan "aurora" skin (aurora.css) with 4 giant
     blur(80px) orbs, blur(26px) glass on every panel, a mouse-follow spotlight and
     dozens of infinite animations. That is what makes scrolling lag.
   - This file: (1) repaints everything in a warm, low-saturation beige palette,
     (2) removes the animated background + backdrop blur, (3) stops the always-on
     decorative animations. Pair it with the two small motion.js edits.
   ========================================================================== */

/* ---------- 1. Palette — warm beige (light) + warm espresso (dark) ---------- */
:root,
html[data-theme="light"] {
  --bg: #efe7d6;
  --surface: #faf5ea;
  --surface-2: #f3ecdd;
  --surface-3: #ece3d2;
  --ink: #3c362b;
  --ink-2: #575043;
  --ink-3: #6f6757;
  --accent: #8a9a74;
  --accent-hover: #76855f;
  --accent-ink: #ffffff;
  --accent-soft: #e7e9d7;
  --green: #8a9a74;
  --green-600: #76855f;
  --green-700: #64724f;
  --green-800: #505c40;
  --green-300: #bcc7a8;
  --green-200: #d6ddc5;
  --green-100: #e7e9d7;
  --green-50: #f3f3e9;
  --line: rgba(70, 58, 38, 0.12);
  --line-2: rgba(70, 58, 38, 0.20);
  --glass: rgba(250, 245, 234, 0.90);
  --glass-strong: rgba(250, 245, 234, 0.97);
  --glass-soft: rgba(250, 245, 234, 0.78);
  --glass-border: rgba(70, 58, 38, 0.14);
  --glass-edge: rgba(255, 255, 255, 0.55);
  --glass-blur: none;
  --blur: none;
  --grad-primary: linear-gradient(135deg, #8f9e79 0%, #7f8d68 100%);
  --grad-text: linear-gradient(110deg, #6f7d57 0%, #8a9a74 45%, #a98c6b 100%);
  --grad-hot: linear-gradient(120deg, #b58d70 0%, #c9a24a 100%);
  --spot: transparent;
  --star: transparent;
  --mesh: none;
  --focus: #8a9a74;
  --shadow: 0 1px 2px rgba(70, 58, 38, 0.06), 0 8px 20px -14px rgba(70, 58, 38, 0.24);
  --shadow-lg: 0 20px 48px -22px rgba(70, 58, 38, 0.32);
  --glass-shadow: 0 1px 2px rgba(70, 58, 38, 0.05), 0 10px 26px -18px rgba(70, 58, 38, 0.26);
  --danger: #c05b4e;
  --danger-bg: #f6e7e1;
  --warn: #b4863a;
  --orb-1: #cdbfa0; --orb-2: #cbc3ad; --orb-3: #d8c3ad; --orb-4: #d9cfa6;
}

html[data-theme="dark"] {
  --bg: #211c15;
  --surface: #2b251c;
  --surface-2: #332c22;
  --surface-3: #3a3328;
  --ink: #ece4d5;
  --ink-2: #c3b9a6;
  --ink-3: #a89f8c;
  --accent: #aebb98;
  --accent-hover: #c2cdb0;
  --accent-ink: #232017;
  --accent-soft: #3a3426;
  --green: #aebb98;
  --green-600: #c2cdb0;
  --green-700: #aebb98;
  --green-800: #d2dcc1;
  --green-300: #6c7a54;
  --green-200: #4c5739;
  --green-100: #3a3426;
  --green-50: #2f2a1e;
  --line: rgba(255, 248, 235, 0.09);
  --line-2: rgba(255, 248, 235, 0.15);
  --glass: rgba(43, 37, 28, 0.92);
  --glass-strong: rgba(43, 37, 28, 0.97);
  --glass-soft: rgba(43, 37, 28, 0.80);
  --glass-border: rgba(255, 248, 235, 0.10);
  --glass-edge: rgba(255, 248, 235, 0.05);
  --grad-primary: linear-gradient(135deg, #b2bf9c 0%, #9fae88 100%);
  --grad-text: linear-gradient(110deg, #d2dcc1 0%, #aebb98 45%, #c7a483 100%);
  --grad-hot: linear-gradient(120deg, #c7a483 0%, #d8b45e 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 26px 64px -22px rgba(0, 0, 0, 0.6);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -18px rgba(0, 0, 0, 0.6);
  --danger: #e08a7d;
}

html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); }

/* ---------- 2. Performance: remove the animated aurora background ---------- */
.bg-orbs, .bg-stars, .bg-grid { display: none !important; }
.bg-orbs .orb { animation: none !important; filter: none !important; will-change: auto !important; }
.bg-orbs::before { background: var(--bg) !important; }

/* ---------- 3. Performance: no backdrop blur (the biggest scroll cost) ---------- */
.glass, .panel, .modal, .modal-back, .site-menu, .site-menu::backdrop, .toast, .up-panel,
:is(.now-card, .album-hero, .folders-hero, .week-shell, .lock-card, .login-card, .home-tile),
.music-mini, .call-overlay, .lb, .seg, .day-head, .drop-hint,
.tile .vbadge, .tile .play span {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ---------- 4. Less motion: stop the always-on decorative loops ---------- */
.today-day, .home-tile-icon, .site-menu-logo, .brand-dot,
.nb-bg::before, .nb-blob-1, .nb-blob-2, .nb-blob-3,
.nb-glow, .nb-avatar::after, .nb-badge-icon,
.music-flow-wave i, .music-live-pill i,
.chooser-view[data-phase="chosen"] .chooser-ring {
  animation: none !important;
}
.nb-bg::before, .nb-blob-1, .nb-blob-2, .nb-blob-3 { will-change: auto !important; }
.mo-progress { display: none !important; }
html { scroll-behavior: auto !important; }

/* Instant tab switching — no "smooth placing" entrance animation (this was the scroll/switch lag) */
.view, .view.enter, #albumBody.enter,
.view.enter > *, .view.enter > :not(dialog),
.view.enter .home-launch > *, .view.enter .today-facts > *,
.view.enter .google-tiles > *, .view.enter .folder-grid > *,
.mo-rv, .mo-tick {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.tab-pill { background: var(--accent) !important; box-shadow: none !important; transition: none !important; }
.tab-indicator { transition: none !important; }

/* Neutralize the mouse-follow spotlight layer (JS handler is also disabled in motion.js) */
:root { --mx: -1000px; --my: -1000px; }

/* ---------- 5. Recolor baked-in violet/cyan/pink backgrounds → calm ---------- */
.textbook-hero { background: linear-gradient(135deg, #8a9a74, #6f7d57) !important; color: #fff !important; }
.chooser-idle { background: radial-gradient(90% 90% at 50% 30%, rgba(138, 154, 116, 0.35), transparent 60%), linear-gradient(160deg, #2c2620, #1a1610) !important; }
.yt-player-empty { background: radial-gradient(120% 120% at 50% 0%, rgba(138, 154, 116, 0.18), transparent 60%) !important; }
.lock-card::before { background: radial-gradient(closest-side, rgba(138, 154, 116, 0.22), transparent) !important; }
.today-card.glass,
html[data-theme="dark"] .today-card.glass { background: var(--glass) !important; }
.drop-hint { background: rgba(138, 154, 116, 0.16) !important; }
.lb { background: rgba(33, 28, 21, 0.94) !important; }
.modal-back, .site-menu::backdrop { background: rgba(33, 28, 21, 0.40) !important; }
::selection { background: rgba(138, 154, 116, 0.30); }

/* dark-theme panels that baked #17133a */
html[data-theme="dark"] :is(.glass, .modal, .site-menu, .home-tile) { background: var(--glass) !important; }
html[data-theme="dark"] select.input option { background: var(--surface) !important; }

/* colored glows → soft neutral shadow */
.btn-primary, .btn-primary:hover, .tab-pill, .fab, .now-main:not(.idle),
.fact-ico, .site-menu .site-menu-tabs .tab.on, .tab-indicator,
.brand-mark.photo, .site-menu, .games-picker button[aria-selected="true"] {
  box-shadow: var(--shadow) !important;
}
.brand-dot { box-shadow: 0 0 0 3px rgba(138, 154, 116, 0.18) !important; }
.today-num { -webkit-text-stroke: 2px rgba(138, 154, 116, 0.18) !important; }
/* hero icons + cards + highlights still carried a violet glow */
html[data-theme] :is(.lock-icon, .modal-icon:not(.danger), .now-ico, .album-icon, .folder-hero-icon, .gal-empty .art),
:is(.folder-card, .folder-file, .tile), .wk-head.today, .lesson.now, .seg button.on, .btn-ghost {
  box-shadow: var(--shadow) !important;
}
.lock-icon { animation: none !important; }

/* status tones (chips / covers) → calm earth set */
.tone-0 { --tone: #8a9a74; --tone-bg: rgba(231, 233, 215, 0.85); }
.tone-1 { --tone: #7f988a; --tone-bg: rgba(224, 233, 227, 0.85); }
.tone-2 { --tone: #b5806a; --tone-bg: rgba(240, 228, 220, 0.85); }
.tone-3 { --tone: #b4863a; --tone-bg: rgba(240, 232, 214, 0.85); }
.tone-4 { --tone: #8a9a74; --tone-bg: rgba(231, 233, 215, 0.85); }
.tone-5 { --tone: #6f978b; --tone-bg: rgba(221, 235, 231, 0.85); }
.tone-6 { --tone: #a9755c; --tone-bg: rgba(238, 226, 220, 0.85); }
.tone-7 { --tone: #7d7a63; --tone-bg: rgba(233, 230, 216, 0.85); }
html[data-theme="dark"] :is(.tone-0, .tone-4) { --tone: #aebb98; }
html[data-theme="dark"] :is(.tone-1, .tone-5) { --tone: #9fb3a5; }
html[data-theme="dark"] :is(.tone-2, .tone-6) { --tone: #ca9b85; }
html[data-theme="dark"] .tone-3 { --tone: #d8b45e; }
html[data-theme="dark"] .tone-7 { --tone: #b6b29a; }
/* textbook covers — aurora recolored these to violet; restore warm earth tones */
.textbook-cover, .textbook-card.tone-green .textbook-cover { background: #345642 !important; }
.textbook-card.tone-rose .textbook-cover { background: #88544f !important; }
.textbook-card.tone-sand .textbook-cover { background: #927343 !important; }
.textbook-card.tone-blue .textbook-cover { background: #41656c !important; }
.textbook-card.tone-orange .textbook-cover { background: #ae7049 !important; }
.textbook-stack i { background: #cdbfa0 !important; color: #4a4336 !important; box-shadow: var(--shadow) !important; }

/* board overlay variables (defined violet in aurora.css) */
#view-board {
  --board-shell: #ece3d2; --bg-glass: rgba(250, 245, 234, 0.93); --bg-glass-solid: #faf5ea;
  --bg-drawer: rgba(250, 245, 234, 0.95); --bg-on: rgba(138, 154, 116, 0.16);
  --bg-on-ink: #64724f; --bg-ring: #8a9a74;
}
html[data-theme="dark"] #view-board {
  --board-shell: #2b251c; --bg-glass: rgba(43, 37, 28, 0.90); --bg-glass-solid: #332c22;
  --bg-drawer: rgba(43, 37, 28, 0.95); --bg-on: rgba(174, 187, 152, 0.22);
  --bg-on-ink: #d2dcc1; --bg-ring: #aebb98;
}
.board-card-paper {
  background-image: linear-gradient(rgba(70, 58, 38, 0.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(70, 58, 38, 0.06) 1px, transparent 1px) !important;
}

/* flashcard faces */
.fc-front { background: linear-gradient(160deg, #faf5ea, #f1ead9) !important; }
.fc-word { color: #3c362b !important; }
.fc-face-kicker { color: #6f7d57 !important; }
.fc-tap-hint { color: #948c79 !important; }
.fc-back { background: linear-gradient(160deg, #8a9a74, #64724f) !important; }
.fc-btn-know { background: linear-gradient(135deg, #9fb3a5, #8a9a74) !important; box-shadow: var(--shadow) !important; }
.fc-deck-eng { background: linear-gradient(135deg, rgba(159, 179, 165, 0.2), var(--glass)) !important; }

/* teacher-mirror stage navy → warm dark */
:is(.mirror-stage, .mirror-stage video, .mirror-placeholder, .mirror-preview) { background: #201b14 !important; }

/* ---------- 6. Music: recolor the violet "listening room" → sage/clay ---------- */
#view-music {
  --mix-violet: #8a9a74; --mix-rose: #b5806a; --mix-peach: #cbab8a;
  --accent: #8a9a74; --accent-hover: #76855f; --accent-soft: #e7e9d7; --accent-ink: #ffffff;
}

/* ---------- 7. Chooser camera game: calm the loud gradients ---------- */
.chooser-steps b { background: linear-gradient(120deg, #8a9a74, #7f988a) !important; }
.chooser-view[data-phase="scanning"] .chooser-frame i { border-color: #8a9a74 !important; }
.chooser-view[data-phase="scanning"] .chooser-stage {
  box-shadow: 0 0 0 3px #8a9a74, 0 0 50px -6px rgba(138, 154, 116, 0.5), 0 30px 60px -30px rgba(30, 26, 18, 0.7) !important;
}
.chooser-ring { border-color: #8a9a74 !important; box-shadow: 0 0 30px rgba(138, 154, 116, 0.8), inset 0 0 30px rgba(138, 154, 116, 0.4) !important; }
.chooser-banner-sub { color: #d7e0cf !important; }
.chooser-banner strong { text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5) !important; }

/* ---------- 8. note-board full-screen aurora → calm static ---------- */
.nb-bg::before { background: radial-gradient(60% 60% at 30% 20%, rgba(138, 154, 116, 0.12), transparent 70%) !important; }
.nb-blob-1, .nb-blob-2, .nb-blob-3 { background: rgba(138, 154, 116, 0.10) !important; }

/* ---------- 10. Sandwich (Цэс) menu: always a tappable hamburger, no docked sidebar ----------
   On wide screens (>=1180px) the home layout docked the menu as a permanent left sidebar and
   HID the hamburger button. Keep the simple click-to-open popup everywhere so "Цэс" is always there. */
@media (min-width: 1180px) {
  body[data-page="home"] { padding-left: 0 !important; }
  body[data-page="home"] > .site-menu:not([open]) { display: none !important; }
  body[data-page="home"] .nav-with-menu .site-menu-button { display: inline-flex !important; }
  body[data-page="home"] .nav-with-menu .brand { display: flex !important; }
}
/* menu opens instantly — no slide/fade/stagger (disables site-menu-enter, mo-drawer, mo-slide) */
.site-menu[open],
.site-menu[open] .site-menu-tabs > *,
.site-menu[open] .site-menu-tabs > :not(.tab-indicator) {
  animation: none !important;
}

/* make the hamburger clearly a button in the calm theme */
.site-menu-button { background: var(--surface) !important; border: 1px solid var(--line-2) !important; color: var(--ink) !important; }
.site-menu-button[aria-expanded="true"] { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; }

/* ---------- 9. Respect reduced-motion fully ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- 11. Design polish — crisp surfaces, one title style, readable text, calm accents ---------- */
:root, html[data-theme="light"] { --hot: #b5806a; --sun: #c9a24a; --sky: #7f988a; }
html[data-theme="dark"] { --hot: #ca9b85; --sun: #d8b45e; --sky: #9fb3a5; }

/* every section title: solid ink with an accent dot (no gradient text) */
:is(.games-hero, .game-hero, .ludo-hero, .chooser-hero, .yt-hero, .fc-hero, .music-hero, .mono-hero, .ch-hero, .ai-chat-hero, .pb-heading, .sp-hero, .mirror-heading, .student-clubs-heading, .section-head, .album-title, .folders-heading) h2 {
  background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important;
  color: var(--ink) !important; -webkit-text-fill-color: currentColor !important; letter-spacing: -0.025em;
}
:is(.games-hero, .game-hero, .ludo-hero, .chooser-hero, .yt-hero, .fc-hero, .music-hero, .mono-hero, .ch-hero, .ai-chat-hero, .pb-heading, .sp-hero, .mirror-heading, .student-clubs-heading, .section-head, .album-title, .folders-heading) h2 > span {
  color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important;
}
.google-hero .google-wordmark span { color: var(--ink) !important; }

/* cards & tiles: thin warm border, small soft shadow, no hover jump */
.home-tile { border-color: var(--line-2) !important; box-shadow: var(--shadow) !important; }
.home-tile:hover { border-color: var(--accent) !important; box-shadow: var(--shadow) !important; }
.home-tile-icon { box-shadow: none !important; }
:is(.home-tile, .folder-card, .google-tile, .fc-deck, .textbook-cover-button, .tile, .music-playlist-card, .yt-card, .doodle-page-card, .senior-shortcut, .mono-setup-btn, .ludo-setup-btn):hover,
.home-tile:hover :is(.home-tile-icon, .home-tile-arrow),
.site-menu .site-menu-tabs .tab:hover { transform: none !important; }

/* buttons & selected states: solid and calm */
.btn-primary, .btn-primary:hover { background: var(--accent) !important; background-size: auto !important; color: var(--accent-ink) !important; border-color: transparent !important; }
.btn-primary:hover { background: var(--accent-hover) !important; }
.btn-ghost { border-color: var(--line-2) !important; box-shadow: none !important; }
.site-menu .site-menu-tabs .tab.on, .tab-pill, .games-picker button[aria-selected="true"] { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: transparent !important; }

/* form fields */
.input, select.input, textarea.input { border-color: var(--line-2) !important; box-shadow: none !important; }
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; }

/* Google: calm focus ring instead of bright blue glow */
.google-omnibox:focus-within, .google-big-field:focus-within { border-color: var(--accent) !important; box-shadow: 0 0 0 4px var(--accent-soft) !important; }
.google-wordmark-lg { filter: none !important; }

/* YouTube: warm dark stage instead of navy, calm play badge */
.yt-player-frame { background: #1d1914 !important; }
.yt-empty-icon { background: #a9755c !important; box-shadow: none !important; }
.yt-card-thumb { background: #2a241c !important; }

/* keyboard focus that is always visible */
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

/* warm, thin scrollbars */
html { scrollbar-width: thin; scrollbar-color: rgba(70, 58, 38, 0.28) transparent; }
html[data-theme="dark"] { scrollbar-color: rgba(255, 248, 235, 0.22) transparent; }

/* ---------- 12. No animations anywhere — instant UI ----------
   Only the loading spinner and the urgent-notice countdown ring still move (they carry information). */
*, *::before, *::after { animation: none !important; transition: none !important; }
html { scroll-behavior: auto !important; }
.spinner { animation: spin 0.8s linear infinite !important; }
.is-counting .nb-ring-fill { animation: nb-ring 10s linear forwards !important; }
