/* =========================================
   SHIFTY — Custom Styles
   ========================================= */

:root {
  --bg: #07070d;
  --bg-card: rgba(255, 255, 255, 0.03);
  --text: #e0d8f0;
  --text-dim: rgba(224, 216, 240, 0.45);
  --accent-purple: #c084fc;
  --accent-pink: #f472b6;
  --accent-cyan: #22d3ee;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --sidebar-w: 220px;
  --nav-h: 64px;
}

::selection {
  background: rgba(192, 132, 252, 0.35);
  color: #fff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(192, 132, 252, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(192, 132, 252, 0.4); }

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Particles canvas ---------- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Sidebar Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: var(--sidebar-w);
  background: rgba(7, 7, 13, 0.8);
  backdrop-filter: blur(20px) saturate(1.4);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--accent-purple), var(--accent-pink), transparent);
  opacity: 0.3;
}

.nav-inner {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.25rem;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  padding-bottom: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.nav-logo-sub {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.1rem;
  -webkit-text-fill-color: var(--text-dim);
  background: none;
  display: block;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 2.5rem;
  flex: 1;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
  letter-spacing: 0.02em;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-left-color: rgba(192, 132, 252, 0.2);
}

.nav-link.active {
  color: var(--accent-purple);
  background: rgba(192, 132, 252, 0.08);
  border-left-color: var(--accent-purple);
}

.nav-footer {
  font-size: 0.65rem;
  color: var(--text-dim);
  opacity: 0.3;
  letter-spacing: 0.05em;
  padding: 0.85rem;
  text-align: center;
  margin-top: auto;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Main / Pages ---------- */
main {
  margin-left: var(--sidebar-w);
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.page {
  display: none;
  opacity: 0;
  animation: pageOut 0.35s ease forwards;
}

.page.active {
  display: block;
  opacity: 1;
  animation: pageIn 0.5s ease forwards;
}

@keyframes pageIn {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pageOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 3rem 0 1.5rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.15);
  padding: 0.3rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 211, 238, 0.1); }
  50% { box-shadow: 0 0 20px rgba(34, 211, 238, 0.2); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c084fc, #f472b6, #22d3ee, #c084fc);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 8s ease-in-out infinite;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.06em;
}

.accent-line {
  width: 60px;
  height: 2px;
  margin: 0 auto 3rem;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
  border-radius: 2px;
  box-shadow: 0 0 24px rgba(192, 132, 252, 0.25);
}

/* ---------- Section header ---------- */
.page-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.page-number {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-purple);
  opacity: 0.5;
  letter-spacing: 0.05em;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-purple);
}

.section-head-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ---------- Blog Cards ---------- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.25s, box-shadow 0.3s;
  animation: cardIn 0.5s ease backwards;
}

.blog-card:hover {
  border-color: rgba(192, 132, 252, 0.2);
  box-shadow: 0 0 30px rgba(192, 132, 252, 0.04);
  transform: translateY(-2px);
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes cardIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.blog-card .date {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.blog-card .content {
  color: rgba(224, 216, 240, 0.85);
  font-size: 0.95rem;
  line-height: 1.7;
}

.blog-empty {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- About ---------- */
.about-wrap {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.about-avatar {
  flex-shrink: 0;
}

.avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(192, 132, 252, 0.25);
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.1);
  transition: box-shadow 0.3s, transform 0.3s;
}

.avatar-img:hover {
  box-shadow: 0 0 35px rgba(192, 132, 252, 0.25);
  transform: scale(1.02);
}

.about-text p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: rgba(224, 216, 240, 0.85);
  line-height: 1.8;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-signoff {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  color: rgba(224, 216, 240, 0.65);
  font-size: 0.9rem;
}

.text-gradient-pink {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* ---------- Stats ---------- */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(192, 132, 252, 0.1);
  border-color: rgba(192, 132, 252, 0.2);
  z-index: 2;
}

.gallery-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-photo {
  transform: scale(1.08);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgba(7, 7, 13, 0.85));
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.03em;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 7, 13, 0.92);
  backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
  animation: lbFadeIn 0.3s ease;
}

@keyframes lbFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-content {
  max-width: 80vw;
  max-height: 80vh;
  text-align: center;
}

.lightbox-content .lb-img {
  width: 300px;
  height: 300px;
  border-radius: var(--radius-sm);
  margin: 0 auto 1.5rem;
  border: 1px solid var(--border);
}

.lightbox-content .lb-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 0.5rem;
}

.lightbox-content .lb-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- Commander ---------- */
.commander-wrap {
  display: flex;
  justify-content: center;
}

.commander-letter {
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
}

.letter-ornament {
  font-size: 1.5rem;
  color: var(--accent-pink);
  opacity: 0.4;
  margin-bottom: 1.5rem;
}

.letter-ornament:last-of-type {
  margin-bottom: 0;
  margin-top: 1.5rem;
}

.commander-letter p {
  margin-bottom: 1.2rem;
  font-size: 1rem;
  color: rgba(224, 216, 240, 0.85);
  line-height: 1.9;
}

.commander-letter p:last-of-type {
  margin-bottom: 0;
}

.letter-signoff {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.commander-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.commander-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: cardIn 0.5s ease backwards;
}

.commander-entry:hover {
  border-color: rgba(244, 114, 182, 0.15);
  box-shadow: 0 0 30px rgba(244, 114, 182, 0.04);
}

.commander-entry:nth-child(1) { animation-delay: 0.1s; }
.commander-entry:nth-child(2) { animation-delay: 0.2s; }
.commander-entry:nth-child(3) { animation-delay: 0.3s; }

.commander-entry .entry-ornament {
  font-size: 1.2rem;
  color: var(--accent-pink);
  opacity: 0.35;
  margin-bottom: 1rem;
}

.commander-entry .entry-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-pink);
  margin-bottom: 1rem;
}

.commander-entry .entry-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.commander-entry .entry-text {
  color: rgba(224, 216, 240, 0.85);
  font-size: 0.95rem;
  line-height: 1.85;
  white-space: pre-line;
}

.commander-entry .entry-signoff {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.commander-quote {
  margin-top: 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.quote-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
  opacity: 0.4;
}

.commander-quote blockquote {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-dim);
  max-width: 440px;
  line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  :root { --sidebar-w: 200px; }
  .nav-logo { font-size: 1.25rem; }
  .hero-title { font-size: 3.2rem; }
}

@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }

  .nav {
    width: 100%;
    height: var(--nav-h);
    bottom: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
  }

  .nav::after { display: none; }

  .nav-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    max-width: 100%;
    width: 100%;
  }

  .nav-logo { font-size: 1.2rem; }

  .nav-logo-sub { display: none; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(7, 7, 13, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    display: none;
    margin-top: 0;
    flex: none;
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-footer { display: none; }

  main {
    margin-left: 0;
    padding-top: var(--nav-h);
  }

  .hero-title { font-size: 2.8rem; }
  .about-wrap { flex-direction: column; align-items: center; text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { gap: 1.5rem; }
}

@media (max-width: 450px) {
  .container { padding: 1.5rem 1rem 3rem; }
  .hero-title { font-size: 2.5rem; }
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .commander-entry { padding: 1.5rem 1.25rem; }
}

.lb-photo {
  max-width: 520px;
  max-height: 520px;
  width: auto;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  object-fit: contain;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
