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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #FFFFFF;
  background: #0B1D3A;
  display: flex;
}

ul, ol {
  list-style: none;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid #00FF7F;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== CSS VARIABLES ===== */
:root {
  --color-primary: #0B1D3A;
  --color-accent: #D4AF37;
  --color-secondary: #00FF7F;
  --color-bg-dark: #0D0D0D;
  --color-bg-light: #F5F5F5;
  --color-surface-1: #1A1A2E;
  --color-surface-2: #2D2D44;
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #B0B0C0;
  --color-accent-glow: rgba(212, 175, 55, 0.25);
  --color-green-glow: rgba(0, 255, 127, 0.25);
  --font-heading: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  --font-body: 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  --sidebar-width: 280px;
  --nav-transition: 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --content-max: 1280px;
  --focus-outline: 2px solid #00FF7F;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 8px 20px;
  background: #00FF7F;
  color: #0D0D0D;
  font-weight: 600;
  font-size: 0.875rem;
  transform: translateY(-100%);
  transition: transform 200ms ease;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* ===== SIDEBAR ===== */
.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg-dark);
  z-index: 900;
  display: flex;
  flex-direction: column;
  padding: 32px 24px 24px;
  overflow-y: auto;
  border-right: 1px solid rgba(212, 175, 55, 0.08);
  transition: transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== BRAND ===== */
.site-brand {
  margin-bottom: 40px;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 1.8rem;
  color: var(--color-accent);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  animation: starPulse 3s ease-in-out infinite;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #D4AF37 0%, #F0D68A 40%, #D4AF37 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.04em;
}

@keyframes starPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* ===== NAV TOGGLE ===== */
.nav-toggle {
  display: none;
  position: absolute;
  top: 20px;
  right: 16px;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border-radius: 4px;
  z-index: 950;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: transform 300ms ease, opacity 300ms ease;
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== NAVIGATION ===== */
.site-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 16px 10px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: color 250ms ease, background 250ms ease, box-shadow 250ms ease;
  letter-spacing: 0.02em;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.25);
  transition: background 250ms ease, box-shadow 250ms ease;
}

.nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(212, 175, 55, 0.06);
}

.nav-link:hover::before {
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.nav-link[aria-current="page"] {
  color: var(--color-secondary);
  font-weight: 600;
  background: rgba(0, 255, 127, 0.06);
}

.nav-link[aria-current="page"]::before {
  background: var(--color-secondary);
  box-shadow: 0 0 10px rgba(0, 255, 127, 0.5);
  width: 8px;
  height: 8px;
}

/* ===== SIDEBAR DECOR ===== */
.sidebar-decor {
  position: relative;
  flex-shrink: 0;
  height: 80px;
  margin-top: auto;
  pointer-events: none;
  overflow: hidden;
}

.sidebar-decor::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 10%, rgba(212, 175, 55, 0.35), transparent),
    radial-gradient(2px 2px at 60% 30%, rgba(212, 175, 55, 0.25), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255, 255, 255, 0.15), transparent),
    radial-gradient(1.5px 1.5px at 30% 60%, rgba(212, 175, 55, 0.20), transparent),
    radial-gradient(1px 1px at 70% 70%, rgba(255, 255, 255, 0.10), transparent),
    radial-gradient(2px 2px at 50% 90%, rgba(0, 255, 127, 0.12), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(212, 175, 55, 0.30), transparent),
    radial-gradient(1.5px 1.5px at 90% 50%, rgba(212, 175, 55, 0.15), transparent),
    radial-gradient(1px 1px at 40% 40%, rgba(255, 255, 255, 0.08), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #00FF7F, #D4AF37);
  z-index: 999;
  transition: width 50ms linear;
  pointer-events: none;
  will-change: width;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar {
    transition: none;
  }
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-primary);
  position: relative;
  padding-top: 3px; /* space for progress bar */
}

/* ===== CONTAINER ===== */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background 250ms ease, transform 250ms ease, box-shadow 250ms ease;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-secondary);
  color: #0D0D0D;
  box-shadow: 0 2px 12px rgba(0, 255, 127, 0.2);
}

.btn-primary:hover {
  background: #00E070;
  box-shadow: 0 4px 20px rgba(0, 255, 127, 0.35);
}

.btn-accent {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.08);
}

.btn-accent:hover {
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

/* ===== SECTION CHIP ===== */
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-chip::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.4;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-bg-dark);
  border-top: 1px solid rgba(212, 175, 55, 0.06);
  padding: 48px 40px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.footer-brand .brand-icon {
  font-size: 1.4rem;
  animation: none;
}

.footer-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #D4AF37 0%, #F0D68A 40%, #D4AF37 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 140px;
}

.footer-link {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  transition: color 250ms ease;
  position: relative;
  width: fit-content;
}

.footer-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 250ms ease;
}

.footer-link:hover {
  color: var(--color-accent);
}

.footer-link:hover::after {
  width: 100%;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.contact-item {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.footer-icp {
  max-width: var(--content-max);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.copyright {
  color: rgba(176, 176, 192, 0.6);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .site-sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  }

  .site-sidebar .skip-link {
    display: none;
  }

  .site-brand {
    margin-bottom: 0;
    flex: 1;
  }

  .brand-link {
    gap: 8px;
  }

  .brand-icon {
    font-size: 1.4rem;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .nav-toggle {
    display: flex;
    position: relative;
    top: auto;
    right: auto;
  }

  .site-nav {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--color-bg-dark);
    padding: 24px 20px;
    transform: translateX(-100%);
    transition: transform 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    z-index: 890;
  }

  .site-nav[data-open] {
    transform: translateX(0);
  }

  .nav-list {
    gap: 4px;
  }

  .nav-link {
    padding: 14px 16px 14px 32px;
    font-size: 1rem;
  }

  .sidebar-decor {
    display: none;
  }

  .main-content {
    margin-left: 0;
    margin-top: 60px;
    padding-top: 3px;
  }

  .container {
    padding: 0 20px;
  }

  .site-footer {
    padding: 32px 20px 20px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }

  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .footer-contact {
    min-width: auto;
  }

  .footer-icp {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }

  .site-sidebar {
    padding: 28px 20px 20px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .container {
    padding: 0 32px;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .site-nav {
    transition: none;
  }

  .skip-link {
    transition: none;
  }

  .nav-toggle .toggle-bar {
    transition: none;
  }

  .btn {
    transition: none;
  }

  .nav-link {
    transition: none;
  }

  .sidebar-decor::before {
    animation: none;
    opacity: 0.5;
  }

  .brand-icon {
    animation: none;
  }
}

/* ===== PRINT ===== */
@media print {
  .site-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    padding: 16px;
  }

  .site-nav {
    display: block;
  }

  .nav-toggle,
  .sidebar-decor,
  .progress-bar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .site-footer {
    break-inside: avoid;
  }
}
