/* my.enemy.org — Console theme. No external fonts or requests. */
:root {
  --bg: #0d0c0a;
  --panel: #14120e;
  --panel-2: #1e1b14;
  --line: #3a3426;
  --fg: #e6dcc3;
  --fg-strong: #f4ebd2;
  --muted: #a89c80;
  --accent: #ffb547;
  --accent-ink: #0d0c0a;
  --accent-soft: #ffd590;
  --ok: #7fbf8e;
  --info: #8fb4d9;
  --warn: #e0a458;
  --bad: #ff7a6b;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5efe0; --panel: #fbf7ea; --panel-2: #efe7d2; --line: #cfc3a6; --fg: #2b2619;
  --fg-strong: #14110a; --muted: #6a604a; --accent: #8a4b00; --accent-ink: #fbf7ea;
  --accent-soft: #6b3a00; --ok: #2f6b3e; --info: #1f5a8a; --warn: #8a5a10; --bad: #a3271b;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--panel); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 10px; padding-bottom: 10px; }
.brand { color: var(--fg-strong); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; }
.brand .at { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 0 4px; }
.nav a { color: var(--fg); text-decoration: none; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 3px; }
.nav a:hover { background: var(--panel-2); color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* layout */
main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.cols { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.box { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 22px 26px; min-width: 0; }
.label { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.prompt { color: var(--accent); }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; overflow-wrap: anywhere; }
.crumb a { color: var(--muted); }
.crumb b { color: var(--accent); font-weight: 500; }

h1, h2, h3 { color: var(--fg-strong); line-height: 1.2; text-wrap: balance; }
h1 { font-size: 40px; margin: 0 0 16px; }
h2 { font-size: 24px; margin: 32px 0 12px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
p { margin: 0 0 16px; }
.lead { color: var(--lead, #c9bd9f); max-width: 64ch; }
:root[data-theme="light"] { --lead: #2b2619; }

.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 3px; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn:hover { background: var(--panel-2); color: var(--accent-soft); }
.btn.primary:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* file tree */
.tree a { text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.tree .dir { color: var(--accent); }
.tree .ind { padding-left: 20px; display: block; }
.tree .here { color: var(--fg-strong); font-weight: 700; }

/* lists */
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { border-top: 1px solid var(--line); }
.entries li:first-child { border-top: 0; }
.entries a { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; text-decoration: none; color: var(--fg); min-height: 44px; }
.entries a:hover .t { color: var(--accent); }
.tag { color: var(--ok); flex: none; }
.entries .t { font-weight: 500; }
.entries .d { color: var(--muted); flex-basis: 100%; font-size: 13px; }

/* article body */
.body { min-width: 0; }
.body pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 14px 84px 14px 16px; overflow-x: auto; position: relative; margin: 0 0 20px; color: var(--accent-soft); }
.body pre code { color: inherit; background: none; white-space: pre; }
.body :not(pre) > code { background: var(--panel-2); padding: 2px 6px; border-radius: 3px; color: var(--accent-soft); overflow-wrap: anywhere; }
.body img { max-width: 100%; height: auto; }
.body table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.body th, .body td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.body a { overflow-wrap: anywhere; }
.note { border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--panel-2); border-radius: 4px; padding: 10px 14px; margin: 0 0 14px; }
.note-1 { border-left-color: var(--warn); }
.note-2 { border-left-color: var(--bad); }
.note-3 { border-left-color: var(--info); }
.note-4 { border-left-color: var(--ok); }
.copy { position: absolute; top: 6px; right: 6px; font: inherit; font-size: 12px; min-height: 32px; padding: 2px 10px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 18px 20px; text-decoration: none; color: var(--fg); }
.card:hover { border-color: var(--accent); }
.card strong { display: block; color: var(--fg-strong); font-size: 18px; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 13px; }

/* footer */
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px)); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; background: var(--accent); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* error pages */
.err-code { font-size: 96px; font-weight: 700; line-height: 1; color: var(--accent); margin: 0 0 8px; letter-spacing: -0.02em; }
.err-code.server { color: var(--bad); }
.term { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 12px 16px; overflow-x: auto; margin: 0 0 20px; }
.term .out { color: var(--muted); }
.term .st { color: var(--bad); }
.term .st.ok { color: var(--ok); }

/* responsive */
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .tree-box { order: 2; }
  h1 { font-size: 32px; }
  .err-code { font-size: 72px; }
}
@media (max-width: 520px) {
  body { font-size: 14px; }
  main { padding-top: 18px; }
  .box { padding: 16px 16px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .btns .btn { flex: 1 1 100%; justify-content: center; }
  .nav { width: 100%; }
  .nav a { flex: 1 1 auto; justify-content: center; }
  .err-code { font-size: 60px; }
}

.theme-btn { font: inherit; font-size: 13px; min-height: 44px; padding: 4px 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
