/* daq.amansharmanuclear.com — light, paper-like, no frills.
   Brand fonts (Helios tokens) on the light_mode palette. Deliberately plain:
   this is civilian science, content first. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;700&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* light (default) — Helios light_mode; greys darkened from the first draft for legible contrast */
  --bg:      #F9F6EF;   /* ground_white */
  --card:    #FFFFFF;
  --ink:     #1A1A22;   /* ink_black    */
  --dim:     rgba(26,26,34,0.74);
  --muted:   rgba(26,26,34,0.56);
  --amber:   #B85F14;   /* solar_amber_paper, nudged darker for AA on paper */
  --maroon:  #5A1923;
  --blue:    #3F6C8E;
  --border:  rgba(26,26,34,0.16);
  --line:    rgba(26,26,34,0.09);
  --code:    rgba(26,26,34,0.05);
  --map-bg:  #EDE9E0;
  --map-filter: none;

  --f-display: 'Playfair Display', Georgia, serif;
  --f-body:    'Source Serif 4', Georgia, serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, monospace;
  --max:  820px;
  --text: 66ch;
}
/* dark — Helios dark_mode. Applied by the toggle (data-theme) and, until then, by the OS setting. */
:root[data-theme="dark"] {
  --bg:#0A0A0F; --card:#15151E; --ink:#F2EDE4;
  --dim:rgba(242,237,228,0.72); --muted:rgba(242,237,228,0.52);
  --amber:#E8952F; --maroon:#EBB45A; --blue:#6FA3CC;
  --border:rgba(242,237,228,0.16); --line:rgba(242,237,228,0.09);
  --code:rgba(242,237,228,0.07); --map-bg:#15151E;
  --map-filter: brightness(.82) contrast(1.05);   /* tame the bright OSM tiles on a dark page */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0A0A0F; --card:#15151E; --ink:#F2EDE4;
    --dim:rgba(242,237,228,0.72); --muted:rgba(242,237,228,0.52);
    --amber:#E8952F; --maroon:#EBB45A; --blue:#6FA3CC;
    --border:rgba(242,237,228,0.16); --line:rgba(242,237,228,0.09);
    --code:rgba(242,237,228,0.07); --map-bg:#15151E;
    --map-filter: brightness(.82) contrast(1.05);
  }
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-weight: 300; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* nav */
nav { border-bottom: 1px solid var(--line); }
.nav-in { max-width: var(--max); margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-family: var(--f-mono); font-size: 13px; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.brand b { color: var(--amber); font-weight: 500; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-links a { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--amber); }

/* headings & text */
h1 { font-family: var(--f-display); font-weight: 500; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.01em; }
h2 { font-family: var(--f-display); font-weight: 500; font-size: 1.5rem; margin: 2.5rem 0 .8rem; }
h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
p  { max-width: var(--text); margin: 0 0 1rem; color: var(--ink); }
p.lead { font-size: 1.15rem; color: var(--dim); }
a { color: var(--amber); text-underline-offset: 2px; }
a:hover { color: var(--maroon); }
strong { font-weight: 600; }
em { font-style: italic; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
ul { max-width: var(--text); margin: 0 0 1rem 1.2rem; }
li { margin: .3rem 0; }
code { font-family: var(--f-mono); font-size: .85em; background: var(--code);
  padding: .1em .35em; border-radius: 2px; }

.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--amber); display: block; margin-bottom: .8rem; }
header.hero { padding: 3rem 0 1.5rem; }
header.hero .tagline { font-family: var(--f-display); font-style: italic; color: var(--dim);
  font-size: 1.1rem; margin-top: .6rem; max-width: var(--text); }

section { padding: 1rem 0; }

/* project list (hub) */
.projects { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.projects li { border-top: 1px solid var(--line); }
.projects li:last-child { border-bottom: 1px solid var(--line); }
.proj { display: flex; align-items: baseline; gap: 1rem; padding: 1.1rem .2rem; text-decoration: none; color: var(--ink); }
.proj:hover { color: var(--amber); }
.proj .name { font-family: var(--f-display); font-size: 1.2rem; font-weight: 500; }
.proj .desc { color: var(--dim); font-size: .95rem; flex: 1; }
.proj .status { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.proj .status.live { color: var(--blue); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); margin: 1.5rem 0; }
.stat { background: var(--card); padding: .9rem 1rem; }
.stat .k { font-family: var(--f-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--f-mono); font-size: 1.4rem; color: var(--ink); margin-top: .15rem; }

/* map */
#map { height: 420px; border: 1px solid var(--border); border-radius: 2px; margin: 1rem 0; background: var(--map-bg); }
#map .leaflet-tile { filter: var(--map-filter); }
.empty { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding: 1rem 0; }

/* horizontal bars (TPMS census: pressure histogram, manufacturer mix, bands) */
.bars { margin: 1rem 0 1.5rem; display: flex; flex-direction: column; gap: .45rem; max-width: var(--text); }
.bar { display: grid; grid-template-columns: 108px 1fr auto; align-items: center; gap: .7rem;
  font-family: var(--f-mono); font-size: 12px; }
.bar .lab { color: var(--dim); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { background: var(--line); border-radius: 2px; height: 14px; overflow: hidden; }
.bar .fill { background: var(--amber); height: 100%; border-radius: 2px; transition: width .3s ease; }
.bar .val { color: var(--ink); font-variant-numeric: tabular-nums; }
.method { font-family: var(--f-mono); font-size: 11px; color: var(--muted); line-height: 1.6;
  border-left: 2px solid var(--border); padding-left: .85rem; margin: 1.2rem 0; max-width: var(--text); }
.text-dim { color: var(--dim); }

/* theme toggle — minimal, mono, sits in the nav */
.theme-toggle { background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: var(--muted); display: inline-flex; align-items: center; line-height: 1; }
.theme-toggle:hover { color: var(--amber); }
.theme-toggle svg { width: 15px; height: 15px; display: block; }

/* footer */
footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.foot-in a { color: var(--muted); }
.foot-in a:hover { color: var(--amber); }

@media (max-width: 560px) {
  .proj { flex-direction: column; gap: .25rem; }
  h2 { margin-top: 2rem; }
}
