/* Base */
:root {
	/* Brand-aligned gradient: mint green → soft teal (from logo palette) */
	--bg-start: #eaf5ef; /* light mint */
	--bg-end: #e6f4f5;   /* light teal */
	--pill-bg: rgba(255,255,255,0.7);
	--pill-border: rgba(0,0,0,0.08);
	--pill-shadow: 0 4px 24px rgba(0,0,0,0.06);
	--ink: #20222a;
	--ink-dim: #5a5f72;
	--accent: #6a6ff5;
}

html, body {
	height: 100%;
}
body {
	font-family: 'Roboto', Arial, sans-serif;
	color: var(--ink);
	margin: 0;
	background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

/* Header */
.site-header {
	padding: 16px 24px;
	position: static;
	top: 0;
	z-index: 100;
}
/* In Dash apps, keep the header static so it doesn't overlay scrolling content */
.dash-page .site-header {
	position: static;
	z-index: 1;
}

/* Keep MathJax display equations inside the container (v3 + v2) */
.dash-page mjx-container[display="true"],
.dash-page .MathJax_Display {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

/* Allow inline math to wrap */
.dash-page mjx-container:not([display="true"]),
.dash-page .MathJax {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Guard against accidental horizontal overflow on the page container */
.dash-page .page-container {
  overflow-x: hidden;
}

.header-inner {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}
.brand-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
}
.brand-name {
	font-weight: 800;
	font-size: 1.25rem;
	color: var(--ink);
}

/* Nav pill */
.nav-pill {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--pill-bg);
	backdrop-filter: blur(6px);
	padding: 8px;
	border-radius: 9999px;
	border: 1px solid var(--pill-border);
	box-shadow: var(--pill-shadow);
}

/* Dropdowns */
.dropdown { position: static; display: inline-block; }
.dropbtn {
	background: transparent;
	color: var(--ink);
	padding: 10px 16px;
	font-size: 1rem;
	border: none;
	border-radius: 9999px;
	cursor: pointer;
}
.dropbtn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.dropbtn:hover { background: rgba(0,0,0,0.04); }
.dropbtn:focus { outline: none; }
.dropdown-content {
	display: none;
	position: absolute;
	left: 0;
	background: #fff;
	min-width: 240px;
	box-shadow: 0 12px 28px rgba(0,0,0,0.12);
	border-radius: 12px;
	z-index: 10;
	margin-top: 8px;
	border: 1px solid #eee;
}
.dropdown.open .dropdown-content { display: block; }
.dropdown-content a {
	color: var(--ink);
	padding: 12px 16px;
	text-decoration: none;
	display: block;
	font-size: 0.98rem;
	border-bottom: 1px solid #f2f2f2;
}
.dropdown-content a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background: #f8f9fb; }

/* Page container */
.page-container {
	max-width: 900px;
	margin: 24px auto 48px;
	padding: 32px;
	background: rgba(255,255,255,0.82);
	border: 1px solid #eef0f4;
	border-radius: 16px;
	box-shadow: 0 8px 36px rgba(0,0,0,0.08);
}

h1 { font-weight: 800; font-size: 2.4rem; margin-bottom: 0.5em; }
p { font-size: 1.15rem; color: var(--ink-dim); }
.mascot { display: block; margin: 0 auto 2em auto; max-width: 420px; }

/* Footer */
.site-footer {
	text-align: center;
	color: var(--ink-dim);
	padding: 24px 0 40px;
}

/* Theme toggle button */
.theme-toggle {
	margin-left: 8px;
	background: var(--pill-bg);
	border: 1px solid var(--pill-border);
	color: var(--ink);
	border-radius: 9999px;
	padding: 8px 12px;
	cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,0.9); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dark theme */
body[data-theme="dark"] {
	/* Brand-aligned dark gradient: deep teal → teal-navy */
	--bg-start: #0e3a36;
	--bg-end: #103a4a;
	--pill-bg: rgba(28,29,38,0.6);
	--pill-border: rgba(255,255,255,0.08);
	--pill-shadow: 0 6px 24px rgba(0,0,0,0.5);
	--ink: #e9eaf1;
	--ink-dim: #b6bad1;
	--accent: #8ea2ff;
}
body[data-theme="dark"] .dropdown-content { background: #2b2f45; border-color: rgba(255,255,255,0.08); }
body[data-theme="dark"] .dropdown-content a { color: var(--ink); border-bottom-color: rgba(255,255,255,0.08); }
body[data-theme="dark"] .dropdown-content a:hover { background: rgba(255,255,255,0.06); }
body[data-theme="dark"] .page-container { background: rgba(25,26,35,0.8); border-color: rgba(255,255,255,0.08); box-shadow: 0 8px 36px rgba(0,0,0,0.6); }

/* Responsive tweaks */
@media (max-width: 780px) {
	.nav-pill { width: 100%; justify-content: space-between; flex-wrap: wrap; }
	.dropbtn { padding: 8px 12px; font-size: 0.95rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
	.nav-pill { box-shadow: none; }
}
