/* Liquid glass layer: spring motion, light-catching glass, draggable cards.
   Everything is scoped away from the Counter-Strike theme, and motion follows
   prefers-reduced-motion through the global rules in refinements.css. */
:root {
  --spring: cubic-bezier(.34,1.56,.64,1);
  --spring-soft: cubic-bezier(.22,1.2,.36,1);
  --sheen-rgb: 255 255 255;
  --sheen-alpha: .5;
  --edge-hi: rgba(255,255,255,.85);
  --edge-lo: rgba(40,70,55,.06);
  --surface-glass: rgba(240,246,241,.72);
  --pill: rgba(255,255,255,.62);
  --focus-tint: linear-gradient(135deg,rgba(222,234,218,.6),rgba(241,246,229,.6));
  --float-shadow: 0 34px 60px -20px rgba(35,60,48,.38),0 14px 26px -14px rgba(35,60,48,.28);
}
/* Real spring curves (overshoot, then settle) where the browser supports linear(). */
@supports (animation-timing-function: linear(0,1)) {
  :root {
    --spring: linear(0,0.047,0.166,0.327,0.503,0.675,0.828,0.954,1.049,1.114,1.15,1.163,1.158,1.14,1.114,1.086,1.057,1.032,1.01,0.994,0.983,0.976,0.974,0.974,0.977,0.981,0.985,0.99,0.994,0.998,1.001,1.003,1.004,1.004,1.004,1.004,1.003,1.003,1.002,1.001,1);
    --spring-soft: linear(0,0.05,0.168,0.317,0.471,0.613,0.736,0.835,0.911,0.965,1.001,1.023,1.035,1.038,1.037,1.033,1.027,1.021,1.016,1.011,1.007,1.004,1.002,1,0.999,0.999,0.999,0.999,0.999,0.999,0.999,0.999,1);
  }
}
html[data-theme="dark"] {
  --sheen-rgb: 190 235 208;
  --sheen-alpha: .13;
  --edge-hi: rgba(210,240,222,.16);
  --edge-lo: rgba(0,0,0,.25);
  --surface-glass: rgba(33,48,41,.7);
  --pill: rgba(173,201,181,.13);
  --focus-tint: linear-gradient(135deg,#3b4f395c,#30463755);
  --float-shadow: 0 34px 60px -20px rgba(0,0,0,.6),0 14px 26px -14px rgba(0,0,0,.45);
}
@property --glow { syntax:'<number>'; inherits:false; initial-value:0; }

/* Glass that catches the light: a soft highlight follows the pointer (set by liquid.js). */
html:not([data-theme="cs"]) .glass {
  --mx:50%; --my:0%;
  background-image:radial-gradient(280px circle at var(--mx) var(--my),rgb(var(--sheen-rgb) / calc(var(--glow) * var(--sheen-alpha))),transparent 70%);
  -webkit-backdrop-filter:blur(26px) saturate(170%); backdrop-filter:blur(26px) saturate(170%);
  box-shadow:var(--glass-shadow,var(--shadow)),inset 0 1px 0 var(--edge-hi),inset 0 -1px 0 var(--edge-lo);
  transition:--glow .45s ease,transform .6s var(--spring),box-shadow .3s ease;
}
html:not([data-theme="cs"]) .focus-card {
  background-image:radial-gradient(280px circle at var(--mx) var(--my),rgb(var(--sheen-rgb) / calc(var(--glow) * var(--sheen-alpha))),transparent 70%),var(--focus-tint);
}
html:not([data-theme="cs"]) .deadline-popup { --glass-shadow:0 22px 60px -12px #23392e45; background-color:var(--surface-glass); transform-origin:top right; }
html:not([data-theme="cs"]) .timer-expiry { --glass-shadow:0 25px 100px #10241b40; background-color:var(--surface-glass); }
html:not([data-theme="cs"]) .mini-focus { --glass-shadow:0 0 transparent; }
/* Desktop only: on mobile the sidebar must not get a backdrop-filter, or it would trap the fixed bottom navigation inside it. */
@media(min-width:761px) { html:not([data-theme="cs"]) .sidebar { box-shadow:inset -1px 0 0 var(--edge-lo); -webkit-backdrop-filter:blur(28px) saturate(170%); backdrop-filter:blur(28px) saturate(170%); } }

/* Everything pressable squishes, then springs back. */
html:not([data-theme="cs"]) :is(.button,.icon-button,nav a,nav>button,.theme-switch,.tabs button,.auth-tabs a,.calendar-day,.calendar-event,.task-check,.add-inline,.deadline-item,.agenda-event,#mini-duration,.timer-edit) {
  transition:transform .55s var(--spring),background-color .2s ease,color .2s ease,border-color .2s ease,box-shadow .3s ease;
}
html:not([data-theme="cs"]) :is(.button,.icon-button,nav a,nav>button,.theme-switch,.tabs button,.calendar-day,.calendar-event,.task-check,.add-inline,#mini-duration,.timer-edit):active {
  transform:scale(.93); transition-duration:.1s,.2s,.2s,.2s,.3s;
}
html:not([data-theme="cs"]) .button:hover { transform:translateY(-1px) scale(1.02); }
html:not([data-theme="cs"]) .button:active { transform:scale(.95); }
html:not([data-theme="cs"]) .primary { box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 8px 18px -10px var(--accent); }
html:not([data-theme="cs"]) .secondary { box-shadow:inset 0 1px 0 var(--edge-hi); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); }
html:not([data-theme="cs"]) .note-card:hover,html:not([data-theme="cs"]) .subject-card:hover { transform:translateY(-4px) scale(1.012); box-shadow:0 22px 40px -22px rgba(35,60,48,.35),inset 0 1px 0 var(--edge-hi),inset 0 -1px 0 var(--edge-lo); }
html:not([data-theme="cs"]) .note-card:active { transform:scale(.975); transition-duration:.45s,.12s,.3s; }

/* The selection pill that flows between navigation items. */
.liquid-indicator { position:absolute; left:0; top:0; z-index:0; opacity:0; pointer-events:none; border-radius:12px; background:var(--pill); box-shadow:inset 0 1px 0 var(--edge-hi),0 6px 16px -8px rgba(40,70,55,.35); }
.liquid-indicator.liquid-line { border-radius:2px; background:var(--accent); box-shadow:none; }
[data-theme="cs"] .liquid-indicator { display:none; }
.tabs,.auth-tabs { position:relative; }
.sidebar nav a,.sidebar nav>button { position:relative; z-index:1; }
@media(min-width:761px) { .sidebar nav { position:relative; } }
html.liquid-ready:not([data-theme="cs"]) nav a.active { background:transparent; }
html.liquid-ready:not([data-theme="cs"]) .tabs button.active,html.liquid-ready:not([data-theme="cs"]) .auth-tabs a.active { border-bottom-color:transparent; }

/* Surfaces grow out of where they come from. */
html:not([data-theme="cs"]) dialog {
  background:var(--surface-glass); border-radius:26px;
  -webkit-backdrop-filter:blur(34px) saturate(180%); backdrop-filter:blur(34px) saturate(180%);
  box-shadow:0 40px 120px -20px #253f3466,inset 0 1px 0 var(--edge-hi);
}
html:not([data-theme="cs"]) dialog[open] { animation:liquid-pop .6s var(--spring) both; }
html:not([data-theme="cs"]) .deadline-popup:not([hidden]) { animation:liquid-menu .55s var(--spring) both; }
html:not([data-theme="cs"]) .sidebar-bottom.mobile-open { transform-origin:bottom right; animation:liquid-menu .55s var(--spring) both; }
html:not([data-theme="cs"]) .auth-card { animation:liquid-pop .7s var(--spring) both; }
html:not([data-theme="cs"]) .toast-message {
  border-radius:999px; background:color-mix(in srgb,var(--accent) 86%,transparent);
  -webkit-backdrop-filter:blur(18px) saturate(170%); backdrop-filter:blur(18px) saturate(170%);
  box-shadow:0 18px 40px -16px rgba(35,60,48,.5),inset 0 1px 0 rgba(255,255,255,.3);
  animation:liquid-toast .65s var(--spring) both;
}
html[data-theme="dark"] .toast-message { color:#12261c; }
html:not([data-theme="cs"]) .task-check.liquid-pop { animation:liquid-check .55s var(--spring); }
@keyframes liquid-pop { from { opacity:0; transform:translateY(26px) scale(.86); } to { opacity:1; transform:none; } }
@keyframes liquid-menu { from { opacity:0; transform:scale(.55); } to { opacity:1; transform:none; } }
@keyframes liquid-toast { from { opacity:0; transform:translate(-50%,34px) scale(.75); } to { opacity:1; transform:translate(-50%,0) scale(1); } }
@keyframes liquid-check { from { transform:scale(.4); } to { transform:scale(1); } }

/* Cards you can pick up. The transform itself is driven by spring physics in liquid.js. */
.note-card,.subject-card { -webkit-touch-callout:none; }
.subject-card a { -webkit-user-drag:none; }
html:not([data-theme="cs"]) .liquid-dragging {
  position:relative; z-index:30; will-change:transform; cursor:grabbing;
  transition:box-shadow .3s ease,--glow .45s ease!important;
  box-shadow:var(--float-shadow),inset 0 1px 0 var(--edge-hi),inset 0 -1px 0 var(--edge-lo)!important;
}
.liquid-slot { position:relative; z-index:30; }
body.liquid-grabbing,body.liquid-grabbing * { cursor:grabbing!important; -webkit-user-select:none; user-select:none; }

/* Light and dark mode pour into each other from the switch. */
::view-transition-old(root) { animation:none; }
::view-transition-new(root) { animation:liquid-reveal .65s cubic-bezier(.3,.7,.2,1) both; }
@keyframes liquid-reveal { from { clip-path:circle(0 at var(--vt-x,50%) var(--vt-y,50%)); } to { clip-path:circle(150vmax at var(--vt-x,50%) var(--vt-y,50%)); } }

@media(max-width:760px) {
  html:not([data-theme="cs"]) .sidebar nav { box-shadow:0 14px 34px -12px #00000040,inset 0 1px 0 var(--edge-hi); }
  html:not([data-theme="cs"]) .sidebar-bottom { background:var(--surface-glass); -webkit-backdrop-filter:blur(30px) saturate(170%); backdrop-filter:blur(30px) saturate(170%); }
  html:not([data-theme="cs"]) dialog { border-radius:22px; }
}
