:root {
  --primary-color: #1a1a1a;
  --secondary-color: #4a4a4a;
  --accent-color: #3b82f6;
  --bg-color: #f8fafc;
  --surface-color: rgba(255, 255, 255, 0.85);
  --border-color: rgba(0, 0, 0, 0.08);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-color);
  background-image: 
    radial-gradient(at 40% 20%, hsla(210,100%,94%,1) 0px, transparent 50%),
    radial-gradient(at 80% 0%, hsla(189,100%,96%,1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, hsla(355,100%,97%,1) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.2rem;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

nav a:hover {
  color: var(--primary-color);
  background: rgba(0, 0, 0, 0.04);
}

/* Main */
main {
  flex: 1;
  padding: 3rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

.hidden {
  display: none !important;
}

#loading {
  text-align: center;
  padding: 4rem 2rem;
}

#error {
  background: #fee2e2;
  color: #991b1b;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #ef4444;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

/* Welcome Page */
.welcome-page {
  text-align: center;
  padding: 2rem 0;
}

.welcome-header {
  margin-bottom: 4rem;
}

.welcome-header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-header p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.welcome-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.welcome-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(255, 255, 255, 0.9);
}

.link-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.link-arrow {
  font-size: 1.25rem;
  color: var(--accent-color);
  transition: transform 0.2s ease;
}

.welcome-link:hover .link-arrow {
  transform: translateX(4px);
}

/* Legal Document */
.legal-document {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 3.5rem;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.doc-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.doc-status {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-status.active {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.doc-status.inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.doc-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.doc-dates {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.date-separator {
  color: var(--border-color);
  font-weight: 400;
}

.doc-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
}

.doc-content h1, .doc-content h2, .doc-content h3, .doc-content h4 {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.doc-content h1 { font-size: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.doc-content h2 { font-size: 1.5rem; }
.doc-content h3 { font-size: 1.25rem; }

.doc-content p { margin-bottom: 1.25rem; }

.doc-content ul, .doc-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.doc-content li {
  margin-bottom: 0.5rem;
}

.doc-content a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.doc-content a:hover {
  border-bottom-color: var(--accent-color);
}

.doc-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding: 1rem 1.5rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: #475569;
}

.doc-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  color: #ef4444;
}

.doc-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.doc-footer a {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
}

.doc-footer a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
}

.footer-section:first-child { text-align: left; }
.footer-section:last-child { text-align: right; }

.footer-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  nav {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
  }
  
  .legal-document {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .doc-title {
    font-size: 2rem;
  }
  
  .doc-dates {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .footer-section:first-child, 
  .footer-section:last-child { 
    text-align: center; 
  }
}
