/* ============================================================
   Matte-black, technical. Single source of truth.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #0a0a0a;
  --bg-deep:   #060606;
  --surface:   #111111;
  --surface-2: #161616;
  --surface-3: #1c1c1c;

  /* Text */
  --ink:       #f5f5f5;
  --ink-soft:  #c8c8c8;
  --muted:     #7a7a7a;
  --dim:       #555555;

  /* Lines */
  --line:        #232323;
  --line-soft:   #1a1a1a;
  --line-strong: #2e2e2e;

  /* Accent (overridable) */
  --accent:     oklch(0.82 0.18 140);   /* phosphor green */
  --accent-dim: color-mix(in oklch, var(--accent) 22%, transparent);
  --accent-ink: #050505;

  --grid-color: rgba(255,255,255,0.025);
  --shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 18px 40px -24px rgba(0,0,0,0.8);
}

/* Accent palette options (Tweaks) */
[data-accent="green"]  { --accent: oklch(0.82 0.18 140); }
[data-accent="amber"]  { --accent: oklch(0.84 0.16 78);  }
[data-accent="cyan"]   { --accent: oklch(0.82 0.13 210); }
[data-accent="red"]    { --accent: oklch(0.70 0.20 25);  }
[data-accent="white"]  { --accent: oklch(0.96 0.005 0);  }

/* ------- Base ------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  font-feature-settings: 'tnum' on;
}

.serif {
  /* legacy class — now renders as JetBrains Mono for consistency with brand-name labels */
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.display-caps {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'tnum' on; }

/* Hairline grid backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 50%, transparent 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 600px at 50% -10%, color-mix(in oklch, var(--accent) 6%, transparent), transparent 60%);
}

/* ------- Page chrome ------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(20px, 5vw, 36px) 120px;
  position: relative;
  z-index: 1;
}

/* ------- Top status bar ------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  margin-bottom: 36px;
}
.topbar .left, .topbar .right { display: flex; gap: 14px; align-items: center; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: oklch(0.78 0.18 145);
  box-shadow: 0 0 0 3px oklch(0.78 0.18 145 / 0.22),
              0 0 12px oklch(0.78 0.18 145 / 0.6);
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.topbar a { color: var(--ink-soft); text-decoration: none; }
.topbar a:hover { color: var(--accent); }
.topbar .sep { color: var(--dim); }

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
}
.lang-btn {
  background: none; border: none; padding: 2px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease;
  line-height: 1;
}
.lang-btn:hover { color: var(--ink-soft); }
.lang-btn.lang-active { color: var(--accent); }
.lang-sep { color: var(--dim); }

/* ------- Hero ------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; margin-bottom: 22px; }
.avatar-wrap {
  width: 92px; height: 92px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 5px var(--line),
    0 0 24px -4px color-mix(in oklch, var(--accent) 30%, transparent);
}
.avatar-wrap image-slot { width: 100%; height: 100%; display: block; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero h1 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(30px, 5.5vw, 46px);
  line-height: 1;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  color: var(--ink);
  text-transform: uppercase;
}
.hero h1 em {
  color: var(--accent);
  font-weight: 700;
}
.handle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.handle a { color: var(--ink-soft); text-decoration: none; }
.handle a:hover { color: var(--accent); }
.handle .role {
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

.bio {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(14.5px, 1.8vw, 17px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 22px 0 26px;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.bio .tag { color: var(--accent); }

/* ------- Social row ------- */
.socials {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 36px;
}
.social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all .15s ease;
  position: relative;
  overflow: hidden;
}
.social::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  pointer-events: none;
}
.social svg { width: 15px; height: 15px; color: var(--ink-soft); }
.social:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, var(--surface));
}
.social:hover svg { color: var(--accent); }

/* ------- Section ------- */
.section { margin: 40px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.section-head::before {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 40px; height: 1px;
  background: var(--accent);
}
.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
}
.section-title .bracket { color: var(--accent); }
.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em;
}

/* ------- Link cards ------- */
.stack { display: flex; flex-direction: column; gap: 8px; }

.card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
  position: relative;
  isolation: isolate;
}
.card:hover {
  border-color: transparent;
  background: var(--surface-2);
}
.card:hover .card-arrow { transform: translate(2px, -2px); color: var(--accent); }

.card-icon {
  width: 42px; height: 42px;
  border-radius: 5px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  flex: none;
  overflow: hidden;
  position: relative;
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon img { width: 100%; height: 100%; object-fit: cover; }

.card-body { min-width: 0; }
.card-title {
  font-weight: 500; font-size: 14.5px;
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px;
  color: var(--ink);
}
.card-sub {
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-arrow {
  width: 16px; height: 16px;
  color: var(--dim);
  transition: transform .2s ease, color .2s ease;
  flex: none;
}

/* Apps cards — show the full description instead of truncating to one line */
.app-card { align-items: start; }
.app-card .card-icon { margin-top: 1px; }
.app-card .card-sub { white-space: normal; overflow: visible; }

/* Featured / hero card */
.featured {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--accent) 10%, var(--surface)), var(--surface) 60%);
  color: var(--ink);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 170px;
  transition: all .2s ease;
}
.featured::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in oklch, var(--accent) 28%, transparent), transparent 50%),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,0.012) 8px 9px);
  pointer-events: none;
}
.featured:hover { border-color: transparent; }
.featured .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.featured .eyebrow .est { color: var(--muted); }
.featured .feat-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(20px, 3.2vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  max-width: 26ch;
  color: var(--ink);
}
.featured .feat-sub {
  font-size: 13px; color: var(--ink-soft);
  max-width: 50ch; line-height: 1.55;
}
.featured .feat-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500;
  color: var(--accent);
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.featured-glyph {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: clamp(80px, 17vw, 130px);
  line-height: 1;
  color: color-mix(in oklch, var(--accent) 40%, transparent);
  letter-spacing: -0.04em;
  align-self: end;
  user-select: none;
  font-weight: 700;
}

/* Brand pair */
.brand-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 540px) { .brand-grid { grid-template-columns: 1fr; } }

.brand {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
  background: var(--surface);
  transition: all .2s ease;
  position: relative;
}
.brand:hover { border-color: var(--line-strong); background: var(--surface-2); }

.brand-art {
  height: 150px;
  display: grid; place-items: center;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg-deep);
}
.brand-art.plakton,
.brand-art.lionzen {
  background:
    radial-gradient(circle at 25% 75%, color-mix(in oklch, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(circle at 78% 25%, color-mix(in oklch, var(--accent) 5%, transparent), transparent 55%),
    #0c0c0c;
  position: relative;
}
.brand-art.lionzen::before {
  /* subtle capsule motif in corner */
  content: "";
  position: absolute;
  top: 14px; right: 16px;
  width: 22px; height: 7px;
  background: var(--accent);
  border-radius: 999px;
  opacity: 0.35;
  box-shadow:
    -6px 9px 0 -1px color-mix(in oklch, var(--accent) 30%, transparent),
    -15px 4px 0 -2px color-mix(in oklch, var(--accent) 18%, transparent);
}

/* Brand logos — most brand SVGs are dark on light; force white on dark */
.brand-logo {
  max-width: 70%;
  max-height: 68px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.92;
  transition: opacity .2s ease, transform .35s ease;
}
.brand-logo-lionzen { max-height: 76px; max-width: 62%; }
.brand-logo-plakton { max-height: 44px; max-width: 70%; }
.brand:hover .brand-logo { opacity: 1; transform: scale(1.03); }
.brand-mark {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 44px;
  letter-spacing: -0.025em;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  z-index: 1;
  position: relative;
}
.brand-mark::after {
  content: "®";
  font-size: 12px; vertical-align: super;
  font-style: normal;
  margin-left: 2px;
  color: var(--muted);
}
.brand-body {
  padding: 14px 16px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.brand-name {
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.brand-tag { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Offer badge */
.offer {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--accent) 28%, transparent);
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 500;
}
.offer.neutral {
  color: var(--ink-soft);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

/* Books strip */
.books-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.book-cat {
  display: block;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 14px 16px;
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.book-stack {
  display: flex;
  margin-bottom: 14px;
  height: 88px;
  position: relative;
}
.book-stack img {
  width: 60px; height: 88px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.6);
  transition: transform .25s ease;
}
.book-stack img:nth-child(1) { transform: rotate(-3deg) translateX(0); z-index: 3; }
.book-stack img:nth-child(2) { transform: rotate(1deg) translateX(-14px); z-index: 2; }
.book-stack img:nth-child(3) { transform: rotate(5deg) translateX(-28px); z-index: 1; }
.book-stack img:nth-child(4) { transform: rotate(-1deg) translateX(-42px); z-index: 0; opacity: 0.55; }

.book-cat-name {
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.book-cat-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Download tile */
.download {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--bg-deep);
  text-decoration: none; color: var(--ink);
  transition: all .2s ease;
}
.download:hover { border-style: solid; border-color: var(--accent); background: var(--surface); }
.download-thumb {
  width: 56px; height: 56px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  flex: none;
}
.download-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.download-glyph {
  width: 56px; height: 56px; border-radius: 5px;
  background: color-mix(in oklch, var(--accent) 12%, var(--surface));
  color: var(--accent);
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.05em;
  border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
}
.download-title { font-weight: 500; font-size: 14.5px; margin-bottom: 2px; color: var(--ink); }
.download-sub { font-size: 12px; color: var(--muted); }
.download-price {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.download-price em { font-style: normal; color: var(--accent); }

/* Now box */
.now {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  margin-bottom: 40px;
  position: relative;
}
.now-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--accent);
  padding: 3px 6px;
  border: 1px solid color-mix(in oklch, var(--accent) 32%, transparent);
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  border-radius: 3px;
  flex: none;
  font-weight: 500;
  align-self: center;
}
.now-text { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.now-text strong { color: var(--ink); font-weight: 500; }

/* Footer */
.foot {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.foot a {
  color: var(--ink-soft); text-decoration: none; transition: color .15s ease;
  position: relative; display: inline-block;
}
.foot a:hover { color: var(--accent); }
.foot a::after {
  content: '';
  position: absolute; left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.foot a:hover::after { transform: scaleX(1); }
.foot-links { display: flex; gap: 10px; align-items: center; }
.foot-sep { color: var(--dim); }
.foot-meta { display: flex; gap: 18px; }

/* ============================================================
   Cookie banner — fixed bottom-left, dismissible
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 16px; bottom: 16px; right: 16px;
  max-width: 460px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--accent) 30%, transparent),
    0 20px 50px -16px rgba(0,0,0,0.85);
  animation: cookieIn .45s cubic-bezier(.2,.7,.2,1);
}
@keyframes cookieIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cookie-banner-body { flex: 1; min-width: 0; }
.cookie-banner-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.cookie-banner-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cookie-banner-text a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  padding-bottom: 1px;
}
.cookie-banner-text a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.cookie-banner-btn {
  flex: none;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in oklch, var(--accent) 14%, var(--surface));
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all .15s ease;
}
.cookie-banner-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}
@media (max-width: 540px) {
  .cookie-banner { flex-direction: column; align-items: stretch; max-width: none; }
  .cookie-banner-btn { width: 100%; }
}

/* ---- Layout variants ---- */
[data-layout="compact"] .card { padding: 10px 14px; }
[data-layout="compact"] .card-icon { width: 36px; height: 36px; border-radius: 4px; }
[data-layout="compact"] .card-icon svg { width: 17px; height: 17px; }
[data-layout="compact"] .card-title { font-size: 13.5px; }
[data-layout="compact"] .section { margin: 32px 0; }
[data-layout="compact"] .stack { gap: 5px; }

[data-layout="airy"] .card { padding: 17px 20px; border-radius: 8px; }
[data-layout="airy"] .stack { gap: 12px; }
[data-layout="airy"] .section { margin: 52px 0; }

/* ---- Sans-only mode (no serif) ---- */
[data-display="sans"] .serif, [data-display="sans"] .hero h1, [data-display="sans"] .bio,
[data-display="sans"] .featured .feat-title, [data-display="sans"] .brand-mark,
[data-display="sans"] .download-price, [data-display="sans"] .featured-glyph {
  font-family: 'Geist', system-ui, sans-serif !important;
  font-style: normal !important;
}
[data-display="sans"] .hero h1 { font-weight: 700; letter-spacing: -0.035em; }
[data-display="sans"] .bio { font-weight: 400; }
[data-display="sans"] .featured .feat-title { font-weight: 600; letter-spacing: -0.025em; }
[data-display="sans"] .hero h1 em { font-style: normal; }
[data-display="sans"] .featured-glyph { font-weight: 700; }
[data-display="sans"] .brand-mark::after { vertical-align: top; }

/* responsive */
@media (max-width: 540px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .avatar-wrap { width: 76px; height: 76px; }
  .featured { grid-template-columns: 1fr; padding: 22px; min-height: 0; }
  .featured-glyph { display: none; }
  .topbar { font-size: 9.5px; padding: 8px 12px; }
  .topbar .hide-sm { display: none; }
  .topbar .left, .topbar .right { gap: 10px; }
  .book-stack { height: 76px; }
  .book-stack img { width: 52px; height: 76px; }
}

/* ============================================================
   Animations — bulletproof, no @property dependency
   ============================================================ */

/* ---- Hover: lift + glowing outer ring + sweep shimmer ---- */
.card, .featured, .brand, .social, .book-cat {
  transition: transform .25s cubic-bezier(.2,.7,.2,1),
              background .2s ease,
              box-shadow .25s ease,
              border-color .2s ease;
}
.card:hover,
.brand:hover,
.featured:hover,
.social:hover,
.book-cat:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklch, var(--accent) 70%, var(--line));
  background: color-mix(in oklch, var(--accent) 6%, var(--surface-2));
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--accent) 75%, transparent),
    0 14px 36px -10px color-mix(in oklch, var(--accent) 50%, transparent),
    0 0 28px -6px color-mix(in oklch, var(--accent) 70%, transparent);
}
.featured:hover {
  background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 18%, var(--surface)), var(--surface) 60%);
}

/* Sweep shimmer that runs across the card on hover. Linear-gradient
   translated via background-position — works in every browser. */
.card::after,
.featured::after,
.brand::after,
.social::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    transparent 0%,
    transparent 35%,
    color-mix(in oklch, var(--accent) 18%, transparent) 50%,
    transparent 65%,
    transparent 100%);
  background-size: 240% 100%;
  background-position: 110% 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  mix-blend-mode: screen;
  z-index: 1;
}
.card:hover::after,
.featured:hover::after,
.brand:hover::after,
.social:hover::after {
  opacity: 1;
  animation: sweep 2.2s ease-in-out infinite;
}
@keyframes sweep {
  0%   { background-position: 110% 0; }
  100% { background-position: -110% 0; }
}

/* ---- Book stack hover: spread + lift ---- */
.book-stack img {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.book-cat:hover .book-stack img:nth-child(1) { transform: rotate(-7deg) translate(0, -3px); box-shadow: 0 8px 18px -4px rgba(0,0,0,0.7); }
.book-cat:hover .book-stack img:nth-child(2) { transform: rotate(3deg)  translate(-4px, -3px); }
.book-cat:hover .book-stack img:nth-child(3) { transform: rotate(9deg)  translate(-14px, -4px); }
.book-cat:hover .book-stack img:nth-child(4) { transform: rotate(-3deg) translate(-30px, -2px); opacity: 0.85; }

/* ---- Entrance: fade-up sections on load ---- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.topbar, .hero, .bio, .socials, .section, .foot {
  opacity: 0;
  animation: riseIn 0.7s cubic-bezier(.2,.7,.2,1) forwards;
}
.topbar  { animation-delay: 0.05s; }
.hero    { animation-delay: 0.15s; }
.bio     { animation-delay: 0.25s; }
.socials { animation-delay: 0.32s; }
.section:nth-of-type(1) { animation-delay: 0.40s; }
.section:nth-of-type(2) { animation-delay: 0.48s; }
.section:nth-of-type(3) { animation-delay: 0.56s; }
.section:nth-of-type(4) { animation-delay: 0.64s; }
.foot    { animation-delay: 0.72s; }

/* ---- Avatar: scale + breathing glow (impossible to miss) ---- */
@keyframes avatarBreathe {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 4px var(--bg),
      0 0 0 5px var(--line),
      0 0 22px -4px color-mix(in oklch, var(--accent) 22%, transparent);
  }
  50% {
    transform: scale(1.03);
    box-shadow:
      0 0 0 4px var(--bg),
      0 0 0 5px var(--accent),
      0 0 44px 2px color-mix(in oklch, var(--accent) 70%, transparent);
  }
}
.avatar-wrap { animation: avatarBreathe 3.2s ease-in-out infinite; }

/* ---- Featured glyph: clear drift ---- */
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(4deg); }
}
.featured-glyph {
  animation: drift 4.5s ease-in-out infinite;
  transform-origin: center;
}

/* ---- Featured-card backdrop: drifting radial sheen ---- */
.featured::before {
  background:
    radial-gradient(circle at var(--cx, 90%) 10%, color-mix(in oklch, var(--accent) 30%, transparent), transparent 50%),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,0.012) 8px 9px);
  animation: featuredDrift 6s ease-in-out infinite;
}
@keyframes featuredDrift {
  0%, 100% { --cx: 92%; }
  50%      { --cx: 68%; }
}

/* ---- Icon nudge on hover ---- */
@keyframes iconNudge {
  0%, 100% { transform: translateY(0) rotate(0); }
  40%      { transform: translateY(-3px) rotate(-10deg); }
  70%      { transform: translateY(0) rotate(6deg); }
}
.social:hover svg,
.card:hover .card-icon svg {
  animation: iconNudge .55s ease;
  color: var(--accent);
}

/* ---- Book stack: ambient float (preserves rotations) ---- */
@keyframes bookFloat1 {
  0%, 100% { transform: rotate(-3deg) translate(0, 0); }
  50%      { transform: rotate(-3deg) translate(0, -5px); }
}
@keyframes bookFloat2 {
  0%, 100% { transform: rotate(1deg) translateX(-14px); }
  50%      { transform: rotate(1deg) translate(-14px, -5px); }
}
@keyframes bookFloat3 {
  0%, 100% { transform: rotate(5deg) translateX(-28px); }
  50%      { transform: rotate(5deg) translate(-28px, -5px); }
}
.book-stack img:nth-child(1) { animation: bookFloat1 4.2s ease-in-out infinite; }
.book-stack img:nth-child(2) { animation: bookFloat2 4.2s ease-in-out infinite -0.7s; }
.book-stack img:nth-child(3) { animation: bookFloat3 4.2s ease-in-out infinite -1.4s; }
.book-cat:hover .book-stack img { animation: none; }

/* ---- Grid slow drift (ambient backdrop) ---- */
@keyframes gridDrift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 56px 56px, 56px 56px; }
}
body::before {
  animation: gridDrift 40s linear infinite;
}

/* ---- Ambient: scanning beam down the page ---- */
.scan-beam {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.scan-beam::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 280px;
  top: -280px;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in oklch, var(--accent) 8%, transparent) 45%,
    color-mix(in oklch, var(--accent) 18%, transparent) 50%,
    color-mix(in oklch, var(--accent) 8%, transparent) 55%,
    transparent 100%);
  animation: scanBeam 8s linear infinite;
  filter: blur(2px);
  mix-blend-mode: screen;
}
@keyframes scanBeam {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(120vh); opacity: 0; }
}

/* ---- Section-head accent underline: scales in continuously ---- */
@keyframes accentSlide {
  0%   { transform: scaleX(0.6); transform-origin: left; }
  50%  { transform: scaleX(1); transform-origin: left; }
  100% { transform: scaleX(0.6); transform-origin: right; }
}
.section-head::before {
  animation: accentSlide 4s ease-in-out infinite;
}


/* ============================================================
   Books modal — opens on category click
   ============================================================ */
.books-modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(4,4,4,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: modalIn .25s ease;
  cursor: zoom-out;
}
@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.books-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 22px 24px 24px;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--accent) 30%, transparent),
    0 30px 80px -20px rgba(0,0,0,0.8),
    0 0 60px -20px color-mix(in oklch, var(--accent) 40%, transparent);
  animation: modalCardIn .35s cubic-bezier(.2,.7,.2,1);
  cursor: default;
}
@keyframes modalCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.books-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.books-modal-head::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 40px; height: 1px;
  background: var(--accent);
}
.books-modal-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.books-modal-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 700;
}
.books-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  flex: none;
  transition: all .15s ease;
  font-family: inherit;
}
.books-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(90deg);
}

.books-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.books-modal-item {
  display: block;
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  text-decoration: none;
  color: var(--ink);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease, border-color .2s ease;
}
.books-modal-item:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: var(--accent);
  box-shadow:
    0 10px 24px -8px rgba(0,0,0,0.85),
    0 0 0 1px color-mix(in oklch, var(--accent) 55%, transparent);
  z-index: 2;
}
.books-modal-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.books-modal-item-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 8px 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 50%, rgba(0,0,0,0.98) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
}
.books-modal-item:hover .books-modal-item-meta {
  opacity: 1;
  transform: translateY(0);
}
.books-modal-item-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: #fff;
  font-weight: 600;
  margin-bottom: 2px;
}
.books-modal-item-author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in oklch, var(--accent) 80%, white);
}
.books-modal-card { max-width: 720px; }
.books-modal-foot {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.books-modal-foot a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  transition: color .15s ease, border-color .15s ease;
}
.books-modal-foot a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 540px) {
  .books-modal { padding: 16px; }
  .books-modal-card { padding: 18px; max-height: 90vh; }
  .books-modal-title { font-size: 22px; }
  .books-modal-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
}

/* ============================================================
   Boot sequence overlay
   ============================================================ */
.boot-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: opacity .3s ease;
}
.boot-overlay--out { opacity: 0; pointer-events: none; }
.boot-lines {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(12px, 1.8vw, 14px);
  color: var(--muted);
  line-height: 2.2;
  padding: 0 clamp(20px, 5vw, 40px);
  max-width: 420px;
  width: 100%;
}
.boot-line {
  display: flex; align-items: center;
  white-space: pre; letter-spacing: 0.04em;
}
.boot-prompt { color: var(--accent); }
.boot-cursor {
  display: inline-block;
  width: 0.55em; height: 1em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: -0.15em;
  animation: bootCursorBlink .9s step-end infinite;
}
@keyframes bootCursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   Hero cursor — blinks after @pablopedrajas handle
   ============================================================ */
.handle a::after {
  content: '▋';
  margin-left: 2px;
  color: var(--accent);
  animation: cursorBlink 1.1s step-end infinite;
  font-style: normal;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   prefers-reduced-motion — disable all motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* Entrance stagger — show immediately */
  .topbar, .hero, .bio, .socials, .section, .foot {
    opacity: 1;
    animation: none;
  }
  /* Ambient pulse / breathe / drift */
  .dot            { animation: none; }
  .avatar-wrap    { animation: none; }
  .featured-glyph { animation: none; }
  .featured::before { animation: none; }
  body::before    { animation: none; }
  .scan-beam::before { animation: none; opacity: 0; }
  .section-head::before { animation: none; transform: scaleX(1); }
  /* Book ambient float */
  .book-stack img:nth-child(1) { animation: none; }
  .book-stack img:nth-child(2) { animation: none; }
  .book-stack img:nth-child(3) { animation: none; }
  /* Cookie / modal entrances */
  .cookie-banner   { animation: none; }
  .books-modal     { animation: none; }
  .books-modal-card { animation: none; }
  /* Hover: remove transforms, keep colour/border changes */
  .card, .featured, .brand, .social, .book-cat {
    transition: background .15s ease, border-color .15s ease;
  }
  .card:hover, .brand:hover, .featured:hover,
  .social:hover, .book-cat:hover {
    transform: none;
    box-shadow: none;
  }
  .card::after, .featured::after, .brand::after, .social::after { display: none; }
  .social:hover svg, .card:hover .card-icon svg { animation: none; }
  .card-arrow       { transition: color .15s ease; }
  .card:hover .card-arrow { transform: none; }
  /* Book hover spread */
  .book-cat:hover .book-stack img { animation: none; transform: none; }
  /* Brand logo */
  .brand-logo { transition: opacity .15s ease; }
  .brand:hover .brand-logo { transform: none; }
  /* Modal items */
  .books-modal-item { transition: border-color .15s ease; }
  .books-modal-item:hover { transform: none; }
  .books-modal-item-meta { transition: opacity .15s ease; transform: none !important; }
  .books-modal-close { transition: color .15s ease, border-color .15s ease; }
  .books-modal-close:hover { transform: none; }
  /* Cookie button */
  .cookie-banner-btn { transition: background .15s ease, color .15s ease; }
  .cookie-banner-btn:hover { transform: none; }
  /* Hero cursor — visible but static */
  .handle a::after { animation: none; opacity: 1; }
  /* Footer underline — instant reveal, no slide */
  .foot a::after { transition: none; }
  /* Boot cursor (safety, boot won't show under reduced-motion) */
  .boot-cursor { animation: none; }
}
