/* Bankereum · base.css
 * Design tokens come straight from brand/README.md section 2.
 * Light page, Ethereum violet-blue, graphite + silver metal, one warm brass accent.
 */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-var.woff2') format('woff2-variations'),
       url('../assets/fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/plex-mono-600.woff2') format('woff2');
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
:root {
  --bg: #F6F7FB;
  --bg-2: #ECEFF8;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #FFFFFF;
  --line: rgba(20, 34, 80, .12);
  --line-2: rgba(20, 34, 80, .18);

  --ink: #131A2E;
  --ink-2: #3A4461;
  --ink-3: #5F6983;

  --eth: #627EEA;
  --eth-deep: #3B4FB8;
  --eth-soft: #8FA3F3;
  --eth-pale: #C7D1FA;
  --eth-wash: #EDF1FE;
  --eth-ink: #1D2768;

  --steel-900: #2A3250;
  --steel-800: #222942;
  --steel-600: #5E6887;
  --steel-400: #8E9AB8;
  --steel-300: #AAB4CB;
  --steel-100: #E3E7F0;
  --silver: #F2F4F9;
  --ink-surface: #121829;

  --brass: #E9A63E;
  --brass-light: #FFD48F;
  --brass-deep: #A86B1D;
  --brass-ink: #8A5A12;

  --up: #16A571;
  --up-ink: #0B7A51;
  --down: #E0484D;
  --down-ink: #C33338;

  --mesh:
    radial-gradient(760px 520px at 84% 6%, rgba(98, 126, 234, .30), transparent 64%),
    radial-gradient(640px 460px at 10% 104%, rgba(233, 166, 62, .17), transparent 62%),
    radial-gradient(900px 600px at 50% -30%, rgba(146, 166, 246, .18), transparent 70%);
  --btn: linear-gradient(180deg, #6F86ED, #3B4FB8);
  --rule: linear-gradient(90deg, #3B4FB8 0%, #627EEA 34%, #9FB1FB 56%, #E9A63E 92%);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 20px 44px -30px rgba(23, 34, 74, .45);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 34px 70px -40px rgba(23, 34, 74, .55);

  --f-display: 'Archivo', system-ui, -apple-system, sans-serif;
  --f-body: 'Archivo', system-ui, -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 24px;
  --maxw: 1200px;
  --header-h: 72px;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-weight: 420;
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* page atmosphere: mesh glow + fine grid, both masked at the edges */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before { background: var(--mesh); }
body::after {
  background-image:
    linear-gradient(to right, rgba(27, 42, 90, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 42, 90, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(1100px 760px at 50% 18%, #000 0%, rgba(0, 0, 0, .5) 52%, transparent 86%);
  mask-image: radial-gradient(1100px 760px at 50% 18%, #000 0%, rgba(0, 0, 0, .5) 52%, transparent 86%);
}

/* the 5px brand edge at the very top of the page */
#top-rule {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--rule);
  z-index: 60;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--ink);
  margin: 0;
  line-height: 1.16;
  letter-spacing: -0.018em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(34px, 5.2vw, 58px); letter-spacing: -0.028em; }
h2 { font-size: clamp(25px, 3.1vw, 36px); letter-spacing: -0.022em; }
h3 { font-size: clamp(18px, 1.8vw, 22px); }
h4 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--eth-deep);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 0 0 7px; }
li::marker { color: var(--eth); }

code, kbd {
  font-family: var(--f-mono);
  font-size: .88em;
  background: var(--eth-wash);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--eth-ink);
  word-break: break-word;
}

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 28px 0;
}

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--eth-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--eth-pale); color: var(--eth-ink); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--panel-solid);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ----------------------------------------------------------------- layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main {
  position: relative;
  z-index: 1;
  display: block;
  padding-top: calc(var(--header-h) + 34px);
  padding-bottom: 72px;
  min-height: 70vh;
}

section { position: relative; }

.section {
  padding: 56px 0;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.section--tint {
  background: linear-gradient(180deg, rgba(236, 239, 248, 0), rgba(236, 239, 248, .72) 18%, rgba(236, 239, 248, .72) 82%, rgba(236, 239, 248, 0));
}

.eyebrow {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
}
.eyebrow::before {
  content: '';
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--brass);
  flex: none;
}
.eyebrow--plain::before { display: none; }

.section-head { margin-bottom: 28px; max-width: 760px; }
.section-head p {
  color: var(--ink-2);
  font-size: 16.5px;
  margin-top: 10px;
}

.lede {
  font-size: clamp(16.5px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
}

/* text column for long-form pages */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 44px; }
.prose h3 { margin-top: 30px; margin-bottom: 8px; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 650; }

/* grids */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1020px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --gutter: 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 40px 0; }
}

/* ----------------------------------------------------------------- header */
.site-header {
  position: fixed;
  top: 13px;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}
.site-header .bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  padding: 0 10px 0 16px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 16px 34px -26px rgba(23, 34, 74, .5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
  border-radius: var(--r-pill);
  padding: 4px 6px 4px 2px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand > span:last-child { display: flex; flex-direction: column; justify-content: center; }
.brand .name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.012em;
  color: var(--ink);
  line-height: 1;
}
.brand .sub {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--ink-3);
  line-height: 1;
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 13px;
  border-radius: var(--r-pill);
  position: relative;
  white-space: nowrap;
}
.nav a:hover { background: rgba(98, 126, 234, .10); color: var(--eth-ink); text-decoration: none; }
.nav a[aria-current='page'] {
  color: var(--eth-ink);
  background: var(--eth-wash);
  font-weight: 600;
}
.nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--brass);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.nav .nav-social { display: inline-flex; align-items: center; gap: 8px; min-width: 40px; min-height: 44px; }
.nav-social svg, .footer-social svg { width: 16px; height: 16px; flex: none; }
.nav-social > span { display: none; }
@media (max-width: 1080px) { .nav-social > span { display: inline; } }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 1080px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header.open .nav {
    display: flex;
    position: absolute;
    top: 68px;
    left: var(--gutter);
    right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: var(--r);
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    pointer-events: auto;
  }
  .site-header.open .nav a { padding: 11px 14px; }
  .site-header.open .nav a[aria-current='page']::after { display: none; }
}
@media (max-width: 560px) {
  .brand .name { font-size: 17px; }
  .site-header .bar { padding-left: 12px; gap: 8px; }
}
@media (max-width: 360px) {
  .site-header .bar { padding-left: 8px; padding-right: 6px; gap: 4px; }
  .brand { gap: 5px; padding-right: 2px; }
  .brand img { width: 28px; height: 28px; }
  .brand .name { font-size: 15px; }
  .header-actions { gap: 4px; margin-left: auto; min-width: 0; flex: 0 1 auto; }
  .header-actions .wallet-btn { min-width: 0; max-width: 94px; padding-left: 8px; padding-right: 8px; }
  .wallet-btn > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { width: 36px; height: 36px; flex: none; }
}

/* ----------------------------------------------------------------- footer */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--ink-surface);
  color: #C2CAE0;
  padding: 46px 0 30px;
  margin-top: 40px;
}
.site-footer::before {
  content: '';
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rule);
  opacity: .9;
}
.site-footer a { color: var(--eth-soft); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 {
  color: #fff;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--steel-400);
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 14.5px; }
.footer-brand .lockup { width: 268px; max-width: 100%; height: auto; display: block; }
.footer-brand p { font-size: 14px; color: #93A0BE; margin-top: 16px; max-width: 34ch; }
.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: 4px;
  color: var(--eth-pale);
  font-size: 14px;
  font-weight: 500;
}
.footer-social:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 13px;
  color: #8894B2;
}
.footer-bottom .mono {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .site-header, .site-footer, .toast-stack { display: none; }
  body::before, body::after { display: none; }
}
