/* Constantin black art layer. Small, explicit, and Relearn-safe. */

:root {
  --cc-black: #000;
  --cc-text: #e8ecf8;
  --cc-muted: #a8afc2;
  --cc-cyan: #00f5d4;
  --cc-purple: #a78bfa;
  --cc-pink: #ff2d92;
  --cc-card: rgba(255, 255, 255, 0.045);
  --cc-line: rgba(0, 245, 212, 0.22);
}

html,
body,
#R-body,
#R-body-inner,
#R-content-wrapper,
#R-main-overlay,
#R-sidebar,
#R-sidebar-wrapper,
#body,
#body-inner {
  background: var(--cc-black) !important;
}

body,
#body-inner {
  color: var(--cc-text) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#body-inner {
  line-height: 1.72;
}

#body-inner p,
#body-inner li,
#body-inner td,
#body-inner dd,
#body-inner dt {
  color: var(--cc-text);
}

#body-inner strong {
  color: #fff;
}

#body-inner a {
  color: var(--cc-cyan);
  text-decoration-color: rgba(0, 245, 212, 0.45);
  text-underline-offset: 0.18em;
}

#body-inner a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 245, 212, 0.45);
}

#body-inner h1,
#body-inner h1 *,
#body-inner h2,
#body-inner h2 *,
#body-inner h3,
#body-inner h3 *,
#body-inner h4,
#body-inner h4 *,
#body-inner h5,
#body-inner h5 *,
#body-inner h6,
#body-inner h6 * {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

#body-inner h1 {
  text-shadow: 0 0 18px rgba(0, 245, 212, 0.32), 0 0 34px rgba(167, 139, 250, 0.22);
}

#body-inner h2 {
  border-bottom: 0;
  margin-top: 2.4rem;
  padding-bottom: 0.4rem;
  position: relative;
  text-shadow: 0 0 14px rgba(167, 139, 250, 0.28);
}

#body-inner h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(15rem, 100%);
  height: 2px;
  background: linear-gradient(90deg, var(--cc-cyan), var(--cc-purple), var(--cc-pink));
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.35);
}

#body-inner h3,
#body-inner h3 * {
  color: var(--cc-cyan) !important;
  -webkit-text-fill-color: var(--cc-cyan) !important;
}

#body-inner hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.55), rgba(255, 45, 146, 0.35), transparent);
  margin: 2rem 0;
}

#body-inner table {
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 28px rgba(0, 245, 212, 0.06);
}

#body-inner th {
  background: rgba(0, 245, 212, 0.08);
  color: #fff !important;
}

#body-inner td,
#body-inner th {
  border-color: rgba(255, 255, 255, 0.08);
}

#body-inner img {
  border-radius: 12px;
  border: 1px solid rgba(0, 245, 212, 0.25);
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.11);
}

#body-inner blockquote {
  background: rgba(167, 139, 250, 0.07);
  border-left: 3px solid var(--cc-purple);
  border-radius: 0 12px 12px 0;
}

.cc-hero {
  background:
    radial-gradient(circle at 18% 25%, rgba(0, 245, 212, 0.18), transparent 34%),
    radial-gradient(circle at 85% 70%, rgba(255, 45, 146, 0.14), transparent 34%),
    #000;
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: 22px;
  padding: clamp(2rem, 5vw, 3.4rem);
  margin: 0 0 2rem 0;
  box-shadow: 0 0 45px rgba(0, 245, 212, 0.12);
}

.cc-hero h1,
.hero-banner h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 0.95;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.cc-hero-tagline,
.hero-tagline {
  color: var(--cc-cyan) !important;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cc-hero-location,
.cc-hero-quote,
.hero-location,
.hero-quote {
  color: var(--cc-muted) !important;
}

.cc-hero-quote,
.hero-quote {
  margin-top: 1.2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--cc-purple);
  font-style: italic;
}

.cc-stat-row,
.cc-about-grid,
.stat-row,
.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 1.5rem 0 2rem;
}

.cc-stat-card,
.cc-about-card,
.stat-card,
.about-card {
  background: var(--cc-card);
  border: 1px solid rgba(0, 245, 212, 0.18);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
}

.cc-stat-card:hover,
.cc-about-card:hover,
.stat-card:hover,
.about-card:hover {
  border-color: rgba(255, 45, 146, 0.45);
  box-shadow: 0 0 28px rgba(255, 45, 146, 0.12);
  transform: translateY(-2px);
}

.cc-stat-card,
.stat-card {
  text-align: center;
}

.cc-stat-icon,
.stat-icon {
  font-size: 1.7rem;
}

.cc-stat-value,
.cc-timeline-title,
.stat-value,
.timeline-title {
  color: #fff !important;
  font-weight: 800;
}

.cc-stat-label,
.cc-timeline-year,
.cc-timeline-desc,
.stat-label,
.timeline-year,
.timeline-desc {
  color: var(--cc-muted) !important;
}

.cc-stat-label,
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cc-section-header,
.section-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2.3rem;
}

.cc-section-header h2,
.section-header h2 {
  margin: 0;
}

.cc-section-emoji,
.section-emoji {
  filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.45));
}

.cc-dna-divider,
.dna-divider {
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.25rem;
  text-align: center;
  margin: 2rem 0;
}

.cc-timeline,
.timeline {
  border-left: 2px solid rgba(0, 245, 212, 0.35);
  margin: 1.4rem 0;
  padding-left: 1.2rem;
}

.cc-timeline-item,
.timeline-item {
  margin-bottom: 1.2rem;
}

.cc-contact-row,
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.cc-contact-badge,
.contact-badge {
  border: 1px solid rgba(0, 245, 212, 0.28);
  border-radius: 999px;
  color: #fff !important;
  padding: 0.55rem 1rem;
  text-decoration: none !important;
  background: rgba(255, 255, 255, 0.06);
}

.cc-contact-badge:hover,
.contact-badge:hover {
  background: rgba(0, 245, 212, 0.11);
}

body:has(.cc-hero) #body-inner > h1:first-of-type,
body:has(.hero-banner) #body-inner > h1:first-of-type,
body:has(.hw-hero) #body-inner > h1:first-of-type,
body:has(.cc-hero) article > h1:first-of-type,
body:has(.hero-banner) article > h1:first-of-type,
body:has(.hw-hero) article > h1:first-of-type {
  display: none;
}

/* Homework index: portfolio card wall inspired by strong HTGAA student pages. */
.hw-hero {
  margin: 0 0 2rem;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid rgba(0, 245, 212, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 25%, rgba(0, 245, 212, 0.16), transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(255, 45, 146, 0.12), transparent 34%),
    #000;
  box-shadow: 0 0 42px rgba(0, 245, 212, 0.09);
}

.hw-hero h1 {
  margin: 0.15rem 0 0.45rem;
  font-size: clamp(2.25rem, 7vw, 4.6rem);
  line-height: 0.95;
}

.hw-kicker {
  margin: 0;
  color: var(--cc-cyan) !important;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hw-hero p:last-child {
  max-width: 58rem;
  margin-bottom: 0;
  color: var(--cc-muted);
}

.hw-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.35rem;
  margin: 1.5rem 0 3rem;
}

.hw-card {
  position: relative;
  display: flex;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(9, 9, 13, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-decoration: none !important;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.hw-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 245, 212, 0.58);
  box-shadow: 0 0 34px rgba(0, 245, 212, 0.13), 0 18px 52px rgba(0, 0, 0, 0.7);
}

.hw-card img,
.hw-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #050509;
}

.hw-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hw-thumb span {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.22);
}

.hw-thumb--governance {
  background: radial-gradient(circle at 35% 30%, rgba(0, 245, 212, 0.35), transparent 32%), linear-gradient(135deg, #000, #111827);
}

.hw-thumb--protein {
  background: radial-gradient(circle at 65% 40%, rgba(167, 139, 250, 0.42), transparent 30%), linear-gradient(135deg, #000, #150722);
}

.hw-thumb--circuit {
  background: repeating-linear-gradient(90deg, rgba(0, 245, 212, 0.18) 0 2px, transparent 2px 18px), linear-gradient(135deg, #000, #061a1a);
}

.hw-thumb--gene {
  background: radial-gradient(circle at 50% 50%, rgba(255, 45, 146, 0.34), transparent 36%), linear-gradient(135deg, #000, #190411);
}

.hw-thumb--cellfree {
  background: radial-gradient(circle at 40% 45%, rgba(125, 252, 0, 0.28), transparent 32%), linear-gradient(135deg, #000, #071607);
}

.hw-thumb--massspec {
  background: linear-gradient(135deg, #000, #0b1022 65%, #111), radial-gradient(circle, rgba(0, 245, 212, 0.3), transparent 35%);
}

.hw-body {
  position: relative;
  flex: 1;
  padding: 1.15rem 1.15rem 1.05rem;
}

.hw-badge {
  position: absolute;
  top: -1.15rem;
  left: 1rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: #ffd166;
  color: #050505;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hw-label {
  margin: 0 0 0.4rem;
  color: var(--cc-cyan) !important;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hw-card h2 {
  margin: 0 0 0.55rem !important;
  padding: 0 !important;
  font-size: 1.08rem;
  line-height: 1.2;
}

.hw-card h2::after {
  display: none;
}

.hw-card p {
  margin: 0 0 0.85rem;
  color: rgba(232, 236, 248, 0.76) !important;
  font-size: 0.92rem;
  line-height: 1.55;
}

.hw-card strong {
  color: #ffd166 !important;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
}

@media (prefers-reduced-motion: no-preference) {
  .cc-stat-card,
  .cc-about-card,
  .cc-contact-badge,
  .stat-card,
  .about-card,
  .contact-badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
}

/* Final heading contrast override.
   Relearn's real content wrapper is #R-body-inner, not #body-inner.
   This block intentionally comes last so it wins against active theme variants. */
#R-body-inner h1,
#R-body-inner h1 *,
#R-body-inner h2,
#R-body-inner h2 *,
#R-body-inner h3,
#R-body-inner h3 *,
#R-body-inner h4,
#R-body-inner h4 *,
#R-body-inner h5,
#R-body-inner h5 *,
#R-body-inner h6,
#R-body-inner h6 *,
#R-body-inner .article-subheading,
#R-body-inner .card-title,
#R-body-inner .btn.anchor i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

#R-body-inner h1 {
  text-shadow: 0 0 18px rgba(0, 245, 212, 0.35), 0 0 30px rgba(167, 139, 250, 0.24) !important;
}

#R-body-inner h2 {
  position: relative;
  border-bottom: 0 !important;
  text-shadow: 0 0 15px rgba(0, 245, 212, 0.26) !important;
}

#R-body-inner h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.18rem;
  width: min(15rem, 100%);
  height: 2px;
  background: linear-gradient(90deg, var(--cc-cyan), var(--cc-purple), var(--cc-pink));
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.35);
}

#R-body-inner h3,
#R-body-inner h3 * {
  color: var(--cc-cyan) !important;
  -webkit-text-fill-color: var(--cc-cyan) !important;
}

#R-body-inner p,
#R-body-inner li,
#R-body-inner td,
#R-body-inner dd,
#R-body-inner dt {
  color: var(--cc-text) !important;
}

#R-body-inner th,
#R-body-inner th * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body:has(.cc-hero) #R-body-inner > h1:first-of-type,
body:has(.hero-banner) #R-body-inner > h1:first-of-type,
body:has(.hw-hero) #R-body-inner > h1:first-of-type,
body:has(.cc-hero) #R-body-inner article > h1:first-of-type,
body:has(.hero-banner) #R-body-inner article > h1:first-of-type,
body:has(.hw-hero) #R-body-inner article > h1:first-of-type {
  display: none !important;
}

/* Global readable tables.
   Relearn can render Markdown tables with light row backgrounds even on the
   black theme, so table text must stay dark for contrast. */
#R-body-inner table {
  background: #ffffff !important;
  border: 1px solid #cfd4df !important;
  border-collapse: collapse !important;
  border-radius: 12px;
  box-shadow: 0 0 28px rgba(0, 245, 212, 0.08);
  overflow: hidden;
}

#R-body-inner table thead,
#R-body-inner table tbody,
#R-body-inner table tr {
  background: #ffffff !important;
}

#R-body-inner table th,
#R-body-inner table td {
  background: #ffffff !important;
  border: 1px solid #cfd4df !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

#R-body-inner table th,
#R-body-inner table th * {
  background: #e8ecf8 !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 800;
}

#R-body-inner table td,
#R-body-inner table td *,
#R-body-inner table td strong,
#R-body-inner table tr,
#R-body-inner table tr * {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

#R-body-inner table a,
#R-body-inner table a * {
  color: #0645ad !important;
  -webkit-text-fill-color: #0645ad !important;
}
