/* Clearline Institutional Design System
   All tokens come from clearline-brand.css (loaded first).
   This file contains page-specific layout and component styles only.
*/

html {
  overflow-y: scroll;
}

body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--brand-text1);
  background: var(--brand-bg0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--brand-text0);
  font-weight: 600;
  letter-spacing: var(--letter-tight);
  line-height: 1.2;
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-accent);
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--brand-border);
  padding: 0.5rem 0;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-text0);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  color: var(--brand-text1);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--brand-primary);
  transition: width var(--transition-fast);
}

.nav-link:hover {
  color: var(--brand-text0);
}

.nav-link:hover::after {
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--brand-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--brand-bg0);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 211, 231, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--brand-text0);
  border-color: var(--brand-border);
}

.btn-secondary:hover {
  background: var(--brand-surface0);
  border-color: var(--brand-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-text1);
  border: none;
}

.btn-ghost:hover {
  color: var(--brand-text0);
  background: var(--brand-surface0);
}

/* Cards */
.card {
  background: var(--brand-surface0);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-md);
  padding: 2.5rem;
  box-shadow: var(--brand-shadow-soft);
  transition: all var(--transition-normal);
  position: relative;
}

.card:hover {
  transform: translateY(-4px) rotateX(2deg);
  box-shadow: var(--brand-shadow-lift);
  border-color: rgba(13, 211, 231, 0.3);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.card:hover::before {
  opacity: 1;
}

/* Glass Surface */
.glass {
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hero */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(13, 211, 231, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(13, 211, 231, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: 1.5rem;
  max-width: 900px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--brand-muted);
  max-width: 700px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(13, 211, 231, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(13, 211, 231, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--brand-warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand-success);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Sections */
.section {
  padding: 6rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--brand-muted);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--grid-gutter);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 968px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background: var(--brand-bg1);
  border-top: 1px solid var(--brand-border);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-column h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: var(--brand-text0);
}

.footer-column a {
  display: block;
  color: var(--brand-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  transition: color var(--transition-fast);
}

.footer-column a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: 0.85rem;
}

.footer-disclaimer {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background: var(--brand-surface0);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  font-size: 0.85rem;
  color: var(--brand-muted);
  line-height: 1.6;
}

/* Microcopy */
.microcopy {
  font-size: 0.85rem;
  color: var(--brand-muted);
  margin-top: 1rem;
}

/* Form */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-text0);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  background: var(--brand-surface0);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  color: var(--brand-text0);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 211, 231, 0.1);
}

.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  background: var(--brand-surface0);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  color: var(--brand-text0);
  cursor: pointer;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--brand-border);
  margin-bottom: 2rem;
}

.tab {
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--brand-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--brand-text0);
}

.tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp var(--transition-slow) ease-out;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--brand-text0);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive - Tablet */
@media (max-width: 968px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--brand-bg1);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 0;
    border-left: 1px solid var(--brand-border);
    transition: right 0.3s ease;
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links .nav-link {
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid var(--brand-border);
    font-size: 1.1rem;
  }

  .nav-links .btn {
    width: 100%;
    margin-top: 1rem;
    margin-left: 0 !important;
  }

  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100% - 280px);
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
  }

  .mobile-overlay.active {
    display: block;
  }
  
  .hero {
    min-height: 70vh;
    padding-top: 2rem;
  }
  
  .hero h1 {
    font-size: clamp(28px, 7vw, 42px);
  }
  
  .hero p {
    font-size: 1rem;
  }

  .hero-ctas {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-ctas .btn {
    width: 100%;
  }
  
  .section {
    padding: 3rem 0;
  }

  .section-title {
    font-size: clamp(24px, 5vw, 36px);
  }
  
  .card {
    padding: 1.5rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .nav-inner {
    padding: 0 1.25rem;
  }

  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    padding: 0.75rem 1rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  .hero {
    min-height: 60vh;
    text-align: center;
  }

  .hero h1 {
    font-size: clamp(24px, 8vw, 36px);
  }

  .hero p {
    font-size: 0.95rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .card {
    padding: 1.25rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-disclaimer {
    padding: 1rem;
    font-size: 0.8rem;
  }

  .form-input,
  .form-select {
    padding: 0.75rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Stack pricing cards */
  .pricing-grid {
    grid-template-columns: 1fr !important;
  }

  /* FAQ accordion mobile */
  .faq-question {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 380px) {
  .container {
    padding: 0 1rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--brand-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Accessibility: focus-visible */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
