/* ===== Tokens & Base (Light Theme) ===== */
:root{
  --bg: #ffffff;
  --panel: rgba(0,0,0,0.04);
  --panel-2: rgba(0,0,0,0.02);
  --text: #111111;
  --muted: #555555;
  --border: rgba(0,0,0,0.12);
  --accent: #007acc;     /* primary accent */
  --accent-2: #005f99;   /* secondary accent */
  --radius: 16px;
  --shadow: 0 8px 20px rgba(0,0,0,0.08), inset 0 0 0 1px var(--border);
  --wrap: min(1100px, 92vw);
}

html, body { height: 100%; }

/* Page wrapper body */
body.page-project-white{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout helpers ===== */
.wrap{
  width: var(--wrap);
  margin-inline: auto;
}

/* ===== Topbar (Light) ===== */
.topbar{
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px) saturate(1.1);
}
.topbar .wrap{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}

/* Back button: high-contrast on light header */
.back-btn{
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.05);
}
.back-btn:hover{ filter: brightness(1.03); transform: translateY(-1px); transition: transform .15s ease, filter .15s ease; }
.back-btn:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

.page-tag{
  color: var(--muted);
  font-size: 0.95rem;
}

/* ===== Content ===== */
.content{
  padding: 24px 0 48px;
  display: grid;
  gap: 18px;
}

/* ===== Cards (Light) ===== */
.card{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* ===== Intro ===== */
.title{
  margin: 0 0 8px;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.1;
}
.lede{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 18px);
}
.source-note{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.source-note a{
  color: var(--accent);
  text-decoration: none;
}
.source-note a:hover{ text-decoration: underline; }

/* ===== Section titles ===== */
.section-title{
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
}

/* ===== Fieldsets / Controls ===== */
.nice-fieldset{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 14px 0;
  background: rgba(255,255,255,0.6);
}
.nice-fieldset legend{
  padding: 0 8px;
  color: var(--text);
  opacity: 0.9;
}
.choice{
  display: block;
  margin: .35rem 0;
  color: var(--text);
}
.choice input{ transform: translateY(1px); margin-right: .5rem; }

.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem 1rem;
  align-items: center;
}
label{ color: var(--text); opacity: 0.92; }

/* Inputs on light background */
input[type="number"]{
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  outline: none;
}
input[type="number"]::placeholder{ color: #8a8a8a; }
input[type="number"]:focus{
  border-color: rgba(0,0,0,0.22);
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.18);
}

.hint{
  color: var(--muted);
  font-size: .95rem;
  margin: .4rem 0 0;
}

/* ===== Actions ===== */
.actions{ margin-top: 10px; }
.btn-primary{
  appearance: none;
  border: 1px solid rgba(0,0,0,0.06);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover{ transform: translateY(-2px); filter: brightness(1.03); }
.btn-primary:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Charts ===== */
.charts #chartArea{
  margin-top: 8px;
}
svg{ max-width: 100%; height: auto; }

/* ===== Links inside content ===== */
.card a{
  color: var(--accent);
  text-underline-offset: 2px;
}
.card a:hover{ text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 780px){
  .grid{ grid-template-columns: 1fr; }
}
