/* ---------- Tokens ---------- */
:root {
  --bg: #f3ede1;
  --ink: #1c2a22;
  --dim: #5e675f;
  --line: #1c2a22;
  --acc: #e5582b;
  --side: #1f3b2d;
  --side-ink: #f3ede1;
  --side-dim: #a9b8ad;
  --side-hover: rgba(243, 237, 225, .08);
  --side-line: rgba(243, 237, 225, .14);
  --display: Anton, Impact, "Arial Narrow", sans-serif;
  --font: Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111712;
  --ink: #ece6d8;
  --dim: #99a196;
  --line: #ece6d8;
  --acc: #ff7a45;
  --side: #0b100c;
  --side-ink: #ece6d8;
  --side-dim: #7f8a80;
  --side-hover: rgba(236, 230, 216, .06);
  --side-line: rgba(236, 230, 216, .1);
  color-scheme: dark;
}
/* No-JS fallback follows the OS */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #111712; --ink: #ece6d8; --dim: #99a196; --line: #ece6d8; --acc: #ff7a45;
    --side: #0b100c; --side-ink: #ece6d8; --side-dim: #7f8a80; --side-hover: rgba(236,230,216,.06); --side-line: rgba(236,230,216,.1);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); transition: background-color .2s, color .2s; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--bg); padding: 8px 12px; }

/* ---------- Sidebar ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 20;
  display: flex; flex-direction: column; padding: 18px 12px;
  background: var(--side); color: var(--side-ink); transition: transform .25s ease;
}
.me { display: flex; gap: 12px; align-items: center; padding: 6px 10px 18px; }
.av { width: 40px; height: 40px; border-radius: 12px; background: var(--acc); color: #fff; display: grid; place-items: center; font: 400 17px/1 var(--display); flex: none; }
.me b { display: block; font: 400 18px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.me small { display: block; font-size: 12px; color: var(--side-dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.find { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--side-line); }
.find:focus-within { border-color: var(--acc); }
.find svg { width: 15px; height: 15px; color: var(--side-dim); flex: none; }
.find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--side-ink); font: inherit; font-size: 15px; }
.find input::placeholder { color: var(--side-dim); }
.find input::-webkit-search-cancel-button { display: none; }
.find kbd { font: 11px ui-monospace, monospace; color: var(--side-dim); border: 1px solid var(--side-line); border-radius: 4px; padding: 1px 5px; }
.nav { flex: 1; overflow: auto; }
.nav h4 { font-size: 11px; font-weight: 700; color: var(--side-dim); margin: 18px 12px 6px; text-transform: uppercase; letter-spacing: .12em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; position: relative; }
.nav a:hover { background: var(--side-hover); }
.nav a.on { background: var(--side-hover); }
.nav a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--acc); }
.nav .ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--side); background: var(--side-ink); flex: none; }
.nav a.on .ico { background: var(--acc); color: #fff; }
.nav .none { padding: 7px 12px; font-size: 13px; color: var(--side-dim); }
.foot { border-top: 1px solid var(--side-line); padding-top: 10px; margin-top: 10px; }
.foot button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 9px 12px;
  border: 0; border-radius: 8px; background: none; color: var(--side-ink); cursor: pointer;
  font: 600 13px var(--font); text-transform: uppercase; letter-spacing: .06em;
}
.foot button:hover { background: var(--side-hover); }
.sw { width: 38px; height: 22px; border-radius: 999px; border: 1.5px solid var(--side-line); position: relative; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--acc); transition: transform .2s; }
:root[data-theme="dark"] .sw::after { transform: translateX(16px); }

/* ---------- Main ---------- */
.main { margin-left: 272px; min-height: 100vh; }
.mtop { display: none; }
.content { max-width: 860px; margin: 0 auto; padding: 56px 48px 48px; display: flex; flex-direction: column; }
.crumb { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.cover {
  margin-top: 14px; border-radius: 14px; overflow: hidden; white-space: nowrap; padding: 22px 0;
  background: var(--side); color: var(--side-ink); font: 400 30px/1 var(--display); text-transform: uppercase;
}
:root[data-theme="dark"] .cover { background: var(--acc); color: var(--bg); }
.cover .track { display: inline-block; animation: marquee 28s linear infinite; }
.cover span { margin: 0 18px; }
.cover i { font-style: normal; color: var(--acc); }
:root[data-theme="dark"] .cover i { color: var(--bg); opacity: .5; }
@keyframes marquee { to { transform: translateX(-50%); } }

h1 { font-size: clamp(56px, 9vw, 104px); line-height: .88; margin: 28px 0 14px; }
h1 span { color: var(--acc); }
.lead { color: var(--dim); font-size: 18px; max-width: 58ch; }

.toolbox { order: 1; }
.h2row { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 48px 0 14px; flex-wrap: wrap; }
h2 { font-size: clamp(40px, 6vw, 64px); line-height: .9; margin: 0; }
.count { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.idx { border-top: 2px solid var(--line); }
.item {
  display: grid; grid-template-columns: 52px 1fr auto 36px; gap: 16px; align-items: center;
  padding: 18px 8px; border-bottom: 2px solid var(--line); transition: background-color .2s, color .2s, padding .2s;
}
.item:hover { background: var(--ink); color: var(--bg); padding-left: 16px; }
.item .no { font: 400 24px/1 var(--display); color: var(--acc); }
.item h3 { margin: 0; font: 400 clamp(24px, 3vw, 32px)/1.05 var(--display); text-transform: uppercase; }
.item p { margin-top: 4px; font-size: 14px; opacity: .75; }
.item .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; opacity: .8; white-space: nowrap; }
.item .arr { font-size: 26px; justify-self: end; transition: transform .2s; }
.item:hover .arr { transform: translateX(4px) rotate(-45deg); }
.empty { padding: 28px 8px; color: var(--dim); border-bottom: 2px solid var(--line); }

.props {
  order: 2; display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 48px 0 0; padding: 18px 0;
  border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); font-size: 14px;
}
.props dt { color: var(--dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding-top: 2px; }
.props dd { margin: 0; font-weight: 500; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; margin: 0 4px 4px 0; border: 1.5px solid currentColor;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.pill--acc { background: var(--acc); border-color: var(--acc); color: #fff; }
.footer {
  order: 3; margin-top: 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.scrim { display: none; }

/* ---------- Phone & tablet ---------- */
@media (max-width: 860px) {
  .side { transform: translateX(-100%); }
  body.open .side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 15; }
  body.open { overflow: hidden; }
  .main { margin-left: 0; }
  .mtop {
    display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 8px;
    border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 10;
  }
  .mtop__l { display: flex; align-items: center; gap: 4px; }
  .mtop button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
  .mtop button svg { width: 22px; height: 22px; }
  .mtop b { font: 400 18px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
  .content { padding: 24px 16px 32px; }
  /* Phone: get to the tools fast */
  .crumb, .cover { display: none; }
  h1 { font-size: 48px; margin: 0 0 10px; }
  .lead { font-size: 16px; }
  .h2row { margin-top: 28px; }
  h2 { font-size: 40px; }
  .item { grid-template-columns: 34px 1fr; gap: 4px 12px; padding: 16px 4px; }
  .item:hover { padding-left: 4px; }
  .item .meta { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; }
  .item .arr { display: none; }
  .props { grid-template-columns: 80px 1fr; margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
