/* ============================================================
   DEDSEC site — styles.css
   Design system: docs/DESIGN.md (opencode.ai-derived, same family
   as the HuntPack landing). Tokens only. Flat, mono, warm dark.
   ============================================================ */

:root {
  --bg: #201d1d;
  --bg-elevated: #302c2c;
  --border: rgba(15, 0, 0, 0.12);
  --border-strong: #646262;
  --text-1: #fdfcfc;
  --text-2: #9a9898;
  --text-3: #84848a;
  --accent: #00e063;
  --ok: #30d158;
  --err: #ff3b30;
  --warn: #ff9f0a;

  --fs-h1: 38px;
  --fs-h2: 16px;
  --fs-body: 16px;
  --fs-caption: 14px;
  --fs-mono: 14px;

  --mono: "Berkeley Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular",
          Menlo, Monaco, Consolas, "Liberation Mono", Courier New, monospace;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --sp-20: 80px; --sp-24: 96px;

  --r-default: 4px;
  --r-input: 6px;
  --content: min(880px, 100% - 48px);
  --ease: ease-out;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text-1);
  font-family: var(--mono); font-size: var(--fs-body); font-weight: 400;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a {
  color: var(--text-1); font-weight: 500; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  transition: color 0.12s var(--ease);
}
a:hover { color: var(--accent); text-decoration-thickness: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-2); top: -48px; z-index: 100;
  padding: var(--sp-2) var(--sp-3); background: var(--bg-elevated);
  color: var(--text-1); border: 1px solid var(--border-strong);
  border-radius: var(--r-default); transition: top 0.12s var(--ease);
}
.skip-link:focus { top: var(--sp-2); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; border-radius: var(--r-default); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner {
  width: var(--content); margin-inline: auto; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6);
}
.brand { color: var(--text-1); font-weight: 700; text-decoration: none; }
.brand:hover { color: var(--accent); }
.brand-caret { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: var(--sp-5); }
.nav-links > a:not(.btn) { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: var(--fs-caption); }
.nav-links > a:not(.btn):hover { color: var(--accent); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border-strong);
  border-radius: var(--r-default); padding: var(--sp-2); cursor: pointer;
}
.nav-toggle-bar { display: block; width: 16px; height: 1px; background: var(--text-1); margin: 4px 0; transition: transform 0.12s var(--ease), opacity 0.12s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(4) { transform: translateY(-5px) rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-block; padding: 4px 20px; background: var(--bg); color: var(--text-1);
  border: 1px solid var(--border-strong); border-radius: var(--r-default);
  font-family: var(--mono); font-size: var(--fs-body); font-weight: 500;
  line-height: 2; text-decoration: none; cursor: pointer;
  transition: color 0.12s var(--ease), border-color 0.12s var(--ease), background 0.12s var(--ease);
}
.btn:hover { color: var(--accent); border-color: #8a8888; background: var(--bg-elevated); text-decoration: none; }
.btn:active { background: var(--bg-elevated); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-elevated); }

/* Layout */
.section { width: var(--content); margin-inline: auto; padding-block: var(--sp-16) var(--sp-20); }
h1, h2, h3 { font-weight: 700; margin: 0; }
h2 { font-size: var(--fs-h2); line-height: 1.5; margin-bottom: var(--sp-3); }
.section-sub { color: var(--text-2); font-weight: 400; max-width: 60ch; margin: 0 0 var(--sp-12); }

/* Hero */
.hero { width: var(--content); margin-inline: auto; padding-block: var(--sp-20) var(--sp-24); text-align: left; }
.hero-title { font-size: var(--fs-h1); line-height: 1.5; margin-bottom: var(--sp-4); }
.hero-sub { color: var(--text-2); font-weight: 400; max-width: 52ch; margin: 0 0 var(--sp-6); }
.hero-actions { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-16); flex-wrap: wrap; }

/* Terminal */
.term {
  margin: 0; padding: var(--sp-6); background: var(--bg-elevated);
  border: 1px solid var(--border-strong); border-radius: var(--r-default);
  font-family: var(--mono); font-size: var(--fs-mono); line-height: 1.6;
  color: var(--text-1); overflow-x: auto; white-space: pre;
}
.term-d { color: var(--text-3); }
.term-c { color: var(--accent); }
.term-m { color: var(--text-2); }
.term-ok { color: var(--ok); }
.term-warn { color: var(--warn); }
.term-err { color: var(--err); }

/* Stage list */
.stage-list { list-style: none; margin: 0; padding: 0; }
.stage-list li {
  display: grid; grid-template-columns: 48px 180px 1fr; align-items: baseline;
  gap: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border); transition: background 0.12s var(--ease);
}
.stage-list li:last-child { border-bottom: 1px solid var(--border); }
.stage-list li:hover { background: var(--bg-elevated); }
.stage-num { color: var(--accent); font-size: var(--fs-caption); }
.stage-name { font-weight: 700; }
.stage-desc { color: var(--text-2); font-weight: 400; }

/* Skill list */
.skill-group { margin-bottom: var(--sp-12); }
.group-label { color: var(--text-3); font-size: var(--fs-caption); font-weight: 400; margin-bottom: var(--sp-2); }
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-list li {
  display: grid; grid-template-columns: 280px 1fr; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border);
  transition: background 0.12s var(--ease);
}
.skill-list li:last-child { border-bottom: 1px solid var(--border); }
.skill-list li:hover { background: var(--bg-elevated); }
.skill-name { font-weight: 700; transition: color 0.12s var(--ease); }
.skill-list li:hover .skill-name { color: var(--accent); }
.skill-desc { color: var(--text-2); font-weight: 400; }

/* Code blocks */
.code-block { background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-default); margin-bottom: var(--sp-4); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--border); }
.code-file { color: var(--text-2); font-size: var(--fs-caption); }
.copy {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  font-family: var(--mono); font-size: var(--fs-caption); padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-default); transition: color 0.12s var(--ease);
}
.copy:hover { color: var(--accent); }
.copy.copied { color: var(--ok); }
.code-block pre { margin: 0; padding: var(--sp-4) var(--sp-5); font-family: var(--mono); font-size: var(--fs-mono); line-height: 1.6; overflow-x: auto; color: var(--text-1); }
.code-inline { color: var(--accent); border: 1px solid var(--border-strong); border-radius: var(--r-default); padding: 0 var(--sp-1); font-size: 0.9em; }

.install-cta { display: flex; align-items: center; gap: var(--sp-6); margin-top: var(--sp-12); flex-wrap: wrap; }
.text-link { color: var(--accent); font-size: var(--fs-caption); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: var(--sp-16) var(--sp-12); }
.footer-inner { width: var(--content); margin-inline: auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-8); }
.footer-logo { font-weight: 700; color: var(--text-1); }
.footer-tag { color: var(--text-3); font-size: var(--fs-caption); margin: var(--sp-2) 0 0; }
.footer-col { display: flex; flex-direction: column; gap: var(--sp-1); }
.footer-label { color: var(--text-3); font-size: var(--fs-caption); margin-bottom: var(--sp-1); }
.footer-col a { color: var(--text-2); font-size: var(--fs-caption); font-weight: 400; text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-note { color: var(--text-3); font-size: var(--fs-caption); grid-column: 1 / -1; margin: var(--sp-6) 0 0; }

/* Responsive */
@media (max-width: 768px) {
  .skill-list li { grid-template-columns: 1fr; gap: var(--sp-1); }
  .stage-list li { grid-template-columns: 40px 1fr; gap: var(--sp-2); }
  .stage-desc { grid-column: 2; }
}
@media (max-width: 640px) {
  .hero { padding-block: var(--sp-12) var(--sp-16); }
  .hero-title { font-size: clamp(28px, 6vw, 38px); }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border-strong); padding: var(--sp-3) var(--sp-6) var(--sp-5);
  }
  .nav-links.open { display: flex; }
  .nav-links > a:not(.btn) { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: var(--sp-3); align-self: flex-start; }
  .footer-inner { grid-template-columns: 1fr; gap: var(--sp-6); }
  .footer-note { grid-column: auto; margin-top: var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
