/*
 * Light-mode polish for the dark-first generated site.
 * Every rule is scoped to .shoug-light-mode so dark mode remains untouched.
 */
body.shoug-light-mode {
  --bg: #f8f6ff;
  --bg-void: #f8f6ff;
  --bg-surface: #ffffff;
  --bg-elevated: #f1ecff;
  --surface: rgba(255, 255, 255, 0.9);
  --text-main: #21152f;
  --text-primary: #21152f;
  --text-bright: #21152f;
  --text-high: #21152f;
  --text-secondary: #574867;
  --text-med: #574867;
  --text-dim: #6e607d;
  --text-dimmed: #6e607d;
  --text-muted: #766786;
  --text-low: #766786;
  --text-dark: #21152f;
  --border: rgba(108, 55, 145, 0.2);
  --border-color: rgba(108, 55, 145, 0.2);
  --border-dim: rgba(108, 55, 145, 0.13);
  --border-subtle: rgba(108, 55, 145, 0.13);
  --border-main: rgba(108, 55, 145, 0.24);
  --border-med: rgba(108, 55, 145, 0.26);
  --border-medium: rgba(108, 55, 145, 0.26);
  --border-hard: rgba(108, 55, 145, 0.34);
  --grid-line: rgba(184, 41, 234, 0.07);
  --grid-pattern: rgba(184, 41, 234, 0.07);
  color-scheme: light;
  background-color: #f8f6ff !important;
  background-image:
    radial-gradient(circle at 10% 8%, rgba(184, 41, 234, 0.1), transparent 25rem),
    radial-gradient(circle at 92% 28%, rgba(255, 42, 75, 0.08), transparent 24rem),
    linear-gradient(rgba(184, 41, 234, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 41, 234, 0.055) 1px, transparent 1px) !important;
  background-size: auto, auto, 40px 40px, 40px 40px !important;
  color: var(--text-main) !important;
}

body.shoug-light-mode::before,
body.shoug-light-mode::after {
  opacity: 0.22 !important;
}

body.shoug-light-mode .shoug-site-header,
body.shoug-light-mode .shoug-site-footer,
body.shoug-light-mode .top-bar,
body.shoug-light-mode .sidebar,
body.shoug-light-mode .academic-sidebar,
body.shoug-light-mode .sidebar-header {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(108, 55, 145, 0.2) !important;
  box-shadow: 0 12px 36px rgba(81, 37, 112, 0.08) !important;
}

body.shoug-light-mode .shoug-site-header,
body.shoug-light-mode .top-bar {
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

body.shoug-light-mode .shoug-site-footer {
  background:
    linear-gradient(135deg, rgba(246, 238, 255, 0.98), rgba(255, 241, 247, 0.98)) !important;
}

body.shoug-light-mode .shoug-header-logo,
body.shoug-light-mode .shoug-footer-brand,
body.shoug-light-mode h1,
body.shoug-light-mode h2,
body.shoug-light-mode h3,
body.shoug-light-mode h4,
body.shoug-light-mode h5,
body.shoug-light-mode strong {
  color: #21152f !important;
  text-shadow: none !important;
}

body.shoug-light-mode .shoug-header-nav a:hover,
body.shoug-light-mode .shoug-header-nav a.active,
body.shoug-light-mode a:hover {
  color: #9b1cc8;
}

body.shoug-light-mode .shoug-icon-btn,
body.shoug-light-mode .shoug-lang-btn,
body.shoug-light-mode .shoug-theme-btn,
body.shoug-light-mode button,
body.shoug-light-mode input,
body.shoug-light-mode textarea,
body.shoug-light-mode select {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(108, 55, 145, 0.25);
  color: #21152f;
}

body.shoug-light-mode .hero-terminal,
body.shoug-light-mode .terminal-window,
body.shoug-light-mode .terminal-panel,
body.shoug-light-mode [class*="terminal-box"],
body.shoug-light-mode [class*="code-window"],
body.shoug-light-mode [class*="code-panel"] {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(242, 235, 255, 0.96)) !important;
  border-color: rgba(184, 41, 234, 0.3) !important;
  box-shadow: 0 28px 70px rgba(92, 41, 128, 0.16) !important;
  color: #382548 !important;
}

body.shoug-light-mode .terminal-header,
body.shoug-light-mode [class*="terminal-header"],
body.shoug-light-mode [class*="code-header"] {
  background: rgba(229, 216, 247, 0.72) !important;
  border-color: rgba(108, 55, 145, 0.2) !important;
}

body.shoug-light-mode .terminal-content,
body.shoug-light-mode [class*="terminal-content"],
body.shoug-light-mode [class*="code-content"],
body.shoug-light-mode .term-dim {
  color: #655473 !important;
}

body.shoug-light-mode .terminal-scanline,
body.shoug-light-mode [class*="scanline"] {
  opacity: 0.08 !important;
}

body.shoug-light-mode .stat-card,
body.shoug-light-mode .work-card,
body.shoug-light-mode .explore-item,
body.shoug-light-mode [class$="-card"],
body.shoug-light-mode [class*="-card "],
body.shoug-light-mode [class$="-panel"],
body.shoug-light-mode [class*="-panel "],
body.shoug-light-mode [class$="-box"],
body.shoug-light-mode [class*="-box "],
body.shoug-light-mode [class$="-tile"],
body.shoug-light-mode [class*="-tile "],
body.shoug-light-mode [class$="-widget"],
body.shoug-light-mode [class*="-widget "] {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 242, 255, 0.96)) !important;
  border-color: rgba(108, 55, 145, 0.2) !important;
  box-shadow: 0 16px 42px rgba(81, 37, 112, 0.09) !important;
  color: var(--text-main) !important;
}

body.shoug-light-mode .stat-card:hover,
body.shoug-light-mode .work-card:hover,
body.shoug-light-mode .explore-item:hover,
body.shoug-light-mode [class$="-card"]:hover,
body.shoug-light-mode [class$="-panel"]:hover,
body.shoug-light-mode [class$="-tile"]:hover {
  background:
    linear-gradient(145deg, #ffffff, #f4eaff) !important;
  border-color: rgba(184, 41, 234, 0.58) !important;
  box-shadow: 0 22px 52px rgba(111, 35, 154, 0.16) !important;
}

body.shoug-light-mode .work-card::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(248, 244, 255, 0.68) 48%, rgba(247, 241, 255, 0.98) 100%) !important;
}

body.shoug-light-mode .work-card-preview {
  filter: saturate(0.82) brightness(1.08) contrast(0.9);
}

body.shoug-light-mode .work-card:hover .work-card-preview {
  filter: saturate(1) brightness(1.04) contrast(0.96);
}

body.shoug-light-mode .explore {
  background:
    radial-gradient(circle at bottom right, rgba(184, 41, 234, 0.13), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(244, 237, 255, 0.62)) !important;
}

body.shoug-light-mode .explore-grid,
body.shoug-light-mode [class*="grid-frame"],
body.shoug-light-mode [class*="directory"],
body.shoug-light-mode [class*="table-wrap"] {
  background-color: rgba(108, 55, 145, 0.18) !important;
  border-color: rgba(108, 55, 145, 0.22) !important;
}

body.shoug-light-mode .dir-row,
body.shoug-light-mode .tree-item,
body.shoug-light-mode .list-row,
body.shoug-light-mode [class*="resource-row"],
body.shoug-light-mode [class*="course-row"] {
  background: rgba(255, 255, 255, 0.76) !important;
  border-color: rgba(108, 55, 145, 0.16) !important;
  color: var(--text-main) !important;
}

body.shoug-light-mode .dir-row:hover,
body.shoug-light-mode .tree-item:hover,
body.shoug-light-mode .list-row:hover,
body.shoug-light-mode [class*="resource-row"]:hover,
body.shoug-light-mode [class*="course-row"]:hover {
  background: rgba(241, 230, 255, 0.94) !important;
  border-color: rgba(184, 41, 234, 0.42) !important;
}

body.shoug-light-mode .hero-bg-glow,
body.shoug-light-mode .cursor-follower,
body.shoug-light-mode [class*="glow"] {
  opacity: 0.32 !important;
}

body.shoug-light-mode .bio-text,
body.shoug-light-mode p,
body.shoug-light-mode li,
body.shoug-light-mode td,
body.shoug-light-mode label {
  color: var(--text-secondary);
}

body.shoug-light-mode .section-tag,
body.shoug-light-mode .eyebrow,
body.shoug-light-mode [class*="-tag"],
body.shoug-light-mode [class*="-label"] {
  text-shadow: none !important;
}

body.shoug-light-mode table {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(108, 55, 145, 0.2) !important;
  box-shadow: 0 16px 42px rgba(81, 37, 112, 0.08);
}

body.shoug-light-mode th {
  background: #eee4fa !important;
  color: #2c193b !important;
}

body.shoug-light-mode td {
  background: rgba(255, 255, 255, 0.78) !important;
  border-color: rgba(108, 55, 145, 0.14) !important;
}

body.shoug-light-mode pre,
body.shoug-light-mode code {
  background: #eee8f8;
  border-color: rgba(108, 55, 145, 0.2);
  color: #432955;
}

body.shoug-light-mode hr {
  border-color: rgba(108, 55, 145, 0.18) !important;
}

/* Resources page: bright editorial light palette */
body.shoug-light-mode:has(.jump-nav) {
  --bg-void: #fffaf4;
  --bg-surface: #ffffff;
  --bg-elevated: #f6f0ff;
  --brand-purple: #8b19d6;
  --brand-purple-dim: rgba(139, 25, 214, 0.1);
  --alert-red: #ef3158;
  --alert-red-dim: rgba(239, 49, 88, 0.1);
  --text-bright: #21142e;
  --text-main: #392b45;
  --text-muted: #70627b;
  --border-color: rgba(139, 25, 214, 0.28);
  --border-alert: rgba(239, 49, 88, 0.32);
  background-color: #fffaf4 !important;
  background-image:
    radial-gradient(circle at 6% 10%, rgba(139, 25, 214, 0.09), transparent 30rem),
    radial-gradient(circle at 94% 34%, rgba(239, 49, 88, 0.07), transparent 28rem),
    linear-gradient(rgba(139, 25, 214, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 25, 214, 0.055) 1px, transparent 1px) !important;
}

body.shoug-light-mode:has(.jump-nav) #glcanvas {
  opacity: 0.06 !important;
}

body.shoug-light-mode:has(.jump-nav) .breadcrumb {
  color: #766580 !important;
}

body.shoug-light-mode:has(.jump-nav) .hero-label {
  background: #8b19d6 !important;
  color: #ffffff !important;
  box-shadow: 7px 7px 0 rgba(239, 49, 88, 0.14);
}

body.shoug-light-mode:has(.jump-nav) .hero h1 {
  color: #21142e !important;
  text-shadow: 3px 3px 0 rgba(139, 25, 214, 0.12) !important;
}

body.shoug-light-mode:has(.jump-nav) .hero-meta {
  padding: 14px 18px;
  background: #ffffff !important;
  border: 1px solid rgba(139, 25, 214, 0.3) !important;
  box-shadow: 8px 8px 0 rgba(139, 25, 214, 0.08);
  color: #5b287d !important;
}

body.shoug-light-mode:has(.jump-nav) .jump-nav {
  background: rgba(255, 250, 244, 0.94) !important;
  border-color: rgba(139, 25, 214, 0.28) !important;
  box-shadow: 0 10px 28px rgba(69, 31, 92, 0.08);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

body.shoug-light-mode:has(.jump-nav) .jump-nav a {
  color: #7918b9 !important;
}

body.shoug-light-mode:has(.jump-nav) .jump-nav a.nav-alert {
  color: #df284d !important;
}

body.shoug-light-mode:has(.jump-nav) details {
  background: #ffffff !important;
  border-color: rgba(139, 25, 214, 0.28) !important;
  box-shadow: 10px 10px 0 rgba(139, 25, 214, 0.07) !important;
}

body.shoug-light-mode:has(.jump-nav) details.theme-alert {
  border-color: rgba(239, 49, 88, 0.34) !important;
  box-shadow: 10px 10px 0 rgba(239, 49, 88, 0.07) !important;
}

body.shoug-light-mode:has(.jump-nav) summary {
  background:
    linear-gradient(100deg, #f3e9ff, #fff 58%) !important;
  border-color: rgba(139, 25, 214, 0.24) !important;
}

body.shoug-light-mode:has(.jump-nav) .theme-alert summary {
  background:
    linear-gradient(100deg, #ffe9ee, #fff 58%) !important;
}

body.shoug-light-mode:has(.jump-nav) .section-num {
  color: #ffffff !important;
  box-shadow: 4px 4px 0 rgba(33, 20, 46, 0.12);
}

body.shoug-light-mode:has(.jump-nav) .details-content {
  background: #fffdfb !important;
  border-color: rgba(139, 25, 214, 0.2) !important;
}

body.shoug-light-mode:has(.jump-nav) .card {
  background:
    linear-gradient(145deg, #ffffff, #f7f1ff) !important;
  border-color: rgba(139, 25, 214, 0.23) !important;
  box-shadow: inset 0 0 0 1px rgba(139, 25, 214, 0.04), 0 8px 24px rgba(78, 35, 106, 0.07) !important;
}

body.shoug-light-mode:has(.jump-nav) .theme-alert .card {
  background:
    linear-gradient(145deg, #ffffff, #fff2f5) !important;
  border-color: rgba(239, 49, 88, 0.24) !important;
}

body.shoug-light-mode:has(.jump-nav) .card:hover {
  background: #eee0ff !important;
  border-color: #8b19d6 !important;
  box-shadow: 7px 7px 0 rgba(139, 25, 214, 0.13) !important;
  transform: translate(-2px, -2px);
}

body.shoug-light-mode:has(.jump-nav) .theme-alert .card:hover {
  background: #ffe5eb !important;
  border-color: #ef3158 !important;
  box-shadow: 7px 7px 0 rgba(239, 49, 88, 0.12) !important;
}

body.shoug-light-mode:has(.jump-nav) .card-tags span {
  background: #ead7fa !important;
  color: #7113ad !important;
}

body.shoug-light-mode:has(.jump-nav) .theme-alert .card-tags span {
  background: #ffdce4 !important;
  color: #c91e42 !important;
}

body.shoug-light-mode:has(.jump-nav) .warning-banner {
  background: #fff0f3 !important;
}

/* Workshops landing page: clean paper light palette with static CSS glow */
body.shoug-light-mode:has(.workshops-hub) {
  --bg-void: #fffdf8;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f1ff;
  --brand-purple: #8f19d8;
  --alert-red: #ee3159;
  --text-main: #24152f;
  --text-dim: #685873;
  --border-subtle: rgba(99, 47, 126, 0.18);
  --border-medium: rgba(99, 47, 126, 0.34);
  background-color: #fffdf8 !important;
  background-image:
    radial-gradient(circle at 88% 12%, rgba(218, 160, 255, 0.28), transparent 28rem),
    radial-gradient(circle at 8% 42%, rgba(255, 181, 198, 0.2), transparent 24rem),
    linear-gradient(rgba(143, 25, 216, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 25, 216, 0.05) 1px, transparent 1px) !important;
}

body.shoug-light-mode:has(.workshops-hub) #glcanvas {
  display: block !important;
  opacity: 0.48 !important;
}

body.shoug-light-mode:has(.workshops-hub) main::before,
body.shoug-light-mode:has(.workshops-hub) main::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(1px);
}

body.shoug-light-mode:has(.workshops-hub) main::before {
  width: 38rem;
  height: 38rem;
  top: 2rem;
  right: -12rem;
  background: radial-gradient(circle, rgba(197, 119, 244, 0.2), transparent 68%);
}

body.shoug-light-mode:has(.workshops-hub) main::after {
  width: 32rem;
  height: 32rem;
  top: 28rem;
  left: -14rem;
  background: radial-gradient(circle, rgba(255, 137, 164, 0.14), transparent 68%);
}

body.shoug-light-mode:has(.workshops-hub) .breadcrumb {
  color: #74627e !important;
}

body.shoug-light-mode:has(.workshops-hub) .breadcrumb::before {
  background: #8f19d8 !important;
}

body.shoug-light-mode:has(.workshops-hub) .hero-label {
  color: #8f19d8 !important;
  text-shadow: none !important;
}

body.shoug-light-mode:has(.workshops-hub) .hero-title {
  color: #24152f !important;
  text-shadow: 4px 4px 0 rgba(143, 25, 216, 0.1) !important;
}

body.shoug-light-mode:has(.workshops-hub) .hero-ghost {
  -webkit-text-stroke-color: rgba(143, 25, 216, 0.09) !important;
  transform: none !important;
}

body.shoug-light-mode:has(.workshops-hub) .metadata-strip {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.84) !important;
  border: 1px solid rgba(143, 25, 216, 0.24) !important;
  box-shadow: 7px 7px 0 rgba(143, 25, 216, 0.07);
  color: #655170 !important;
}

body.shoug-light-mode:has(.workshops-hub) .hero-dim-text {
  color: #584763 !important;
  border-left-color: #8f19d8 !important;
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card {
  background:
    linear-gradient(135deg, #ffffff, #fbf7ff) !important;
  border-color: rgba(143, 25, 216, 0.22) !important;
  box-shadow: 10px 10px 0 rgba(143, 25, 216, 0.07) !important;
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card[data-accent="red"] {
  border-left: 5px solid #ee3159 !important;
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card[data-accent="purple"] {
  border-left: 5px solid #8f19d8 !important;
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card[data-accent="red"]:hover {
  background: #fff0f3 !important;
  box-shadow: 12px 12px 0 rgba(238, 49, 89, 0.12) !important;
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card[data-accent="purple"]:hover {
  background: #f3e7ff !important;
  box-shadow: 12px 12px 0 rgba(143, 25, 216, 0.12) !important;
}

body.shoug-light-mode:has(.workshops-hub) .card-badge-container {
  background: #fffdf8 !important;
  border-color: rgba(99, 47, 126, 0.42) !important;
}

body.shoug-light-mode:has(.workshops-hub) .type-tag {
  box-shadow: 4px 4px 0 rgba(36, 21, 47, 0.08);
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card[data-accent="red"] .type-tag {
  background: #ffe3ea !important;
  border-color: #ee3159 !important;
  color: #bd173b !important;
}

body.shoug-light-mode:has(.workshops-hub) .dossier-card[data-accent="purple"] .type-tag {
  background: #efddff !important;
  border-color: #8f19d8 !important;
  color: #7113ad !important;
}

body.shoug-light-mode:has(.workshops-hub) .card-desc,
body.shoug-light-mode:has(.workshops-hub) .topic-tag {
  color: #62516d !important;
}

/* Available status: unmistakably green in light mode */
body.shoug-light-mode .status-tag.available,
body.shoug-light-mode .status-tag.status-active,
body.shoug-light-mode .tag-available,
body.shoug-light-mode .badge-available,
body.shoug-light-mode .status-badge.available {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08), 0 5px 14px rgba(21, 128, 61, 0.1) !important;
  text-shadow: none !important;
}

body.shoug-light-mode .dir-row:hover .status-tag.available,
body.shoug-light-mode .dir-row:hover .status-tag.status-active,
body.shoug-light-mode .course-row:hover .status-tag.status-active,
body.shoug-light-mode .tag-available:hover,
body.shoug-light-mode .badge-available:hover {
  background: #bbf7d0 !important;
  border-color: #16a34a !important;
  color: #166534 !important;
}

/*
 * Academic directory shell: force the entire utility row into light mode.
 * These selectors intentionally outrank page-local dark-first header rules.
 */
html body.shoug-light-mode .main-wrapper > .top-bar,
html body.shoug-light-mode .app-layout .main-wrapper > .top-bar,
html body.shoug-light-mode .layout-wrapper .main-wrapper > .top-bar,
html body.shoug-light-mode .sys-layout .main-wrapper > .top-bar {
  background: #fffdf8 !important;
  background-color: #fffdf8 !important;
  background-image: none !important;
  border-color: rgba(143, 25, 216, 0.22) !important;
  color: #2b1938 !important;
  box-shadow: 0 5px 18px rgba(66, 31, 87, 0.07) !important;
  opacity: 1 !important;
}

html body.shoug-light-mode .main-wrapper > .top-bar .breadcrumb,
html body.shoug-light-mode .main-wrapper > .top-bar .breadcrumb-link,
html body.shoug-light-mode .main-wrapper > .top-bar .breadcrumb span,
html body.shoug-light-mode .main-wrapper > .top-bar .breadcrumb .current,
html body.shoug-light-mode .main-wrapper > .top-bar .top-bar-meta,
html body.shoug-light-mode .main-wrapper > .top-bar .sys-time,
html body.shoug-light-mode .main-wrapper > .top-bar #clock,
html body.shoug-light-mode .main-wrapper > .top-bar #live-clock {
  color: #655170 !important;
  text-shadow: none !important;
}

html body.shoug-light-mode .main-wrapper > .top-bar .breadcrumb .current,
html body.shoug-light-mode .main-wrapper > .top-bar .breadcrumb-link:hover {
  color: #7d16bd !important;
}

html body.shoug-light-mode .main-wrapper > .top-bar .separator {
  color: #b79bc6 !important;
}

html body.shoug-light-mode .academic-sidebar > .sidebar-header,
html body.shoug-light-mode .sidebar.academic-sidebar > .sidebar-header {
  background: #ffffff !important;
  background-image: none !important;
  border-color: rgba(143, 25, 216, 0.22) !important;
  color: #2b1938 !important;
  opacity: 1 !important;
}
