/* =====================================================================
   s0sta.com/DeFi-Hacks-Reproduce — the DeFi exploit archive
   Loaded after style.css (the theme of the profile), so the header,
   buttons, split headlines, form and footer look the same.
   This file only has the parts of the archive. The GitHub copy of the
   site (site/ folder) uses the same two files.
   ===================================================================== */

/* ---------- Colours of the root-cause classes ---------- */
[data-c] { --c: #aea8d8; }
[data-c="ac"] { --c: #8b5cf6; }
[data-c="op"] { --c: #22c3e6; }
[data-c="bl"] { --c: #5790ee; }
[data-c="tl"] { --c: #7176f2; }
[data-c="re"] { --c: #f2c14e; }
[data-c="kc"] { --c: #fb7185; }
[data-c="fl"] { --c: #2dd4bf; }
[data-c="rp"] { --c: #fb923c; }
[data-c="sv"] { --c: #f472b6; }
[data-c="iv"] { --c: #a3e635; }
[data-c="im"] { --c: #facc15; }
[data-c="br"] { --c: #38bdf8; }
[data-c="ar"] { --c: #fdba74; }
[data-c="rg"] { --c: #f87171; }
[data-c="gv"] { --c: #c084fc; }
[data-c="mv"] { --c: #67e8f9; }
[data-c="mc"] { --c: #94a3b8; }
[data-c="fw"] { --c: #e879f9; }
[data-c="dg"] { --c: #fda4af; }

/* ---------- Helpers (the same as on the Web3 page) ---------- */
.page-archive .lead { max-width: 54ch; }
.page-archive .btn { white-space: nowrap; }
.page-archive .btn .ic { width: 17px; height: 17px; }
.page-archive .section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.page-archive .section-head > div { display: grid; gap: 16px; min-width: 0; }
.pt-0 { padding-top: 0; }
.head-gap { margin-top: 16px; }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-d); }
.light .eyebrow { color: var(--muted-l); }
.page-archive code { font: 500 .9em var(--mono); color: #ddd2ff; overflow-wrap: anywhere; }
.page-archive .light code { color: var(--violet-2); }
.block-title { margin-bottom: 22px; }

/* ---------- Header ---------- */
.brand-tag { font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px 4px; border-radius: 7px; background: var(--ink); color: #fff; }
.nav-home { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--muted-l); white-space: nowrap; }
.nav-home:hover { color: var(--ink); background: rgba(22, 18, 58, .06); }
.nav-home .ic { width: 16px; height: 16px; transform: scaleX(-1); }
.page-archive .nav-links { gap: 0; }
.page-archive .nav-links a { padding-inline: 10px; font-size: 14px; }
.page-archive .nav-links a[aria-current="page"] { background: rgba(22, 18, 58, .08); }
.page-archive .mobile-menu nav a[aria-current="page"] { background: rgba(22, 18, 58, .07); }
@media (max-width: 1240px) { .page-archive .nav-home span { display: none; } }
@media (min-width: 1021px) and (max-width: 1180px) { .page-archive .nav-cta { display: none; } }
@media (max-width: 1100px) { .page-archive .nav-links a { padding-inline: 8px; } }
@media (max-width: 420px) { .page-archive .brand-tag { display: none; } }

/* ---------- Class label: a coloured dot and the name ---------- */
.cls { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 550; line-height: 1.25; white-space: nowrap; }
.cls i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px rgba(174, 168, 216, .16); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .cls i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 24%, transparent); }
}

/* ---------- Hero of the home page ---------- */
.arc-hero { padding-block: clamp(118px, 13vw, 164px) clamp(56px, 7vw, 96px); }
.arc-hero-copy { max-width: 900px; }
.arc-hero .hero-title { font-size: clamp(42px, 6.2vw, 92px); }
.arc-hero .hero-lede { max-width: 60ch; }
.arc-hero .pulse-dot { flex: none; }
.hero-title em { font-style: normal; background: linear-gradient(100deg, #b49bff 10%, #5fd6f0 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 14px clamp(22px, 3.4vw, 52px); margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line-d); }
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 4px; min-width: 0; }
.hero-stats dd { font: 300 clamp(30px, 3.2vw, 46px)/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hero-stats dt { font-size: 13.5px; color: var(--muted-d); }
@media (max-width: 640px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Timeline: every incident as a dot ---------- */
.tl {
  position: relative; margin-top: clamp(36px, 5vw, 56px); padding: clamp(16px, 2.4vw, 26px);
  border-radius: var(--r-l); background: rgba(24, 20, 60, .66); border: 1px solid var(--line-d);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tl-cap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; margin-bottom: 16px; }
.tl-title { font: 400 19px/1.3 var(--display); letter-spacing: -.01em; }
.tl-hint { font-size: 13.5px; color: var(--muted-d); }
.tl-box { position: relative; height: clamp(200px, 24vw, 290px); }
.tl-static { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; transition: opacity .5s ease; }
.tl-bars { display: block; width: 100%; height: 100%; }
.tl-col { fill: rgba(167, 139, 250, .38); }
.tl-years { list-style: none; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); text-align: center; font: 500 11.5px/1 var(--mono); color: var(--muted-d); }
.tl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .5s ease; touch-action: pan-y; }
.tl.is-live .tl-static { opacity: 0; }
.tl.is-live .tl-canvas { opacity: 1; cursor: crosshair; }
.tl.is-live .tl-canvas.is-on { cursor: pointer; }
.tl-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-d); }
.tl-legend a { color: var(--muted-d); text-decoration: none; transition: color .2s; }
.tl-legend a:hover { color: var(--text-d); }
.tl-tip {
  position: absolute; z-index: 4; left: 0; top: 0; transform: translate(-50%, calc(-100% - 14px));
  max-width: min(320px, 80vw); padding: 10px 13px; border-radius: 12px; pointer-events: none;
  background: rgba(15, 12, 38, .94); border: 1px solid rgba(196, 181, 253, .35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; line-height: 1.45; color: var(--muted-d); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
}
.tl-tip b { display: block; margin-bottom: 3px; font: 500 15px/1.3 var(--display); color: var(--text-d); }
.tl-tip .cls { font-size: 12.5px; color: var(--text-d); }
.tl-tip small { display: block; margin-top: 3px; font: 500 12px var(--mono); }
@media (max-width: 560px) {
  .tl-years li:nth-child(even) { visibility: hidden; }
  .tl-hint { font-size: 13px; }
}

/* ---------- Seven tools (bento) ---------- */
.tools { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.tool {
  grid-column: span 3; position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 214px;
  padding: clamp(20px, 2.2vw, 26px); border-radius: var(--r-l); background: #fff; border: 1px solid var(--line-l);
  color: var(--ink); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tool:hover { transform: translateY(-3px); border-color: rgba(22, 18, 58, .22); box-shadow: 0 26px 44px -30px rgba(22, 18, 58, .55); }
.tool:nth-child(n+6) { grid-column: span 6; min-height: 0; }
.tool-big {
  grid-column: span 6; grid-row: span 2; padding: clamp(24px, 3vw, 38px); border-color: transparent; color: #fff;
  background: radial-gradient(110% 120% at 100% 0%, rgba(124, 58, 237, .55), transparent 58%), radial-gradient(90% 90% at 0% 100%, rgba(8, 145, 178, .32), transparent 60%), var(--ink);
}
.tool-big:hover { box-shadow: 0 30px 60px -30px rgba(76, 29, 149, .8); }
.tool-ic { display: grid; place-items: center; width: 48px; height: 48px; padding: 11px; border-radius: 14px; background: rgba(124, 58, 237, .1); color: var(--violet-2); }
.tool-ic svg { display: block; width: 100%; height: 100%; }
.tool-big .tool-ic { width: 60px; height: 60px; padding: 14px; background: rgba(255, 255, 255, .1); color: #fff; }
.tool-title { margin-top: auto; padding-top: 10px; font: 400 21px/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.tool-big .tool-title { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.05; letter-spacing: -.035em; }
.tool-text { font-size: 15px; line-height: 1.5; color: var(--muted-l); max-width: 46ch; }
.tool-big .tool-text { font-size: 16.5px; color: rgba(239, 236, 255, .78); }
.tool-go {
  position: absolute; top: clamp(18px, 2vw, 24px); inset-inline-end: clamp(18px, 2vw, 24px);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-l);
  transition: background-color .2s, color .2s, border-color .2s;
}
.tool-go .ic { width: 16px; height: 16px; }
.tool:hover .tool-go { background: var(--ink); border-color: var(--ink); color: #fff; }
.tool-big .tool-go { border-color: rgba(255, 255, 255, .3); }
.tool-big:hover .tool-go { background: #fff; border-color: #fff; color: var(--ink); }
.tool:nth-child(n+6) .tool-title { margin-top: 6px; }
/* the small picture of the database in the big card */
.tool-mock { display: grid; gap: 6px; margin-top: 26px; max-width: 440px; padding: 12px; border-radius: 18px; background: rgba(10, 8, 29, .42); border: 1px solid rgba(196, 181, 253, .18); }
.tm-search { display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-bottom: 4px; border-radius: 11px; background: rgba(255, 255, 255, .07); font-size: 13.5px; color: rgba(239, 236, 255, .6); }
.tm-search .ic { width: 15px; height: 15px; }
.tm-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14px; }
.tm-row + .tm-row { border-top: 1px solid rgba(196, 181, 253, .1); border-radius: 0; }
.tm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-loss { font: 500 12.5px var(--mono); color: #fecdd3; }
@media (max-width: 560px) { .tool-mock { display: none; } }
@media (max-width: 1000px) {
  .tool, .tool:nth-child(n+6) { grid-column: span 6; min-height: 0; }
  .tool-big { grid-column: 1 / -1; grid-row: auto; min-height: 260px; }
}
@media (max-width: 560px) { .tool, .tool:nth-child(n+6) { grid-column: 1 / -1; } }

/* ---------- Incident cards ---------- */
.inc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.inc-grid-dark { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inc {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 18px 18px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line-l); color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.inc:hover { transform: translateY(-2px); border-color: rgba(22, 18, 58, .24); box-shadow: 0 22px 40px -28px rgba(22, 18, 58, .55); }
.inc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.inc-top .cls { white-space: normal; }
.inc-top .inc-date { margin-top: 1px; }
.inc-date { flex: none; font: 500 12.5px/1.2 var(--mono); color: var(--muted-l); white-space: nowrap; }
.inc-title { font: 400 19.5px/1.2 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.inc-title a { color: inherit; text-decoration: none; }
.inc-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 20px; }
.inc-title a:focus-visible { outline: none; }
.inc-title a:focus-visible::after { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.inc-text { font-size: 14.5px; line-height: 1.55; color: var(--muted-l); display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.inc-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inc-meta span, .m-chip { font: 500 12px/1 var(--mono); padding: 6px 9px 5px; border-radius: 999px; background: rgba(22, 18, 58, .06); white-space: nowrap; }
.inc-meta .inc-loss { background: rgba(251, 113, 133, .14); color: #be123c; }
.inc-meta .inc-deep { background: var(--ink); color: #fff; }
.inc-dark { background: var(--night-2); border-color: var(--line-d); color: var(--text-d); }
.inc-dark:hover { border-color: var(--line-d2); box-shadow: 0 24px 44px -28px rgba(0, 0, 0, .8); }
.inc-dark .inc-date, .inc-dark .inc-text { color: var(--muted-d); }
.inc-dark .inc-meta span { background: rgba(255, 255, 255, .07); }
.inc-dark .inc-meta .inc-loss { background: rgba(251, 113, 133, .16); color: #fecdd3; }
.inc-dark .inc-meta .inc-deep { background: rgba(196, 181, 253, .2); color: #ede9fe; }
.inc-dark .inc-title a:focus-visible::after { outline-color: var(--lilac); }
.inc.is-in { animation: inc-in .35s ease both; }
@keyframes inc-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1120px) { .inc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .inc-grid, .inc-grid-dark { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .inc-grid, .inc-grid-dark { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Incident of the week ---------- */
.week {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(22px, 4vw, 56px);
  padding: clamp(24px, 4vw, 52px); border-radius: var(--r-l); border: 1px solid var(--line-d2);
  background: radial-gradient(120% 140% at 100% 0%, rgba(124, 58, 237, .34), transparent 55%), radial-gradient(80% 90% at 0% 100%, rgba(8, 145, 178, .18), transparent 60%), var(--night-2);
}
.week-copy { display: grid; gap: 16px; align-content: start; justify-items: start; min-width: 0; }
.week-title { font: 300 clamp(34px, 4.6vw, 64px)/1.02 var(--display); letter-spacing: -.045em; overflow-wrap: anywhere; }
.week-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.week-badges .cls { color: var(--text-d); }
.week-badges .inc-date, .week-badges .inc-chain { font: 500 12.5px var(--mono); color: var(--muted-d); }
.week-text { color: var(--muted-d); max-width: 64ch; }
.week-copy .btn { margin-top: 6px; }
.week-num { display: grid; align-content: center; gap: 8px; padding: clamp(20px, 2.6vw, 30px); border-radius: 22px; background: rgba(10, 8, 29, .55); border: 1px solid var(--line-d); min-width: 0; }
.week-label { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-d); }
.week-label + .week-loss { margin-bottom: 18px; }
.week-loss { font: 200 clamp(56px, 7vw, 108px)/.92 var(--display); letter-spacing: -.055em; background: linear-gradient(120deg, #fda4af, #f2c14e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.week-lesson { font-size: 15px; line-height: 1.55; color: var(--text-d); opacity: .88; }
@media (max-width: 900px) { .week { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Work with me ---------- */
.arc-work {
  background:
    radial-gradient(75% 55% at 0% 62%, rgba(124, 58, 237, .22), transparent 100%),
    radial-gradient(60% 50% at 100% 100%, rgba(8, 145, 178, .2), transparent 60%),
    var(--night);
}
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.work-copy { min-width: 0; }
.offers { list-style: none; padding: 0; margin-top: 30px; display: grid; gap: 10px; }
.offer { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line-d); background: rgba(255, 255, 255, .03); transition: border-color .2s; }
.offer:hover { border-color: var(--line-d2); }
.offer-ic { width: 44px; height: 44px; padding: 11px; border-radius: 12px; background: rgba(167, 139, 250, .15); color: var(--lilac); }
.offer-copy { min-width: 0; }
.offer-title { font: 500 17px/1.3 var(--display); }
.offer-text { margin-top: 2px; font-size: 14.5px; color: var(--muted-d); }
.offer .chip-btn { white-space: nowrap; }
.work-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 14.5px; color: var(--muted-d); }
.work-note .ic { margin-top: 3px; color: var(--cyan); }
.arc-work .form-card { scroll-margin-top: 100px; }
.work-static { justify-items: start; }
.work-static .lead { margin-bottom: 6px; }
@media (max-width: 900px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .offer { grid-template-columns: 40px minmax(0, 1fr); }
  .offer-ic { width: 40px; height: 40px; padding: 10px; }
  .offer .chip-btn { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- Head of the inner pages ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding-block: clamp(132px, 14vw, 180px) clamp(52px, 6vw, 84px);
  background:
    radial-gradient(55% 90% at 0% 0%, rgba(124, 58, 237, .3), transparent 62%),
    radial-gradient(45% 80% at 100% 100%, rgba(8, 145, 178, .22), transparent 62%),
    var(--night);
}
.page-title { margin-block: 20px 18px; max-width: 22ch; font: 300 clamp(40px, 5.6vw, 80px)/1.02 var(--display); letter-spacing: -.045em; text-wrap: balance; overflow-wrap: break-word; }
.page-hero .lead { max-width: 62ch; }
.page-hero + .section { padding-top: clamp(40px, 5vw, 68px); }

/* ---------- Database: search and filters ---------- */
.db-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 300px; min-width: 0; }
.search input {
  width: 100%; padding: 12px 14px 12px 42px; border-radius: 14px; border: 1px solid var(--line-l); background: #fff; color: var(--ink);
  font: 400 15.5px/1.4 var(--body); transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: #8a84ad; }
.search input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-l); pointer-events: none; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(22, 18, 58, .06); }
.seg button {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--muted-l); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(22, 18, 58, .16); }
.seg b { font: 600 11.5px/1 var(--mono); padding: 4px 6px; border-radius: 999px; background: rgba(22, 18, 58, .07); }
.seg button[aria-pressed="true"] b { background: var(--ink); color: #fff; }
.sel { display: inline-flex; min-width: 0; }
.sel select {
  appearance: none; -webkit-appearance: none; max-width: 100%; padding: 11px 38px 11px 14px; border-radius: 14px;
  border: 1px solid var(--line-l); background-color: #fff; color: var(--ink); font: 500 14.5px/1.4 var(--body); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2357507f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.sel select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.page-arc-database .chips { gap: 6px; margin-bottom: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 7px 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-l); background: #fff; color: var(--ink); transition: background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.chip:hover { border-color: rgba(22, 18, 58, .3); }
.chip b { font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: 999px; background: rgba(22, 18, 58, .07); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] b { background: rgba(255, 255, 255, .16); }
.chip[aria-pressed="true"] .cls i { box-shadow: 0 0 0 3px rgba(255, 255, 255, .18); }
.chip.is-zero { opacity: .45; }
.db-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; margin-bottom: 14px; }
.db-count { font-size: 14px; color: var(--muted-l); }
.db-reset {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-l); background: transparent; color: var(--ink); font-size: 13.5px; font-weight: 500;
}
.db-reset:hover { border-color: var(--ink); }
.db-reset .ic { width: 14px; height: 14px; }
.db-empty { padding: 48px 20px; border-radius: 24px; border: 1px dashed rgba(22, 18, 58, .25); text-align: center; color: var(--muted-l); }
.db-more { display: flex; justify-content: center; margin-top: 30px; }
@media (max-width: 700px) {
  .search { flex-basis: 100%; }
  .seg { flex: 1 1 100%; flex-wrap: nowrap; }
  .seg button { flex: 1 1 auto; justify-content: center; gap: 6px; padding-inline: 8px; font-size: 13.5px; white-space: nowrap; }
  .sel { flex: 1 1 calc(50% - 5px); }
  .sel select { width: 100%; }
  /* the class chips scroll sideways on phones */
  .page-arc-database .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .page-arc-database .chip { flex: none; }
}
@media (max-width: 374px) {
  .seg { flex-wrap: wrap; }
  .seg button:last-child { flex-basis: 100%; }
}

/* ---------- Bars (SVG, so no inline styles are needed) ---------- */
.bar { display: block; width: 100%; height: 8px; overflow: visible; }
.bar-bg { fill: rgba(22, 18, 58, .08); }
.bar-fill { fill: var(--c, var(--violet)); }

/* ---------- Intelligence ---------- */
.intel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.intel { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 22px 20px 20px; border-radius: 22px; background: #fff; border: 1px solid var(--line-l); overflow: hidden; }
.intel::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.intel-head .cls { font-size: 14px; }
.intel-num { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.intel-num b { font: 300 46px/1 var(--display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.intel-num span { font-size: 13.5px; color: var(--muted-l); }
.intel-usd { min-height: 1.5em; font-size: 14px; color: var(--muted-l); }
.intel-usd b { font: 500 15px var(--mono); color: var(--ink); }
.intel-top { list-style: none; padding: 0; border-top: 1px solid var(--line-l); }
.intel-top li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--line-l); font-size: 14.5px; }
.intel-top a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.intel-top a:hover { text-decoration: underline; }
.intel-top span { flex: none; font: 500 12.5px var(--mono); color: var(--muted-l); }
.intel-go { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding-top: 6px; font-weight: 600; font-size: 14.5px; text-decoration: none; border-bottom: 1.5px solid currentColor; }
.intel-go .ic { width: 15px; height: 15px; }
@media (max-width: 1000px) { .intel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .intel-grid { grid-template-columns: minmax(0, 1fr); } }

/* heat map: class x year */
.heat-wrap { overflow-x: auto; padding: 10px; border-radius: 22px; background: var(--night-2); border: 1px solid var(--line-d); -webkit-overflow-scrolling: touch; }
.heat { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 4px; }
.heat thead th { padding: 6px 2px 8px; font: 500 12px/1 var(--mono); color: var(--muted-d); text-align: center; }
.heat tbody th { position: sticky; left: 0; z-index: 1; width: 1%; padding-inline: 8px 16px; background: var(--night-2); text-align: start; font-weight: 400; white-space: nowrap; }
.heat td { padding: 0; }
.heat-c { display: grid; place-items: center; height: 34px; border-radius: 9px; font: 500 12.5px var(--mono); color: #fff; text-decoration: none; transition: transform .15s ease; }
a.heat-c:hover { transform: scale(1.08); outline: 2px solid var(--lilac); outline-offset: 1px; }
.heat-c.q0 { background: rgba(255, 255, 255, .03); }
.heat-c.q1 { background: rgba(124, 58, 237, .22); color: #ddd2ff; }
.heat-c.q2 { background: rgba(124, 58, 237, .42); }
.heat-c.q3 { background: rgba(124, 58, 237, .68); }
.heat-c.q4 { background: linear-gradient(135deg, #7c3aed, #5163ef); }
.heat-c.q5 { background: linear-gradient(135deg, #7c3aed, #22c3e6); box-shadow: 0 8px 20px -10px rgba(34, 195, 230, .9); }

/* ---------- Checklists and patterns ---------- */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 30px; padding: 5px; border-radius: 18px; background: rgba(22, 18, 58, .06); }
.cat-tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 13px;
  color: var(--muted-l); font-size: 14.5px; font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s;
}
.cat-tabs a:hover { color: var(--ink); }
.cat-tabs a[aria-selected="true"] { background: var(--ink); color: #fff; }
.cat-tabs b { font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: 999px; background: rgba(22, 18, 58, .08); }
.cat-tabs a[aria-selected="true"] b { background: rgba(255, 255, 255, .16); }
.cat { scroll-margin-top: 110px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 8px; }
.chip-light { border-color: var(--line-l); color: var(--ink); }
.chip-light:hover { border-color: var(--violet-2); background: rgba(124, 58, 237, .06); }
.chip-light.is-done { border-color: #059669; color: #047857; }
.pat { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding-block: 26px; border-top: 1px solid var(--line-l); }
.pat-num { font: 200 38px/1 var(--display); letter-spacing: -.05em; color: var(--violet-2); font-variant-numeric: tabular-nums; }
.pat-body { display: grid; gap: 12px; min-width: 0; align-content: start; }
.pat-title { font: 400 clamp(21px, 2vw, 26px)/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.pat-why { color: var(--muted-l); max-width: 80ch; }
.pat-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; }
.pat-ex span { margin-inline-end: 4px; font: 600 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted-l); }
.pat-ex a { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-l); background: #fff; text-decoration: none; transition: border-color .2s; }
.pat-ex a:hover { border-color: var(--violet-2); }
.pat-label { margin-top: 4px; font: 600 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-l); }
.checks { list-style: none; padding: 0; display: grid; gap: 6px; }
.checks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: #0f0c26; }
.page-archive .checks code { font: 500 13px/1.6 var(--mono); color: #ddd2ff; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid rgba(196, 181, 253, .24); background: transparent; color: #cfc6ff; cursor: pointer; transition: border-color .2s, color .2s; }
.copy:hover { border-color: var(--lilac); color: #fff; }
.copy .ic { width: 16px; height: 16px; }
.copy .ic-done, .copy.is-done .ic-copy { display: none; }
.copy.is-done { border-color: var(--ok); color: var(--ok); }
.copy.is-done .ic-done { display: block; }
.pats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pat-card { grid-template-columns: 52px minmax(0, 1fr); padding: clamp(20px, 2.4vw, 28px); border: 1px solid var(--line-l); border-radius: 22px; background: #fff; }
.pat-def { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(52, 211, 153, .12); font-size: 14.5px; }
.pat-def span { min-width: 0; overflow-wrap: anywhere; }
.pat-title, .pat-why { overflow-wrap: break-word; }
.pat-def .ic { margin-top: 2px; color: #059669; }
@media (max-width: 900px) { .pats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .pat, .pat-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pat-num { font-size: 30px; }
  .cat-tabs a { flex: 1 1 auto; justify-content: space-between; }
}

/* ---------- Analytics ---------- */
.sums { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.sum { display: grid; gap: 8px; align-content: start; min-width: 0; padding: clamp(20px, 2.6vw, 28px); border-radius: var(--r-l); background: #fff; border: 1px solid var(--line-l); color: var(--ink); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; }
.sum:hover { transform: translateY(-2px); box-shadow: 0 24px 40px -30px rgba(22, 18, 58, .55); }
.sum-dark { border-color: transparent; color: #fff; background: radial-gradient(110% 130% at 100% 0%, rgba(124, 58, 237, .55), transparent 58%), var(--ink); }
.sum-label { font-size: 14px; color: var(--muted-l); }
.sum-dark .sum-label, .sum-dark .sum-note { color: rgba(239, 236, 255, .76); }
.sum-num { font: 300 clamp(34px, 4vw, 62px)/1.05 var(--display); letter-spacing: -.045em; overflow-wrap: break-word; }
.sum-note { font-size: 13.5px; color: var(--muted-l); }
.chart { min-width: 0; padding: clamp(20px, 2.6vw, 30px); border-radius: var(--r-l); background: #fff; border: 1px solid var(--line-l); }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: clamp(4px, 1.2vw, 16px); height: 280px; }
.col { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; min-width: 0; text-decoration: none; text-align: center; }
.col-plot { display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; padding-top: 26px; }
.col-val { margin-bottom: 6px; font: 500 13px var(--mono); color: var(--muted-l); }
.col-bar { display: block; min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #7c3aed, #0891b2); transition: opacity .2s; }
.col:hover .col-bar { opacity: .82; }
.col:hover .col-val { color: var(--ink); }
.col-label { font: 500 12.5px var(--mono); color: var(--muted-l); }
.cb-1 { height: 2%; } .cb-2 { height: 4%; } .cb-3 { height: 6%; } .cb-4 { height: 8%; } .cb-5 { height: 10%; } .cb-6 { height: 12%; } .cb-7 { height: 14%; } .cb-8 { height: 16%; } .cb-9 { height: 18%; } .cb-10 { height: 20%; } .cb-11 { height: 22%; } .cb-12 { height: 24%; } .cb-13 { height: 26%; } .cb-14 { height: 28%; } .cb-15 { height: 30%; } .cb-16 { height: 32%; } .cb-17 { height: 34%; } .cb-18 { height: 36%; } .cb-19 { height: 38%; } .cb-20 { height: 40%; } .cb-21 { height: 42%; } .cb-22 { height: 44%; } .cb-23 { height: 46%; } .cb-24 { height: 48%; } .cb-25 { height: 50%; } .cb-26 { height: 52%; } .cb-27 { height: 54%; } .cb-28 { height: 56%; } .cb-29 { height: 58%; } .cb-30 { height: 60%; } .cb-31 { height: 62%; } .cb-32 { height: 64%; } .cb-33 { height: 66%; } .cb-34 { height: 68%; } .cb-35 { height: 70%; } .cb-36 { height: 72%; } .cb-37 { height: 74%; } .cb-38 { height: 76%; } .cb-39 { height: 78%; } .cb-40 { height: 80%; } .cb-41 { height: 82%; } .cb-42 { height: 84%; } .cb-43 { height: 86%; } .cb-44 { height: 88%; } .cb-45 { height: 90%; } .cb-46 { height: 92%; } .cb-47 { height: 94%; } .cb-48 { height: 96%; } .cb-49 { height: 98%; } .cb-50 { height: 100%; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-top: 14px; }
.bars { list-style: none; padding: 0; display: grid; gap: 2px; }
.bars a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "r l v" ". b b"; align-items: center; gap: 6px 10px; padding: 8px; border-radius: 12px; text-decoration: none; transition: background-color .2s; }
.bars a:hover { background: rgba(22, 18, 58, .04); }
.b-rank { grid-area: r; font: 500 12px var(--mono); color: var(--muted-l); }
.b-label { grid-area: l; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 500; }
.b-val { grid-area: v; font: 500 13.5px var(--mono); }
.bars .bar { grid-area: b; }
.chart-note { margin-top: 18px; max-width: 84ch; font-size: 13.5px; color: var(--muted-l); }
@media (max-width: 860px) { .sums { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .cols { height: 230px; gap: 4px; }
  .col-label, .col-val { font-size: 10px; letter-spacing: -.02em; }
  .col-bar { border-radius: 5px 5px 2px 2px; }
}

/* ---------- Methodology ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 14px; }
.step-item { display: grid; grid-template-columns: clamp(58px, 7vw, 100px) minmax(0, 1fr); gap: clamp(12px, 3vw, 36px); padding: clamp(22px, 3vw, 36px); border-radius: var(--r-l); background: #fff; border: 1px solid var(--line-l); }
.step-n { font: 200 clamp(40px, 5vw, 66px)/.9 var(--display); letter-spacing: -.055em; background: linear-gradient(160deg, #7c3aed, #0891b2); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.step-body { min-width: 0; }
.step-h { margin-bottom: 18px; font: 400 clamp(22px, 2.4vw, 31px)/1.15 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.step-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.step-grid dt { margin-bottom: 6px; font: 600 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--violet-2); }
.step-grid dd { font-size: 15.5px; line-height: 1.6; color: #3d3768; }
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.principle { display: grid; align-content: start; gap: 10px; padding: 24px 22px; border-radius: 22px; background: var(--night-2); border: 1px solid var(--line-d); }
.principle-n { font: 500 13px var(--mono); color: var(--lilac); }
.principle h3 { font: 400 21px/1.2 var(--display); letter-spacing: -.015em; }
.principle p { font-size: 15px; color: var(--muted-d); }
@media (max-width: 1000px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .step-item { grid-template-columns: minmax(0, 1fr); }
  .step-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .principles { grid-template-columns: minmax(0, 1fr); } }

/* ---------- About ---------- */
.page-arc-about .about-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, .65fr); }
.about-main { display: grid; gap: 30px; min-width: 0; }
.about-main .block-title { margin-bottom: 0; }
.hows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.how { display: grid; align-content: start; gap: 8px; padding: 22px 20px; border-radius: 20px; background: #fff; border: 1px solid var(--line-l); }
.how-n { font: 500 12.5px var(--mono); color: var(--violet-2); }
.how h3 { font: 400 20px/1.2 var(--display); letter-spacing: -.015em; }
.how p { font-size: 15px; color: var(--muted-l); }
.data-card { display: grid; justify-items: start; gap: 14px; padding: clamp(22px, 3vw, 34px); border-radius: var(--r-l); color: #fff; background: radial-gradient(110% 130% at 100% 0%, rgba(124, 58, 237, .5), transparent 58%), var(--ink); }
.data-card p { max-width: 64ch; color: rgba(239, 236, 255, .82); }
.page-archive .data-card code { color: #ddd2ff; }
.data-sync { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.data-sync .ic { color: var(--ok); }
.data-card .btn-ink { background: #fff; color: var(--ink); }
.data-card .btn-ink:hover { background: var(--paper); }
.me-card { position: sticky; top: 112px; display: grid; justify-items: start; gap: 10px; padding: 26px 24px; border-radius: var(--r-l); background: #fff; border: 1px solid var(--line-l); }
.me-photo { width: 116px; height: 145px; margin-bottom: 8px; border-radius: 20px; object-fit: cover; background: var(--night-2); }
.me-name { font: 400 24px/1.2 var(--display); letter-spacing: -.02em; }
.me-text { font-size: 15px; color: var(--muted-l); }
.me-card .card-link { margin-top: 8px; }
@media (max-width: 900px) {
  .page-arc-about .about-grid { grid-template-columns: minmax(0, 1fr); }
  .hows { grid-template-columns: minmax(0, 1fr); }
  .me-card { position: static; }
}

/* ---------- The incident window ---------- */
html.is-modal { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 24, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: m-fade .2s ease; }
.modal-card {
  position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(100%, 800px); max-height: min(90vh, 940px); max-height: min(90dvh, 940px);
  border-radius: 26px; background: var(--night-2); border: 1px solid var(--line-d2); color: var(--text-d);
  box-shadow: 0 50px 110px -30px rgba(0, 0, 0, .85); overflow: hidden; animation: m-up .25s ease;
}
.modal-card:focus { outline: none; }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-d2); background: rgba(15, 12, 38, .6); color: var(--text-d); cursor: pointer; transition: border-color .2s; }
.modal-x:hover { border-color: var(--lilac); }
.modal-x .ic { width: 18px; height: 18px; }
.modal-head { padding: clamp(22px, 3vw, 34px) clamp(22px, 3.4vw, 40px) 20px; border-bottom: 1px solid var(--line-d); background: radial-gradient(90% 140% at 100% 0%, rgba(124, 58, 237, .22), transparent 60%); }
.modal-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-inline-end: 48px; }
.modal-badges .cls { color: var(--text-d); margin-inline-end: 4px; }
.m-chip { background: rgba(255, 255, 255, .07); color: var(--muted-d); }
.m-chip.m-loss { background: rgba(251, 113, 133, .16); color: #fecdd3; }
.m-chip.m-deep { background: rgba(196, 181, 253, .2); color: #ede9fe; }
.modal-title { margin-top: 14px; font: 300 clamp(28px, 3.8vw, 46px)/1.04 var(--display); letter-spacing: -.035em; overflow-wrap: anywhere; }
.modal-sub { margin-top: 8px; font: 500 12.5px var(--mono); color: var(--muted-d); overflow-wrap: anywhere; }
.modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 24px clamp(22px, 3.4vw, 40px) 28px; }
.modal-body h3 { margin: 24px 0 8px; font: 600 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lilac); }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { font-size: 16px; line-height: 1.7; color: #dcd7f8; overflow-wrap: break-word; }
.modal-body .m-raw { font: 500 13px/1.6 var(--mono); color: var(--muted-d); }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px clamp(22px, 3.4vw, 40px); border-top: 1px solid var(--line-d); background: rgba(10, 8, 29, .35); }
@keyframes m-fade { from { opacity: 0; } }
@keyframes m-up { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (max-width: 600px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Split headlines: a bit smaller, the lines are long ---------- */
.page-archive .split { font-size: clamp(38px, 8.2vw, 116px); }

/* ---------- Footer ---------- */
.page-archive .footer-note { max-width: 62ch; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .inc.is-in, .modal, .modal-card { animation: none; }
}
