/* ==========================================================================
   DEFORMITY CORRECTION HULL - CORE DESIGN SYSTEM (Clean & Executive)
   Refined 2026/2027 Medical Aesthetic: Crisp White Canvas & Deep Surgical Navy
   ========================================================================== */

:root {
  /* DCH Brand Palette (Preserved & Elevated) */
  --dch-navy: #002f5d;
  --dch-navy-dark: #001c38;
  --dch-navy-light: #0d4680;
  --dch-blue: #0284c7;
  --dch-blue-light: #e0f2fe;
  --dch-accent: #0284c7;

  /* Crisp Neutral Canvas with Architectural Depth */
  --bg-page: #edf2f7;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-on-navy: #ffffff;
  --text-on-navy-muted: #cbd5e1;

  /* Layout Tokens */
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* High-End Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(0, 47, 93, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(0, 47, 93, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 240ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Accessibility Scaling */
  --font-scale: 1;
}

/* Accessibility Modes */
body.font-dyslexic {
  --font-sans: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
  letter-spacing: 0.04em;
  line-height: 1.8 !important;
}

html.text-size-lg,
body.text-size-lg {
  --font-scale: 1.18;
}

html.text-size-xl,
body.text-size-xl {
  --font-scale: 1.36;
}

html.text-size-lg {
  font-size: 19px !important;
}

html.text-size-xl {
  font-size: 22px !important;
}

body.text-size-lg p,
body.text-size-lg .nav-link,
body.text-size-lg .hero-description,
body.text-size-lg .content-lead,
body.text-size-lg li:not(.accessibility-drawer *),
body.text-size-lg span:not(.accessibility-drawer *):not(.floating-a11y-widget *) {
  font-size: calc(1em * 1.12);
}

body.text-size-xl p,
body.text-size-xl .nav-link,
body.text-size-xl .hero-description,
body.text-size-xl .content-lead,
body.text-size-xl li:not(.accessibility-drawer *),
body.text-size-xl span:not(.accessibility-drawer *):not(.floating-a11y-widget *) {
  font-size: calc(1em * 1.25);
}

/* Ensure accessibility drawer controls stay at base readable size */
.accessibility-drawer,
.accessibility-drawer *,
.floating-a11y-widget,
.floating-a11y-widget * {
  font-size: 14px;
}

html.contrast-high,
body.contrast-high {
  --bg-page: #ffffff !important;
  --bg-card: #ffffff !important;
  --text-primary: #000000 !important;
  --text-secondary: #000000 !important;
  --text-muted: #111111 !important;
  --border-light: #000000 !important;
  --dch-navy: #000000 !important;
  --dch-blue: #0000ee !important;
}

html.mode-grayscale {
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
}

body.reduce-motion * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

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

html {
  font-size: calc(16px * var(--font-scale));
  scroll-behavior: smooth;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--dch-navy);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 20px;
  outline: 3px solid #0284c7;
}

:focus-visible {
  outline: 3px solid var(--dch-blue);
  outline-offset: 2px;
}

/* Layout Container */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-base);
  width: calc(100vw - var(--sidebar-width));
}

.view-wrapper {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem 2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 3.75rem;
  opacity: 1;
  transform: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--dch-navy);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
}

h3 {
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
}

p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.65;
}

a {
  color: var(--dch-navy);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--dch-blue);
}

/* Refined Cards */
.card-clean {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card-clean:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-navy {
  background: rgba(0, 47, 93, 0.08);
  color: var(--dch-navy);
  border: 1px solid rgba(0, 47, 93, 0.2);
}

.badge-blue {
  background: var(--dch-blue-light);
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.badge-rcs {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Buttons */
/* Buttons with Advanced Micro-Interactions & Shimmer */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-22deg);
  transition: none;
  pointer-events: none;
}

.btn:hover::after {
  left: 160%;
  transition: left 0.75s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #002f5d 0%, #034b91 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 47, 93, 0.28), 0 2px 4px rgba(0, 47, 93, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #002347 0%, #0266c8 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.38), 0 2px 6px rgba(0, 47, 93, 0.2);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--dch-navy);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--dch-blue);
  color: var(--dch-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 47, 93, 0.1);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.45);
  color: #ffffff;
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 1rem 2.2rem;
  font-size: 1.05rem;
}

/* Page Transitions & Slide-in Animations */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titleSlideIn {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes subtitleSlideIn {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cardStaggerIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-view {
  animation: pageFadeIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.app-view .section-title {
  animation: titleSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both;
}

.app-view .section-eyebrow {
  animation: subtitleSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.02s both;
}

.app-view .hero-card {
  animation: cardStaggerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.app-view .metrics-ribbon {
  animation: cardStaggerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.app-view .faculty-grid,
.app-view .faculty-card {
  animation: cardStaggerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
}

.app-view .sponsors-section {
  animation: cardStaggerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

/* Preloader (Advanced Medical-Tech Experience) */
.dch-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, #ffffff 0%, #f0f4f8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dch-preloader.preloader-hidden {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.preloader-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 2.25rem 2.75rem;
  box-shadow: 0 20px 48px -8px rgba(0, 47, 93, 0.18), 0 0 0 1px rgba(0, 47, 93, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.preloader-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.preloader-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  position: relative;
  z-index: 2;
  animation: logoPulse 2.4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 8px rgba(0, 47, 93, 0.12));
  }
  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 8px 18px rgba(2, 132, 199, 0.3));
  }
}

.preloader-bar-wrap {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.preloader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #002f5d 0%, #0284c7 60%, #38bdf8 100%);
  border-radius: var(--radius-full);
  animation: loadProgress 0.85s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loadProgress {
  0% {
    width: 0%;
  }
  40% {
    width: 65%;
  }
  80% {
    width: 90%;
  }
  100% {
    width: 100%;
  }
}

.preloader-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dch-navy);
}

.preloader-dot {
  color: #0284c7;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
