/* pickaxe · r0n4ld.nl — Pickaxe Mountain dossier PWA */

:root {
  --bg: #0a0a14;
  --surface: #15151f;
  --surface-2: #1f1f2e;
  --card: #15151f;
  --border: #2a2a3a;
  --border-strong: #3a3a4d;
  --text: #f5f5fa;
  --text-muted: #9090a8;
  --text-dim: #6a6a80;
  --primary: #d97706;
  --primary-soft: #f59e0b33;
  --primary-hover: #f59e0b;
  --secondary: #a855f7;
  --secondary-soft: #a855f733;
  --danger: #ef4444;
  --success: #10b981;
  --highlight: #fbbf24;
  --highlight-soft: #fbbf2433;
  --tag-neutral: #6b7280;
  --tag-neutral-soft: #6b728033;
  --tag-west: #3b82f6;
  --tag-west-soft: #3b82f633;
  --tag-iran: #059669;
  --tag-iran-soft: #05966933;
  --tag-israel: #f59e0b;
  --tag-israel-soft: #f59e0b33;
  --tag-tech: #a855f7;
  --tag-tech-soft: #a855f733;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px -8px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px -16px rgba(0,0,0,0.6);
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  --topbar-h: 56px;
  --sidebar-w: 220px;
  --bottombar-h: 64px;
  --content-max: 1000px;
}

[data-theme="light"] {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-2: #efece4;
  --card: #ffffff;
  --border: #e3ddd0;
  --border-strong: #cdc6b6;
  --text: #1a1a2e;
  --text-muted: #5a5a6e;
  --text-dim: #8a8a9c;
  --primary: #b45309;
  --primary-soft: #f59e0b22;
  --primary-hover: #92400e;
  --secondary: #7c3aed;
  --secondary-soft: #a855f722;
  --highlight: #b45309;
  --highlight-soft: #f59e0b22;
  --shadow: 0 4px 24px -8px rgba(60,40,0,0.15);
  --shadow-lg: 0 16px 48px -16px rgba(60,40,0,0.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1200px 600px at 0% 0%, var(--primary-soft), transparent 60%),
    radial-gradient(ellipse 1000px 500px at 100% 100%, var(--secondary-soft), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
button { font: inherit; cursor: pointer; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip:focus { left: 0; }

mark {
  background: var(--highlight-soft);
  color: var(--highlight);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

code { font-family: var(--font-mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }

/* ── topbar ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.brand:hover { background: var(--surface); color: inherit; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
  box-shadow: inset 0 0 0 1px var(--border);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.clock {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--text-muted);
  padding: 4px 10px; border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }

/* ── layout ────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  height: calc(100vh - var(--topbar-h));
  position: sticky; top: var(--topbar-h);
  display: flex; flex-direction: column;
  background: color-mix(in oklab, var(--bg) 50%, transparent);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.12s;
}
.sidebar a:hover { background: var(--surface); color: var(--text); }
.sidebar a.is-active {
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  color: var(--text);
  border-left: 2px solid var(--primary);
  padding-left: 10px;
}
.sidebar-foot { padding: 8px 12px; color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }

.main {
  padding: 32px 32px calc(var(--bottombar-h) + 32px);
  max-width: var(--content-max);
  width: 100%;
}
.main:focus { outline: none; }

.page { display: flex; flex-direction: column; gap: 20px; animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
.lede { margin: 0; color: var(--text-muted); font-size: 15px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 4px;
  font-weight: 600;
}

/* ── card ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-link {
  background: none; border: none;
  color: var(--primary); font-size: 13px; font-weight: 500; padding: 0;
}
.card-link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ── hero ──────────────────────────────────────────────── */
.hero {
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--primary-soft) 70%, transparent), transparent 70%),
    linear-gradient(225deg, color-mix(in oklab, var(--secondary-soft) 70%, transparent), transparent 70%),
    var(--card);
  border: 1px solid var(--border-strong);
}
.hero h1 { font-size: 36px; line-height: 1.1; }
.hero-text { display: flex; flex-direction: column; gap: 6px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-mono); }
.kv .v { font-size: 14px; font-weight: 600; }

/* ── grids ─────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.span-2 { grid-column: span 2; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  transition: all 0.12s;
  text-align: center;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── tags (perspectief) ─────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.tag-neutral   { color: var(--tag-neutral);   background: var(--tag-neutral-soft);   border-color: var(--tag-neutral); }
.tag-west-int  { color: var(--tag-west);      background: var(--tag-west-soft);      border-color: var(--tag-west); }
.tag-pro-iran  { color: var(--tag-iran);      background: var(--tag-iran-soft);      border-color: var(--tag-iran); }
.tag-pro-israel{ color: var(--tag-israel);    background: var(--tag-israel-soft);    border-color: var(--tag-israel); }
.tag-technical { color: var(--tag-tech);      background: var(--tag-tech-soft);      border-color: var(--tag-tech); }

/* ── sources (mini + card) ─────────────────────────────── */
.source-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.source-mini-item a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  transition: background 0.12s;
  flex-wrap: wrap;
}
.source-mini-item a:hover { background: var(--surface-2); }
.source-mini .src-name { font-weight: 500; }
.source-mini .tag { font-size: 9px; padding: 2px 7px; }

.source-card { position: relative; overflow: hidden; }
.source-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: currentColor;
  opacity: 0.6;
}
.source-card.tag-neutral   { --accent: var(--tag-neutral); }
.source-card.tag-west-int  { --accent: var(--tag-west); }
.source-card.tag-pro-iran  { --accent: var(--tag-iran); }
.source-card.tag-pro-israel{ --accent: var(--tag-israel); }
.source-card.tag-technical { --accent: var(--tag-tech); }

.source-card .card-h { flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.source-card .card-h > div:first-child { flex: 1 1 180px; min-width: 0; }
.source-card .card-h .tag {
  white-space: normal;
  text-align: right;
  flex-shrink: 1;
  max-width: 100%;
  line-height: 1.35;
}

.tl-src {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
.tl-src a { color: var(--text-muted); }
.tl-src a:hover { color: var(--primary); }

/* ── timeline ──────────────────────────────────────────── */
.timeline {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.tl-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.tl-marker {
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 2px;
}
.tl-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.tl-body { display: flex; flex-direction: column; gap: 4px; }
.tl-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tl-event { font-size: 14px; line-height: 1.45; }

.timeline-mini {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.timeline-mini li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
}
.timeline-mini .tl-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
}

/* ── deflist (facts) ───────────────────────────────────── */
.deflist {
  margin: 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px 20px;
  font-size: 14px;
}
.deflist dt {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding-top: 2px;
}
.deflist dd { margin: 0; color: var(--text); }

/* ── search results ────────────────────────────────────── */
.search-results { display: flex; flex-direction: column; gap: 14px; }
.search-group { display: flex; flex-direction: column; gap: 8px; }
.search-group h3 { font-size: 14px; }
.search-group h3 a { color: var(--primary); font-weight: 600; }
.search-snippet {
  padding: 10px 14px;
  background: var(--surface);
  border-left: 2px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.suggest {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-right: 4px;
  margin-top: 4px;
  transition: all 0.12s;
}
.suggest:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ── tool ──────────────────────────────────────────────── */
.tool { display: flex; flex-direction: column; gap: 10px; }
.tool label { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-row label { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }

textarea, input[type="text"], input[type="number"], input[type="datetime-local"], select {
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  width: 100%;
}
textarea { resize: vertical; min-height: 44px; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ── checklist ─────────────────────────────────────────── */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.checklist li { padding: 4px 0; line-height: 1.5; }

/* ── bottombar ─────────────────────────────────────────── */
.bottombar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 15;
  height: var(--bottombar-h);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  align-items: center; justify-content: space-around;
}
.bottombar a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.bottombar a.is-active { color: var(--primary); background: var(--primary-soft); }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottombar { display: flex; }
  .main { padding: 20px 16px calc(var(--bottombar-h) + 24px); }
  h1 { font-size: 24px; }
  .hero h1 { font-size: 26px; }
  .span-2 { grid-column: span 1; }
  .clock { display: none; }
  .brand-sub { display: none; }
  .tl-item { grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; }
  .tl-num { width: 28px; height: 28px; font-size: 12px; }
  .timeline-mini li { grid-template-columns: 80px 1fr; gap: 8px; }
  .deflist { grid-template-columns: 1fr; gap: 4px 0; }
  .deflist dt { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
