/* ═══════════════════════════════════════════
   SAMURAI PORTFOLIO — MASTER STYLES
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Zen+Antique&family=Noto+Serif+JP:wght@400;700;900&family=Space+Mono:wght@400;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #0a0a0b;
  --paper: #f0ebe3;
  --blood: #8b1a1a;
  --blood-glow: #c23b3b;
  --blood-dim: rgba(139,26,26,0.5);
  --steel: #4a4a4a;
  --mist: #c4bfb6;
  --smoke: #111113;
  --ash: #1a1a1e;
  --ghost: rgba(240,235,227,0.04);
  --ghost-line: rgba(240,235,227,0.06);
  --kanji-opacity: 0.07;
}

/* ── LIGHT THEME ──────────────────────────────── */
html[data-theme="light"] {
  --ink: #f0ebe3 !important;
  --paper: #1a1a1c !important;
  --blood: #8b1a1a !important;
  --blood-glow: #9a2222 !important;
  --steel: #7a756e !important;
  --mist: #4a4540 !important;
  --smoke: #e8e3db !important;
  --ash: #ddd8d0 !important;
  --ghost: rgba(26,26,28,0.04) !important;
  --ghost-line: rgba(26,26,28,0.1) !important;
}
html[data-theme="light"] body { background-color: #f0ebe3 !important; color: #1a1a1c !important; }
html[data-theme="light"] h1,html[data-theme="light"] h2,html[data-theme="light"] h3,html[data-theme="light"] h4 { color: #1a1a1c !important; }
html[data-theme="light"] nav { background: rgba(218,212,202,0.95) !important; border-bottom: 1px solid rgba(26,26,28,0.12) !important; }
html[data-theme="light"] .nav-links a { color: #3a3530 !important; }
html[data-theme="light"] .nav-links a:hover,html[data-theme="light"] .nav-links a.active { color: #8b1a1a !important; }
html[data-theme="light"] .nav-mark { color: #1a1a1c !important; }
html[data-theme="light"] .nav-mark span { color: #8b1a1a !important; }
html[data-theme="light"] .nav-brand svg rect { fill: #f0ebe3 !important; }
html[data-theme="light"] .hero-name { color: #1a1a1c !important; }
html[data-theme="light"] .hero-name .stroke { -webkit-text-stroke-color: #1a1a1c !important; }
html[data-theme="light"] .hero-title { color: #5a554e !important; }
html[data-theme="light"] .hero-desc { color: #5a554e !important; }
html[data-theme="light"] .hero-name-pre { color: rgba(139,26,26,0.45) !important; }
html[data-theme="light"] .btn { border-color: rgba(26,26,28,0.18) !important; color: #1a1a1c !important; }
html[data-theme="light"] .bg-kanji { color: rgba(26,26,28,0.03) !important; }
html[data-theme="light"] .v-accent { background: rgba(139,26,26,0.06) !important; }
html[data-theme="light"] .bg-smoke,html[data-theme="light"] .intro-strip { background: #e8e3db !important; }
html[data-theme="light"] .intro-text strong { color: #1a1a1c !important; }
html[data-theme="light"] .about-intro p { color: #4a4540 !important; }
html[data-theme="light"] .about-intro p strong { color: #1a1a1c !important; }
html[data-theme="light"] .page-tag { color: #5a554e !important; }
html[data-theme="light"] .page-title { color: #1a1a1c !important; }
html[data-theme="light"] .page-subtitle { color: #5a554e !important; }
html[data-theme="light"] .page-title-jp { color: rgba(139,26,26,0.4) !important; }
html[data-theme="light"] .section-title { color: #1a1a1c !important; }
html[data-theme="light"] .section-num { color: rgba(139,26,26,0.35) !important; }
html[data-theme="light"] .intro-stat,html[data-theme="light"] .exp-stat,html[data-theme="light"] .forge-stat,html[data-theme="light"] .p-stat,html[data-theme="light"] .stat,html[data-theme="light"] .vol-card { background: #e8e3db !important; }
html[data-theme="light"] .stat-label,html[data-theme="light"] .intro-stat-label,html[data-theme="light"] .exp-stat-label,html[data-theme="light"] .forge-stat-label,html[data-theme="light"] .p-stat-label { color: #5a554e !important; }
html[data-theme="light"] .edu-card,html[data-theme="light"] .paper-card,html[data-theme="light"] .persona-card,html[data-theme="light"] .skill-card,html[data-theme="light"] .extra-card,html[data-theme="light"] .blog-card,html[data-theme="light"] .contact-card,html[data-theme="light"] .artifact-card { background: rgba(26,26,28,0.025) !important; border-color: rgba(26,26,28,0.08) !important; }
html[data-theme="light"] .nav-card { background: transparent !important; border-color: rgba(26,26,28,0.08) !important; }
html[data-theme="light"] .nav-card-label { color: #1a1a1c !important; }
html[data-theme="light"] .nav-card-sub { color: #5a554e !important; }
html[data-theme="light"] .acc-header { background: #ebe6de !important; }
html[data-theme="light"] .acc-item.open .acc-header { background: rgba(139,26,26,0.06) !important; }
html[data-theme="light"] .acc-content { background: #f5f0e8 !important; }
html[data-theme="light"] .acc-role { color: #1a1a1c !important; }
html[data-theme="light"] .acc-mission { color: #4a4540 !important; }
html[data-theme="light"] .hover-map,html[data-theme="light"] .radar-section { background: rgba(26,26,28,0.02) !important; }
html[data-theme="light"] .map-core,html[data-theme="light"] .map-node { background: rgba(240,235,227,0.95) !important; }
html[data-theme="light"] .map-popup { background: rgba(240,235,227,0.97) !important; }
html[data-theme="light"] .node-title,html[data-theme="light"] .map-core-title { color: #1a1a1c !important; }
html[data-theme="light"] .quote-strip { background: #e8e3db !important; border-color: rgba(26,26,28,0.06) !important; }
html[data-theme="light"] .quote-strip-item { color: #5a554e !important; }
html[data-theme="light"] footer { background: #e0dbd3 !important; }
html[data-theme="light"] .footer-text { color: #5a554e !important; }
html[data-theme="light"] .paper-title,html[data-theme="light"] .artifact-title,html[data-theme="light"] .edu-degree,html[data-theme="light"] .persona-title,html[data-theme="light"] .blog-title { color: #1a1a1c !important; }
html[data-theme="light"] .paper-journal,html[data-theme="light"] .artifact-brief,html[data-theme="light"] .persona-desc,html[data-theme="light"] .skill-items { color: #4a4540 !important; }
html[data-theme="light"] .contact-heading { color: #1a1a1c !important; }
html[data-theme="light"] .contact-desc { color: #5a554e !important; }
html[data-theme="light"] .contact-card-label { color: #1a1a1c !important; }
html[data-theme="light"] .ac-transition { background: #f0ebe3 !important; }
html[data-theme="light"] .philosophy-text h3 { color: #1a1a1c !important; }
html[data-theme="light"] .philosophy-text p { color: #4a4540 !important; }
html[data-theme="light"] .journey-text { color: #4a4540 !important; }
html[data-theme="light"] .journey-text strong { color: #1a1a1c !important; }
html[data-theme="light"] .edu-school { color: #9a2222 !important; }
html[data-theme="light"] .edu-note { color: #5a554e !important; }
html[data-theme="light"] .forge-path { background: rgba(26,26,28,0.02) !important; }
html[data-theme="light"] .mono { color: #5a554e !important; }
body,nav,footer,.content-section,.bg-smoke,.intro-strip,.nav-card,.stat,.acc-header,.acc-content,.edu-card,.paper-card,.persona-card,.skill-card,.contact-card,.blog-card,.extra-card,.vol-card{transition:background-color .4s ease,color .4s ease,border-color .4s ease}
.theme-toggle{width:30px;height:30px;background:0;border:1px solid var(--ghost-line);color:var(--steel);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.78rem;transition:all .3s;margin-left:.8rem;flex-shrink:0;padding:0;line-height:1}
.theme-toggle:hover{border-color:rgba(139,26,26,.4);color:var(--paper)}
.theme-toggle .icon-sun{display:none}
html[data-theme="light"] .theme-toggle{border-color:rgba(26,26,28,.25)!important;color:#3a3530!important;background:rgba(26,26,28,.05)!important}
html[data-theme="light"] .theme-toggle:hover{border-color:#8b1a1a!important;color:#1a1a1c!important}
html[data-theme="light"] .theme-toggle .icon-moon{display:none!important}
html[data-theme="light"] .theme-toggle .icon-sun{display:inline!important}



html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── GRAIN OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── TYPOGRAPHY ── */
.font-samurai {
  font-family: 'Zen Antique', 'Noto Serif JP', serif;
}

h1, h2, h3, .heading {
  font-family: 'Zen Antique', 'Noto Serif JP', serif;
}

.mono {
  font-family: 'Space Mono', monospace;
}

/* ── KANJI BACKGROUND ── */
.bg-kanji {
  position: fixed;
  left: -5%;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(22rem, 45vw, 55rem);
  font-weight: 900;
  color: rgba(139,26,26, var(--kanji-opacity));
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.bg-kanji-right {
  left: auto;
  right: -5%;
}

.bg-kanji-secondary {
  position: fixed;
  right: 5%;
  bottom: -10%;
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(10rem, 20vw, 25rem);
  font-weight: 900;
  color: rgba(240,235,227,0.02);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ── BACKGROUND KATANA SVG ── */
.bg-katana {
  position: fixed;
  left: 8%;
  top: 50%;
  transform: translateY(-50%) rotate(12deg);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.bg-katana-right {
  left: auto;
  right: 8%;
  transform: translateY(-50%) rotate(-15deg) scaleX(-1);
}

.bg-katana-dual {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.03;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(10,10,11,0.8);
  border-bottom: 1px solid var(--ghost-line);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.nav-headband {
  width: 32px;
  height: 12px;
  position: relative;
}

.nav-mark {
  font-family: 'Zen Antique', serif;
  font-size: 1.3rem;
  color: var(--paper);
  letter-spacing: 0.05em;
}
.nav-mark span { color: var(--blood); }

.nav-links { display: flex; gap: 1.8rem; align-items: center; }

.nav-links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--mist);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
  padding: 0.3rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blood);
  transition: width 0.4s;
}

.nav-links a:hover, .nav-links a.active { color: var(--paper); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-divider {
  width: 1px;
  height: 14px;
  background: rgba(240,235,227,0.1);
}

/* ── QUOTE BANNERS ── */
.quote-banner {
  padding: 3rem;
  text-align: center;
  border-top: 1px solid var(--ghost-line);
  border-bottom: 1px solid var(--ghost-line);
  background: rgba(139,26,26,0.02);
  position: relative;
  overflow: hidden;
}

.quote-text {
  font-family: 'Zen Antique', serif;
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: var(--mist);
  font-style: italic;
  max-width: 700px;
  margin: 0 auto 0.8rem;
  line-height: 1.6;
}

.quote-source {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--blood-glow);
}

/* ── PAGE HERO ── */
.page-hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8rem 3rem 4rem;
  position: relative;
  z-index: 1;
}

.page-hero-full {
  min-height: 100vh;
  justify-content: center;
}

.page-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--blood);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-tag::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--blood);
}

.page-title {
  font-family: 'Zen Antique', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.page-title-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(1rem, 2vw, 1.6rem);
  color: var(--blood-glow);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--steel);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ── SECTIONS ── */
.content-section {
  padding: 5rem 3rem;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.section-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--blood);
  letter-spacing: 0.1em;
}

.section-title {
  font-family: 'Zen Antique', serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: 0.02em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(240,235,227,0.12), transparent);
}

/* ── DARK / SMOKE SECTIONS ── */
.bg-smoke { background: var(--smoke); }
.bg-ash { background: var(--ash); }

/* ── KATANA DIVIDER ── */
.katana-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.katana-divider svg {
  opacity: 0.3;
  transition: opacity 0.4s;
}

.katana-divider:hover svg {
  opacity: 0.6;
}

/* ── CARDS ── */
.card {
  padding: 2rem;
  border: 1px solid var(--ghost-line);
  background: var(--ghost);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--blood);
  transition: height 0.4s;
}

.card:hover {
  border-color: rgba(139,26,26,0.25);
  background: rgba(139,26,26,0.03);
}

.card:hover::before { height: 100%; }

/* ── EXPERIENCE ITEMS ── */
.exp-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--ghost-line);
  transition: background 0.3s;
}

.exp-item:hover { background: rgba(139,26,26,0.02); }

.exp-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  color: var(--steel);
  letter-spacing: 0.03em;
  padding-top: 0.3rem;
}

.exp-role {
  font-family: 'Zen Antique', serif;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.exp-org {
  font-size: 0.82rem;
  color: var(--blood-glow);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.exp-desc {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--mist);
  font-weight: 300;
}

/* ── STAT BLOCKS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat {
  padding: 1.8rem;
  border: 1px solid var(--ghost-line);
  background: var(--ghost);
  text-align: center;
}

.stat-num {
  font-family: 'Zen Antique', serif;
  font-size: 2.8rem;
  color: var(--blood-glow);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--mist);
}

/* ── BUTTONS / LINKS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--paper);
  text-decoration: none;
  padding: 0.85rem 2rem;
  border: 1px solid var(--blood);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blood);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
  z-index: -1;
}

.btn:hover::before { transform: scaleX(1); }
.btn .arrow { transition: transform 0.3s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ── FOOTER ── */
footer {
  padding: 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--ghost-line);
  position: relative;
  z-index: 1;
}

.footer-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: var(--steel);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }

.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── VERTICAL ACCENT LINE ── */
.v-accent {
  position: fixed;
  left: 3rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 10%, rgba(139,26,26,0.15) 30%, rgba(139,26,26,0.15) 70%, transparent 90%);
  z-index: 0;
  pointer-events: none;
}

/* ── GRIDS ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ── INLINE KANJI ACCENT ── */
.kanji-accent {
  font-family: 'Noto Serif JP', serif;
  color: var(--blood);
  opacity: 0.5;
}

/* ── HEADBAND ELEMENT ── */
.headband-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.headband-line {
  height: 6px;
  background: var(--ink);
  border-top: 2px solid var(--blood-dim);
  border-bottom: 2px solid var(--blood-dim);
  position: relative;
}

.headband-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 20px,
    rgba(139,26,26,0.15) 20px,
    rgba(139,26,26,0.15) 21px
  );
}

/* ── AC PAGE TRANSITIONS: HIGH-VISIBILITY SNAPPY LEAP ── */

.ac-transition {
  position: fixed;
  inset: 0;
  z-index: 9999; /* Boosted above all elements */
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Eagle Vision flash: Brighter gold and higher opacity */
.ac-transition .eagle-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(212,175,55,0.4), var(--ink) 85%);
  opacity: 0;
}

/* Animus scan lines: Increased opacity for visibility on dark theme */
.ac-transition .animus-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(212,175,55,0.2) 2px, 
    rgba(212,175,55,0.2) 4px
  );
  opacity: 0;
}

.ac-transition .ac-insignia {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(4rem, 12vw, 8rem); /* Larger presence */
  color: rgba(212,175,55,0.9); /* Sharp visibility */
  text-shadow: 0 0 30px rgba(212,175,55,0.6), 0 0 10px rgba(212,175,55,0.4);
  opacity: 0;
  transform: scale(0.8);
  z-index: 2;
}

/* ── ADJUSTED TIMING (2.5s Total Duration) ── */

body.leaping .ac-transition .eagle-flash {
  animation: eagleFlash 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

body.leaping .ac-transition .animus-lines {
  animation: animusScan 2.5s steps(20) forwards;
}

body.leaping .ac-transition .ac-insignia {
  animation: insigniaFlash 2.5s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

body.leaping .page-content {
  /* Cinematic Physics: Slight recoil up, then fast drop */
  animation: leapFall 2.5s cubic-bezier(0.6, 0, 0.4, 1) forwards;
}

/* ── REFINED KEYFRAMES ── */

@keyframes eagleFlash {
  0% { opacity: 0; }
  20% { opacity: 1; } /* Flare up quickly */
  80% { opacity: 1; background: rgba(212,175,55,0.2); }
  100% { opacity: 1; background: var(--ink); }
}

@keyframes insigniaFlash {
  0% { opacity: 0; transform: scale(0.7) rotate(-5deg); filter: blur(10px); }
  25% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); } /* Pop in early */
  80% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(2); filter: blur(20px); }
}

@keyframes leapFall {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  25% { opacity: 0.9; transform: translateY(-15px) scale(0.98); } /* Recoil "The Jump" */
  100% { opacity: 0; transform: translateY(300px) scale(1.1); filter: blur(15px); }
}

@keyframes animusScan {
  0% { opacity: 0; }
  8% { opacity: 0.8; }
  40% { opacity: 0.4; }
  80% { opacity: 0.15; }
  100% { opacity: 0; }
}

/* Landing Synchronization (Snappy landing) */
.page-content {
  animation: syncRise 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s; 
}

@keyframes syncRise {
  0% { 
    opacity: 0; 
    transform: scale(0.98) translateY(20px);
    filter: brightness(2) contrast(1.5) blur(10px);
  }
  100% { 
    opacity: 1; 
    transform: scale(1) translateY(0);
    filter: brightness(1) contrast(1) blur(0);
  }
}

/* ── GLITCH BARS ── */
.glitch-bars {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
body.leaping .glitch-bars {
  animation: glitchBarsFlash 2.5s steps(1);
}
.glitch-bars div {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(240,235,227,0.12);
}
.glitch-bars div:nth-child(1) { top: 22%; }
.glitch-bars div:nth-child(2) { top: 45%; height: 3px; background: rgba(139,26,26,0.18); }
.glitch-bars div:nth-child(3) { top: 67%; }
.glitch-bars div:nth-child(4) { top: 83%; height: 1px; }

@keyframes glitchBarsFlash {
  0%,100% { opacity: 0; }
  3%  { opacity: 1; }
  4%  { opacity: 0; }
  12% { opacity: 0.7; }
  13% { opacity: 0; }
  25% { opacity: 0.35; }
  26% { opacity: 0; }
  45% { opacity: 0.2; }
  46% { opacity: 0; }
  65% { opacity: 0.15; }
  66% { opacity: 0; }
}

/* ── CORNER BRACKETS ── */
.ac-corner {
  position: absolute;
  width: 14px; height: 14px;
  border-style: solid;
  border-color: rgba(139,26,26,0.25);
  pointer-events: none;
  opacity: 0;
}
body.leaping .ac-corner {
  animation: cornerFade 2.5s ease-out forwards;
}
.ac-corner.c-tl { top: 20px; left: 20px; border-width: 1px 0 0 1px; }
.ac-corner.c-tr { top: 20px; right: 20px; border-width: 1px 1px 0 0; }
.ac-corner.c-bl { bottom: 20px; left: 20px; border-width: 0 0 1px 1px; }
.ac-corner.c-br { bottom: 20px; right: 20px; border-width: 0 1px 1px 0; }

@keyframes cornerFade {
  0% { opacity: 0; }
  10% { opacity: 0.8; }
  80% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* ── HUD CONTAINER ── */
.ac-hud {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 380px;
  opacity: 0;
  z-index: 3;
}
body.leaping .ac-hud {
  animation: hudFade 2.5s ease-out forwards;
}
@keyframes hudFade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}

.ac-hud-text {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,235,227,0.75);
  height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
}

.ac-hud-sub {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(139,26,26,0.55);
  height: 13px;
  text-align: center;
  transition: opacity 0.25s;
}

/* ── SYNC BAR ── */
.ac-sync-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ac-sync-label {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(139,26,26,0.4);
  white-space: nowrap;
}

.ac-sync-track {
  flex: 1;
  height: 3px;
  background: rgba(240,235,227,0.06);
  position: relative;
  overflow: hidden;
}

.ac-sync-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #8b1a1a, #c23b3b);
  transition: width 0.1s linear;
  position: relative;
}

.ac-sync-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 1px;
  height: 7px;
  background: #c23b3b;
  box-shadow: 0 0 6px rgba(194,59,59,0.6);
}

.ac-sync-pct {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(240,235,227,0.5);
  min-width: 32px;
  text-align: right;
}

@media (max-width: 500px) {
  .ac-hud { width: 280px; bottom: 40px; }
  .ac-hud-text { font-size: 10px; letter-spacing: 0.15em; }
}

/* ── HOME NAV GRID: 6-CARD LAYOUT ── */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--ghost-line);
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .nav-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 500px) {
  .nav-grid {
    grid-template-columns: 1fr;
  }
}



/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.55rem; }
  .content-section { padding: 3.5rem 1.5rem; }
  .page-hero { padding: 6rem 1.5rem 3rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .exp-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .v-accent { display: none; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; }
  .nav-divider { display: none; }
  .bg-kanji { font-size: clamp(14rem, 60vw, 22rem); }
}

@media (max-width: 500px) {
  .stats-row { grid-template-columns: 1fr; }
  .nav-links { gap: 0.6rem; }
}

/* ═══════════════════════════════════════════
   EDUCATION & EXPERIENCE LOGO STYLES
   ═══════════════════════════════════════════ */

/* Container for the logo to handle background and rounding */
.logo-container {
  width: 110px; /* Increased size for better visibility */
  height: 110px;
  background: rgba(255, 255, 255, 0.05); /* Subtle backing to lift the logo */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px; /* Softened rounded corners */
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* AC-inspired transition */
  border: 1px solid var(--ghost-line);
  flex-shrink: 0; /* Prevents the logo from squishing on mobile */
}

/* The base logo style */
.edu-logo {
  width: 82%;
  height: auto;
  transition: all 0.5s ease;
  /* Default for dark/black logos: make them white and transparent */
  filter: grayscale(1) invert(1) brightness(1.2);
  mix-blend-mode: screen; 
}

/* Specific rule for logos that are ALREADY white (like IP Paris) */
.edu-logo.logo-white {
  filter: grayscale(1) brightness(1.2); /* Removes invert(1) */
  mix-blend-mode: normal; /* No special blending needed */
}

/* --- Hover Effects --- */

/* Lifts and glows the logo container when the card is hovered */
.edu-card:hover .logo-container {
  background: rgba(139, 26, 26, 0.15); /* Blood-red tint on hover */
  transform: scale(1.08) translateY(-5px);
  border-color: var(--blood);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Returns color and brightness to the logo on hover */
.edu-card:hover .edu-logo {
  filter: grayscale(0) invert(1) brightness(1.5);
  transform: scale(1.1);
}

/* Special hover state for white-only logos */
.edu-card:hover .edu-logo.logo-white {
  filter: grayscale(0) brightness(1.5); /* No invert on hover either */
}

/* Container to group dates and health bars at the top right */
.edu-meta-right {
  position: absolute;
  top: 1.5rem;
  right: 2.5rem;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem; /* Space between the date and the bars */
  z-index: 10;
}

/* Base style for the SYNC text and segments */
.health-bar-container {
  text-align: right;
  min-width: 150px;
}

.health-segments {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 4px;
}

.segment {
  width: 10px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1); 
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: skewX(-15deg);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.segment.filled {
  background: var(--blood);
  box-shadow: 0 0 10px var(--blood-dim);
  border-color: var(--blood-glow);
}

.edu-card:hover .segment.filled {
  background: var(--blood-glow);
  box-shadow: 0 0 18px var(--blood-glow);
  filter: brightness(1.3);
}

/* Ensure the date looks consistent with the theme */
.edu-dates.mono {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--mist);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* Represents a partial synchronization (e.g., the .5 in 8.5) */
.segment.filled-dim {
  background: rgba(139, 26, 26, 0.4); /* Faded var(--blood) */
  box-shadow: 0 0 4px var(--blood-dim);
  border-color: rgba(194, 59, 59, 0.3);
  animation: sync-pulse 2s infinite ease-in-out;
}

@keyframes sync-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Ensure the content boxes don't overlap the vertical timeline line */
.exp-content {
  margin-left: 3rem; /* Space for the timeline line and dots */
  background: rgba(255, 255, 255, 0.02);
  padding: 2rem;
  border-radius: 8px;
  border-left: 1px solid rgba(139, 26, 26, 0.3); /* Subtle blood-red border */
  transition: all 0.3s ease;
}

.exp-content:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(10px); /* Subtle slide effect on hover */
  box-shadow: -5px 0 20px rgba(139, 26, 26, 0.2);
}

.exp-org {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--mist);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════
   LIGHT MODE FIX — visibility recovery
   Paste at the VERY BOTTOM of styles.css
   ═══════════════════════════════════════════ */

html[data-theme="light"],
html[data-theme="light"] body {
  background: #f0ebe3 !important;
  color: #1a1a1c !important;
}

/* Global text recovery */
html[data-theme="light"] body,
html[data-theme="light"] main,
html[data-theme="light"] section {
  color: #1a1a1c !important;
}

html[data-theme="light"] p,
html[data-theme="light"] li {
  color: #4a4540 !important;
}

/* Headings */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6,
html[data-theme="light"] .page-title,
html[data-theme="light"] .section-title,
html[data-theme="light"] .hero-name,
html[data-theme="light"] .nav-mark,
html[data-theme="light"] .acc-role,
html[data-theme="light"] .paper-title,
html[data-theme="light"] .artifact-title,
html[data-theme="light"] .edu-degree,
html[data-theme="light"] .contact-heading,
html[data-theme="light"] .persona-title,
html[data-theme="light"] .story-title,
html[data-theme="light"] .fiction-title {
  color: #1a1a1c !important;
}

/* Body/subtext */
html[data-theme="light"] .hero-desc,
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .intro-text,
html[data-theme="light"] .journey-text,
html[data-theme="light"] .persona-desc,
html[data-theme="light"] .skill-items,
html[data-theme="light"] .acc-mission,
html[data-theme="light"] .abstract-text,
html[data-theme="light"] .contact-desc,
html[data-theme="light"] .edu-note,
html[data-theme="light"] .artifact-desc,
html[data-theme="light"] .blog-card p,
html[data-theme="light"] .story-desc,
html[data-theme="light"] .fiction-copy,
html[data-theme="light"] .story-copy,
html[data-theme="light"] .story-reader p {
  color: #4a4540 !important;
}

/* Muted labels */
html[data-theme="light"] .hero-title,
html[data-theme="light"] .page-tag,
html[data-theme="light"] .nav-card-sub,
html[data-theme="light"] .acc-dates,
html[data-theme="light"] .acc-location,
html[data-theme="light"] .paper-journal,
html[data-theme="light"] .forge-stat-label,
html[data-theme="light"] .intro-stat-label,
html[data-theme="light"] .p-stat-label,
html[data-theme="light"] .story-kicker,
html[data-theme="light"] .fiction-label,
html[data-theme="light"] .path-name,
html[data-theme="light"] .legend-item,
html[data-theme="light"] .open-text {
  color: #6d655c !important;
}

/* Red accents */
html[data-theme="light"] .nav-mark span,
html[data-theme="light"] .page-title-jp,
html[data-theme="light"] .section-num,
html[data-theme="light"] .paper-link,
html[data-theme="light"] .edu-school,
html[data-theme="light"] .acc-org,
html[data-theme="light"] .forge-section-label,
html[data-theme="light"] .story-accent,
html[data-theme="light"] .fiction-label,
html[data-theme="light"] .contact-sub-jp,
html[data-theme="light"] .skill-label,
html[data-theme="light"] .journey-era,
html[data-theme="light"] .paper-status span {
  color: #8b1a1a !important;
}

/* Navigation */
html[data-theme="light"] nav {
  background: rgba(240, 235, 227, 0.96) !important;
  border-bottom: 1px solid rgba(26, 26, 28, 0.14) !important;
}

html[data-theme="light"] .nav-links a {
  color: #2a2622 !important;
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active {
  color: #8b1a1a !important;
}

html[data-theme="light"] .nav-divider {
  background: rgba(26, 26, 28, 0.16) !important;
}

/* Main panels/cards */
html[data-theme="light"] .intro-stat,
html[data-theme="light"] .exp-stat,
html[data-theme="light"] .forge-stat,
html[data-theme="light"] .p-stat,
html[data-theme="light"] .stat,
html[data-theme="light"] .vol-card,
html[data-theme="light"] .edu-card,
html[data-theme="light"] .paper-card,
html[data-theme="light"] .persona-card,
html[data-theme="light"] .skill-card,
html[data-theme="light"] .extra-card,
html[data-theme="light"] .blog-card,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .artifact-card,
html[data-theme="light"] .acc-header,
html[data-theme="light"] .acc-content,
html[data-theme="light"] .abstract-body,
html[data-theme="light"] .story-hero,
html[data-theme="light"] .story-reader,
html[data-theme="light"] .fiction-shelf,
html[data-theme="light"] .travel-cta-inner,
html[data-theme="light"] .forge-path,
html[data-theme="light"] .travel-map-wrap,
html[data-theme="light"] .personal-stats,
html[data-theme="light"] .exp-stats,
html[data-theme="light"] .forge-dashboard,
html[data-theme="light"] .intro-stats {
  background: rgba(26, 26, 28, 0.035) !important;
  border-color: rgba(26, 26, 28, 0.12) !important;
}

/* Accordion/content panels */
html[data-theme="light"] .acc-header {
  background: rgba(26, 26, 28, 0.04) !important;
}

html[data-theme="light"] .acc-item.open .acc-header {
  background: rgba(139, 26, 26, 0.07) !important;
}

html[data-theme="light"] .acc-content {
  background: rgba(26, 26, 28, 0.025) !important;
}

/* Home/nav cards */
html[data-theme="light"] .nav-card {
  background: rgba(26, 26, 28, 0.025) !important;
  border-color: rgba(26, 26, 28, 0.1) !important;
}

html[data-theme="light"] .nav-card-label {
  color: #1a1a1c !important;
}

html[data-theme="light"] .nav-card-sub {
  color: #6d655c !important;
}

/* Large sections */
html[data-theme="light"] .bg-smoke,
html[data-theme="light"] .intro-strip,
html[data-theme="light"] .quote-strip,
html[data-theme="light"] .nav-grid,
html[data-theme="light"] .philosophy,
html[data-theme="light"] .section {
  background-color: transparent !important;
}

/* Buttons and controls */
html[data-theme="light"] .btn,
html[data-theme="light"] button,
html[data-theme="light"] .forge-filter,
html[data-theme="light"] .paper-link,
html[data-theme="light"] .story-btn,
html[data-theme="light"] .kp-act,
html[data-theme="light"] .contact-card {
  color: #1a1a1c !important;
  border-color: rgba(26, 26, 28, 0.18) !important;
}

html[data-theme="light"] .btn:hover,
html[data-theme="light"] button:hover,
html[data-theme="light"] .forge-filter:hover,
html[data-theme="light"] .forge-filter.active,
html[data-theme="light"] .story-btn:hover {
  color: #8b1a1a !important;
  border-color: rgba(139, 26, 26, 0.45) !important;
  background: rgba(139, 26, 26, 0.06) !important;
}

/* Inputs */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: rgba(26, 26, 28, 0.04) !important;
  color: #1a1a1c !important;
  border-color: rgba(26, 26, 28, 0.14) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #7a756e !important;
}

/* Decorative backgrounds should not overpower light mode */
html[data-theme="light"] .bg-kanji,
html[data-theme="light"] .bg-katana,
html[data-theme="light"] .v-accent,
html[data-theme="light"] .persona-kanji,
html[data-theme="light"] .journey-era-kanji,
html[data-theme="light"] .edu-kanji,
html[data-theme="light"] .contact-kanji-big,
html[data-theme="light"] .philosophy-kanji {
  opacity: 0.08 !important;
}

/* Borders / divider lines */
html[data-theme="light"] .quote-strip,
html[data-theme="light"] .intro-strip,
html[data-theme="light"] .journey-chapter,
html[data-theme="light"] .acc-item,
html[data-theme="light"] .paper-card,
html[data-theme="light"] .artifact-card,
html[data-theme="light"] .edu-card,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .persona-card,
html[data-theme="light"] .skill-card {
  border-color: rgba(26, 26, 28, 0.12) !important;
}

/* Links */
html[data-theme="light"] a {
  color: inherit;
}

html[data-theme="light"] a:hover {
  color: #8b1a1a !important;
}

/* Story page */
html[data-theme="light"] .story-screen,
html[data-theme="light"] .story-frame,
html[data-theme="light"] .story-lock,
html[data-theme="light"] .story-toolbar {
  background: rgba(26, 26, 28, 0.035) !important;
  border-color: rgba(26, 26, 28, 0.12) !important;
  color: #1a1a1c !important;
}

html[data-theme="light"] .story-screen img,
html[data-theme="light"] .fiction-cover img {
  box-shadow: 0 20px 60px rgba(26, 26, 28, 0.18) !important;
}

/* Kage panel light mode */
html[data-theme="light"] .kp {
  background: rgba(240, 235, 227, 0.98) !important;
  color: #1a1a1c !important;
  border-color: rgba(26, 26, 28, 0.16) !important;
}

html[data-theme="light"] .kp-id span {
  color: #1a1a1c !important;
}

html[data-theme="light"] .kp-msg.kage {
  background: rgba(139, 26, 26, 0.06) !important;
  color: #2a2622 !important;
}

html[data-theme="light"] .kp-msg.user {
  background: rgba(26, 26, 28, 0.06) !important;
  color: #1a1a1c !important;
}

html[data-theme="light"] .kp-in {
  color: #1a1a1c !important;
}

html[data-theme="light"] .kp-in::placeholder {
  color: #7a756e !important;
}

html[data-theme="light"] .kp-hd,
html[data-theme="light"] .kp-iw,
html[data-theme="light"] .kp-acts,
html[data-theme="light"] .kp-con,
html[data-theme="light"] .kp-rep {
  border-color: rgba(26, 26, 28, 0.12) !important;
}

/* Transition overlay should stay dark even in light mode */
html[data-theme="light"] .ac-transition {
  background: #080809 !important;
  color: #f0ebe3 !important;
}

/* Focus */
html[data-theme="light"] :focus-visible {
  outline: 2px solid #8b1a1a !important;
  outline-offset: 4px !important;
}

/* Text selection */
html[data-theme="light"] ::selection {
  background: rgba(139, 26, 26, 0.22);
  color: #1a1a1c;
}

/* ═══════════════════════════════════════════
   FINAL LIGHT MODE OVERLAY FIX
   Paste at the VERY BOTTOM of styles.css
   ═══════════════════════════════════════════ */

/* The transition overlay should be invisible unless page navigation is actively happening */
.ac-transition {
  background: transparent !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Only show it during the actual AC page transition */
body.leaping .ac-transition {
  opacity: 1 !important;
  visibility: visible !important;
  background: #080809 !important;
}

/* Keep inner transition layers dark/visible during transition */
body.leaping .ac-transition .eagle-flash {
  background: radial-gradient(circle at center, rgba(212,175,55,0.4), #080809 85%) !important;
}

/* If light mode is active, do NOT let the overlay become a pale sheet */
html[data-theme="light"] .ac-transition {
  background: transparent !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

html[data-theme="light"] body.leaping .ac-transition {
  background: #080809 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Safety: make sure page content is visible when not transitioning */
body:not(.leaping) .page-content,
body:not(.leaping) nav,
body:not(.leaping) footer {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
}

/* Safety: if animation leaves page-content faded, restore it outside transitions */
body:not(.leaping) .page-content {
  animation-fill-mode: none !important;
}

/* ═══════════════════════════════════════════
   LARGE SCREEN READABILITY + CTA CONTRAST PATCH
   Paste at the VERY BOTTOM of styles.css
   ═══════════════════════════════════════════ */

/* Stronger global contrast variables */
:root {
  --blood-readable: #b83232;
  --blood-readable-bright: #f05252;
  --text-readable: rgba(240, 235, 227, 0.86);
  --text-muted-readable: rgba(240, 235, 227, 0.68);
  --panel-readable: rgba(240, 235, 227, 0.055);
  --panel-line-readable: rgba(240, 235, 227, 0.13);
}

/* Prevent content from becoming too wide on large workstation screens */
.page-content,
.content-section,
.page-hero,
.quote-banner,
.katana-divider,
footer {
  max-width: 1720px;
  margin-left: auto;
  margin-right: auto;
}

/* Keep nav full-width, but constrain its contents visually */
nav {
  padding-left: clamp(1.5rem, 3vw, 4.5rem);
  padding-right: clamp(1.5rem, 3vw, 4.5rem);
}

/* Improve general readability */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

p,
li,
.exp-desc,
.page-subtitle,
.quote-text,
.footer-text {
  color: var(--text-readable);
}

/* Muted text should not become invisible on large monitors */
.page-subtitle,
.exp-date,
.stat-label,
.footer-text,
.mono,
.nav-card-sub,
.paper-journal,
.edu-note,
.contact-desc,
.persona-desc,
.skill-items {
  color: var(--text-muted-readable);
}

/* Stronger section/card boundaries */
.card,
.stat,
.edu-card,
.paper-card,
.persona-card,
.skill-card,
.extra-card,
.blog-card,
.contact-card,
.artifact-card,
.vol-card,
.nav-card,
.acc-header,
.acc-content {
  border-color: var(--panel-line-readable);
  background-color: var(--panel-readable);
}

/* Stronger hover state for cards */
.card:hover,
.edu-card:hover,
.paper-card:hover,
.persona-card:hover,
.skill-card:hover,
.extra-card:hover,
.blog-card:hover,
.contact-card:hover,
.artifact-card:hover,
.vol-card:hover,
.nav-card:hover {
  border-color: rgba(184, 50, 50, 0.45);
  background-color: rgba(139, 26, 26, 0.075);
}

/* Main CTA/button visibility fix */
.btn,
button,
.story-btn,
.forge-filter,
.paper-link {
  border-color: rgba(184, 50, 50, 0.75);
  color: #f8eee8;
  background: rgba(139, 26, 26, 0.08);
}

/* Fill animation should be more visible */
.btn::before {
  background: linear-gradient(90deg, #8b1a1a, #b83232);
}

/* Button hover should pop on large screens */
.btn:hover,
button:hover,
.story-btn:hover,
.forge-filter:hover,
.forge-filter.active,
.paper-link:hover {
  border-color: var(--blood-readable-bright);
  color: #fff7f0;
  background: rgba(184, 50, 50, 0.18);
  box-shadow: 0 0 28px rgba(184, 50, 50, 0.22);
}

/* Important CTAs should never look faint */
.btn-primary,
.btn.primary,
.hero-cta,
.nav-cta,
a[href*="recruiter"],
a[href*="contact"] {
  border-color: rgba(240, 82, 82, 0.85);
}

/* Red accent visibility */
.page-tag,
.section-num,
.quote-source,
.exp-org,
.edu-school,
.paper-link,
.stat-num,
.nav-mark span {
  color: var(--blood-readable-bright);
}

/* Better nav readability */
.nav-links a {
  color: rgba(240, 235, 227, 0.72);
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff4ec;
}

.nav-links a::after {
  background: var(--blood-readable-bright);
}

/* Large monitor tuning */
@media (min-width: 1500px) {
  body {
    font-size: 17px;
  }

  .content-section {
    padding-left: clamp(4rem, 5vw, 7rem);
    padding-right: clamp(4rem, 5vw, 7rem);
  }

  .page-hero {
    padding-left: clamp(4rem, 5vw, 7rem);
    padding-right: clamp(4rem, 5vw, 7rem);
  }

  .page-title {
    font-size: clamp(3.2rem, 5vw, 6rem);
  }

  .section-title {
    font-size: clamp(1.8rem, 2.2vw, 2.6rem);
  }

  .btn {
    font-size: 0.72rem;
    padding: 0.95rem 2.15rem;
    border-width: 1.25px;
  }

  .nav-links a {
    font-size: 0.68rem;
  }

  .card,
  .stat,
  .edu-card,
  .paper-card,
  .persona-card,
  .skill-card,
  .extra-card,
  .blog-card,
  .contact-card,
  .artifact-card,
  .vol-card {
    border-width: 1.25px;
  }
}

/* Ultra-wide monitor safety */
@media (min-width: 1900px) {
  .page-content,
  .content-section,
  .page-hero,
  .quote-banner,
  footer {
    max-width: 1680px;
  }

  .grid-2 {
    gap: 4.5rem;
  }

  .grid-3 {
    gap: 2rem;
  }

  .stats-row {
    gap: 2rem;
  }

  .nav-grid {
    max-width: 1680px;
    margin-left: auto;
    margin-right: auto;
  }

  .bg-kanji {
    opacity: 0.82;
  }
}

/* Better focus visibility */
:focus-visible {
  outline: 2px solid var(--blood-readable-bright);
  outline-offset: 4px;
}

/* Improve selection contrast */
::selection {
  background: rgba(184, 50, 50, 0.42);
  color: #fff7f0;
}

/* ═══════════════════════════════════════════
   LIGHT MODE LARGE SCREEN READABILITY PATCH
   ═══════════════════════════════════════════ */

html[data-theme="light"] {
  --blood-readable: #9a2222;
  --blood-readable-bright: #b83232;
  --text-readable: #3a3530;
  --text-muted-readable: #5f5750;
  --panel-readable: rgba(26, 26, 28, 0.045);
  --panel-line-readable: rgba(26, 26, 28, 0.16);
}

html[data-theme="light"] p,
html[data-theme="light"] li,
html[data-theme="light"] .exp-desc,
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .quote-text,
html[data-theme="light"] .footer-text {
  color: var(--text-readable) !important;
}

html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .exp-date,
html[data-theme="light"] .stat-label,
html[data-theme="light"] .footer-text,
html[data-theme="light"] .mono,
html[data-theme="light"] .nav-card-sub,
html[data-theme="light"] .paper-journal,
html[data-theme="light"] .edu-note,
html[data-theme="light"] .contact-desc,
html[data-theme="light"] .persona-desc,
html[data-theme="light"] .skill-items {
  color: var(--text-muted-readable) !important;
}

/* Light mode buttons should be visible, not pale */
html[data-theme="light"] .btn,
html[data-theme="light"] button,
html[data-theme="light"] .story-btn,
html[data-theme="light"] .forge-filter,
html[data-theme="light"] .paper-link {
  color: #1a1a1c !important;
  border-color: rgba(154, 34, 34, 0.65) !important;
  background: rgba(139, 26, 26, 0.055) !important;
}

html[data-theme="light"] .btn:hover,
html[data-theme="light"] button:hover,
html[data-theme="light"] .story-btn:hover,
html[data-theme="light"] .forge-filter:hover,
html[data-theme="light"] .forge-filter.active,
html[data-theme="light"] .paper-link:hover {
  color: #8b1a1a !important;
  border-color: rgba(154, 34, 34, 0.9) !important;
  background: rgba(139, 26, 26, 0.11) !important;
  box-shadow: 0 0 22px rgba(139, 26, 26, 0.14) !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .stat,
html[data-theme="light"] .edu-card,
html[data-theme="light"] .paper-card,
html[data-theme="light"] .persona-card,
html[data-theme="light"] .skill-card,
html[data-theme="light"] .extra-card,
html[data-theme="light"] .blog-card,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .artifact-card,
html[data-theme="light"] .vol-card,
html[data-theme="light"] .nav-card,
html[data-theme="light"] .acc-header,
html[data-theme="light"] .acc-content {
  border-color: var(--panel-line-readable) !important;
  background-color: var(--panel-readable) !important;
}

html[data-theme="light"] .page-tag,
html[data-theme="light"] .section-num,
html[data-theme="light"] .quote-source,
html[data-theme="light"] .exp-org,
html[data-theme="light"] .edu-school,
html[data-theme="light"] .paper-link,
html[data-theme="light"] .stat-num,
html[data-theme="light"] .nav-mark span {
  color: var(--blood-readable) !important;
}

/* Do not let global button styles damage Kage panel buttons */
.kp button,
.kp .kp-act,
.kp .kp-snd,
.kp .kp-x,
.kp-rep button {
  box-shadow: none;
}

/* Kage buttons still get their own styling */
.kp .kp-act:hover {
  box-shadow: none;
}


/* Kage chat cleanup: keep one consistent live 3D Kage and compact chat UI */
.kc-row .kc-mini,.kp-row .kp-mini{display:none!important}
.kc-row,.kp-row{display:block!important}
.kage-console .kc-msg,.kc-msg{font-size:0.86rem;line-height:1.55}
.kage-console .kc-messages,#kageConsoleMessages{max-height:520px;overflow-y:auto}
@media(max-width:760px){.kp{width:calc(100vw - 104px)!important;right:90px!important}.recruiter-kage .kp{width:calc(100vw - 104px)!important}}

/* Dynamic atmosphere layer: shader field, reveal motion, cursor/card glow */
body{position:relative;isolation:isolate}
body::before{content:"";position:fixed;inset:-20%;z-index:-3;pointer-events:none;background:
  radial-gradient(circle at 18% 18%,rgba(139,26,26,.24),transparent 24rem),
  radial-gradient(circle at 78% 8%,rgba(160,56,42,.16),transparent 28rem),
  radial-gradient(circle at 50% 92%,rgba(88,38,95,.12),transparent 28rem),
  linear-gradient(115deg,rgba(255,255,255,.035),transparent 36%,rgba(139,26,26,.08) 58%,transparent 78%);
filter:blur(4px) saturate(1.1);animation:shaderDrift 24s ease-in-out infinite alternate;}
body::after{content:"";position:fixed;inset:0;z-index:-2;pointer-events:none;opacity:.28;background-image:
  linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),
  linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px),
  radial-gradient(circle at 50% 50%,rgba(255,255,255,.05),transparent 1px);
background-size:46px 46px,46px 46px,5px 5px;mask-image:linear-gradient(to bottom,rgba(0,0,0,.9),rgba(0,0,0,.2) 72%,transparent);animation:gridFloat 18s linear infinite;}
@keyframes shaderDrift{0%{transform:translate3d(-2%,0,0) rotate(0deg) scale(1)}100%{transform:translate3d(2%,-2%,0) rotate(4deg) scale(1.06)}}
@keyframes gridFloat{to{background-position:46px 46px,46px 46px,12px 18px}}
.dynamic-cursor-glow{position:fixed;left:0;top:0;width:34rem;height:34rem;margin:-17rem 0 0 -17rem;z-index:-1;pointer-events:none;border-radius:50%;background:radial-gradient(circle,rgba(179,34,34,.16),rgba(179,34,34,.05) 34%,transparent 68%);filter:blur(8px);mix-blend-mode:screen;opacity:.85}
.dyn-reveal{opacity:0;transform:translate3d(0,26px,0) scale(.985);filter:blur(8px);transition:opacity .75s ease,transform .75s cubic-bezier(.2,.8,.2,1),filter .75s ease;transition-delay:var(--reveal-delay,0ms)}
.dyn-reveal.is-visible{opacity:1;transform:translate3d(0,0,0) scale(1);filter:blur(0)}
.dyn-card{position:relative;overflow:hidden;transform-style:preserve-3d;transition:transform .28s ease,border-color .28s ease,box-shadow .28s ease;background-blend-mode:screen}
.dyn-card::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .28s ease;background:radial-gradient(360px circle at var(--mx,50%) var(--my,50%),rgba(255,255,255,.13),rgba(179,34,34,.09) 32%,transparent 64%)}
.dyn-card:hover{transform:translateY(-5px);box-shadow:0 24px 70px rgba(0,0,0,.34),0 0 34px rgba(139,26,26,.13)}
.dyn-card:hover::after{opacity:1}
@media(prefers-reduced-motion:reduce){body::before,body::after{animation:none}.dyn-reveal{opacity:1;transform:none;filter:none;transition:none}.dyn-card,.dyn-card:hover{transform:none}.dynamic-cursor-glow{display:none}}
