﻿/* ═══════════════════════════════════════════════════════════════
   GUV Fluctuation Spectroscopy — Global Design System
  Aesthetic: Formal Scientific Journal
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  --bg:        #0f172a;
  --bg2:       #111827;
  --bg3:       #1f2937;
  --border:    #334155;
  --border2:   #475569;

  --cyan:      #3b82f6;
  --cyan-dim:  #2563eb;
  --blue:      #64748b;
  --violet:    #7c83a3;
  --amber:     #b0895a;
  --rose:      #9f6b7a;
  --green:     #5d8572;

  --text:      #e5e7eb;
  --text-mid:  #cbd5e1;
  --text-dim:  #9ca3af;

  --font-ui:   "Times New Roman", Times, serif;
  --font-mono: "Times New Roman", Times, serif;

  --radius:    6px;
  --radius-lg: 12px;
  --shadow:    0 10px 24px rgba(2, 6, 23, 0.42);
  --glow-cyan: 0 0 0 rgba(0,0,0,0);
  --glow-blue: 0 0 0 rgba(0,0,0,0);

  --soft-grid-lines: repeating-linear-gradient(
    0deg,
    rgba(148,163,184,0.05) 0,
    rgba(148,163,184,0.05) 1px,
    transparent 1px,
    transparent 42px
  ),
  repeating-linear-gradient(
    90deg,
    rgba(148,163,184,0.05) 0,
    rgba(148,163,184,0.05) 1px,
    transparent 1px,
    transparent 42px
  );

  --transition: 0.2s ease;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 14% 12%, rgba(59,130,246,0.14), transparent 36%),
    radial-gradient(circle at 82% 6%, rgba(125,211,252,0.08), transparent 34%),
    var(--soft-grid-lines);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Times New Roman", Times, serif;
  letter-spacing: 0.3px;
  line-height: 1.35;
  color: var(--text);
}
h1 { font-weight: 700; }
h2 { font-weight: 600; }
h3 { font-weight: 600; }
p, li, a, span, label, legend, input, select, textarea, button {
  font-family: "Times New Roman", Times, serif;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9fa8b2; }

/* ─── Top Navigation ─────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15,23,42,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 60px;
  gap: 8px;
}
.topnav-brand {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  margin-right: auto;
}
.topnav-brand span { color: var(--cyan); }
.topnav a {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition), background var(--transition);
}
.topnav a:hover, .topnav a.active {
  color: var(--cyan);
  background: rgba(59,130,246,0.14);
}
.topnav-divider { width: 1px; height: 20px; background: var(--border); margin: 0 8px; }

/* ─── Page Layout ────────────────────────────────────────────── */
.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 96px 36px 72px;
}
.page-hero {
  margin-bottom: 56px;
}
.page-hero h1 {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}
.page-hero h1 .accent { color: var(--cyan); }
.page-hero p {
  color: var(--text-mid);
  font-size: 16px;
  max-width: 600px;
  line-height: 1.65;
}
.page-hero .badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mid);
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.32);
  border-radius: 100px;
  padding: 3px 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ─── Cards & Panels ─────────────────────────────────────────── */
.card {
  background: var(--bg2);
  background-image:
    linear-gradient(180deg, rgba(148,163,184,0.03), rgba(148,163,184,0.01)),
    var(--soft-grid-lines);
  background-size: auto, 42px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border2); }
.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.card-title .icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: rgba(42,72,107,0.1);
  border-radius: 4px;
  text-align: center;
  line-height: 20px;
  margin-right: 8px;
  font-size: 10px;
}

/* ─── Two-Column Grid ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

/* ─── Form Controls ──────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.form-label .eq {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  font-style: italic;
  font-weight: 400;
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}
input[type="number"], input[type="text"], select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.16);
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.range-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  float: right;
  margin-top: -4px;
}

/* Checkboxes for mode selection */
.mode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mode-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.mode-chip input[type="checkbox"] {
  display: none;
}
.mode-chip-label {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border2);
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.mode-chip input:checked + .mode-chip-label {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(59,130,246,0.14);
}
.mode-chip-label:hover { border-color: var(--cyan-dim); color: var(--text); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--cyan);
  color: #e5e7eb;
  box-shadow: none;
}
.btn-primary:hover { background: var(--cyan-dim); box-shadow: none; }
.btn-secondary {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-full { width: 100%; justify-content: center; }

/* ─── Chart Canvas Container ─────────────────────────────────── */
.chart-wrap {
  background: var(--bg3);
  background-image: linear-gradient(180deg, rgba(148,163,184,0.03), rgba(148,163,184,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}

.chart-wrap canvas {
  background: #111827;
  border-radius: 8px;
}
.chart-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  text-align: center;
}
.chart-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ─── Stats / Metrics ────────────────────────────────────────── */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-box {
  flex: 1;
  min-width: 130px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mid);
  margin-top: 4px;
}

/* ─── Result Box ─────────────────────────────────────────────── */
.result-box {
  background: var(--bg3);
  background-image:
    linear-gradient(180deg, rgba(148,163,184,0.03), rgba(148,163,184,0.01)),
    var(--soft-grid-lines);
  background-size: auto, 42px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mid);
}
.result-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.result-err { font-size: 11px; color: var(--text-dim); }

/* ─── Info/Equation Blocks ───────────────────────────────────── */
.eq-block {
  background: var(--bg3);
  background-image:
    linear-gradient(180deg, rgba(148,163,184,0.03), rgba(148,163,184,0.01)),
    var(--soft-grid-lines);
  background-size: auto, 42px 42px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mid);
  overflow-x: auto;
}
.info-block {
  background: rgba(148,163,184,0.08);
  background-image:
    linear-gradient(180deg, rgba(148,163,184,0.03), rgba(148,163,184,0.01)),
    var(--soft-grid-lines);
  background-size: auto, 42px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-mid);
  margin: 12px 0;
}
.info-block strong { color: var(--text); }

/* ─── Divider ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── Tag Pills ──────────────────────────────────────────────── */
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 500;
}
.pill-cyan { background: rgba(42,72,107,0.1); color: var(--cyan); }
.pill-blue { background: rgba(58,79,108,0.1); color: var(--blue); }
.pill-violet { background: rgba(90,86,111,0.1); color: var(--violet); }
.pill-amber { background: rgba(106,91,66,0.1); color: var(--amber); }
.pill-rose { background: rgba(108,77,86,0.1); color: var(--rose); }

/* ─── Loading Spinner ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Tooltip ────────────────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 6px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ─── Table ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}
.data-table th {
  text-align: left;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.18);
  color: var(--text-mid);
}
.data-table tr:hover td { background: rgba(148,163,184,0.08); }
.data-table td.num { color: var(--cyan); }

/* Paper-like section flow */
.paper-section {
  margin-top: 28px;
}

.paper-section-title {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-bottom: 10px;
}

.paper-section-note {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 14px;
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.4s ease forwards; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(42,72,107,0); }
  50% { box-shadow: 0 0 20px rgba(42,72,107,0.2); }
}

/* ─── Misc ───────────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.text-cyan { color: var(--cyan); }
.text-mid { color: var(--text-mid); }
.text-dim { color: var(--text-dim); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* MathJax overrides */
.MathJax { color: var(--text) !important; }

/* Background grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: none;
}
.page-wrapper { position: relative; z-index: 1; }


