/* ═══════════════════════════════════════════════════════════════
   RDB · Interactive CV — stylesheet (deploy build)
   Palette is STATIC. Dark mode = html[data-mode="dark"] (app.js flips it).
   ═══════════════════════════════════════════════════════════════ */

/* Locked palette · seed #B6E01F · analogous */
:root {
  --bg: #f7f8f2;
  --bg-2: #f1f3e8;
  --surface: #fdfdfc;
  --surface-2: #f6f8f0;
  --text: #242817;
  --text-dim: #747b5d;
  --border: #e9ecde;
  --accent: #b7e022;
  --accent-2: #5ae334;
  --accent-ink: #0b0d12;
  --accent-soft: rgba(183, 224, 34, 0.12);
  --shadow: rgba(94, 107, 46, 0.22);

  --max: 1180px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Sora', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* dark mode — html flips data-mode="dark" */
html[data-mode="dark"] {
  --bg: #1a1c11;
  --bg-2: #222517;
  --surface: #292c1d;
  --surface-2: #323622;
  --text: #eff0eb;
  --text-dim: #a2a791;
  --border: #434831;
  --accent: #c0ea2b;
  --accent-2: #67e544;
  --accent-ink: #0b0d12;
  --accent-soft: rgba(192, 234, 43, 0.18);
  --shadow: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ───────────────────────── Background layers ───────────────────── */
.bg-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.bg-grid {
  --sp: 46px;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--sp) - 1px),
      color-mix(in srgb, var(--accent) 14%, transparent) calc(var(--sp) - 1px) var(--sp)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--sp) - 1px),
      color-mix(in srgb, var(--accent) 14%, transparent) calc(var(--sp) - 1px) var(--sp));
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  opacity: .5;
  transform: perspective(700px) rotateX(34deg) scale(1.6) translateY(-6%);
  transform-origin: top center;
  animation: gridDrift 26s linear infinite;
}
@keyframes gridDrift { to { background-position: 0 var(--sp), var(--sp) 0; } }

.bg-glow {
  background:
    radial-gradient(40vw 40vw at 18% 12%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 60%),
    radial-gradient(36vw 36vw at 85% 30%, color-mix(in srgb, var(--accent-2) 32%, transparent), transparent 60%),
    radial-gradient(50vw 40vw at 60% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%);
  filter: blur(20px) saturate(1.1);
  opacity: .55;
  animation: glowFloat 18s ease-in-out infinite alternate;
}
@keyframes glowFloat {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.12); }
}

.bg-noise {
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed; top: 0; left: 0; width: 360px; height: 360px;
  border-radius: 50%; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
  transform: translate(-50%, -50%); transition: opacity .4s;
  mix-blend-mode: plus-lighter;
}
@media (pointer: fine) { body:hover .cursor-glow { opacity: 1; } }

/* ───────────────────────── Scroll progress ────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: color-mix(in srgb, var(--border) 60%, transparent);
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
}

/* ───────────────────────── Boot loader ────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center; transition: opacity .6s, visibility .6s;
}
.boot.gone { opacity: 0; visibility: hidden; }
.boot-log {
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  min-width: 280px; line-height: 1.9; margin: 0;
}
.boot-log b { color: var(--accent); }

/* ───────────────────────── Top bar ────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  font-weight: 800; font-size: 20px; letter-spacing: 1px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--text); background: var(--surface); cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
  transition: transform .15s var(--ease), border-color .2s, background .2s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ───────────────────────── Side rail ──────────────────────────── */
.rail {
  position: fixed; top: 50%; left: 18px; transform: translateY(-50%);
  z-index: 40;
}
.rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rail a {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px;
  color: var(--text-dim); font-size: 12px; letter-spacing: .4px;
  border-radius: 8px; opacity: .65; transition: all .25s var(--ease);
}
.rail a::before {
  content: ""; width: 16px; height: 2px; border-radius: 2px;
  background: currentColor; transition: width .25s var(--ease);
}
.rail a:hover { opacity: 1; text-decoration: none; }
.rail a.is-active { color: var(--accent); opacity: 1; font-weight: 600; }
.rail a.is-active::before { width: 30px; background: var(--accent); }
@media (max-width: 1100px) { .rail { display: none; } }

/* ───────────────────────── Layout / sections ──────────────────── */
main { max-width: var(--max); margin: 0 auto; padding: 96px clamp(20px, 5vw, 56px) 60px; }

.section { padding: 56px 0; position: relative; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.section-no {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px;
}
.section-title { font-size: clamp(26px, 4vw, 38px); font-weight: 700; margin: 0; }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ───────────────────────── Cards ──────────────────────────────── */
.card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 18px 50px -28px var(--shadow);
  backdrop-filter: blur(8px);
}

/* ───────────────────────── Hero ───────────────────────────────── */
.hero { padding-top: 24px; }
.hero-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
}
.ping {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
.hero-name { font-size: clamp(56px, 13vw, 130px); line-height: .92; margin: 0; font-weight: 800; letter-spacing: -2px; }
.reveal-word {
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 60%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: 200% 0; } }
.hero-role { font-size: clamp(18px, 3vw, 26px); font-weight: 500; color: var(--text-dim); margin: 10px 0 18px; min-height: 1.4em; }
.type { color: var(--text); }
.caret { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-lede { max-width: 54ch; font-size: 17px; color: var(--text-dim); }
.hero-lede strong { color: var(--text); }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 22px;
  border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .25s, background .25s; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-3px); }
.btn-solid { background: linear-gradient(120deg, var(--accent), var(--accent-2)); background-origin: border-box; color: var(--accent-ink); box-shadow: 0 14px 34px -14px var(--accent); }
.btn-line { background: transparent; border-color: var(--border); color: var(--text); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 0; padding: 0; }
@media (max-width: 560px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.hero-stats b { display: block; font-size: clamp(26px, 5vw, 38px); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12.5px; color: var(--text-dim); }

/* Hero card */
.hero-card { padding: 26px; display: grid; gap: 20px; }
.tilt { transition: transform .2s var(--ease); transform-style: preserve-3d; will-change: transform; }
.avatar { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto; }
.avatar-ini {
  font-weight: 800; font-size: 26px; letter-spacing: 1px; color: var(--accent-ink);
  width: 80px; height: 80px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.avatar-ring {
  position: absolute; inset: 0; border-radius: 30px;
  border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.vitals { margin: 0; display: grid; gap: 12px; }
.vitals div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.vitals dt { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin: 0; }
.vitals dd { margin: 0; font-size: 14px; text-align: right; }

.langs { display: grid; gap: 10px; }
.lang { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 10px; font-size: 13px; }
.lang i { height: 6px; border-radius: 6px; background: var(--bg-2); position: relative; overflow: hidden; }
.lang i::after {
  content: ""; position: absolute; inset: 0; width: var(--lvl, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1s var(--ease) .3s;
}
.lang b { font-family: var(--mono); font-size: 11px; color: var(--text-dim); text-align: right; }

/* ───────────────────────── Prose ──────────────────────────────── */
.prose { max-width: 70ch; font-size: 17px; color: var(--text-dim); }
.prose strong { color: var(--text); }

/* ───────────────────────── Timeline ───────────────────────────── */
.timeline { position: relative; }
.tl-item { position: relative; padding: 26px 28px; margin-left: 8px; }
.tl-marker {
  position: absolute; left: -9px; top: 32px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent);
}
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-head h3 { margin: 0; font-size: 21px; }
.tl-period { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.tl-org { margin: 4px 0 14px; color: var(--text-dim); font-size: 14px; }
.tl-body { margin: 0 0 12px; color: var(--text-dim); font-size: 15.5px; }
.tl-body strong { color: var(--text); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 0; }
.chips li {
  font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ───────────────────────── Skills ─────────────────────────────── */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.skill {
  padding: 22px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border); position: relative; overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s;
}
.skill:hover { transform: translateY(-4px); border-color: var(--accent); }
.skill::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120px 120px at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
}
.skill:hover::before { opacity: 1; }
.skill-ico { font-size: 22px; }
.skill h3 { margin: 10px 0 8px; font-size: 17px; }
.skill p { margin: 0; font-size: 14px; color: var(--text-dim); }

.stack { margin-top: 40px; }
.stack-title { font-size: 15px; color: var(--text-dim); font-family: var(--mono); font-weight: 500; margin-bottom: 16px; }
.stack-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.stack-cloud span {
  font-size: 14px; padding: 8px 14px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); cursor: default; transition: transform .15s var(--ease), color .2s, border-color .2s;
}
.stack-cloud span:hover { transform: translateY(-3px) scale(1.04); color: var(--accent); border-color: var(--accent); }

/* ───────────────────────── Contact ────────────────────────────── */
.contact-card { padding: 40px; text-align: center; display: grid; gap: 22px; place-items: center; }
.contact-lede { font-size: clamp(20px, 3vw, 28px); font-weight: 600; margin: 0; max-width: 24ch; }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim); font-family: var(--mono);
}

kbd {
  font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 2px 0 var(--border);
}

/* ═══════════════════════ Command palette ═══════════════════════ */
.cmdk { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-start; justify-content: center; padding-top: 14vh; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(8px); }
.cmdk.open { display: flex; }
.cmdk-panel { width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 40px 90px -40px var(--shadow); overflow: hidden; animation: pop .25s var(--ease); }
@keyframes pop { from { transform: translateY(-12px) scale(.98); opacity: 0; } }
.cmdk-input { width: 100%; border: none; outline: none; padding: 20px; font-size: 17px; font-family: var(--font); background: transparent; color: var(--text); border-bottom: 1px solid var(--border); }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.cmdk-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.cmdk-list li .k-ico { width: 24px; text-align: center; }
.cmdk-list li .k-hint { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.cmdk-list li.sel, .cmdk-list li:hover { background: var(--accent-soft); color: var(--accent); }

/* ═══════════════════════ Sheet / toast ════════════════════════ */
.sheet { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(8px); }
.sheet.open { display: grid; }
.sheet-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px 30px; min-width: 280px; }
.sheet-panel h3 { margin: 0 0 16px; }
.sheet-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sheet-panel li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sheet-panel li span { color: var(--text-dim); margin-left: auto; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; z-index: 95;
  transition: opacity .3s, transform .3s var(--ease); box-shadow: 0 20px 40px -20px var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .1s !important; }
}

@media print {
  .rail, .topbar, .scroll-progress, .bg-layer, .cursor-glow, .boot, .hero-cta, .contact-links { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding-top: 20px; }
}
