/* Frostfox Air - Stylesheet, needs a current browser (light-dark(), color-mix(), backdrop-filter). */
/* Shares its building blocks with Frostfox, see STYLE.md. */

/* ---------- colors: three themes, each with a light and a dark version ---------- */
:root {
  color-scheme: light dark;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Fira Code", ui-monospace, monospace;
  --col: 504px; --gut: 18px; --bar-h: 48px; --bar-gap: 10px;

  /* plasm (teal), default */
  --base:     light-dark(#e2f1f0, #0a2a2a);
  --text:     light-dark(#0b2626, #e9f6f5);
  --muted:    light-dark(#3c5d5c, #a6c6c4);
  --glass:    light-dark(rgba(250, 254, 254, .66), rgba(12, 50, 50, .55));
  --glass-solid: light-dark(rgba(246, 252, 252, .94), rgba(12, 50, 50, .93));
  --tile:     light-dark(rgba(255, 255, 255, .55), rgba(255, 255, 255, .08));
  --edge:     light-dark(rgba(255, 255, 255, .85), rgba(255, 255, 255, .14));
  --line:     light-dark(rgba(8, 60, 60, .16), rgba(255, 255, 255, .14));
  --reveal:   light-dark(rgba(8, 70, 76, .85), rgba(255, 255, 255, .88));
  --fill:     light-dark(rgba(255, 255, 255, .6), rgba(255, 255, 255, .13));
  --hover:    light-dark(rgba(0, 60, 60, .08), rgba(255, 255, 255, .12));
  --accent:    light-dark(#2f7f89, #62bcc6);
  --accent-2:  light-dark(#4aa3d6, #98d6f2);
  --on-accent: light-dark(#ffffff, #052b2e);
  --link:      light-dark(#0b6670, #8fe0ea);
  --good:      light-dark(#0c8a63, #5fe3b8);
  --bad:       light-dark(#c0392b, #ff8f85);
}
html[data-mode="light"] { color-scheme: light; }
html[data-mode="dark"] { color-scheme: dark; }

/* foptastic (orange): the accent is the "fox" accent of Frostfox */
html[data-theme="foptastic"] {
  --base:     light-dark(#fbeedd, #28160a);
  --text:     light-dark(#2b1707, #fcefe2);
  --muted:    light-dark(#6a4a2c, #d6b999);
  --glass:    light-dark(rgba(255, 251, 246, .68), rgba(58, 31, 12, .55));
  --glass-solid: light-dark(rgba(255, 250, 243, .95), rgba(46, 25, 10, .94));
  --tile:     light-dark(rgba(255, 255, 255, .55), rgba(255, 255, 255, .08));
  --edge:     light-dark(rgba(255, 255, 255, .85), rgba(255, 235, 215, .16));
  --line:     light-dark(rgba(90, 45, 5, .18), rgba(255, 235, 215, .16));
  --reveal:   light-dark(rgba(150, 70, 5, .85), rgba(255, 240, 225, .9));
  --fill:     light-dark(rgba(255, 255, 255, .6), rgba(255, 235, 215, .14));
  --hover:    light-dark(rgba(110, 50, 0, .08), rgba(255, 235, 215, .12));
  --accent: #f08a24; --accent-2: #ffc93c; --on-accent: #1b1205; --link: light-dark(#9a4c05, #ffb257);
  --good:      light-dark(#2f7d32, #8fe08c);
  --bad:       light-dark(#b3261e, #ff8f85);
}

/* high vis: the "contrast" accent of Frostfox. Solid colors, thick borders, no blur, no motion */
html[data-theme="highvis"] {
  --accent: light-dark(#0b1fd1, #ffe600); --accent-2: var(--accent);
  --on-accent: light-dark(#ffffff, #000000); --link: light-dark(#0b1fd1, #ffe600);
  --base: light-dark(#ffffff, #000000); --text: light-dark(#000000, #ffffff); --muted: light-dark(#161616, #eeeeee);
  --glass: light-dark(#ffffff, #000000); --glass-solid: light-dark(#ffffff, #000000); --tile: light-dark(#ffffff, #000000);
  --edge: light-dark(#000000, #ffffff); --line: light-dark(#000000, #ffffff);
  --reveal: light-dark(#0b1fd1, #ffe600); --fill: light-dark(rgba(11, 31, 209, .16), rgba(255, 230, 0, .22));
  --hover: light-dark(rgba(11, 31, 209, .2), rgba(255, 230, 0, .28));
  --good: light-dark(#006b2c, #4dff88); --bad: light-dark(#b00020, #ff8a80);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 15px/1.6 var(--font); color: var(--text); background: var(--base); overflow-wrap: anywhere; }
a { color: var(--link); text-underline-offset: .18em; }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- background: soft circles that pulse on the screen edges ---------- */
.bg { --pulse: 7s; --orb-alpha: 20%; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 800px at 88% 112%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(900px 700px at 0% -10%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%),
    var(--base); }
.orbs { position: absolute; --c: var(--accent); }
.orbs i { position: absolute; border-radius: 50%; will-change: transform, opacity;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) var(--orb-alpha), transparent) 0%, color-mix(in srgb, var(--c) calc(var(--orb-alpha) * .8), transparent) 62%, color-mix(in srgb, var(--c) calc(var(--orb-alpha) * .5), transparent) 68%, transparent 71%);
  animation: pulse var(--pulse) ease-in-out infinite; }
.orbs i:nth-child(1) { inset: 0; }
.orbs i:nth-child(2) { inset: 15%; animation-delay: calc(var(--pulse) * -.2); --c: var(--accent-2); }
.orbs i:nth-child(3) { inset: 30%; animation-delay: calc(var(--pulse) * -.4); }
.orbs i:nth-child(4) { inset: 45%; animation-delay: calc(var(--pulse) * -.6); --c: var(--accent-2); }
.orbs.o1 { width: 1700px; height: 1700px; right: -900px; bottom: -900px; }
.orbs.o2 { width: 1200px; height: 1200px; left: -640px; top: -640px; --c: var(--accent-2); }
.orbs.o2 i { animation-duration: calc(var(--pulse) * 1.3); }
.orbs.o3 { width: 760px; height: 760px; right: -330px; top: 6%; opacity: .6; }
.orbs.o3 i { animation-duration: calc(var(--pulse) * 1.6); animation-delay: calc(var(--pulse) * -.9); }
@keyframes pulse { 0%, 100% { transform: scale(.86); opacity: .35; } 50% { transform: scale(1.1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .orbs i { animation: none; opacity: .8; } }

/* ---------- glass ---------- */
.glass, .panel { background: var(--glass); border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); }
.panel { position: relative; overflow: hidden; padding: 18px 18px 16px; margin: 0 0 14px; }
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.panel > * { position: relative; z-index: 1; }
.panel h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.05rem; line-height: 1.3; }
.panel h3 { margin: 14px 0 4px; font-size: .95rem; }
.panel p { margin: 0 0 8px; }
.mark { display: inline-flex; color: var(--accent); }

/* animation off: no circles, no blur */
html[data-anim="off"] .orbs, html[data-theme="highvis"] .orbs { display: none; }
html[data-anim="off"] .glass, html[data-anim="off"] .panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
html[data-anim="off"] .panel::after, html[data-theme="highvis"] .panel::after { display: none; }
/* high vis: flat and bold */
html[data-theme="highvis"] .bg { background: var(--base); }
html[data-theme="highvis"] .glass, html[data-theme="highvis"] .panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass); border-width: 2px; }
html[data-theme="highvis"] :focus-visible { outline-width: 3px; }
html[data-theme="highvis"] a { text-decoration: underline; }

/* ---------- reveal highlight (the "flashlight") ---------- */
.reveal { position: relative; --r: 90px; --x: -9999px; --y: -9999px; }
.reveal::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; padding: 2px; border-radius: inherit;
  background: radial-gradient(var(--r) circle at var(--x) var(--y), var(--reveal), transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.reveal::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(calc(var(--r) * 1.25) circle at var(--x) var(--y), var(--fill), transparent 100%); }
@media (hover: none) { .reveal::before, .reveal::after { display: none; } }

/* ---------- layout ---------- */
.page { max-width: calc(var(--col) + 2 * var(--gut)); margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) var(--gut) calc(var(--bar-h) + var(--bar-gap) + 28px + env(safe-area-inset-bottom)); }
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 0 24px; }
.avatar { display: block; width: 132px; height: 132px; object-fit: cover; border: 4px solid var(--accent); background: var(--tile); }
.name { margin: 16px 0 4px; font-size: clamp(1.6rem, 6vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.tagline { margin: 0; color: var(--muted); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.soc { display: grid; place-items: center; width: 46px; height: 46px; color: var(--text); background: var(--tile); border: 1px solid var(--edge); --r: 70px; }
.soc:hover { background: var(--hover); }
/* seven social buttons fit one row on phones */
@media (max-width: 420px) { .socials { gap: 4px; } .soc { width: 40px; } }
@media (max-width: 340px) { .soc { width: 34px; } }

.links { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.link { display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: inherit; text-decoration: none; --r: 110px; }
.link:hover { background: var(--hover); }
.tile { display: grid; place-items: center; flex: none; width: 46px; height: 46px; background: var(--accent); color: var(--on-accent); }
.txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.txt strong { font-weight: 600; }
.txt small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.go { color: var(--muted); opacity: .75; }
.go .ico { width: 16px; height: 16px; }


.player-ph { display: flex; flex-direction: column; gap: 12px; }
.note { margin: 0; color: var(--muted); font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.player-frame { display: block; width: 100%; border: 0; background: var(--tile); }
.player-frame.youtube { aspect-ratio: 16 / 9; height: auto; }

.rules ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rule { display: flex; align-items: flex-start; gap: 10px; font-size: .93rem; line-height: 1.45; }
.rule .mark { margin-top: 1px; }
.rule .ico { width: 18px; height: 18px; }
.rule.good .mark { color: var(--good); }
.rule.bad .mark { color: var(--bad); }

.doc h1 { margin: 0 0 12px; font-size: 1.5rem; line-height: 1.25; }
.doc .content > :first-child { margin-top: 0; }
.doc .content p, .doc .content ul, .doc .content ol { margin: 0 0 1em; }
.doc .content h2 { margin: 1.4em 0 .5em; font-size: 1.15rem; }
.doc .content code { padding: .1em .35em; background: var(--tile); font-family: var(--mono); font-size: .9em; }
.err-img { display: block; max-width: 100%; height: auto; margin: 12px auto; }
.back { margin: 16px 0 0; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 22px; color: var(--muted); font: 12px var(--mono); }
.foot a { color: var(--link); }

/* ---------- shared building blocks (same as Frostfox) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px; background: var(--tile); border: 1px solid var(--edge); color: var(--text); font: 600 14px var(--font); text-decoration: none; cursor: pointer; --r: 90px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: none; border: 0; cursor: pointer; --r: 48px; }
.icon-btn:hover { background: var(--hover); }
.flyout-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.flyout-head h2 { margin: 0; font-size: 16px; }
.field { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; gap: 7px; padding: 6px 10px; background: var(--tile); border: 1px solid var(--edge); font-size: 13px; }
.seg input:hover + span { background: var(--hover); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch { flex: none; width: 18px; height: 18px; background: linear-gradient(135deg, var(--s1) 50%, var(--s2) 50%); border: 1px solid rgba(128, 128, 128, .6); }
.sw-plasm { --s1: #62bcc6; --s2: #98d6f2; }
.sw-foptastic { --s1: #f08a24; --s2: #ffc93c; }
.sw-highvis { --s1: #000; --s2: #ffe600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.switch-row label { font-size: 13px; font-weight: 600; color: var(--muted); }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 24px; margin: 0; background: var(--tile); border: 1px solid var(--edge); cursor: pointer; }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--text); transition: transform .15s; }
.switch:checked { background: var(--accent); border-color: transparent; }
.switch:checked::before { transform: translateX(20px); background: var(--on-accent); }
.switch:disabled { opacity: .45; cursor: default; }
.hint { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.flyout-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 4px 2px; }
.cal-title { padding: 6px 8px; font-weight: 500; text-transform: capitalize; }
.cal-nav { display: flex; }
.cal-nav button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: none; border: 0; cursor: pointer; --r: 48px; }
.cal-nav button:hover { background: var(--hover); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow div { padding: 6px 0; text-align: center; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.cal-grid { gap: 2px; }
.cell { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid transparent; font-size: 13px; font-variant-numeric: tabular-nums; }
.cell.out { color: var(--muted); opacity: .72; }
.cell.today { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---------- taskbar ---------- */
.dock { position: fixed; z-index: 20; left: 50%; bottom: calc(var(--bar-gap) + env(safe-area-inset-bottom));
  width: min(var(--col), calc(100% - 2 * var(--gut))); transform: translateX(-50%); }
.taskbar { display: flex; align-items: stretch; height: var(--bar-h); padding: 0; margin: 0; }
.tb { display: grid; place-items: center; min-width: var(--bar-h); height: 100%; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; --r: 60px; }
.tb:hover { background: var(--hover); }
.tb[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }
.tb[aria-disabled="true"] { opacity: .4; cursor: default; }
.tb[aria-disabled="true"]:hover { background: none; }
.tb-gap { flex: 1; }
.tb-clock { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 1px; padding: 0 12px; font-size: 12px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tb-clock .t { font-weight: 600; }
.menu { position: absolute; left: 0; bottom: calc(var(--bar-h) + 8px); width: min(340px, 100%); margin: 0; padding: 16px;
  max-height: calc(100vh - var(--bar-h) - var(--bar-gap) - 36px - env(safe-area-inset-bottom)); overflow: auto; }
.menu-r { left: auto; right: 0; }
.menu[hidden] { display: none; }
@media print { .dock { display: none; } }
