/* ============ THEME TOKENS — DOJO ============ */
:root {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --bg-card: #171717;
  --fg: #f5f5f5;
  --fg-muted: #8a8a8a;
  --accent: #e11d2e;
  --accent-hi: #ff3344;
  --accent-soft: #2a0808;
  --border: #242424;
  --code-bg: #000000;
  --code-fg: #e6e6e6;
  --table-head: #1a1a1a;
  --link: #ff4d5c;
  --radius: 10px;
  --max: 1080px;
}
[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f0f0f0;
  --bg-card: #ffffff;
  --fg: #111111;
  --fg-muted: #666666;
  --accent: #c1121f;
  --accent-hi: #e11d2e;
  --accent-soft: #fff0f0;
  --border: #e0e0e0;
  --code-bg: #111111;
  --code-fg: #f0f0f0;
  --table-head: #fff0f0;
  --link: #c1121f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  transition: background 0.25s, color 0.25s;
}
a { color: var(--link); text-decoration: none; font-weight: 600; transition: color 0.15s; }
a:hover { color: var(--accent-hi); text-decoration: underline; }
img { max-width: 100%; height: auto; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 0 0 8px 0;
  font-weight: 800; z-index: 10000;
}
.skip-link:focus { left: 0; }
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .site-header { background: rgba(250,250,250,0.85); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--fg);
  font-size: 1.05em;
  white-space: nowrap;
  text-decoration: none;
}
.brand span { color: var(--accent-hi); }
.brand:hover { text-decoration: none; color: var(--fg); }
.nav-links {
  display: flex; gap: 2px;
  list-style: none; margin: 0; padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--fg-muted);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.88em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--fg); background: var(--bg-alt); text-decoration: none; }
.nav-links a.active { color: var(--accent-hi); background: var(--accent-soft); }
.nav-spacer { flex: 1; }
.kbd-hint {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-alt); color: var(--fg-muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; font-size: 12px;
  font-family: inherit; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.kbd-hint:hover { color: var(--fg); border-color: var(--accent); }
.kbd-hint kbd {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
  font-size: 11px; font-family: inherit;
}
.theme-toggle {
  background: var(--accent); color: #fff;
  border: 2px solid var(--accent); border-radius: 999px;
  padding: 8px 16px; font-size: 12px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(225,29,46,0.35);
  transition: all 0.15s;
  font-family: inherit;
}
.theme-toggle:hover {
  background: var(--accent-hi); border-color: var(--accent-hi);
  box-shadow: 0 0 24px rgba(255,51,68,0.55);
  transform: translateY(-1px);
}
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 24px 100px;
}
main.wide { max-width: 100%; padding: 0; }
h1, h2, h3, h4 { letter-spacing: -0.3px; }
h1 {
  font-size: clamp(2.1em, 5vw, 3.2em);
  font-weight: 900;
  line-height: 1.1;
  border-bottom: 4px solid var(--accent);
  padding-bottom: 14px;
  margin: 0 0 0.6em;
}
h2 {
  font-size: 1.7em;
  font-weight: 900;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 10px;
  margin: 2em 0 0.8em;
}
h3 {
  font-size: 1.15em;
  font-weight: 800;
  color: var(--accent-hi);
  margin: 1.6em 0 0.5em;
}
h4 {
  font-size: 0.9em;
  font-weight: 800;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 1.4em 0 0.4em;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(225,29,46,0.35);
  transition: all 0.15s;
  font-family: inherit;
  text-align: center;
}
.btn:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  box-shadow: 0 0 28px rgba(255,51,68,0.55);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--accent-hi) !important;
  box-shadow: none;
}
.btn-ghost:hover { background: var(--accent-soft); }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin-top: 0; }
.card .card-foot { margin-top: auto; padding-top: 14px; }
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-hi);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.badge-muted {
  background: var(--bg-alt);
  color: var(--fg-muted);
  border-color: var(--border);
}
code {
  background: var(--bg-alt);
  color: var(--accent-hi);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.9em;
}
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 18px 22px;
  border-radius: 6px;
  border-left: 4px solid var(--accent);
  overflow-x: auto;
  font-size: 0.86em;
  line-height: 1.55;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  position: relative;
}
pre code { background: none; color: inherit; padding: 0; }
pre:hover .copy-btn { opacity: 1; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 4px;
  padding: 4px 10px; font-size: 11px; font-weight: 700;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
  font-family: inherit;
}
.copy-btn:hover { background: var(--accent-hi); }
.copy-btn.copied { background: #28c840; }
blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  margin: 1.5em 0;
  padding: 14px 20px;
  color: var(--fg-muted);
  border-radius: 0 6px 6px 0;
  font-style: italic;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.6em 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}
th, td { border-bottom: 1px solid var(--border); padding: 14px 16px; text-align: left; }
th {
  background: var(--table-head);
  color: var(--accent-hi);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 1.2px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }
.grid { display: grid; gap: 18px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.muted { color: var(--fg-muted); }
.center { text-align: center; }
.divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 60px 0;
  border: none;
}
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 24px 30px;
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}
@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-inner h4 {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-hi);
  margin: 0 0 10px;
}
.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner li { margin: 6px 0; font-size: 0.9em; }
.footer-inner a { color: var(--fg-muted); font-weight: 500; }
.footer-inner a:hover { color: var(--accent-hi); }
.footer-bottom {
  max-width: var(--max);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85em;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
.progress-bar {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  z-index: 200;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent);
}
.palette-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
}
.palette-overlay.open { display: flex; }
.palette {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}
.palette input {
  width: 100%; padding: 18px 20px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
  color: var(--fg); font-size: 16px;
  font-family: inherit; outline: none;
}
.palette input::placeholder { color: var(--fg-muted); }
.palette-list {
  list-style: none; margin: 0; padding: 8px;
  max-height: 50vh; overflow-y: auto;
}
.palette-list li {
  padding: 10px 14px; border-radius: 6px;
  cursor: pointer; font-size: 0.9em;
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--fg);
}
.palette-list li:hover, .palette-list li.selected {
  background: var(--accent-soft); color: var(--accent-hi);
}
.palette-list li .hint { color: var(--fg-muted); font-size: 0.85em; }
.palette-list li.selected .hint { color: var(--accent-hi); }
.palette-list .empty { padding: 20px; text-align: center; color: var(--fg-muted); font-size: 0.9em; }
.palette-footer {
  border-top: 1px solid var(--border);
  padding: 10px 16px; font-size: 11px;
  color: var(--fg-muted); display: flex; gap: 16px;
}
.palette-footer kbd {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-family: inherit;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.chip {
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--fg-muted); padding: 8px 16px;
  border-radius: 999px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.chip:hover { color: var(--fg); border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.skill-row {
  display: grid; grid-template-columns: 1fr 100px;
  gap: 12px; align-items: center; margin: 14px 0;
}
.skill-row .name { font-size: 0.92em; }
.skill-bar {
  height: 6px; background: var(--bg-alt);
  border-radius: 999px; overflow: hidden;
}
.skill-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  border-radius: 999px; width: 0%;
  transition: width 1s ease;
}
.timeline { position: relative; padding-left: 32px; margin: 30px 0; }
.timeline::before {
  content: "";
  position: absolute; left: 10px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-item::before {
  content: "";
  position: absolute; left: -27px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-item time {
  color: var(--accent-hi); font-size: 0.85em;
  font-weight: 800; letter-spacing: 0.5px;
}
@media print {
  .site-header, .site-footer, .theme-toggle, .kbd-hint,
  #ninja, .no-print, .palette-overlay, .progress-bar { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  main { padding: 0; max-width: 100%; }
  h1, h2 { border-color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover { transform: none; }
  .btn:hover { transform: none; }
  #ninja { display: none !important; }
  .skill-bar span { transition: none; }
  .theme-toggle:hover { transform: none; }
}
#ninja {
  position: fixed; top: 0; left: 0;
  font-size: 22px; pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s linear;
  filter: drop-shadow(0 0 8px rgba(225, 29, 46, 0.8));
  opacity: 0.9;
}
body.ninja-on, body.ninja-on a, body.ninja-on button { cursor: none; }
body.ninja-on input, body.ninja-on textarea, body.ninja-on select { cursor: text; }
@media (hover: none) { #ninja { display: none; } }
:focus-visible {
  outline: 3px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ============ HERO TYPEWRITER ============ */
.hero-name {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  letter-spacing: -1.5px;
}
.hero-name .cursor {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent-hi);
  animation: blink 1.1s step-end infinite;
  font-weight: 400;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ============ ANIMATED COUNTERS ============ */
.counter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0 0;
}
@media (min-width: 720px) {
  .counter-grid { grid-template-columns: repeat(4, 1fr); }
}
.counter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  text-decoration: none !important;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.counter:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.counter-num {
  font-size: clamp(2em, 4vw, 2.8em);
  font-weight: 900;
  line-height: 1;
  color: var(--accent-hi);
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}
.counter-label {
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ============ NUMBERS BAND ============ */
.numbers-band {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 28px 24px;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  border-radius: var(--radius, 10px);
  text-align: center;
}
@media (min-width: 720px) {
  .numbers-band { grid-template-columns: repeat(4, 1fr); }
}
.numbers-band strong {
  display: block;
  font-size: 2em;
  font-weight: 900;
  color: var(--accent-hi);
  line-height: 1;
  margin-bottom: 6px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}
.numbers-band span {
  font-size: 0.85em;
  color: var(--fg-muted);
  font-weight: 600;
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .hero-name .cursor { animation: none; opacity: 1; }
}
