
/* ── Theme Variables ── */
:root {
  --bg: #0b0d0e;
  --bg2: #151718;
  --card: rgba(22, 24, 26, 0.85);
  --fg: #e6edf3;
  --muted: #7d8590;
  --border: rgba(48, 54, 61, 0.6);
  --accent: #f0883e;
  --accent2: #d96f1f;
  --red: #f85149;
  --green: #3fb950;
  --blue: #58a6ff;
  --yellow: #d29922;
  --radius: 12px;
  --maxw: 900px;
  --nav-bg: rgba(11,13,14,.92);
  --badge-bg: rgba(248,81,73,.15);
  --badge-fg: #f85149;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg2: #eaeef2;
  --card: rgba(255,255,255,.85);
  --fg: #1f2328;
  --muted: #656d76;
  --border: rgba(208,215,222,.8);
  --accent: #c2410c;
  --accent2: #9a3412;
  --red: #cf222e;
  --green: #1a7f37;
  --blue: #0969da;
  --yellow: #9a6700;
  --nav-bg: rgba(246,248,250,.94);
  --badge-bg: rgba(207,34,46,.1);
  --badge-fg: #cf222e;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-width: none; }
body { -ms-overflow-style: none; }
body::-webkit-scrollbar { display: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Nav ── */
nav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
nav .inner { display: flex; align-items: center; gap: 8px; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; height: 52px; flex-wrap: nowrap; }
nav .logo { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }
nav .links { display: flex; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0; }
nav .links a { padding: 6px 10px; font-size: .8rem; border-radius: 6px; color: var(--muted); white-space: nowrap; transition: .15s; flex-shrink: 0; text-decoration: none; }
nav .links a:hover { color: var(--fg); background: var(--bg2); text-decoration: none; }
nav .badge { font-size: .68rem; font-weight: 700; background: var(--badge-bg); color: var(--badge-fg); padding: 3px 10px; border-radius: 20px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .5px; }

/* Theme toggle */
.theme-toggle { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .15s; }
.theme-toggle:hover { color: var(--fg); background: var(--bg2); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Hamburger */
.nav-toggle { display: none; flex-direction: column; gap: 4px; cursor: pointer; background: none; border: none; padding: 8px; margin-right: 4px; flex-shrink: 0; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--fg); border-radius: 2px; transition: .2s; }

/* ── Layout ── */
section { padding: 48px 16px; max-width: var(--maxw); margin: 0 auto; }
section h2 { font-size: 1.55rem; font-weight: 700; margin-bottom: 4px; }
section h2 .sub { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.card p { font-size: .92rem; color: var(--muted); margin-bottom: 8px; }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-top: 6px; }
.tag-critical { background: rgba(248,81,73,.15); color: var(--red); }
.tag-high { background: rgba(210,153,34,.15); color: var(--yellow); }
.tag-medium { background: rgba(88,166,255,.15); color: var(--blue); }
.tag-low { background: rgba(139,148,158,.15); color: var(--muted); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 32px 0; max-width: var(--maxw); }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px; text-align: center; }
.stat-card .num { font-size: 1.6rem; font-weight: 800; color: var(--fg); }
.stat-card .label { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* Hero */
.hero { text-align: center; padding: 64px 16px 32px; max-width: var(--maxw); margin: 0 auto; }
.hero .date-badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 4px 14px; border-radius: 20px; background: rgba(248,81,73,.12); color: var(--red); margin-bottom: 16px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero h1 span { display: inline-block; background: linear-gradient(135deg, var(--accent), var(--red)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero .subtitle { font-size: 1.1rem; color: var(--muted); max-width: 680px; margin: 0 auto 24px; line-height: 1.6; }
.hero .cta { display: inline-block; padding: 12px 28px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; font-size: .95rem; text-decoration: none; transition: .15s; }
.hero .cta:hover { background: var(--accent2); text-decoration: none; }

/* Grids */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Search */
.search-box { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box input { flex: 1; min-width: 200px; padding: 12px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; color: var(--fg); font-size: 1rem; }
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box button { padding: 12px 24px; background: var(--accent); border: none; border-radius: 8px; color: #fff; font-weight: 600; cursor: pointer; }
.search-box button:hover { background: var(--accent2); }
.search-results { margin-top: 8px; }
.search-result { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-result .ifsc { font-family: monospace; color: var(--accent); font-weight: 600; }
.search-result .branch-info { flex: 1; }
.search-result .status { font-size: .8rem; font-weight: 600; }
.status-impacted { color: var(--red); }
.status-unknown { color: var(--muted); }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 24px 20px; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; }
.tl-breach::before { background: var(--red); }
.tl-disclosure::before { background: var(--accent); }
.tl-intel::before { background: var(--blue); }
.tl-threat::before { background: var(--yellow); }
.tl-evidence::before { background: var(--green); }
.tl-response::before { background: var(--accent); }
.tl-item .date { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tl-item .title { font-weight: 600; margin: 2px 0; }
.tl-item .desc { font-size: .88rem; color: var(--muted); }

/* Exposure grid */
.exposure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.exp-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.exp-card .icon { font-size: 1.5rem; margin-bottom: 8px; }
.exp-card h4 { font-size: .9rem; }
.exp-card .count { font-size: .75rem; color: var(--muted); }
.exp-card .file-count { font-size: 1.2rem; font-weight: 700; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 16px; text-align: center; color: var(--muted); font-size: .8rem; }
footer a { color: var(--accent); }

/* Filter */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn { padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px; background: transparent; color: var(--muted); font-size: .8rem; cursor: pointer; transition: .15s; }
.filter-btn:hover, .filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(240,136,62,.1); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .88rem; }
.alert-red { background: rgba(248,81,73,.1); border: 1px solid rgba(248,81,73,.3); color: var(--red); }
.alert-yellow { background: rgba(210,153,34,.1); border: 1px solid rgba(210,153,34,.3); color: var(--yellow); }
.alert-green { background: rgba(63,185,80,.1); border: 1px solid rgba(63,185,80,.3); color: var(--green); }

.anchor { scroll-margin-top: 64px; }

/* Consumer guide checklist */
.checklist { list-style: none; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.checklist li::before { content: '☐'; color: var(--accent); font-weight: 700; font-size: 1.1rem; }

/* Sections nav */
.section-nav { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; max-width: var(--maxw); padding: 0 16px; margin-left: auto; margin-right: auto; }
.section-nav a { padding: 10px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--muted); font-size: .88rem; }
.section-nav a:hover { border-color: var(--accent); color: var(--accent); }

.not-found { text-align: center; padding: 60px 16px; }
.not-found h2 { font-size: 3rem; margin-bottom: 8px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  nav .links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--nav-bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; gap: 4px; backdrop-filter: blur(12px); }
  nav .links.open { display: flex; }
  nav .links a { width: 100%; padding: 12px 8px; white-space: normal; }
  nav .inner { position: relative; padding: 0 12px; }
  nav .badge { margin-left: auto; }
  .hero { min-height: auto; padding: 48px 16px; }
  .hero h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .hero .subtitle { font-size: .95rem; }
  .hero .cta { display: block; width: 100%; text-align: center; }
  .hero .cta + .cta { margin-left: 0 !important; margin-top: 10px; }
  section { padding: 32px 16px; }
  section h2 { font-size: 1.25rem; }
  .stats { grid-template-columns: repeat(2, 1fr); max-width: 100%; gap: 8px; }
  .stat-card { padding: 12px 8px; }
  .stat-card .num { font-size: 1.2rem; }
  .exposure-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .exp-card { padding: 12px; }
  .exp-card .icon { font-size: 1.2rem; margin-bottom: 4px; }
  .exp-card h4 { font-size: .8rem; }
  .exp-card .file-count { font-size: 1rem; }
  .section-nav { flex-wrap: wrap; gap: 6px; }
  .section-nav a { font-size: .8rem; padding: 8px 14px; }
  .filter-bar { flex-wrap: wrap; gap: 6px; }
  .filter-btn { padding: 8px 12px; font-size: .75rem; min-height: 36px; }
  .card { padding: 16px; }
  .card h3 { font-size: 1rem; }
  .search-box input { min-width: 140px; font-size: 16px; padding: 12px; }
  .search-box button { padding: 12px 16px; font-size: .9rem; min-height: 44px; min-width: 44px; }
  .search-result { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 0; }
  .timeline { padding-left: 20px; }
  .tl-item { padding: 0 0 20px 16px; }
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .checklist li { font-size: .9rem; padding: 10px 0; }
  .grid2 { grid-template-columns: 1fr; }
  [style*="grid-template-columns:repeat(auto-fill,minmax(140px"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="font-family:monospace"] { font-size: .72rem; word-break: break-all; }
}
@media (max-width: 480px) {
  nav .inner { padding: 8px 12px; }
  nav a { font-size: .8rem; padding: 8px; }
  .exposure-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 32px 12px; }
  section { padding: 24px 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .search-box { flex-direction: column; }
  .search-box input { width: 100%; min-width: 0; }
  .search-box button { width: 100%; }
}

button, a, .filter-btn, .section-nav a, nav a { min-height: 44px; display: inline-flex; align-items: center; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }


/* ── About Page ── */
.about-section { max-width: 720px; margin: 0 auto; padding: 48px 16px; }
.about-section h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 24px; }
.about-section h2 { font-size: 1.3rem; font-weight: 700; margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.about-section p { color: var(--muted); line-height: 1.7; margin-bottom: 16px; font-size: .95rem; }
.about-section ul { padding-left: 20px; color: var(--muted); margin-bottom: 16px; }
.about-section ul li { margin-bottom: 8px; }
.about-section strong { color: var(--fg); }

/* ── Search Hero ── */
.search-hero { text-align: center; padding: 80px 16px 40px; max-width: var(--maxw); margin: 0 auto; }
.search-hero h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; margin-bottom: 8px; }
.search-hero .subtitle { color: var(--muted); margin-bottom: 32px; font-size: 1rem; }
.search-hero .search-box { max-width: 600px; margin: 0 auto; }

/* ── Page title area on static pages ── */
.page-header { text-align: center; padding: 64px 16px 32px; max-width: var(--maxw); margin: 0 auto; }
.page-header h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; }
.page-header .sub { color: var(--muted); font-size: 1rem; margin-top: 8px; }

/* ── Active nav link on static pages ── */
nav .links a.active-page { color: var(--fg); background: var(--bg2); }

/* ── Disclaimer banner (on every page) ── */
.disclaimer-banner { background: var(--card); border-bottom: 1px solid var(--border); padding: 16px; font-size: .92rem; line-height: 1.7; color: var(--muted); }
.disclaimer-banner .inner { max-width: var(--maxw); margin: 0 auto; display: flex; gap: 12px; align-items: flex-start; }
.disclaimer-banner .icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 3px; }
.disclaimer-banner strong { color: var(--fg); }

/* ── Risk guide grid ── */
.risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .risk-grid { grid-template-columns: 1fr; } }
.risk-card { padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.risk-card h4 { font-size: .9rem; margin-bottom: 4px; }

/* ── Search results on search page ── */
.search-stats { font-size: .85rem; color: var(--muted); margin-top: 12px; }

/* ── Extra responsive tweaks ── */
@media (max-width: 768px) {
  .about-section { padding: 32px 16px; }
  .about-section h1 { font-size: 1.4rem; }
  .search-hero { padding: 56px 16px 32px; }
  .page-header { padding: 48px 16px 24px; }
}

/* Landing page grid */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid3 { grid-template-columns: 1fr; } }

/* ── Collapsible disclosure banner ── */
.disclosure {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  line-height: 1.6;
  color: var(--muted);
}
.disclosure summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  max-width: var(--maxw);
  margin: 0 auto;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.disclosure summary::-webkit-details-marker,
.disclosure summary::marker {
  display: none;
  content: "";
}
.disclosure summary .d-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
}
.disclosure summary strong {
  color: var(--fg);
  font-size: .85rem;
  white-space: nowrap;
}
.disclosure summary .d-toggle {
  margin-left: auto;
  font-size: .7rem;
  transition: transform .2s;
  color: var(--muted);
  flex-shrink: 0;
}
.disclosure[open] summary .d-toggle {
  transform: rotate(180deg);
}
.disclosure-body {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 14px;
  font-size: .85rem;
  line-height: 1.7;
}
.disclosure-body p { margin-bottom: 10px; }
.disclosure-body p:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
  .disclosure summary { padding: 8px 12px; }
  .disclosure summary strong { font-size: .78rem; white-space: normal; }
  .disclosure-body { padding: 0 12px 12px; font-size: .8rem; }
}
