/* wacns.com — shared styles for every page */

/* ── Fonts (self-hosted, SIL Open Font License — see assets/fonts/) ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url('/assets/fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/plex-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/plex-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/plex-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Theme tokens ── */
:root {
  color-scheme: dark;
  --bg:          #0a0a0f;
  --band:        #0e0e15;
  --card-bg:     #12121a;
  --card-border: #1e1e2e;
  --field-bg:    #0c0c12;
  --accent:      #8A2BE2;
  --accent-text: #a66bf0;
  --accent-rgb:  138, 43, 226;
  --text:        #f0f0f5;
  --muted:       #888899;
  --grid-line:   rgba(255, 255, 255, 0.045);
  --glow:        0.28;
  --topbar-bg:   rgba(10, 10, 15, 0.72);
  --mark:        rgba(166, 107, 240, 0.32);
  --hm0: #1a1a26; --hm1: #3b1d63; --hm2: #5b25a0; --hm3: #7a2bd6; --hm4: #a66bf0;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', 'IBM Plex Sans Arabic', sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg:          #fafafc;
  --band:        #f2f2f7;
  --card-bg:     #ffffff;
  --card-border: #e3e3ec;
  --field-bg:    #f6f6fa;
  --accent:      #7a1fd6;
  --accent-text: #6a17bd;
  --accent-rgb:  122, 31, 214;
  --text:        #15151d;
  --muted:       #5f5f70;
  --grid-line:   rgba(20, 20, 40, 0.06);
  --glow:        0.16;
  --topbar-bg:   rgba(250, 250, 252, 0.78);
  --mark:        rgba(122, 31, 214, 0.16);
  --hm0: #ececf3; --hm1: #dcc6f7; --hm2: #b98cef; --hm3: #9050e0; --hm4: #6a17bd;
}

html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  z-index: 0;
}
html[lang="ar"] body { --sans: 'IBM Plex Sans Arabic', 'Inter', sans-serif; line-height: 1.75; }
a { color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 1rem; }

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s;
}
.skip-link:focus { transform: none; }
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Hero background ── */
.hero-fx {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 620px;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 25%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 75% at 50% 25%, #000 25%, transparent 75%);
  animation: grid-drift 24s linear infinite;
}
.hero-glow {
  position: absolute;
  top: -140px; left: 50%;
  width: 640px; height: 420px;
  transform: translateX(-60%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), var(--glow)), transparent);
  filter: blur(20px);
  animation: glow 9s ease-in-out infinite alternate;
}
@keyframes grid-drift { to { background-position: 44px 44px, 44px 44px; } }
@keyframes glow {
  from { transform: translateX(-60%) scale(1);    opacity: 0.8; }
  to   { transform: translateX(-40%) scale(1.15); opacity: 1; }
}

/* ── Reveal on scroll ── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled, .topbar.solid { border-bottom-color: var(--card-border); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; height: 54px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.brand img { width: 22px; height: 22px; }
.topbar-right { display: flex; align-items: center; gap: 0.35rem; }
.topnav { display: flex; gap: 0.15rem; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--text); background: var(--card-border); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 30px;
  min-width: 30px;
  padding: 0 0.45rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.5); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn kbd { font-family: var(--mono); font-size: 0.65rem; }
.theme-dark-only, html[data-theme="light"] .theme-light-only { display: inline; }
.theme-light-only, html[data-theme="light"] .theme-dark-only { display: none; }
@media (max-width: 560px) {
  .topnav a.opt { display: none; }
  .icon-btn kbd { display: none; }
}
@media (max-width: 480px) { .topnav { display: none; } }

/* ── Bands & headings ── */
.band { padding: 3.75rem 0; }
.band.alt { background: var(--band); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); }
.band[hidden] { display: none; }
h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head h2 { margin-bottom: 0; }
.more-link { font-size: 0.82rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.more-link:hover { color: var(--text); }

/* ── Intro ── */
.hero { padding-top: 4rem; padding-bottom: 3.5rem; }
.handle { font-family: var(--mono); font-size: 0.8rem; color: var(--accent-text); margin-bottom: 0.75rem; }
h1 {
  background: linear-gradient(120deg, var(--text) 30%, #b58cf2);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.15;
}
html[lang="ar"] h1 { letter-spacing: 0; }
.role { color: var(--muted); font-size: 1rem; margin-top: 0.35rem; }

.intro-toggle {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: 2px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--field-bg);
}
.intro-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}
.intro-toggle button[aria-pressed="true"] { background: var(--card-border); color: var(--text); }
.intro { margin-top: 0.9rem; font-size: 1rem; font-weight: 300; max-width: 62ch; }
.intro[hidden] { display: none; }
html[data-intro="long"] .intro[data-intro-text="long"] { display: block; }
html[data-intro="long"] .intro[data-intro-text="short"] { display: none; }
.intro + .intro { margin-top: 0.9rem; }
html[lang="ar"] .intro { font-weight: 400; }

/* Highlighter accents */
mark {
  color: inherit;
  background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%) no-repeat 0 0 / 0% 100%;
  padding: 0 0.1em;
  transition: background-size 0.9s cubic-bezier(.2, .7, .2, 1) 0.35s;
}
html[dir="rtl"] mark { background-position: 100% 0; }
mark.in, .no-js mark { background-size: 100% 100%; }

/* ── Buttons ── */
.links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.85; }
.btn-ghost { border: 1px solid var(--card-border); color: var(--text); }
.btn-ghost:hover { border-color: rgba(var(--accent-rgb), 0.5); }

/* ── Stats ── */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 2rem;
  list-style: none;
  font-size: 0.82rem;
  color: var(--muted);
}
.stats li.pending { visibility: hidden; }
.stats strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Now ── */
.pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-inline-end: 0.45rem;
  vertical-align: 0.35em;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { to { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
}
.now ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.now li { position: relative; padding-inline-start: 1.1rem; font-size: 0.9rem; font-weight: 300; }
html[lang="ar"] .now li { font-weight: 400; }
.now li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 0.6em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.now-updated { margin-top: 0.85rem; font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }

/* ── Projects ── */
.projects { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 600px) { .projects { grid-template-columns: repeat(2, 1fr); } }
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.15rem 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(var(--accent-rgb), 0.35); }
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-desc { font-size: 0.84rem; color: var(--muted); }
.tags { margin-top: auto; padding-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; }
.tags li {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--accent-text);
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 0.85rem; font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }
.card-meta:empty { display: none; }
.lang-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-inline-end: 0.35rem;
  vertical-align: 1px;
}

/* ── Activity ── */
.activity-total { font-size: 0.9rem; margin-bottom: 0.85rem; }
.activity-total strong { font-weight: 600; }
.activity-total span { color: var(--muted); font-weight: 300; }
.activity-graph { direction: ltr; }
.activity-graph svg { display: block; width: 100%; height: auto; }
.hm .h0 { fill: var(--hm0); } .hm .h1 { fill: var(--hm1); } .hm .h2 { fill: var(--hm2); }
.hm .h3 { fill: var(--hm3); } .hm .h4 { fill: var(--hm4); }
.activity-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  direction: ltr;
}
.activity-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.activity-legend .l0 { background: var(--hm0); } .activity-legend .l1 { background: var(--hm1); }
.activity-legend .l2 { background: var(--hm2); } .activity-legend .l3 { background: var(--hm3); }
.activity-legend .l4 { background: var(--hm4); }

/* ── Code card (always dark, like an editor) ── */
.code-card {
  position: relative;
  background: #0c0c12;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  direction: ltr;
  text-align: left;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #1e1e2e;
  background: #12121a;
}
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2a3a; }
.code-bar span { margin-left: 0.5rem; font-family: var(--mono); font-size: 0.7rem; color: #888899; }
.code-card pre {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #d4d4e0;
  tab-size: 4;
}
.tk-kw  { color: #c792ea; }
.tk-ty  { color: #82aaff; }
.tk-pr  { color: #f0f0f5; }
.tk-str { color: #a5e3a0; }
.tk-cm  { color: #6c6c82; font-style: italic; }
.tk-pu  { color: #888899; }
.tk-fn  { color: #ffcb6b; }
@media (max-width: 600px) {
  .code-card pre { font-size: 0.7rem; padding-right: 2rem; }
  .code-card.scrolls::after {
    content: "";
    position: absolute;
    top: 41px; right: 0; bottom: 0;
    width: 2rem;
    background: linear-gradient(90deg, transparent, #0c0c12);
    pointer-events: none;
  }
}

/* ── Notes list ── */
.note-list { list-style: none; display: flex; flex-direction: column; }
.note-list li { border-top: 1px solid var(--card-border); }
.note-list li:last-child { border-bottom: 1px solid var(--card-border); }
.note-list a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 1rem 0;
  text-decoration: none;
}
@media (min-width: 600px) { .note-list a { grid-template-columns: 7rem 1fr; gap: 1rem; } }
.note-date { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); padding-top: 0.15rem; }
.note-title { font-weight: 600; font-size: 0.98rem; transition: color 0.15s; }
.note-list a:hover .note-title { color: var(--accent-text); }
.note-sum { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Call to action ── */
.cta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.cta h2 { font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -1.2px; line-height: 1.05; margin-bottom: 0.6rem; }
html[lang="ar"] .cta h2 { letter-spacing: 0; line-height: 1.3; }
.cta p { color: var(--muted); max-width: 42ch; }
.cta .links { margin-top: 0; }

/* ── Article (notes, uses) ── */
.page-head { padding-top: 3.5rem; padding-bottom: 1.5rem; }
.crumbs { font-size: 0.8rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.page-head h1 { font-size: clamp(2rem, 6vw, 2.6rem); letter-spacing: -1px; line-height: 1.12; }
.page-meta { margin-top: 0.8rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.lede { margin-top: 1rem; font-size: 1.05rem; color: var(--muted); max-width: 60ch; }
.prose { padding-bottom: 4rem; font-size: 0.98rem; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: 1.3rem; margin: 2.4rem 0 0; }
.prose h3 { font-size: 1.02rem; margin-top: 1.8rem; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { padding-inline-start: 1.25rem; }
.prose li + li { margin-top: 0.35rem; }
.prose a { color: var(--accent-text); text-underline-offset: 3px; }
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}
.prose .code-card code, .prose .code-card pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.prose .code-card { margin-top: 1.25rem; }
.prose blockquote {
  border-inline-start: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1rem;
  color: var(--muted);
}
.callout {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
}
.callout strong { color: var(--text); }
.uses-group { margin-top: 2.2rem; }
.uses-list { list-style: none; padding: 0 !important; display: flex; flex-direction: column; }
.uses-list li { display: grid; grid-template-columns: 1fr; gap: 0.1rem; padding: 0.75rem 0; border-top: 1px solid var(--card-border); max-width: none; }
.uses-list li + li { margin-top: 0; }
@media (min-width: 600px) { .uses-list li { grid-template-columns: 11rem 1fr; gap: 1rem; } }
.uses-list strong { font-weight: 600; font-size: 0.92rem; }
.uses-list span { color: var(--muted); font-size: 0.9rem; }

/* ── Footer ── */
footer {
  background: var(--band);
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2.5rem 0 2rem;
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-about { grid-column: 1 / -1; }
@media (min-width: 600px) { .footer-about { grid-column: auto; } }
.footer-about p { margin-top: 0.6rem; max-width: 32ch; }
.footer-col h3 { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.75rem; }
html[lang="ar"] .footer-col h3 { letter-spacing: 0; font-size: 0.75rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
footer a { text-decoration: none; transition: color 0.15s; }
footer a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.75rem;
}
.colophon { font-family: var(--mono); font-size: 0.68rem; }
.colophon a { text-decoration: underline; text-underline-offset: 2px; }

/* ── Command palette ── */
.palette {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  background: rgba(5, 5, 10, 0.55);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.palette[hidden] { display: none; }
.palette-box {
  width: 100%;
  max-width: 520px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.palette-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.95rem 1rem;
  outline: none;
}
.palette-list { list-style: none; max-height: 50vh; overflow-y: auto; padding: 0.35rem; }
.palette-group {
  padding: 0.55rem 0.65rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
html[lang="ar"] .palette-group { letter-spacing: 0; font-size: 0.72rem; }
.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}
.palette-item small { color: var(--muted); font-size: 0.72rem; }
.palette-item[aria-selected="true"] { background: rgba(var(--accent-rgb), 0.14); }
.palette-empty { padding: 1rem; color: var(--muted); font-size: 0.85rem; }
.palette-hint {
  display: flex;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.68rem;
  color: var(--muted);
}
.palette-hint kbd { font-family: var(--mono); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  z-index: 60;
  transform: translateX(-50%) translateY(1rem);
  background: #22c55e;
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg, .hero-glow, .pulse { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  mark { transition: none; background-size: 100% 100%; }
  .card, .skip-link, .toast { transition: none; }
}
.notes-lang { font-size: 0.85rem; color: var(--muted); margin: -0.5rem 0 1rem; }
html[dir="rtl"] bdi { direction: ltr; unicode-bidi: isolate; }
.note-list.no-dates a { grid-template-columns: 1fr; }

/* ── 404 ── */
.nf { min-height: calc(100vh - 54px - 220px); display: flex; align-items: center; }
.nf-inner { padding-top: 4rem; padding-bottom: 4rem; }
.nf-code {
  font-size: clamp(5rem, 22vw, 8.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -4px;
  background: linear-gradient(120deg, var(--accent-text), #c9a8ff);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  margin-bottom: 0.75rem;
}
.nf-hint { margin-top: 2rem; font-size: 0.82rem; color: var(--muted); }
.nf-hint kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  border: 1px solid var(--card-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05rem 0.35rem;
  background: var(--card-bg);
  color: var(--text);
}
