/* Design tokens match the IvzCyberSec portfolio */
:root {
  --bg: #050505;
  --surface: #090909;
  --surface-2: #0e0e0e;
  --fg: #d0d0d0;
  --hi: #f5f5f5;
  --mute: #929292;
  --line: #292929;
  --line-soft: #1f1f1f;
  --line-hover: #555;
  --ok: #6fcf97;
  --warn: #d9a441;
  --bad: #e5736b;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #555; color: #fff; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

a { color: #e5e5e5; text-underline-offset: 4px; transition: color .2s ease; }
a:hover { color: #fff; }

h1, h2, h3 { color: var(--hi); font-family: var(--display); }
h1, h2, h3, p, li, dd, dt { overflow-wrap: break-word; }
h2 { margin-bottom: 26px; font-size: clamp(28px, 3vw, 36px); font-weight: 600; line-height: 1.2; letter-spacing: -.035em; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.5; }
p { max-width: 72ch; }

code, .mono { font-family: var(--mono); font-size: .88em; }
p code, dd code, li code {
  padding: 1px 6px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--surface-2); color: #e8e8e8; overflow-wrap: anywhere;
}

.meta { color: var(--mute); font: 13px/1.8 var(--mono); }
.label { margin-bottom: 10px; color: var(--mute); font: 12px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───── Navigation ───── */
nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 22px;
  padding: 14px max(32px, calc((100% - 1100px) / 2 + 32px));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 14px;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; color: var(--hi); font: 600 20px var(--display); text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; flex-wrap: wrap; gap: 22px; }
.nav-links a { color: #aaa; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; }

/* ───── Layout ───── */
main { max-width: 1100px; margin: 0 auto; padding: 0 32px 72px; }
main > section { margin-top: 72px; padding-top: 30px; border-top: 1px solid var(--line); }

/* ───── Hero ───── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  align-items: center;
  gap: clamp(36px, 6vw, 76px);
  padding: 76px 0 58px;
}
.hero > * { min-width: 0; }
.hero h1 {
  margin-bottom: 22px;
  font-size: clamp(34px, 4.5vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.lede { color: #c4c4c4; font-size: 17.5px; line-height: 1.75; max-width: 60ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* A restrained file-list example, aligned to the right of the hero copy. */
.swap {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 430px;
  justify-self: end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.swap-folder {
  padding: 0 0 12px;
  color: var(--mute);
  font: 12px/1.5 var(--mono);
}
.swap-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  background: transparent;
}
.swap-row:last-child { border-bottom: 1px solid var(--line); }
.swap-tag {
  color: var(--mute);
  font: 11px/1.4 var(--mono);
}
.swap-detail { display: grid; gap: 5px; min-width: 0; }
.swap-url {
  color: #e5e5e5;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.swap-url b { color: #fff; font-weight: 600; }
.swap-note { color: var(--mute); font-size: 12.5px; line-height: 1.5; }
.swap-arrow {
  padding: 10px 0 10px 56px;
  color: var(--mute);
  font: 11.5px/1.5 var(--mono);
  text-align: left;
}
.swap-row.is-hit .swap-tag,
.swap-row.is-hit .swap-url { color: #f0f0f0; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 18px;
  border: 1px solid #393939; border-radius: 2px; background: #101010; color: #eee;
  font: inherit; font-size: 14px; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: #fff; background: #fff; color: #000; }
.btn.primary { border-color: #eee; background: #eee; color: #080808; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--mute); }
.btn.ghost:hover:not(:disabled) { border-color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ───── Issue ───── */
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.prose p + p { margin-top: 16px; }
.prose em { color: var(--hi); font-style: normal; }
.facts { border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.facts dt { color: var(--mute); font: 13px/1.8 var(--mono); }
.facts dd { color: #dedede; }

/* ───── Method ───── */
.steps { list-style: none; padding: 0; }
.steps li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 32px; padding: 26px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps h3 { margin-bottom: 8px; }
.steps p { color: #bdbdbd; }

/* ───── Catalogue ───── */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { margin-bottom: 0; }
.section-head .meta { margin-bottom: 0; }

.toolbar { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; }
.field { display: block; min-width: 0; position: relative; }
.field input, .field select, .adm input[type="password"] {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid #333; border-radius: 2px; background: #080808; color: #eee;
  font: inherit; font-size: 14.5px;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field input::placeholder { color: #777; }
.field input:focus, .field select:focus { border-color: #888; }

.result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 0; padding: 0 0 11px; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.text-action, .page-action {
  padding: 2px 0; border: 0; background: transparent; color: #b7cddd;
  font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.text-action:hover:not(:disabled), .page-action:hover:not(:disabled) { color: #fff; }
.text-action:disabled, .page-action:disabled { color: #666; cursor: default; text-decoration: none; }

.file-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.file-entry { padding: 15px 2px 14px; border-bottom: 1px solid var(--line-soft); }
.file-entry:hover { background: rgba(255,255,255,.018); }
.file-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.file-link { color: #b7cddd; font: 500 15px/1.5 var(--mono); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.file-link:hover { color: #fff; }
.file-link.is-plain { color: var(--fg); text-decoration: none; }
.file-dataset { color: var(--mute); font-size: 13.5px; }
.file-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 4px; color: var(--mute); font-size: 13px; line-height: 1.5; }
.file-secondary-link { color: #aebdca; text-decoration: underline; text-underline-offset: 3px; }
.file-secondary-link:hover { color: #fff; }
.file-unresolved { color: #aaa; }
.file-empty { padding: 28px 2px; color: var(--mute); border-bottom: 1px solid var(--line-soft); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.pagination[hidden] { display: none; }
.page-summary { color: var(--mute); font: 13px/1.6 var(--mono); }

/* ───── Notes ───── */
/* ───── Notes ───── */
.notes { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.notes li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); color: #bdbdbd; max-width: 80ch; }
.notes strong { color: var(--hi); font-weight: 600; }

/* ───── Footer & toast ───── */
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 1100px; margin: auto; padding: 32px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; }
footer a { color: var(--mute); }
footer a:hover { color: #fff; }
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: 320px;
  padding: 11px 16px; border: 1px solid #444; border-radius: 2px; background: #111; color: #eee; font-size: 14px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: none; }

/* ───── Admin ───── */
.adm { max-width: 860px; }
.adm .intro { padding: 64px 0 8px; }
.adm .intro h1 { margin-bottom: 14px; font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -.04em; line-height: 1.08; }
.card { margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.card h2 { margin-bottom: 18px; font-size: 26px; }
.card[hidden], [hidden] { display: none !important; }
.stack { display: grid; gap: 12px; max-width: 420px; }
.stack label { color: var(--mute); font: 12px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }

.dropzone { display: grid; justify-items: center; gap: 8px; margin: 22px 0; padding: 34px 20px; border: 1px dashed #4a4a4a; border-radius: 3px; background: var(--bg); text-align: center; transition: border-color .2s, background .2s; }
.dropzone.dragover { border-color: #fff; background: #0b0b0b; }
.dropzone strong { color: var(--hi); font: 600 18px var(--display); }
.upload-mark { color: var(--mute); font-size: 26px; line-height: 1; }

.help { margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 2px; background: var(--bg); }
.help h3 { margin-bottom: 8px; font-size: 15px; }
.help p { margin-top: 8px; color: #aaa; font-size: 14px; }
.help code.line { display: block; margin: 6px 0; padding: 8px 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; background: #080808; color: #ddd; white-space: nowrap; }

.report { margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); }
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-grid strong { display: block; color: var(--hi); font: 600 22px/1.2 var(--display); }
.report-grid span { color: var(--mute); font: 11.5px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.report ul { margin: 14px 0 0 18px; color: var(--warn); font-size: 13.5px; }
.preview { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 2px; }
.preview table { font-size: 12.5px; font-family: var(--mono); }
.preview th, .preview td { padding: 7px 10px; white-space: nowrap; }
.preview td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.message { min-height: 28px; margin-top: 14px; font-size: 14px; color: var(--mute); }
.message.success { color: var(--ok); }
.message.error { color: var(--bad); }
.current { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.current strong { color: var(--hi); font: 600 20px var(--display); }

/* ───── Responsive ───── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding: 50px 0 44px; }
  .swap { justify-self: start; max-width: 560px; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .format-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  nav { position: static; gap: 12px; padding: 13px 20px; }
  .brand { width: 100%; margin-bottom: 2px; }
  main { padding-right: 20px; padding-left: 20px; }
  main > section { margin-top: 54px; padding-top: 24px; }
  .steps li { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .facts div { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 20px; }

}

@media (max-width: 520px) {
  .toolbar { grid-template-columns: 1fr; }
  footer { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .btn:hover:not(:disabled) { transform: none; }
}
