/* wheels_and_bytes: one stylesheet for the whole site. No framework.
   Layout ideas borrowed from card-style blog themes (left profile sidebar,
   rounded cards, compact lists, sticky contents); all code here is original. */

/* ---------- theme tokens ---------- */
:root {
  --body-bg: #f3f2ef;
  --card-bg: #ffffff;
  --card-bg-2: #f7f6f3;
  --line: #e4e1dc;
  --text: #1d1c1a;
  --text-dim: #67625c;
  --accent: #2f00a3;        /* indigo, from #2f00a3 */
  --accent-hot: #4e1dc9;
  --accent-ink: #ffffff;
  --code-bg: #1b1b1b;
  --code-text: #e2d6ff;
  --inline-code-bg: #efece6;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px rgb(0 0 0 / .06);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / .07), 0 14px 32px rgb(0 0 0 / .10);
  color-scheme: light;
}
/* dark tokens: used when the OS is dark (unless the visitor chose light), or when chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --body-bg: #111111;
    --card-bg: #1c1c1c;
    --card-bg-2: #232323;
    --line: #2d2d2d;
    --text: #e8e5e0;
    --text-dim: #a29d96;
    --accent: #b699ff;      /* #2f00a3 lifted for dark backgrounds */
    --accent-hot: #d3c2ff;
    --accent-ink: #141414;
    --code-bg: #0c0c0c;
    --inline-code-bg: #2a2a2a;
    --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 8px 24px rgb(0 0 0 / .35);
    --shadow-hover: 0 1px 0 rgb(255 255 255 / .04) inset, 0 16px 36px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --body-bg: #111111;
  --card-bg: #1c1c1c;
  --card-bg-2: #232323;
  --line: #2d2d2d;
  --text: #e8e5e0;
  --text-dim: #a29d96;
  --accent: #b699ff;
  --accent-hot: #d3c2ff;
  --accent-ink: #141414;
  --code-bg: #0c0c0c;
  --inline-code-bg: #2a2a2a;
  --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 8px 24px rgb(0 0 0 / .35);
  --shadow-hover: 0 1px 0 rgb(255 255 255 / .04) inset, 0 16px 36px rgb(0 0 0 / .5);
  color-scheme: dark;
}

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans", "Noto Sans JP", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --gap: 1.5rem;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--body-bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  transition: background-color .2s, color .2s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hot); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card-bg); padding: .5rem 1rem; z-index: 10; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page layout: sidebar | main | (toc) ---------- */
.layout {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  padding-block: 2.5rem;
}
.layout.has-toc { grid-template-columns: 15rem minmax(0, 1fr) 14rem; }
.main { display: grid; gap: var(--gap); min-width: 0; }

/* ---------- left sidebar ---------- */
.sidebar {
  position: sticky;
  top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.profile { display: grid; gap: .6rem; justify-items: start; }
.avatar {
  width: 6.5rem; height: 6.5rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px var(--accent), var(--shadow);
}
.site-name { margin: .5rem 0 0; font: 700 1.2rem/1.2 var(--mono); }
.site-name a { color: var(--text); text-decoration: none; }
.site-name a:hover { color: var(--accent); }
.site-name b { color: var(--accent); font-weight: 700; }
.site-tagline { margin: 0; color: var(--text-dim); font-size: .92rem; line-height: 1.5; }
.site-tagline span { display: block; font-size: .85rem; }

.social { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.social a {
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem;
  border-radius: 50%;
  color: var(--text-dim);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  transition: color .15s, transform .15s;
}
.social a:hover { color: var(--accent); transform: translateY(-2px); }
.social .icon { width: 1.1rem; height: 1.1rem; }

.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.menu a, .theme-toggle {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem .8rem;
  margin-inline: -.8rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.menu a:hover { background: var(--card-bg); color: var(--accent); }
.menu a[aria-current="page"] { color: var(--accent); background: var(--card-bg); box-shadow: var(--shadow); }
.menu .icon { color: var(--text-dim); }
.menu a:hover .icon, .menu a[aria-current="page"] .icon { color: var(--accent); }

.theme-toggle {
  width: calc(100% + 1.6rem);
  border: 0; background: none; font: inherit; font-weight: 500; cursor: pointer; text-align: left;
  color: var(--text-dim);
}
.theme-toggle:hover { color: var(--accent); background: var(--card-bg); }

/* ---------- cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
a.card, .card.linked { display: block; color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s; }
a.card:hover, .card.linked:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 1.4rem 1.6rem 1.6rem; display: grid; gap: .55rem; }
.card-body h2, .card-body h3 { margin: 0; font-size: 1.35rem; line-height: 1.3; font-weight: 700; }
.card-body p { margin: 0; color: var(--text-dim); }
a.card:hover h2, a.card:hover h3 { color: var(--accent); }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--text-dim); }
.card-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.card-meta .icon { width: 1rem; height: 1rem; }

.pills { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.pill {
  display: inline-block;
  padding: .22rem .7rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 .75rem/1.4 var(--sans);
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
}
a.pill:hover { color: var(--accent-ink); filter: brightness(1.1); }
.pill.quiet { background: var(--card-bg-2); color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--line); text-transform: none; letter-spacing: 0; font-weight: 500; }
a.pill.quiet:hover { color: var(--accent); }

.widget-title {
  margin: .75rem 0 -.25rem;
  font: 700 .8rem/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex; align-items: center; gap: .5rem;
}
.widget-title .icon { width: 1rem; height: 1rem; color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--gap); }

/* hero card */
.hero {
  position: relative;
  min-height: 21rem;
  display: flex;
  align-items: flex-end;
  color: #f2efea;
  /* Uncropped photo; the laptop sits at ~40-70% of its height (centre ~54%).
     With "cover" on a ~3:1 card, a 58% offset puts that centre mid-card. */
  background: #000 url("https://res.cloudinary.com/du5qvjvrf/image/upload/w_1800,q_auto,f_auto/v1775343293/img/bg/intro-bg.jpg") center 58% / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / .8), rgb(0 0 0 / .1) 60%, rgb(0 0 0 / .2));
}
.hero-text { position: relative; padding: 1.75rem 1.9rem; display: grid; gap: .5rem; }
.hero h1 { margin: 0; font: 700 clamp(1.7rem, 4.6vw, 2.7rem)/1.1 var(--mono); letter-spacing: -.01em; }
.hero h1 .br { color: #bea3ff; font-weight: 400; }
.hero p { margin: 0; color: #cfcac3; font-size: 1.05rem; }

/* section header card (list pages) */
.section-hero {
  position: relative;
  min-height: 13rem;
  display: flex; align-items: flex-end;
  color: #f2efea;
  background-color: #000;
  background-position: center;
  background-size: cover;
}
.section-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .85), rgb(0 0 0 / .15)); }
.section-hero .hero-text { gap: .35rem; }
.section-hero .kicker { margin: 0; font: 600 .85rem/1 var(--mono); color: #bea3ff; }
.section-hero h1 { margin: 0; font: 700 clamp(1.6rem, 4vw, 2.2rem)/1.15 var(--sans); }
.section-hero p { margin: 0; color: #cfcac3; }

/* compact list (Stack-style rows with a square thumbnail) */
.compact { list-style: none; margin: 0; padding: .4rem 0; }
.compact li + li { border-top: 1px solid var(--line); }
.compact a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem 1.6rem;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
.compact a:hover { background: var(--card-bg-2); }
.compact h2, .compact h3 { margin: 0; font-size: 1.1rem; line-height: 1.35; font-weight: 650; }
.compact a:hover h2, .compact a:hover h3 { color: var(--accent); }
.compact p { margin: .2rem 0 0; color: var(--text-dim); font-size: .93rem; line-height: 1.5; }
.compact time, .compact .soon { display: block; margin-top: .35rem; font-size: .8rem; color: var(--text-dim); }
.compact .soon { color: var(--accent); font-weight: 600; }
.compact img { width: 5.5rem; height: 5.5rem; object-fit: cover; border-radius: var(--radius-sm); background: var(--card-bg-2); }

/* project tiles */
.tile { display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem 1.4rem; }
.tile .tile-icon {
  display: grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
}
.tile h3 { margin: 0; font-size: 1.1rem; }
.tile p { margin: .25rem 0 0; color: var(--text-dim); font-size: .93rem; line-height: 1.5; }

/* about card */
.about { display: grid; grid-template-columns: 13rem minmax(0, 1fr); }
.about img { width: 100%; height: 100%; object-fit: cover; }
.about .hello { margin: 0; color: var(--text-dim); font-size: .95rem; line-height: 1.7; }
.about p.plain { color: var(--text); }

/* ---------- article ---------- */
.article-header { padding: 2rem 2.2rem 1.6rem; display: grid; gap: .8rem; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; font-weight: 750; letter-spacing: -.01em; }
.article-header .subtitle { margin: 0; color: var(--text-dim); font-size: 1.12rem; }
.prose { padding: 1.5rem 2.2rem 2.2rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.3rem; line-height: 1.35; margin: 2.4rem 0 .75rem; display: flex; align-items: baseline; gap: .7rem; }
.prose h2 .step {
  display: inline-grid; place-items: center; flex: none;
  min-width: 1.8rem; height: 1.8rem; padding: 0 .4rem;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font: 700 .9rem/1 var(--mono); transform: translateY(-.1em);
}
.prose figure { margin: 1.25rem 0; }
.prose figure img { border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.prose code {
  font: .88em/1.4 var(--mono);
  background: var(--inline-code-bg);
  padding: .12em .4em;
  border-radius: 5px;
}
.prose pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 1rem 1.25rem; border-radius: var(--radius-sm);
  overflow-x: auto; font: .9rem/1.65 var(--mono);
}
.prose pre code { background: none; padding: 0; color: inherit; font: inherit; }
.prose pre .prompt { color: #bea3ff; user-select: none; }
.callout {
  border-left: 4px solid var(--accent-hot);
  background: var(--card-bg-2);
  padding: .9rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
}
.callout p { margin: 0; }
.article-footer { padding: 1.25rem 2.2rem 1.6rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; font-size: .9rem; color: var(--text-dim); }

/* right-hand contents */
.toc { position: sticky; top: 2.5rem; padding: 1.25rem 1.3rem; }
.toc h2 { margin: 0 0 .6rem; font: 700 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; counter-reset: toc; }
.toc a {
  display: block; padding: .3rem .6rem; margin-inline: -.6rem; border-radius: 6px;
  color: var(--text); text-decoration: none; font-size: .88rem; line-height: 1.4;
}
.toc a:hover { background: var(--card-bg-2); color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { padding: .5rem .25rem 0; color: var(--text-dim); font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.site-footer a { color: var(--text-dim); }

/* ---------- responsive ---------- */
@media (max-width: 75rem) {
  .layout.has-toc { grid-template-columns: 15rem minmax(0, 1fr); }
  .layout.has-toc .toc { display: none; }
}
@media (max-width: 52rem) {
  .layout, .layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: 1.25rem 2rem; }
  .sidebar { position: static; gap: 1rem; }
  .profile { grid-template-columns: auto 1fr; align-items: center; column-gap: 1rem; }
  .avatar { width: 4rem; height: 4rem; grid-row: span 2; }
  .site-name { margin: 0; }
  .menu ul { display: flex; flex-wrap: wrap; gap: .25rem; }
  .menu a, .theme-toggle { margin: 0; padding: .45rem .75rem; }
  .theme-toggle { width: auto; }
  .sidebar-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
  .about { grid-template-columns: 1fr; }
  .about img { aspect-ratio: 16 / 9; }
  .article-header, .prose, .article-footer { padding-inline: 1.25rem; }
  .compact a { padding-inline: 1.25rem; grid-template-columns: minmax(0, 1fr) 4.5rem; }
  .compact img { width: 4.5rem; height: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- additions: projects page, captions, keys ---------- */
.section-hero.plain {
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / .035) 0 2px, transparent 2px 9px),
    linear-gradient(135deg, #0d0024 0%, #2f00a3 60%, #5b2ee0 100%);
}
.section-hero.plain::before { background: linear-gradient(to top, rgb(0 0 0 / .45), transparent 70%); }

.project .card-body { gap: .9rem; padding-top: 1.6rem; }
.project-head { display: flex; align-items: center; gap: 1rem; }
.project-head h2 { font-size: 1.45rem; }
.project-head .tile-icon { width: 3.25rem; height: 3.25rem; border-radius: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .3rem; }
.button {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: .92rem; text-decoration: none;
}
.button:hover { color: var(--accent-ink); filter: brightness(1.15); }
.button.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.button.ghost:hover { color: var(--accent-hot); box-shadow: inset 0 0 0 1.5px var(--accent-hot); filter: none; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .92rem; color: var(--text-dim); }
.keys dt { text-align: right; }
.keys dd { margin: 0; }
kbd {
  font: 600 .8em/1 var(--mono); padding: .2em .45em; border-radius: 5px;
  background: var(--card-bg-2); color: var(--text);
  box-shadow: inset 0 -2px 0 var(--line), 0 0 0 1px var(--line);
}
.prose figcaption { margin-top: .55rem; font-size: .88rem; color: var(--text-dim); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .3rem 0; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- additions: article covers, image galleries, more prose ---------- */
.article-cover { width: 100%; max-height: 24rem; object-fit: cover; }

/* Justified rows: each image's share of the row = its aspect ratio (--ar). */
.gallery { display: flex; gap: .5rem; margin: 1.25rem 0; align-items: flex-start; }
.gallery figure { margin: 0; flex: var(--ar) 1 0%; min-width: 0; }
.gallery img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.prose figure a, .gallery a { display: block; cursor: zoom-in; }
.prose figure a:hover img, .gallery a:hover img { filter: brightness(1.06); }

.prose h3 { font-size: 1.15rem; line-height: 1.4; margin: 2rem 0 .6rem; }
.prose h4 { font-size: 1.03rem; line-height: 1.55; font-weight: 600; margin: 1.6rem 0 .6rem; }
.prose h5 { font-size: .95rem; margin: 1.4rem 0 .5rem; }
.prose h2 + h3, .prose h2 + h4, .prose h3 + h4 { margin-top: .5rem; }
.prose blockquote { margin: 1.25rem 0; padding: .2rem 1.2rem; border-left: 4px solid var(--line); color: var(--text-dim); }
.prose ol { padding-left: 1.4rem; }
.prose li > p { margin: .25rem 0; }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose img { max-width: 100%; height: auto; }
.prose .pause { text-align: center; color: var(--text-dim); font: 700 1.2rem/1 var(--mono); margin: 2.5rem 0; letter-spacing: .6em; }

@media (max-width: 34rem) {
  .gallery { flex-wrap: wrap; }
  .gallery figure { flex-basis: calc(50% - .25rem); }
}
.prose del { opacity: .5; }

/* Banner with centred text over a photo (e.g. the win7efi header) */
.article-banner {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 16 / 7;
  padding: 1.5rem;
  text-align: center;
  color: #eee;
  background: #000 center / cover no-repeat;
}
.article-banner::before { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .25); }
.article-banner p {
  position: relative; margin: 0;
  font: 700 clamp(1.4rem, 4.2vw, 2.4rem)/1.2 var(--sans);
  text-shadow: 2px 2px 8px #333;
}

/* Photo banners on section pages match the article banner's 16:7 shape */
.section-hero:not(.plain) { aspect-ratio: 16 / 7; }
/* Night photos: only shade the bottom, where the title sits */
.section-hero.light-scrim::before { background: linear-gradient(to top, rgb(0 0 0 / .6), rgb(0 0 0 / 0) 50%); }

/* ---------- additions: music, about, tables ---------- */
a.card.about { display: grid; }
.compact a:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.prose.lyrics p { margin: 0 0 .9rem; line-height: 1.75; }
.prose figure.art img { max-width: min(100%, 22rem); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .5rem .75rem; text-align: left; }
.prose th { font-weight: 650; }

/* ---------- sidebar: full-height, utilities pinned to the bottom ---------- */
.sidebar {
  top: 0;
  height: 100vh;
  height: 100dvh;
  margin-block: -2.5rem;          /* cancel the layout's top/bottom padding... */
  padding-block: 2.5rem;          /* ...and keep it inside the sidebar instead */
  overflow-y: auto;
  scrollbar-width: none;
  /* overflow-y also clips sideways, so give the menu pills' negative margins,
     the avatar ring and button shadows room inside the box */
  padding-inline: 1rem;
  margin-inline: -1rem;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-utils { margin-top: auto; display: grid; gap: .15rem; }

/* Language and dark mode: plain menu-style rows, icon then label (like the menu) */
.lang-switch {
  display: inline-flex; align-items: center; gap: .8rem;
  padding: .55rem 0;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.lang-switch .icon, .theme-toggle .icon { color: var(--text-dim); }
.lang-switch select {
  appearance: none; -webkit-appearance: none;
  border: 0; background: none; color: inherit;
  font: inherit; font-weight: 500;
  padding: 0; margin: 0;
  cursor: pointer;
}
.lang-switch select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.lang-switch:hover, .lang-switch:hover .icon { color: var(--accent); }
.lang-switch select option { color: var(--text); background: var(--card-bg); }

.theme-toggle,
.theme-toggle:hover { width: auto; margin: 0; padding: .55rem 0; background: none; color: var(--text); }
.theme-toggle:hover, .theme-toggle:hover .icon { color: var(--accent); }
.theme-toggle .icon.on { display: none; }
.theme-toggle[aria-pressed="true"] { color: var(--accent); font-weight: 700; }
.theme-toggle[aria-pressed="true"] .icon { color: var(--accent); }
.theme-toggle[aria-pressed="true"] .icon.on { display: inline; }
.theme-toggle[aria-pressed="true"] .icon.off { display: none; }

@media (max-width: 52rem) {
  .sidebar { height: auto; margin: 0; padding: 0; overflow: visible; }
  .sidebar-utils { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
  .lang-switch, .theme-toggle { padding: .45rem 0; }
  .sidebar-bottom { display: block; }
}
