/* howmuchsun.com — single stylesheet, no build step, no external requests. */

:root {
  --bg: #fdfcfa;
  --surface: #ffffff;
  --border: #e4e0d8;
  --text: #1c1a17;
  --muted: #6b655c;
  --accent: #b45309;
  --accent-soft: #fef3e2;
  --never: #9a3412;
  --l0: #f1efea;
  --l1: #fde9c8;
  --l2: #fbcf8a;
  --l3: #f3a94e;
  --l4: #dd7f1e;
  --l5: #a9530a;
  --maxw: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #1f1d16;
    --border: #35322a;
    --text: #ece7dc;
    --muted: #a09889;
    --accent: #f0a94b;
    --accent-soft: #2a2416;
    --never: #f0866a;
    --l0: #26241d;
    --l1: #4a3a1c;
    --l2: #6d5121;
    --l3: #97701f;
    --l4: #c08f24;
    --l5: #efb949;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.15rem 4rem; }

header.site, footer.site {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1.15rem;
}
header.site { display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; justify-content: space-between; }
.brand { font-size: 1.15rem; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.brand strong { color: var(--accent); }
header.site nav a { margin-left: 1rem; font-size: .9rem; color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--accent); }

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  color: var(--muted);
  font-size: .87rem;
}
footer.site a { color: var(--muted); }

h1 { font-size: 1.9rem; line-height: 1.25; letter-spacing: -0.02em; margin: .4rem 0 1rem; }
h2 { font-size: 1.2rem; letter-spacing: -0.01em; margin: 2.4rem 0 .7rem; }
a { color: var(--accent); }

.crumbs { font-size: .85rem; color: var(--muted); margin-top: 1.5rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.lede { font-size: 1.08rem; color: var(--text); }

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  margin: 1.8rem 0;
}
.callout h2 { margin: 0 0 .3rem; font-size: 1rem; }
.callout .big {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin: .2rem 0 .6rem;
}
.callout p:last-child { margin-bottom: 0; font-size: .93rem; }

form { display: flex; flex-wrap: wrap; gap: .85rem; margin: 1rem 0 1.4rem; }
.field { flex: 1 1 12rem; display: flex; flex-direction: column; gap: .3rem; }
.field label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
select {
  font: inherit;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.results { display: flex; flex-wrap: wrap; gap: .8rem; }
.result {
  flex: 1 1 10rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.result .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.result .value { font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--accent); }
.result .note { font-size: .8rem; color: var(--muted); }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td { font-variant-numeric: tabular-nums; }
tr.no-synth td { color: var(--muted); }
.never { color: var(--never); }

/* Heatmap cells carry the rounded value as text, not colour alone: colour-only
   encoding fails WCAG 1.4.1 and is unreadable for colourblind users. */
table.heatmap td {
  padding: 0;
  height: 22px;
  min-width: 22px;
  border: 1px solid var(--bg);
  text-align: center;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  color: #2a2318;
}
table.heatmap td.l4, table.heatmap td.l5 { color: #fff; }
table.heatmap th { font-size: .72rem; padding: .2rem .35rem; }
table.heatmap caption { text-align: left; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

:where(a, select, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.crosslink {
  border-left: 3px solid var(--border);
  padding-left: .9rem;
  margin: 1.4rem 0;
  font-size: .95rem;
}
.l0 { background: var(--l0); } .l1 { background: var(--l1); } .l2 { background: var(--l2); }
.l3 { background: var(--l3); } .l4 { background: var(--l4); } .l5 { background: var(--l5); }
.legend { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.legend span { width: 20px; height: 14px; display: inline-block; border-radius: 2px; }

.uv-badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  color: #1c1a17;
}
.uv0 { background: var(--l1); }
.uv1 { background: var(--l2); }
.uv2 { background: var(--l3); }
.uv3 { background: var(--l4); }
.uv4 { background: var(--l5); color: #fff; }

ul.related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .8rem; }
ul.related a { font-size: .92rem; }

.assumptions { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 3rem; font-size: .92rem; }
.assumptions ul { padding-left: 1.1rem; }
.assumptions li { margin-bottom: .4rem; }

@media (max-width: 34rem) {
  h1 { font-size: 1.5rem; }
  .result .value { font-size: 1.3rem; }
}

/* Horizontal bars in the monthly-requirement table. */
.bar {
  display: block;
  height: 12px;
  min-width: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .75;
}
