/* ============================================================
   ITACHI UCHIHA FANSITE — MAIN CSS
   Palette: #0a0a0a | #dc143c | #1a1a1a | #e0e0e0
   ============================================================ */

/* ---- CSS Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --clr-black:   #0a0a0a;
  --clr-dark:    #111111;
  --clr-dark2:   #1a1a1a;
  --clr-red:     #dc143c;
  --clr-red-dim: rgba(220, 20, 60, 0.15);
  --clr-red-glow:rgba(220, 20, 60, 0.35);
  --clr-text:    #e0e0e0;
  --clr-muted:   #888888;
  --clr-border:  rgba(220, 20, 60, 0.25);
  --font-jp:     'Noto Serif JP', 'Times New Roman', serif;
  --font-display:'Cinzel', 'Georgia', serif;
  --font-body:   'Inter', system-ui, sans-serif;
  --transition:  300ms ease-out;
  --radius:      4px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--clr-black);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--clr-black); }
::-webkit-scrollbar-thumb { background: var(--clr-red); border-radius: 2px; }

/* ---- Selection ---- */
::selection { background: var(--clr-red); color: #fff; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  transition: background var(--transition), padding var(--transition);
}

.site-header.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  padding: 12px 40px;
  border-bottom: 1px solid var(--clr-border);
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  transition: opacity var(--transition);
}

.logo-link:hover { opacity: 0.8; }

.sharingan-logo {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 8px rgba(220, 20, 60, 0.6));
  transition: transform var(--transition), filter var(--transition);
}

.logo-link:hover .sharingan-logo {
  transform: rotate(45deg);
  filter: drop-shadow(0 0 14px rgba(220, 20, 60, 0.9));
}

.header-nav {
  display: flex;
  gap: 36px;
}

.header-nav a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-muted);
  transition: color var(--transition);
  position: relative;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--clr-red);
  transition: width var(--transition);
}

.header-nav a:hover { color: var(--clr-text); }
.header-nav a:hover::after { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-parallax {
  position: absolute;
  inset: -20% 0;
  will-change: transform;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(10, 0, 0, 0.55) 0%,
    rgba(180, 10, 30, 0.18) 40%,
    rgba(10, 0, 0, 0.75) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  animation: heroFadeIn 1.4s ease-out both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-subtitle-jp {
  font-family: var(--font-jp);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--clr-red);
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1;
  text-shadow:
    0 0 60px rgba(220, 20, 60, 0.4),
    0 4px 40px rgba(0, 0, 0, 0.8);
  margin-bottom: 16px;
}

.hero-tagline {
  font-family: var(--font-jp);
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  letter-spacing: 0.4em;
  color: var(--clr-muted);
  margin-bottom: 24px;
}

.hero-divider {
  width: 60px;
  height: 1px;
  background: var(--clr-red);
  margin: 0 auto 20px;
  box-shadow: 0 0 12px var(--clr-red);
}

.hero-desc {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 300;
  color: rgba(224, 224, 224, 0.7);
  letter-spacing: 0.05em;
  line-height: 1.8;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: heroFadeIn 2s ease-out 0.8s both;
}

.hero-scroll-indicator span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-muted);
}

.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--clr-red), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.2); }
}

/* ============================================================
   SECTION SHARED
   ============================================================ */
.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--clr-red);
  margin-bottom: 40px;
  padding-left: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--clr-text);
  margin-bottom: 8px;
}

.section-title .accent {
  color: var(--clr-red);
}

/* ============================================================
   BIO
   ============================================================ */
.bio {
  background: var(--clr-black);
  padding: 120px 40px;
}

.bio-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 80px;
  align-items: start;
}

.bio-japanese-title {
  font-family: var(--font-jp);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--clr-muted);
  margin-bottom: 36px;
}

.bio-text p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: rgba(224, 224, 224, 0.8);
  margin-bottom: 20px;
  max-width: 620px;
}

.bio-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--clr-dark2);
  border: 1px solid var(--clr-border);
  border-left: 3px solid var(--clr-red);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: var(--font-jp);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: 0.05em;
}

.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--clr-border);
}

/* Bio image column */
.bio-image-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
}

.bio-image-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--clr-border);
}

.bio-image-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(10,0,0,0.7) 100%);
  z-index: 1;
  pointer-events: none;
}

.bio-image {
  width: 100%;
  height: 520px;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.6s ease-out;
  display: block;
}

.bio-image-frame:hover .bio-image {
  transform: scale(1.03);
}

.bio-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.bio-image-caption span:first-child {
  font-family: var(--font-jp);
  font-size: 1rem;
  color: var(--clr-text);
}

.bio-image-caption span:last-child {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-muted);
}

.bio-quote {
  padding: 20px 24px;
  border-left: 2px solid var(--clr-red);
  background: var(--clr-dark2);
}

.bio-quote blockquote {
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.7;
  color: rgba(224, 224, 224, 0.7);
  margin-bottom: 10px;
}

.bio-quote cite {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-red);
  font-style: normal;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline-section {
  background: var(--clr-dark);
  padding: 120px 40px;
  position: relative;
}

.timeline-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--clr-border), transparent);
}

.timeline-header {
  max-width: 1300px;
  margin: 0 auto 80px;
}

.timeline-header-jp {
  font-family: var(--font-jp);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--clr-muted);
  margin-top: 6px;
}

.timeline {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

/* Centre vertical line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: linear-gradient(to bottom, var(--clr-border), rgba(220,20,60,0.1));
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  margin-bottom: 60px;
  position: relative;
}

.timeline-item.timeline-left .timeline-card {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  padding-right: 48px;
}

.timeline-item.timeline-left .timeline-connector {
  grid-column: 2;
  grid-row: 1;
}

.timeline-item.timeline-right .timeline-card {
  grid-column: 3;
  grid-row: 1;
  padding-left: 48px;
}

.timeline-item.timeline-right .timeline-connector {
  grid-column: 2;
  grid-row: 1;
}

.timeline-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--clr-red);
  border-radius: 50%;
  border: 2px solid var(--clr-dark);
  box-shadow: 0 0 14px rgba(220, 20, 60, 0.7);
  flex-shrink: 0;
  transition: box-shadow var(--transition), transform var(--transition);
}

.timeline-item:hover .timeline-dot {
  box-shadow: 0 0 24px rgba(220, 20, 60, 1);
  transform: scale(1.4);
}

.timeline-dot-final {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.9);
}

.timeline-card {
  background: var(--clr-dark2);
  border: 1px solid var(--clr-border);
  padding: 28px 32px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: default;
}

.timeline-item.timeline-left .timeline-card {
  border-right: 2px solid var(--clr-border);
}

.timeline-item.timeline-right .timeline-card {
  border-left: 2px solid var(--clr-border);
}

.timeline-card:hover {
  border-color: var(--clr-red);
  box-shadow: 0 0 30px rgba(220, 20, 60, 0.12);
  transform: translateY(-2px);
}

.timeline-item.timeline-left .timeline-card:hover {
  border-right-color: var(--clr-red);
}

.timeline-item.timeline-right .timeline-card:hover {
  border-left-color: var(--clr-red);
}

.timeline-card-final {
  border-color: rgba(220, 20, 60, 0.4) !important;
}

.timeline-year {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-red);
  margin-bottom: 4px;
}

.timeline-jp {
  font-family: var(--font-jp);
  font-size: 0.9rem;
  color: var(--clr-muted);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

.timeline-card p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: rgba(224, 224, 224, 0.65);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-section {
  background: var(--clr-black);
  padding: 120px 40px;
  position: relative;
}

.gallery-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--clr-border), transparent);
}

.gallery-header {
  max-width: 1300px;
  margin: 0 auto 60px;
}

.gallery-header-sub {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--clr-muted);
  margin-top: 12px;
}

.gallery-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--clr-dark2);
  border: 1px solid var(--clr-border);
  aspect-ratio: 16 / 10;
}

/* Vary heights for masonry-like feel */
.gallery-item:nth-child(1) { aspect-ratio: 16 / 10; }
.gallery-item:nth-child(2) { aspect-ratio: 4 / 3; }
.gallery-item:nth-child(3) { aspect-ratio: 16 / 10; }
.gallery-item:nth-child(4) { aspect-ratio: 3 / 4; }
.gallery-item:nth-child(5) { aspect-ratio: 16 / 9; }
.gallery-item:nth-child(6) { aspect-ratio: 21 / 9; grid-column: span 2; }
.gallery-item:nth-child(7) { aspect-ratio: 16 / 9; }
.gallery-item:nth-child(8) { aspect-ratio: 16 / 9; }

.gallery-item-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease-out, filter 0.5s ease-out;
  display: block;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.05);
  filter: brightness(0.85);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,0,0,0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item:hover {
  border-color: var(--clr-red);
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.25);
}

.gallery-item-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--clr-text);
  text-transform: uppercase;
}

.gallery-item-res {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--clr-red);
  text-transform: uppercase;
  margin-top: 3px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--clr-dark2);
  border-top: 1px solid var(--clr-border);
  padding: 48px 40px;
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.sharingan-footer {
  width: 52px;
  height: 52px;
  opacity: 0.7;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(220, 20, 60, 0.4));
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-title {
  font-family: var(--font-jp);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: 0.1em;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--clr-muted);
  letter-spacing: 0.05em;
}

.footer-disclaimer {
  font-size: 0.7rem;
  color: rgba(136, 136, 136, 0.6);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 0, 0, 0.93);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--clr-border);
  box-shadow: 0 0 60px rgba(220, 20, 60, 0.2);
  transition: transform 0.3s ease-out;
}

.lightbox-caption {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-muted);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  background: rgba(10, 0, 0, 0.8);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  line-height: 1;
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--clr-red);
  border-color: var(--clr-red);
  color: #fff;
}

/* ============================================================
   SCROLL REVEAL UTILITY
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .bio-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .bio-image-col {
    position: static;
  }

  .bio-image {
    height: 360px;
  }

  .timeline-item {
    grid-template-columns: 24px 1fr;
    gap: 0;
  }

  .timeline-item.timeline-left .timeline-card,
  .timeline-item.timeline-right .timeline-card {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    padding: 20px 24px;
    padding-left: 24px;
    padding-right: 24px;
    border-right: none;
    border-left: 2px solid var(--clr-border);
  }

  .timeline-item.timeline-left .timeline-connector,
  .timeline-item.timeline-right .timeline-connector {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }

  .timeline::before {
    left: 5px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item:nth-child(6) {
    grid-column: span 2;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .site-header { padding: 14px 20px; }
  .site-header.scrolled { padding: 10px 20px; }

  .header-nav { gap: 20px; }
  .header-nav a { font-size: 0.72rem; }

  .hero-title { letter-spacing: 0.04em; }

  .bio { padding: 80px 20px; }
  .bio-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .stat-divider { width: 40px; height: 1px; }

  .timeline-section { padding: 80px 20px; }

  .gallery-section { padding: 80px 20px; }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .gallery-item:nth-child(6) { grid-column: 1; }

  .site-footer { padding: 36px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
