/* HackToTheFuture v2 — Clean B&W */

:root {
  --bg:        #080808;
  --surface:   #111111;
  --surface2:  #191919;
  --border:    #262626;
  --border2:   #333333;
  --text:      #e8e8e8;
  --text-muted:#888888;
  --text-dim:  #555555;
  --accent:    #ffffff;
  --code-bg:   #141414;
  --tag-bg:    #1e1e1e;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Typography ─── */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

/* ─── Layout ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Header ─── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.logo span { color: var(--text-dim); }
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.15s; }
.header-nav a:hover { color: var(--text); }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--text-muted); }
.breadcrumb .sep { color: var(--border2); }

/* ─── Hero / Platform Selector ─── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero .label {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.hero h1 { margin-bottom: 0.75rem; }
.hero p { color: var(--text-muted); max-width: 500px; margin: 0 auto 3rem; font-size: 0.95rem; }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 700px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.platform-card {
  background: var(--surface);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  border-right: 1px solid var(--border);
}
.platform-card:last-child { border-right: none; }
.platform-card:hover:not(.disabled) { background: var(--surface2); }
.platform-card.disabled { cursor: not-allowed; opacity: 0.4; }
.platform-card .icon {
  font-size: 1.8rem;
  filter: grayscale(1);
}
.platform-card .name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.platform-card .desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}
.platform-card .badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font-size: 0.6rem;
  font-family: monospace;
  background: var(--tag-bg);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.platform-card.active .badge { display: none; }

/* ─── Attack Chain (phase index page) ─── */
.page-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.page-header .meta {
  font-size: 0.75rem;
  font-family: monospace;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.page-header h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.page-header p { color: var(--text-muted); font-size: 0.9rem; }

.chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 2.5rem 0;
}
.chain-card {
  background: var(--surface);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.15s;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.chain-card:hover { background: var(--surface2); }
.chain-card .num {
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.chain-card h3 { font-size: 0.95rem; }
.chain-card .stats {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.chain-card .stat {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.chain-card .stat::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border2);
}
.chain-card:hover .stat::before { background: var(--text-dim); }

/* ─── Phase Page ─── */
.phase-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 120px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 2rem 0;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
}
.sidebar-section { padding: 0 1.25rem 1.5rem; }
.sidebar-section h4 {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-section a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.3rem 0;
  transition: color 0.1s;
}
.sidebar-section a:hover,
.sidebar-section a.active { color: var(--text); }
.sidebar-section a.active {
  font-weight: 600;
}

.phase-content { padding: 2rem 2.5rem; }

/* ─── Tabs ─── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  gap: 0;
}
.tab-btn {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Article Cards ─── */
.article-list { display: flex; flex-direction: column; gap: 1px; }
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: background 0.15s;
  margin-bottom: 1px;
}
.article-card:hover { background: var(--surface2); }
.article-card .article-meta { flex: 1; }
.article-card h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.article-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.article-card .tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.tag {
  font-size: 0.65rem;
  font-family: monospace;
  background: var(--tag-bg);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.article-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.article-card:hover .article-arrow { color: var(--text-muted); }

/* ─── Command Sections ─── */
.cmd-section { margin-bottom: 2.5rem; }
.cmd-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.cmd-section-header h3 { font-size: 0.9rem; }
.cmd-count {
  font-size: 0.65rem;
  font-family: monospace;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
}

.cmd-block { margin-bottom: 0.75rem; }
.cmd-label {
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.cmd-label.h2 { font-size: 0.65rem; color: var(--text-dim); margin-top: 0.5rem; }
pre.cmd {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.9rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.78rem;
  color: #d4d4d4;
  overflow-x: auto;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.cmd-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
  line-height: 1.5;
}
.cmd-url {
  font-size: 0.78rem;
  font-family: monospace;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  display: block;
  padding: 0.2rem 0;
  word-break: break-all;
}
.cmd-url:hover { color: var(--text); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-family: monospace;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  float: right;
  margin-top: -1.8rem;
  margin-right: 0.3rem;
  transition: color 0.1s;
}
.copy-btn:hover { color: var(--text-muted); }
.copy-btn.copied { color: #6b6b6b; }

/* ─── Section divider ─── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 4rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text-muted); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .platform-grid { grid-template-columns: 1fr; }
  .platform-card { border-right: none; border-bottom: 1px solid var(--border); }
  .phase-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .phase-content { padding: 1.5rem; }
  .chain-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.5rem; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
