/* =====================================================================
   Floating glass (look C, chosen by Ricky on 2026-12-03).
   Loaded after palettes.css. Glass is used only where people move
   around: the rail floats as a glass bar, the search is a glass capsule,
   and on phones the bottom bar floats too. The work itself sits on one
   solid, rounded sheet, so no text is ever read through blur.
   Every colour is mixed from the palette's own tokens, so Slate, Paper
   and Graphite and the accent picker keep working. With "Reduce
   transparency" switched on, the glass turns into plain solid panels.
   ===================================================================== */
:root {
  --sheet: var(--bg);
  --sheet-line: var(--line);
  --wall: color-mix(in oklab, var(--bg) 62%, #000);
  --float: color-mix(in srgb, var(--panel) 60%, transparent);
  --float-line: color-mix(in srgb, #fff 10%, transparent);
  --float-hi: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 12px 34px -12px rgba(0, 0, 0, 0.7);
  --float-blur: blur(26px) saturate(1.6);
  --float-on: color-mix(in srgb, var(--text) 11%, transparent);
  --float-on-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --sheet-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.6);
}
:root[data-theme="light"] {
  --wall: color-mix(in oklab, color-mix(in oklab, var(--bg) 92%, var(--text)) 92%, var(--accent));
  --float: color-mix(in srgb, var(--panel) 62%, transparent);
  --float-line: color-mix(in srgb, #fff 85%, transparent);
  --float-hi: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 30px -12px rgba(16, 40, 24, 0.28);
  --float-on: color-mix(in srgb, var(--panel) 92%, transparent);
  --float-on-shadow: 0 1px 2px rgba(16, 40, 24, 0.08), 0 0 0 1px rgba(16, 40, 24, 0.06);
  --sheet-shadow: 0 1px 2px rgba(16, 40, 24, 0.05), 0 18px 44px -24px rgba(16, 40, 24, 0.3);
}
/* The standard palette gets a soft wash of its green and a little sky behind the glass. */
:root[data-palette="talqava"] {
  --ambient:
    radial-gradient(700px 560px at 0% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(800px 600px at 100% 100%, rgba(40, 110, 170, 0.22), transparent 70%);
}
:root[data-palette="talqava"][data-theme="light"] {
  --ambient:
    radial-gradient(760px 600px at 0% 0%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%),
    radial-gradient(860px 640px at 100% 100%, rgba(120, 190, 250, 0.4), transparent 70%);
}
html { background: var(--wall); }
body::before { background: var(--ambient), var(--wall); }

/* ---------- computers and tablets: a floating rail beside one solid sheet ---------- */
@media (min-width: 601px) {
  #app { padding: 10px; column-gap: 10px; }
  #app:has(> .login, > .termspage, > .accountpage) { padding: 0; column-gap: 0; }
  #app > .rail {
    border: 1px solid var(--float-line); border-radius: 22px;
    background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); box-shadow: var(--float-hi);
  }
  #app > .main { background: var(--sheet); border: 1px solid var(--sheet-line); border-radius: 20px; overflow: hidden; box-shadow: var(--sheet-shadow); }
  .main > .top { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; padding-top: 12px; }
  .main > .areatabs { background: transparent; }
  .acctmenu { left: calc(var(--rail-width) + 20px); bottom: 14px; }
}
.rail .railitem.on, .rail .railitem.on:hover { background: var(--float-on); box-shadow: var(--float-on-shadow); }
.rail .railitem.on .ico { color: var(--accent-ink, var(--accent)); }

/* The search: a glass capsule at the top of the sheet. */
.top .palette input {
  height: 40px; padding-left: 18px; border-radius: 999px; border-color: var(--float-line);
  background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); box-shadow: var(--float-hi);
}
.top .palette .keys { top: 11px; right: 16px; }

/* ---------- phones: the bottom bar floats as a glass pill above the home indicator ---------- */
@media (max-width: 600px) {
  :root { --phonebar: 64px; --phonegap: calc(10px + env(safe-area-inset-bottom, 0px)); }
  #app { padding-bottom: calc(var(--phonebar) + var(--phonegap) + 8px); }
  #app > .rail {
    inset: auto 10px var(--phonegap) 10px; height: var(--phonebar); padding: 0 4px; border: 1px solid var(--float-line); border-radius: 28px;
    background: var(--float); -webkit-backdrop-filter: var(--float-blur); backdrop-filter: var(--float-blur); box-shadow: var(--float-hi);
  }
  .rail .railitem { height: 52px; align-self: center; border-radius: 22px; }
  .rail .railitem.on, .rail .railitem.on:hover { background: var(--float-on); box-shadow: var(--float-on-shadow); }
  .acctmenu { bottom: calc(var(--phonebar) + var(--phonegap) + 8px); }
}

/* ---------- people who ask for less see-through: plain solid panels ---------- */
@media (prefers-reduced-transparency: reduce) {
  #app > .rail, .top .palette input { background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
