/* Househand site. Hand-written; no framework. Brand values are shared with
   the Flutter app (../househand/): teal #1F5F57 (dark mode #7FC4B8),
   terracotta #C8643B for due soon, red #B3261E for overdue, paper #FAF7F2,
   ink #1D2320. */

:root {
  color-scheme: light dark;
  --paper: #FAF7F2;
  --surface: #FFFFFF;
  --sunk: #F1ECE3;
  --ink: #1D2320;
  --muted: #56605B;
  --line: #E2DBCF;
  --primary: #1F5F57;
  --primary-ink: #FFFFFF;
  --primary-soft: #E3EFEC;
  --soon: #C8643B;
  --soon-soft: #F8E7DE;
  --overdue: #B3261E;
  --overdue-soft: #F9E0DE;
  --ok: #1F5F57;
  --cta-bg: #1F5F57;
  --cta-ink: #FFFFFF;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(29 35 32 / 6%), 0 4px 16px rgb(29 35 32 / 5%);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121715;
    --surface: #1A201E;
    --sunk: #202826;
    --ink: #E8E6E1;
    --muted: #A5ADA8;
    --line: #2E3734;
    --primary: #7FC4B8;
    --primary-ink: #0E1F1C;
    --primary-soft: #1D3430;
    --soon: #E58C63;
    --soon-soft: #3A261D;
    --overdue: #F2A09A;
    --overdue-soft: #3D1E1C;
    --ok: #7FC4B8;
    --cta-bg: #1D3430;
    --cta-ink: #E8E6E1;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }

a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--soon); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 7vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 4.5vw, 1.9rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.25rem/1 var(--serif); margin-right: auto; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 2px; }

main { display: block; padding-bottom: 48px; }

/* Hero */
.hero { padding: 40px 0 8px; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 44em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 2px solid var(--primary); background: var(--primary); color: var(--primary-ink);
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--primary); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.btn.quiet { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }

.toggle { display: inline-flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; cursor: pointer; min-height: 44px; }
.toggle input { flex: none; margin: 2px 0 0; width: 20px; height: 20px; accent-color: var(--primary); }

/* Optional tasks (septic, sump pump...) hidden when the toggle is off. */
body:has(#include-optional:not(:checked)) .opt { display: none; }

.tag { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.tag.opt-tag { color: var(--soon); background: var(--soon-soft); }

/* The printable checklist */
.every-month { background: var(--primary-soft); border-radius: var(--radius); padding: 16px 18px; margin: 24px 0 8px; }
.every-month h2 { margin: 0 0 6px; font-size: 1.2rem; }
.every-month p { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; }
.checks li .text { flex: 1; min-width: 0; }
.box { display: inline-block; vertical-align: -2px; flex: none; width: 15px; height: 15px; border: 2px solid var(--primary); border-radius: 4px; transform: translateY(2px); }
.every-month .checks { columns: 2 220px; column-gap: 24px; }
.every-month .checks li { break-inside: avoid; }

.months { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 16px 0; }
@media (min-width: 560px) { .months { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .months { grid-template-columns: repeat(3, 1fr); } }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.month h3 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.month h3 small { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.month .monthly-line .box { width: 12px; height: 12px; margin-left: 6px; border-width: 1.5px; vertical-align: -1px; transform: none; }
.month .monthly-line .short { white-space: nowrap; }
.month .monthly-line { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 0.85rem; color: var(--muted); }
.month .empty { color: var(--muted); font-size: 0.92rem; margin: 4px 0 0; }

.timer { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.timer th, .timer td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.timer thead th { border-top: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--sunk); }
.timer td .box { margin-right: 6px; transform: none; }
.timer td.every { white-space: nowrap; color: var(--muted); }
.timer .last { color: var(--muted); }
.timer .print-only { display: none; }

.table-scroll { overflow-x: auto; }

/* Cards and sections */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards.four { grid-template-columns: repeat(4, 1fr); } }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
a.card:hover { border-color: var(--primary); }
.card h3 { margin-bottom: 4px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.app-cta { background: var(--cta-bg); color: var(--cta-ink); border-radius: 20px; padding: 28px 22px; margin: 40px 0 8px; display: grid; gap: 18px; }
@media (min-width: 760px) { .app-cta { grid-template-columns: 1.4fr 1fr; align-items: center; padding: 36px; } }
.app-cta h2 { margin-top: 0; color: inherit; }
.app-cta p { opacity: 0.92; }
.app-cta ul { margin: 0 0 1em; padding-left: 1.2em; }
.app-cta a:not(.badge) { color: inherit; }

.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 16px 8px 12px;
  border-radius: 12px; background: #111; color: #fff; text-decoration: none; border: 1px solid rgb(255 255 255 / 25%);
}
.badge svg { width: 26px; height: 26px; flex: none; }
.badge span { display: flex; flex-direction: column; line-height: 1.15; }
.badge small { font-size: 0.7rem; opacity: 0.85; }
.badge strong { font-size: 1.05rem; }
.badge .soon-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #F2C6B2; }
.badges.on-paper .badge { border-color: transparent; }

.app-preview { justify-self: center; width: 100%; max-width: 280px; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 25%); font-size: 0.9rem; }
.app-preview .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.app-preview .row:last-child { border-bottom: 0; }

/* Status pills */
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.pill.overdue { background: var(--overdue-soft); color: var(--overdue); }
.pill.soon { background: var(--soon-soft); color: var(--soon); }
.pill.ok { background: var(--primary-soft); color: var(--ok); }
.pill.new { background: var(--sunk); color: var(--muted); }

/* Task pages */
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 24px 0 12px; }
.crumbs a { color: var(--muted); }
.answer { font: 700 clamp(1.5rem, 5vw, 2rem)/1.2 var(--serif); color: var(--primary); margin: 0 0 8px; }
.best { font-size: 1.05rem; margin-bottom: 4px; }
.note { background: var(--soon-soft); border-radius: 10px; padding: 10px 14px; font-size: 0.95rem; }
.fineprint { font-size: 0.88rem; color: var(--muted); }
.related { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.related a:hover { border-color: var(--primary); }
.related .tag { align-self: center; }

.index-cats { columns: 1; }
@media (min-width: 700px) { .index-cats { columns: 2; column-gap: 32px; } }
.index-cats section { break-inside: avoid; margin-bottom: 16px; }
.index-cats h3 { margin: 0 0 6px; }
.index-cats ul { margin: 0; padding-left: 1.1em; }
.index-cats li { margin: 3px 0; }

/* Season checklists */
.season-list h2 { font-size: 1.25rem; }
.season-list .checks li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.season-list .why { display: block; color: var(--muted); font-size: 0.9rem; }

/* My House tracker */
.tracker-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.tracker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.task-row { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.task-row.overdue { border-left-color: var(--overdue); }
.task-row.soon { border-left-color: var(--soon); }
.task-row.ok { border-left-color: var(--ok); }
.task-row .top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.task-row .name { font-weight: 650; }
.task-row .name a { color: var(--ink); text-decoration: none; }
.task-row .name a:hover { text-decoration: underline; }
.task-row .meta { font-size: 0.9rem; color: var(--muted); }
.task-row .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-row input[type="date"] { min-height: 36px; font: inherit; font-size: 0.9rem; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--muted); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin: 20px 0; }
.panel summary { cursor: pointer; font-weight: 650; padding: 12px 0; min-height: 44px; }
.panel fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.panel legend { font-weight: 650; font-family: var(--serif); font-size: 1.05rem; margin-bottom: 4px; }
.panel label { display: flex; gap: 10px; align-items: center; padding: 6px 0; min-height: 40px; }
.panel input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.status-msg { min-height: 1.5em; font-size: 0.95rem; color: var(--primary); }
.status-msg.error { color: var(--overdue); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }

.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Print: the checklist on one or two letter pages ---------- */
@media print {
  @page { size: letter; margin: 0.45in; }
  :root {
    --paper: #fff; --surface: #fff; --ink: #000; --muted: #444; --line: #bbb;
    --primary: #1F5F57; --sunk: #fff; --primary-soft: #fff; --soon-soft: #fff;
  }
  body { font: 9.5pt/1.3 var(--sans); background: #fff; color: #000; }
  .site-header, .site-footer, .no-print, .app-cta, .actions, .crumbs, .panel { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 17pt; margin: 0 0 2pt; }
  h2 { font-size: 12pt; margin: 8pt 0 4pt; }
  h3 { font-size: 10.5pt; }
  .hero { padding: 0; }
  .lede, .eyebrow { display: none; }
  .print-head { display: flex !important; justify-content: space-between; align-items: baseline; border-bottom: 1.5pt solid var(--primary); padding-bottom: 3pt; margin-bottom: 6pt; }
  .print-head span { font-size: 8.5pt; color: var(--muted); }
  .box { width: 9pt; height: 9pt; border: 1pt solid #000; border-radius: 2pt; transform: translateY(1pt); }
  .tag { background: none; padding: 0; font-size: 7.5pt; color: var(--muted); }
  .tag.opt-tag { color: var(--muted); }
  .every-month { padding: 0; margin: 4pt 0; border: 0; }
  .every-month h2 { font-size: 11pt; }
  .every-month p { display: none; }
  .every-month .checks { columns: 4; column-gap: 12pt; }
  .checks li { padding: 1.5pt 0; gap: 5pt; }
  .months { grid-template-columns: repeat(4, 1fr); gap: 5pt; margin: 4pt 0; }
  .month { border: 1pt solid #999; border-radius: 4pt; padding: 5pt 6pt; box-shadow: none; break-inside: avoid; }
  .month h3 { margin-bottom: 2pt; }
  .month .monthly-line .box { width: 7pt; height: 7pt; border-width: 0.75pt; margin-left: 3pt; }
  .month .monthly-line { font-size: 7.5pt; margin-top: 3pt; padding-top: 3pt; }
  .month .empty { font-size: 8pt; }
  .timer-section { break-before: auto; }
  .timer { border: 1pt solid #999; font-size: 8.5pt; }
  .timer th, .timer td { padding: 3pt 5pt; }
  .timer .print-only { display: table-cell; width: 1.6in; }
  .timer .screen-only { display: none; }
  .print-hide { display: none !important; }
  .season-list .checks li { padding: 3pt 0; }
  .season-list .why { font-size: 8pt; }
  .print-foot { display: block !important; margin-top: 8pt; font-size: 7.5pt; color: var(--muted); }
}
.print-head, .print-foot { display: none; }
.actions.centered { justify-content: center; }
.month .opt-empty { display: none; }
body:has(#include-optional:not(:checked)) .month .opt-empty { display: block; }
@media screen and (max-width: 600px) { .timer .screen-only { display: none; } }
@media print { .timer { border-radius: 0; overflow: visible; } }
@media (max-width: 380px) { .nav { gap: 2px 12px; font-size: 0.9rem; } .brand { margin-right: 0; width: 100%; } }
