:root {
  --bg-primary: #040404;
  --bg-secondary: #0b0b0b;
  --bg-card: rgba(20, 12, 14, 0.78);
  --text-main: #f4f0f0;
  --text-soft: #b9aeb1;
  --red-main: #e60000;
  --red-glow: #ff3a3a;
  --line: rgba(230, 0, 0, 0.28);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  color: var(--text-main);
  cursor: crosshair;
  background:
    radial-gradient(circle at 70% -10%, rgba(230, 0, 0, 0.16), transparent 42%),
    radial-gradient(circle at 20% 20%, rgba(120, 10, 25, 0.22), transparent 36%),
    linear-gradient(160deg, #000000 0%, #090506 38%, #000000 100%);
  line-height: 1.6;
}

.video-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  opacity: 0.5  ;
  filter: hue-rotate(320deg) saturate(1.2) brightness(0.7);
}

.video-dark-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.02;
  background-image: url("assets/img/rinnegan.jpg");
  background-size: cover;
  mix-blend-mode: screen;
}

.research-panel {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
}

.research-tab {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: rgba(230, 0, 0, 0.22);
  border: 1px solid rgba(230, 0, 0, 0.5);
  border-left: none;
  color: #ff9d9d;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  padding: 0.95rem 0.5rem;
  border-radius: 0 8px 8px 0;
  transition: background 0.2s ease, padding 0.2s ease, color 0.2s ease;
}

.research-tab:hover {
  background: rgba(230, 0, 0, 0.38);
  color: #ffd3d3;
  padding-left: 0.9rem;
}

.research-content {
  position: fixed;
  left: -390px;
  top: 0;
  width: min(390px, 100vw);
  height: 100vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.97);
  border-right: 1px solid var(--line);
  padding: 1.6rem;
  z-index: 58;
  transition: left 0.28s ease;
}

.research-content.open {
  left: 0;
}

.research-content h3 {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 1px;
  color: var(--red-main);
  margin: 0 0 1rem;
  font-size: 1.12rem;
}

.research-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  border: 1px solid var(--line);
  color: #ff9d9d;
  background: rgba(230, 0, 0, 0.12);
  border-radius: 0.45rem;
  padding: 0.3rem 0.55rem;
  font-family: "Space Mono", monospace;
}

.research-close:hover {
  background: rgba(230, 0, 0, 0.28);
}

.research-entries {
  margin-top: 2.2rem;
  display: grid;
  gap: 0.85rem;
}

.research-entry {
  border-left: 2px solid rgba(230, 0, 0, 0.7);
  padding-left: 0.7rem;
}

.research-date {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: #ff7070;
}

.research-title {
  font-size: 0.92rem;
  color: #e9e1e1;
}

.research-text {
  font-size: 0.82rem;
  color: #a79295;
}

a,
button,
.btn,
.add-floating-btn,
.modal-close,
.social-icons a,
.card {
  cursor: crosshair;
}

input,
textarea,
select {
  cursor: text;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 4rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  text-decoration: none;
  color: var(--text-main);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 1.6px;
  font-size: 1rem;
  text-shadow: 0 0 16px rgba(230, 0, 0, 0.4);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-main);
  border-radius: 0.5rem;
  padding: 0.45rem 0.7rem;
}

.admin-auth-btn {
  border: 1px solid var(--line);
  background: rgba(230, 0, 0, 0.12);
  color: #ffd3d3;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.admin-auth-btn:hover {
  background: rgba(230, 0, 0, 0.28);
  border-color: rgba(255, 120, 120, 0.7);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-soft);
  font-family: "Space Mono", monospace;
  letter-spacing: 0.6px;
  text-transform: lowercase;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-links a:hover {
  color: var(--red-glow);
  text-shadow: 0 0 12px rgba(230, 0, 0, 0.55);
}

.hero-content {
  position: relative;
  padding: 3rem 0 2rem;
}

.hero-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  width: fit-content;
}

.hero-avatar {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(230, 0, 0, 0.65);
  box-shadow: 0 0 24px rgba(230, 0, 0, 0.3);
}

.hero-alias {
  margin: 0.55rem 0 0;
  font-family: "Space Mono", monospace;
  color: #ffc9c9;
  letter-spacing: 0.8px;
}

.eyebrow {
  color: #ff9a9a;
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: 1.08;
  margin: 0.4rem 0 0.6rem;
  max-width: 18ch;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(230, 0, 0, 0.45);
}

.hero-role {
  margin: 0;
  font-family: "Space Mono", monospace;
  color: #e3d9d9;
  font-size: 0.98rem;
  letter-spacing: 0.4px;
}

.subtitle {
  color: var(--text-soft);
  max-width: 54ch;
  font-size: 1.1rem;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(120deg, var(--red-main), #ff5858);
  color: #180000;
  box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.45), 0 10px 20px rgba(230, 0, 0, 0.3);
}

.btn.ghost {
  border: 1px solid var(--line);
  color: var(--text-main);
}

.rinnegan-orb {
  position: absolute;
  right: 0;
  top: -2rem;
  width: min(40vw, 360px);
  aspect-ratio: 1;
  opacity: 0.85;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.ring {
  border: 2px solid rgba(230, 0, 0, 0.4);
  border-radius: 999px;
  position: absolute;
}

.ring-1 { width: 90%; height: 90%; animation: pulse 4s ease-in-out infinite; }
.ring-2 { width: 72%; height: 72%; animation: pulse 3.5s ease-in-out infinite reverse; }
.ring-3 { width: 54%; height: 54%; animation: pulse 3s ease-in-out infinite; }
.ring-4 { width: 36%; height: 36%; animation: pulse 2.5s ease-in-out infinite reverse; }
.ring-5 { width: 18%; height: 18%; background: rgba(230, 0, 0, 0.76); box-shadow: 0 0 20px rgba(230, 0, 0, 0.75); }

.section {
  padding: 4rem 0;
}

.section.alt {
  background: linear-gradient(180deg, rgba(3, 9, 21, 0.6), rgba(3, 9, 21, 0.2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

h2 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  margin-bottom: 1.2rem;
}

.about-typing {
  margin: -0.35rem 0 1rem;
  min-height: 1.5rem;
  font-family: "Space Mono", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  color: #ffb4b4;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.typing-caret {
  width: 0.55ch;
  height: 1.1em;
  background: rgba(255, 130, 130, 0.92);
  border-radius: 2px;
  animation: caret-blink 0.8s steps(1, end) infinite;
}

.info-grid,
.cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.info-card,
.card,
.timeline article {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.info-card,
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.info-card:hover,
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 0, 0, 0.58);
  box-shadow: 0 0 24px rgba(230, 0, 0, 0.2), var(--shadow);
}

.about-quote {
  margin: 1.1rem 0 1.25rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid rgba(230, 0, 0, 0.72);
  background: rgba(230, 0, 0, 0.08);
  border-radius: 0.2rem 0.65rem 0.65rem 0.2rem;
}

.about-quote p {
  margin: 0;
  color: #dfcece;
  font-family: "Space Mono", monospace;
  font-size: 0.88rem;
}

.about-quote cite {
  display: block;
  margin-top: 0.35rem;
  color: #ff8d8d;
  font-style: normal;
  font-size: 0.77rem;
  letter-spacing: 0.4px;
}

.chips-group {
  margin-bottom: 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chips span {
  border: 1px solid var(--line);
  background: rgba(43, 14, 17, 0.52);
  color: #f4dada;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  margin: 0.35rem 0;
  color: var(--text-soft);
}

.card a {
  color: #ff9d9d;
}

.certs .card img,
.card .thumb {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
  display: block;
}

.timeline {
  display: grid;
  gap: 0.9rem;
}

.interest-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-soft);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 3rem;
  background: linear-gradient(180deg, rgba(3, 9, 21, 0.75), rgba(0, 0, 0, 0.9));
}

.contact-grid {
  display: grid;
  gap: 0.65rem;
}

.contact-grid a {
  color: var(--text-main);
  text-decoration: none;
}

.contact-grid a:hover {
  color: var(--red-glow);
}

.social-icons {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
}

.social-icons a {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: rgba(43, 14, 17, 0.52);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.social-icons a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 110, 110, 0.78);
}

.social-icons img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.copyright {
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.add-floating-btn {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #9e0f0f, #5f0808);
  color: #ffe5e5;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 12px 24px rgba(127, 13, 13, 0.45);
  display: none;
}

.add-floating-btn:hover {
  transform: translateY(-1px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 12, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(4, 10, 23, 0.98);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-main);
  border-radius: 0.5rem;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.modal-form {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.modal-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  background: rgba(10, 24, 51, 0.6);
  color: var(--text-main);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

.modal-help {
  color: var(--text-soft);
  margin: 0;
  font-size: 0.85rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%,
  100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing-caret {
    animation: none;
  }
}

@media (max-width: 860px) {
  .research-panel,
  .research-content {
    display: none;
  }

  .rinnegan-orb {
    opacity: 0.35;
    top: -1rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .admin-auth-btn {
    order: 1;
  }

  .nav-links {
    position: absolute;
    top: 3.6rem;
    right: 1rem;
    background: rgba(3, 10, 22, 0.96);
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    padding: 0.8rem;
    width: min(240px, calc(100% - 2rem));
    flex-direction: column;
    transform: scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }

  .hero {
    min-height: 80vh;
  }
}
