/* Frostfox - Windows-10 MDL inspired hugo theme.*/

:root {
  color-scheme: light dark;
  --bar-h: 64px;
  --gap: 12px;
  --end: 40px;   /* space under the three columns */
  --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;

  --base:   light-dark(#e3e8eb, #0e1012);
  --text:   light-dark(#12171b, #f2f4f6);
  --muted:  light-dark(#45525c, #a9b5be);
  --glass:  light-dark(rgba(250, 251, 252, .66), rgba(32, 33, 36, .62));
  --tile:   light-dark(rgba(255, 255, 255, .5), rgba(255, 255, 255, .08));
  --edge:   light-dark(rgba(255, 255, 255, .8), rgba(255, 255, 255, .13));
  --line:   light-dark(rgba(20, 40, 60, .16), rgba(255, 255, 255, .15));
  --reveal: light-dark(rgba(24, 48, 68, .85), rgba(255, 255, 255, .85));
  --fill:   light-dark(rgba(255, 255, 255, .6), rgba(255, 255, 255, .13));
  --hover:  light-dark(rgba(0, 0, 0, .08), rgba(255, 255, 255, .13));
  --code-bg: light-dark(rgba(0, 0, 0, .06), rgba(0, 0, 0, .35));
}
html[data-mode="light"] { color-scheme: light; }
html[data-mode="dark"]  { color-scheme: dark; }

/* ---------- accent palettes ---------- */
html[data-accent="fox"]    { --accent: #f08a24; --accent-2: #ffc93c; --on-accent: #1b1205; --link: light-dark(#9a4c05, #ffb257); }
html[data-accent="autumn"] { --accent: #e0662b; --accent-2: #c9372c; --on-accent: #1d0b03; --link: light-dark(#a6401a, #ff9a6b); }
html[data-accent="winter"] { --accent: #3fa0e8; --accent-2: #9bd5ff; --on-accent: #04121c; --link: light-dark(#0b5a96, #8fd0ff); }
html[data-accent="spring"] { --accent: #4fbf6b; --accent-2: #c5e86c; --on-accent: #07170c; --link: light-dark(#1d6b32, #8fe3a2); }
html[data-accent="summer"] { --accent: #ff6a3d; --accent-2: #ffc233; --on-accent: #1d0a03; --link: light-dark(#a8340f, #ffa27f); }
html[data-accent="contrast"] {
  --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); --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));
}
html[data-accent="contrast"] .panel { -webkit-backdrop-filter: none; backdrop-filter: none; border-width: 2px; }
html[data-accent="contrast"] .panel::after, html[data-accent="contrast"] .bg { display: none; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + var(--gap)); scroll-behavior: smooth; -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: break-word; }
a { color: var(--link); text-underline-offset: .18em; }
img { max-width: 100%; height: auto; }
: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; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; padding: 8px 14px; background: var(--accent); color: var(--on-accent); }
.skip:focus { left: 8px; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.sm { width: 14px; height: 14px; }
button { font: inherit; color: inherit; }

/* ---------- animated background: soft color circles that pulse on the screen edges ----------
   Tune with --pulse (one full cycle) and --orb-alpha. Only transform and opacity animate, so it stays cheap. */
.bg { --pulse: 7s; --orb-alpha: 17%; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 800px at 85% 110%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(900px 700px at 0% -10%, color-mix(in srgb, var(--accent-2) 11%, 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; } }
html[data-motion="off"] .orbs i { animation: none; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .orbs i { animation: none; opacity: .8; } html { scroll-behavior: auto; } }

/* ---------- acrylic panes ---------- */
.panel { position: relative; background: var(--glass); border: 1px solid var(--edge); overflow: hidden;
  -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); }
.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-title { margin: 0; padding: 14px 16px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- reveal highlight (the "flashlight") ---------- */
.reveal { position: relative; --r: 80px; --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%); }
html[data-reveal="off"] .reveal::before, html[data-reveal="off"] .reveal::after { display: none; }

/* ---------- layout ---------- */
.topbar-wrap { position: sticky; top: 0; z-index: 60; padding: var(--gap) 16px 0; }
.topbar { display: flex; align-items: center; gap: 14px; max-width: 1288px; margin: 0 auto; padding: 8px 10px; overflow: visible; min-height: 52px; }
.logo { flex: none; padding: 5px 12px; background: var(--accent); color: var(--on-accent); font: 700 16px var(--mono); text-decoration: none; }
.bars { flex: 1 1 40px; min-width: 20px; height: 26px; background: repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 9px); opacity: .85; }
.menu { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.menu-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; color: var(--link); text-decoration: none; font: 500 14px var(--mono); cursor: pointer; --r: 70px; }
.menu-link:hover { background: var(--hover); text-decoration: underline; }
.menu-link[aria-current] { box-shadow: inset 0 -3px 0 var(--accent); }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; display: flex; flex-direction: column; padding: 4px; z-index: 70; }
.more-list .menu-link { justify-content: flex-start; }

.stage { display: grid; grid-template-columns: 268px minmax(0, 1fr) 300px; gap: var(--gap); max-width: 1320px; margin: 0 auto; padding: var(--gap) 16px var(--end); }
.col-left { min-width: 0; }
.col-main { padding: 22px clamp(16px, 3vw, 34px) 18px; min-width: 0; align-self: start; }
.col-right { min-width: 0; }
.sticky-wrap { position: sticky; top: calc(var(--bar-h) + var(--gap)); display: flex; flex-direction: column; gap: var(--gap);
  max-height: calc(100vh - var(--bar-h) - var(--gap) - var(--end)); }

/* left column (all posts + settings bar) is one sticky unit: it follows you, the list shrinks and scrolls inside when the window is short */
.applist { flex: 0 1 auto; min-height: 140px; display: flex; flex-direction: column; }
.applist-body { overflow: auto; min-height: 0; padding-bottom: 8px; scrollbar-width: thin; }
.letter { padding: 10px 16px 2px; font-size: 13px; font-weight: 600; color: var(--link); }
.row { display: block; padding: 8px 16px; color: inherit; text-decoration: none; min-width: 0; --r: 80px; }
.row b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row time { display: block; font-size: 12px; color: var(--muted); }
.row[aria-current] { box-shadow: inset 3px 0 0 var(--accent); background: var(--hover); }

/* settings bar: width fits its buttons so the icons sit dead center */
.rail { flex: none; align-self: flex-start; width: max-content; display: flex; flex-direction: column; padding: 3px; }
.rail-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; background: none; border: 0; color: var(--text); cursor: pointer; text-decoration: none; --r: 60px; }
.rail-btn:hover { background: var(--hover); }
.rail-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }

/* ---------- calendar ---------- */
.calendar { flex: none; }
.clock { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.clock .time { font-size: 40px; font-weight: 200; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock .date { margin-top: 2px; font-size: 14px; color: var(--muted); }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 10px; }
.cal-title { padding: 6px 10px; background: none; border: 0; font-weight: 500; cursor: pointer; --r: 70px; }
.cal-title:hover, .cal-nav button:hover { background: var(--hover); }
.cal-title:disabled { cursor: default; background: none; }
.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-dow, .cal-grid { display: grid; padding: 0 8px; }
.cal-dow { grid-template-columns: repeat(7, 1fr); }
.cal-dow div { padding: 6px 0; text-align: center; font-size: 12px; color: var(--muted); }
.cal-grid { gap: 2px; padding-bottom: 12px; }
.cal-grid[data-view="days"] { grid-template-columns: repeat(7, 1fr); }
.cal-grid[data-view="months"] { grid-template-columns: repeat(3, 1fr); }
.cal-grid[data-view="years"] { grid-template-columns: repeat(4, 1fr); }
.cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; background: none; border: 1px solid transparent; color: inherit; font: 13px var(--font); text-decoration: none; cursor: pointer; --r: 44px; }
.cal-grid:not([data-view="days"]) .cell { aspect-ratio: 1.5; --r: 62px; }
.cell:hover { background: var(--hover); }
.cell.out { color: var(--muted); opacity: .72; }
.cell.today { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cell .dot { position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cell.has { font-weight: 600; }

/* ---------- gallery ---------- */
.gallery { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 4px; padding: 0 10px 12px; overflow: auto; scrollbar-width: thin; }
.shot { position: relative; display: block; aspect-ratio: 4 / 3; min-width: 0; overflow: hidden; background: #1c1d20; color: #fff; text-decoration: none; --r: 90px; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.shot:hover img { transform: scale(1.05); }
.shot-cap { position: absolute; left: 0; right: 0; bottom: 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 22px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8)); }
.shot-cap b { font-size: 12.5px; font-weight: 600; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; }
.shot-cap time { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- main column: posts, breadcrumbs, content ---------- */
.crumbs { margin: -4px 0 14px; font: 13px var(--mono); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.crumbs li:not(:last-child)::after { content: ">"; margin: 0 8px; color: var(--muted); }
.crumbs a { color: var(--link); }
.crumbs [aria-current] { color: var(--muted); }

.subtitle { margin: 0 0 22px; color: var(--muted); font: 15px var(--mono); }
.page-title, .post-title { margin: 0 0 6px; font: 700 clamp(1.3rem, 2.4vw, 1.7rem)/1.25 var(--mono); }
.post-title a { color: var(--link); text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-title::after { content: ""; display: block; height: 6px; margin-top: 8px; background: radial-gradient(circle, var(--accent) 1px, transparent 1.6px) 0 0 / 6px 6px repeat-x; }
.post-meta { margin: 8px 0 0; color: var(--muted); font: 13px var(--mono); }
time.reldate[data-toggle] { cursor: pointer; border-bottom: 1px dotted currentColor; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; }
.tag { color: var(--link); font: 14px var(--mono); text-decoration: underline; padding: 0 2px; --r: 60px; }
.post { margin: 0 0 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.post.single { border-bottom: 0; }
.post:last-child { border-bottom: 0; }
.cover { display: block; margin: 16px 0; padding: 8px; border: 6px solid var(--accent); background: rgba(0, 0, 0, .28); }
.cover img { display: block; width: 100%; }
.summary { margin-top: 10px; }
.summary > :first-child { margin-top: 0; }
.read-more { font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 18px; }
.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; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.empty { color: var(--muted); }
.term-list { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; list-style: none; }
.count { color: var(--muted); font-size: 13px; }

.content > :first-child { margin-top: 0; }
.content h2, .content h3, .content h4 { margin: 1.6em 0 .5em; font-family: var(--mono); line-height: 1.3; }
.content h2 { font-size: 1.3rem; } .content h3 { font-size: 1.1rem; }
.content p, .content ul, .content ol { margin: 0 0 1em; }
.content blockquote { margin: 1em 0; padding: .2em 1em; border-left: 4px solid var(--accent); background: var(--tile); }
.content code { padding: .1em .35em; background: var(--code-bg); font-family: var(--mono); font-size: .9em; }
.content pre { overflow: auto; padding: 14px; background: var(--code-bg); }
.content pre code { padding: 0; background: none; }
.content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.content th, .content td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.site-footer { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
/* keep the footer on one line: drop the theme credit when the column gets narrow, then the "::" separators */
@media (max-width: 1360px) { .site-footer .credit { display: none; } }
@media (max-width: 1240px) and (min-width: 821px), (max-width: 560px) { .site-footer .sep { display: none; } .site-footer { gap: 4px 16px; } }
@media (max-width: 560px) { .site-footer { gap: 4px 12px; font-size: 11.5px; } }
.site-footer a { color: var(--link); }
.linklike { padding: 0; background: none; border: 0; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- settings flyout, cookie banner ---------- */
.flyout { position: fixed; z-index: 90; left: 16px; top: 80px; width: min(330px, calc(100vw - 32px));
  max-height: calc(100vh - var(--bar-h) - 2 * var(--gap) - 8px); overflow: auto; padding: 12px 16px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.flyout[hidden], .cookie[hidden], #withdraw-btn[hidden], #accept-btn[hidden] { display: none; }
.flyout-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.flyout-head h2 { margin: 0; font-size: 16px; }
.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); }
.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); }
.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; }
@media (prefers-reduced-motion: reduce) { .switch::before { transition: none; } }
.hint { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.flyout-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie { position: fixed; z-index: 95; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(660px, calc(100vw - 24px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.cookie p { flex: 1 1 280px; margin: 0; font-size: 13.5px; }
.cookie-actions { display: flex; gap: 8px; }

/* mobile-only parts are hidden here and switched on by mobile.css */
.dock, .scrim { display: none; }

/* ---------- narrower desktops ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: 250px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; }
  .col-right .sticky-wrap { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
}
