/* EZ Forecasting — site styles */
:root {
  --ink: #14231c;
  --ink-soft: #55635b;
  --page: #f7f5ef;
  --surface: #ffffff;
  --rule: #dcd8cc;
  --green: #17643f;
  --green-soft: #e3efe7;
  --fc: #d9641e;
  --fc-soft: rgba(242, 165, 65, 0.24);
  --amber: #a15c07;
  --amber-soft: #fdf3e2;
  --head: #14231c;
  --head-ink: #eef3ef;
  --link: #135a38;
  --focus: #17643f;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --measure: 70ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e7eee9;
    --ink-soft: #a5b3ab;
    --page: #0f1713;
    --surface: #16211b;
    --rule: #2a3a31;
    --green: #5cc18c;
    --green-soft: #173325;
    --fc: #f2a541;
    --fc-soft: rgba(242, 165, 65, 0.18);
    --amber: #f5b85a;
    --amber-soft: #36270f;
    --head: #0a110d;
    --link: #7fd6a7;
    --focus: #7fd6a7;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--text); font-size: 1.1rem; line-height: 1.58; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-head { background: var(--head); color: var(--head-ink); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding-top: 15px; padding-bottom: 15px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--head-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.wordmark .ez { display: inline-block; background: #f2a541; color: #14231c; font-weight: 800; font-size: 0.9em; padding: 1px 7px 2px; border-radius: 6px; transform: rotate(-4deg); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { font-size: 1rem; font-weight: 600; color: var(--head-ink); text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: #f2a541; }

/* Type */
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.08; color: var(--ink); letter-spacing: -0.02em; }
h1 { font-weight: 800; font-size: clamp(2.3rem, 5.6vw, 3.9rem); margin: 0 0 14px; max-width: 17ch; }
h2 { font-weight: 700; font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 2em 0 0.55em; }
h3 { font-weight: 700; font-size: 1.22rem; margin: 1.5em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
.lede { font-size: 1.24rem; line-height: 1.5; color: var(--ink-soft); max-width: 56ch; margin-bottom: 0; }
.small { font-size: 0.93rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.warn { font-weight: 600; color: var(--amber); }
.opt { font-weight: 400; color: var(--ink-soft); }

main { padding: 44px 0 72px; }
.article { max-width: var(--measure); }
.article > h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
.article .lede { margin-bottom: 22px; }
.article.wide { max-width: 100%; }
.article.wide > :not(.table-scroll) { max-width: var(--measure); }
.article.wide .table-scroll { max-width: 960px; }
.updated { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 26px; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; background: var(--surface); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--display); font-weight: 700; font-size: 0.95rem; background: var(--green-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; margin: 1.1em 0 1.5em; border: 1px solid var(--rule); border-radius: 10px; }
.table-scroll table { min-width: 460px; }
.table-scroll tr:last-child td { border-bottom: 0; }

/* Home */
.hero { padding-bottom: 26px; }
.steps { max-width: var(--measure); }
.step-list { padding-left: 1.3em; }
.step-list li { margin-bottom: 0.6em; }
.card-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.card-grid li { margin: 0; }
.card-grid a { display: block; height: 100%; padding: 16px 18px; background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--green); border-radius: 10px; text-decoration: none; color: inherit; }
.card-grid a:hover { border-color: var(--green); }
.card-grid .c-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; display: block; color: var(--ink); margin-bottom: 4px; letter-spacing: -0.01em; }
.card-grid .c-meta { font-size: 0.98rem; color: var(--ink-soft); display: block; line-height: 1.45; }

/* Tools */
.tool { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 22px 24px; margin: 8px 0 0; box-shadow: 0 1px 2px rgba(20, 35, 28, 0.05), 0 8px 24px -16px rgba(20, 35, 28, 0.25); }
.tool h2 { margin: 0 0 14px; font-size: 1.5rem; }
.field { margin: 0; min-width: 0; }
.field label, .lbl { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 5px; }
.field input, .field select { font: inherit; font-size: 1.02rem; color: var(--ink); background: var(--page); border: 1.5px solid var(--ink-soft); border-radius: 8px; padding: 9px 11px; width: 100%; }
.field input { font-family: var(--mono); font-size: 0.98rem; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px 18px; margin: 4px 0 18px; }
.result { background: var(--green-soft); border-left: 4px solid var(--green); border-radius: 0 10px 10px 0; padding: 14px 18px; }
.result p { margin: 0 0 6px; }
.result p:last-child { margin-bottom: 0; }
.result .big { font-family: var(--display); font-size: 1.4rem; letter-spacing: -0.01em; }
.result .big strong { font-family: var(--mono); font-weight: 500; font-size: 1.55rem; }

/* Forecaster */
.forecaster { border-top: 5px solid var(--green); }
.fc-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px 28px; align-items: start; }
@media (max-width: 900px) { .fc-grid { grid-template-columns: 1fr; } }
.fc-in textarea { width: 100%; min-height: 220px; font-family: var(--mono); font-size: 0.9rem; line-height: 1.5; color: var(--ink); background: var(--page); border: 1.5px solid var(--ink-soft); border-radius: 8px; padding: 10px 12px; resize: vertical; }
.count { min-height: 1.3em; font-size: 0.88rem; color: var(--ink-soft); margin: 4px 0 10px; }
.fc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; margin-bottom: 12px; }
.fc-opts .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.98rem; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.fc-buttons { margin: 0 0 10px; }
.private { font-size: 0.88rem; color: var(--green); font-weight: 600; margin: 0; }
.private span { font-size: 0.7em; vertical-align: 2px; margin-right: 4px; }
.fc-out { min-width: 0; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--page); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.s-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.s-val { font-family: var(--mono); font-size: 1.45rem; font-weight: 500; line-height: 1.2; }
.s-val.s-method { font-family: var(--display); font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.s-note { font-size: 0.86rem; color: var(--ink-soft); }
.s-note.up { color: var(--green); font-weight: 600; }
.s-note.down { color: var(--amber); font-weight: 600; }
.chart-wrap { margin: 0 0 12px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .tick { font-family: var(--mono); font-size: 11px; fill: var(--ink-soft); }
.chart .band { fill: var(--fc-soft); }
.chart .divider { stroke: var(--ink-soft); stroke-dasharray: 3 4; stroke-width: 1; }
.chart .div-label { font-family: var(--text); font-size: 12px; font-weight: 600; fill: var(--ink-soft); }
.chart .line-hist { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.chart .line-fc { fill: none; stroke: var(--fc); stroke-width: 2.4; stroke-dasharray: 6 4; stroke-linejoin: round; }
.chart .dot-fc { fill: var(--fc); }
.chart-wrap figcaption { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.86rem; color: var(--ink-soft); margin-top: 4px; }
.lg::before { content: ""; display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--ink); margin-right: 6px; vertical-align: 4px; }
.lg-fc::before { border-top: 2.5px dashed var(--fc); }
.lg-band::before { height: 10px; border: 0; background: var(--fc-soft); vertical-align: -1px; }
.acc { font-size: 0.97rem; background: var(--page); border-radius: 8px; padding: 8px 12px; }
.fc-table td:first-child { white-space: nowrap; }
.fc-actions { margin: 0 0 8px; }
.cmp { margin: 8px 0 12px; }
.cmp tr.picked td { font-weight: 700; background: var(--green-soft); }
.note { border-top: 1px dashed var(--rule); padding-top: 10px; }

/* Template download */
.download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--green); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 0 0 1.6em; }
.d-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin: 0; }
.d-meta { margin: 2px 0 0; font-size: 0.93rem; color: var(--ink-soft); }

details summary { cursor: pointer; font-weight: 600; font-size: 0.97rem; color: var(--link); }

/* Buttons & forms */
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 1rem; padding: 10px 16px; border: 1.5px solid var(--green); border-radius: 8px; background: var(--green); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: transparent; color: var(--link); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.secondary):not(.ghost) { color: #0a110d; } }
.form { max-width: 34rem; }
.form label { display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 6px; }
.form input, .form textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }
.form textarea { min-height: 140px; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 28px 0 44px; font-size: 0.96rem; color: var(--ink-soft); }
.site-foot nav ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-foot a { color: var(--ink-soft); }
.site-foot p { max-width: 78ch; margin: 0 0 8px; }

@media print { .site-head, .site-foot, .fc-in { display: none !important; } .fc-grid { grid-template-columns: 1fr; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Analytics consent */
.consent[hidden] { display: none; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 34rem; margin: 0 auto; background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--green); border-radius: 12px; padding: 16px 18px; z-index: 20; font-size: 1rem; box-shadow: 0 6px 24px rgba(20, 35, 28, 0.2); }
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.linklike { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
@media print { .consent { display: none !important; } }
