/* Shared look for every DustRust+ page: tokens, header, buttons, footer. */
:root {
  --bg: #0d0b0a;
  --bg-2: #15110f;
  --panel: rgba(22, 18, 16, .82);
  --panel-solid: #17130f;
  --ash: #efe4d6;
  --muted: #b3a595;
  --dim: #978a7a;
  --ember: #ff8a3d;
  --ember-hi: #ffb070;
  --ok: #9bd35a;
  --bad: #ff6b57;
  --warn: #ffc453;
  --line: rgba(239, 228, 214, .14);
  --line-2: rgba(239, 228, 214, .08);
  --display: "Bahnschrift", "DIN Condensed", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --cut: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; }
body {
  background: var(--bg); color: var(--ash);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 40;
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  padding: 16px clamp(16px, 4vw, 48px);
  transition: background .3s, backdrop-filter .3s, box-shadow .3s;
}
.top.solid, .page .top {
  background: rgba(13, 11, 10, .82); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line-2);
}
.logo {
  font: 700 21px/1 var(--display); letter-spacing: .05em; text-transform: uppercase;
  color: var(--ash); text-decoration: none; white-space: nowrap;
}
.logo span { color: var(--ember); }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 12px; text-decoration: none; color: var(--muted);
  font: 600 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  transition: color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ash); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ember); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border: 0; cursor: pointer; white-space: nowrap;
  font-weight: 600; font-size: 15px; letter-spacing: .02em; text-decoration: none;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .2s, color .2s;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-fire { background: var(--ember); color: #1c0d04; }
.btn-fire:hover { background: #ffa05c; }
.btn-ghost { color: var(--ash); background: rgba(13, 11, 10, .45); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(40, 32, 27, .7); }
.btn-sm { padding: 9px 14px; font-size: 14px; --cut: 7px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- text bits ---------- */
.tag, .kicker {
  font: 600 12px/1.2 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--ember);
}
.display { font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: .92; }
.muted { color: var(--muted); }
/* The top padding keeps the breve of Й and the dots of Ё inside the clip;
   the negative margin gives the line spacing back. */
.ln { display: block; overflow: hidden; padding: .14em 0 .05em; margin-top: -.14em; }
.ln > span { display: inline-block; transform: translateY(112%); }
.accent > span { color: var(--ember); }

/* ---------- inner pages ---------- */
.page main { padding: 110px clamp(16px, 5vw, 64px) 80px; max-width: 1320px; margin: 0 auto; }
/* Short pages keep the footer at the bottom of the screen, not under the content. */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page main { flex: 1 0 auto; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.page-head h1 { font: 700 clamp(40px, 6vw, 84px)/.9 var(--display); text-transform: uppercase; margin-top: 14px; }
.page-head p { color: var(--muted); max-width: 520px; margin-top: 14px; }
.page::before {
  content: ""; position: fixed; inset: 0 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 100% at 80% 0%, rgba(255, 138, 61, .10), transparent 70%);
}

.panel-box { background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
}
.chip.hot { color: var(--ember); box-shadow: inset 0 0 0 1px rgba(255, 138, 61, .45); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

.skeleton { background: linear-gradient(90deg, rgba(239, 228, 214, .05), rgba(239, 228, 214, .11), rgba(239, 228, 214, .05)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- shared controls: switch and toast ---------- */
.switch { all: unset; cursor: pointer; margin-left: auto; width: 50px; height: 28px; flex: none; border-radius: 99px; background: rgba(239, 228, 214, .16); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ash); transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.switch[aria-checked="true"] { background: var(--ember); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.switch:disabled { opacity: .45; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 20px; z-index: 50; opacity: 0; pointer-events: none; background: var(--ash); color: #1c0d04; padding: 12px 18px; font-weight: 600; font-size: 14px; transition: opacity .25s, translate .35s cubic-bezier(.16, 1, .3, 1); }
.toast.on { opacity: 1; translate: -50% 0; }
.toast.bad { background: var(--bad); color: #1c0d04; }

/* ---------- footer ---------- */
.site-foot {
  padding: 40px clamp(16px, 5vw, 64px); border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center;
  color: var(--dim); font-size: 14px; background: var(--bg);
}
.site-foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ember); }

@media (max-width: 760px) {
  .nav a { padding: 8px 8px; letter-spacing: .1em; }
  .top .who .btn-label { display: none; }
}
@media (max-width: 460px) {
  .top { gap: 10px; }
  .logo { font-size: 17px; }
  .nav a { padding: 8px 5px; font-size: 11px; letter-spacing: .06em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
