/* HomeKept — layout & components. Mobile-first, fluid to desktop.
   Calm/domestic: generous whitespace, big legible cards, soft motion. */

* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration:.001ms !important; transition-duration:.001ms !important; }
}
body {
  margin: 0; font-family: var(--font-body);
  background: var(--bg); color: var(--ink);
  line-height: 1.55; letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* ledger-rule texture — the maintenance log as a motif, nearly subliminal */
  background-image: var(--ledger);
}
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 1rem + .7vw, 1.45rem); }
p { margin: 0 0 1rem; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.hide { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--tap); padding: .7em 1.3em;
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent-deep); color: var(--on-accent);
  cursor: pointer; text-decoration: none; transition: transform .12s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: .45em .9em; font-size: .92rem; }
.btn.lg { font-size: 1.1rem; padding: .85em 1.6em; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Header / nav ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.brand-link img { width: 34px; height: 34px; border-radius: 8px; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: .3rem; }
.nav-links a { color: var(--ink-2); text-decoration: none; padding: .5em .7em; border-radius: 8px; font-weight: 500; }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }

/* Theme + text-size toggles */
.toggles { display: flex; align-items: center; gap: .4rem; }
.theme-toggle { width: 56px; height: 30px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.theme-toggle img { width: 56px; height: auto; }
.text-size { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.text-size button { min-height: 34px; min-width: 38px; border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer; font-family: var(--font-body); font-weight: 600; }
.text-size button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Hero (marketing) ---------- */
.hero { padding: clamp(2.5rem, 2rem + 5vw, 5rem) 0 clamp(2rem,1.5rem+3vw,4rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center; }
@media (max-width: 860px){ .hero-grid { grid-template-columns: 1fr; } .hero-media { order: -1; } }
.hero .eyebrow { display:inline-block; font-weight:600; color: var(--accent-ink); background: var(--accent-soft); padding:.35em .8em; border-radius: 999px; font-size:.88rem; margin-bottom:1rem; }
.hero h1 { max-width: 16ch; }
.hero .lede { font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); color: var(--ink-2); max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-note { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.hero-media img { width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border); aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- Sections / cards ---------- */
section { padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0; }
section.alt { background: var(--bg-2); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }
.grid { display: grid; gap: 1.1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px){ .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px){ .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--accent);           /* spec-plate pine top rule */
  border-radius: var(--radius); padding: 1.3rem 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  /* cut-corner "spec plate" — like the metal tag on a furnace/water heater */
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.card .ico { background: var(--brass-soft); color: var(--brass-deep); }
.card h3 { margin-top: .2rem; }
.card .ico { width: 40px; height: 40px; display:grid; place-items:center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: .8rem; font-size: 1.3rem; }

/* ---------- Pricing ---------- */
.price-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; max-width: 760px; margin: 0 auto; }
@media (max-width: 640px){ .price-wrap { grid-template-columns: 1fr; } }
.price { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 1.6rem; }
.price.pro { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.price .tag { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; }
.price .per { color: var(--muted); font-size: .95rem; }
.price ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; }
.price li { padding: .35em 0 .35em 1.6em; position: relative; }
.price li::before { content:"✓"; position:absolute; left:0; color: var(--accent); font-weight:700; }
.badge-pill { position:absolute; top:-12px; right:16px; background: var(--accent-deep); color: var(--on-accent); font-size:.78rem; font-weight:700; padding:.3em .8em; border-radius:999px; }

/* ---------- App shell ---------- */
.app-main { padding: 1.2rem 0 5rem; }
.tabbar { position: sticky; top: 64px; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border); }
.tabbar .wrap { display: flex; gap: .2rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabbar .wrap::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; min-height: var(--tap); padding: .6em 1em; border: 0; background: transparent; color: var(--ink-2); font-family: var(--font-body); font-weight: 600; font-size: .98rem; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform:none; } }

/* Seasonal prep chips */
.season-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; }
.season-chip { min-height: 38px; padding: .45em 1em; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2); font-family: var(--font-body); font-weight: 600; font-size: .9rem; cursor: pointer; }
.season-chip.sel { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.season-chip:hover { border-color: var(--accent); }

/* Status summary chips */
.status-row { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0 1.4rem; }
.chip { display:inline-flex; align-items:center; gap:.5em; padding:.55em .9em; border-radius: 999px; font-weight:600; font-size:.95rem; border:1px solid var(--border); background: var(--surface); }
.chip .dot { width:.7em; height:.7em; border-radius:50%; }
.chip.overdue { background: var(--overdue-soft); color: var(--overdue-deep); border-color: transparent; }
.chip.overdue .dot { background: var(--overdue); }
.chip.soon { background: var(--due-soon-soft); color: var(--due-soon-deep); border-color: transparent; }
.chip.soon .dot { background: var(--due-soon); }
.chip.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.chip.ok .dot { background: var(--ok); }

/* Task card */
.task {
  display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 5px solid var(--border-2);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .8rem;
}
.task.is-overdue { border-left-color: var(--overdue); }
.task.is-soon { border-left-color: var(--due-soon); }
.task.is-ok { border-left-color: var(--accent); }
.task .check {
  appearance: none; width: 30px; height: 30px; min-width:30px; margin-top:2px;
  border: 2px solid var(--border-2); border-radius: 8px; cursor: pointer; background: var(--surface);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.task .check:hover { border-color: var(--accent); }
.task .check:checked { background: var(--accent-deep); border-color: var(--accent-deep); }
.task .check:checked::after { content:"✓"; color: var(--on-accent); font-weight: 800; font-size: 1rem; }
.task .body h4 { font-family: var(--font-body); font-weight: 700; font-size: 1.08rem; margin: 0 0 .2rem; }
.task .meta { font-size: .9rem; color: var(--muted); display:flex; flex-wrap:wrap; gap:.3rem .8rem; }
.task .meta .due { font-weight: 600; }
.task .meta .due.overdue { color: var(--overdue-deep); }
.task .meta .due.soon { color: var(--due-soon-deep); }
.task .side { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.task .sys { font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; color: var(--muted); }
.reorder { font-size:.85rem; font-weight:600; color: var(--accent-ink); text-decoration: none; display:inline-flex; align-items:center; gap:.3em; padding:.35em .6em; border-radius:8px; background: var(--accent-soft); }
.reorder:hover { filter: brightness(.97); }

/* Empty / caught-up state */
.caught-up { text-align:center; padding: 3rem 1rem; }
.caught-up .big { font-size: 3.2rem; margin-bottom: .4rem; }
.caught-up h3 { font-size: 1.5rem; }

/* Forms (profile wizard, custom task) */
.field { margin-bottom: 1.1rem; }
.field label { display:block; font-weight:600; margin-bottom:.35rem; }
.field .hint { font-size:.85rem; color: var(--muted); margin-top:.25rem; }
input[type=text], input[type=email], input[type=number], input[type=date], select, textarea {
  width:100%; min-height: var(--tap); padding:.6em .8em; font:inherit; color: var(--ink);
  background: var(--surface); border:1px solid var(--border-2); border-radius: var(--radius-sm);
}
textarea { min-height: 90px; resize: vertical; }
.checks { display:grid; gap:.5rem; }
.check-row { display:flex; align-items:center; gap:.7rem; padding:.6em .8em; border:1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor:pointer; min-height: var(--tap); }
.check-row input { width:22px; height:22px; }
.check-row.sel { border-color: var(--accent); background: var(--accent-soft); }

/* Pro lock */
.locked { position: relative; }
.pro-note { display:inline-flex; align-items:center; gap:.4em; font-size:.8rem; font-weight:700; color: var(--due-soon-deep); background: var(--due-soon-soft); padding:.25em .6em; border-radius:999px; }
.upsell { background: var(--accent-soft); border:1px solid var(--accent); border-radius: var(--radius); padding:1.2rem; margin:1rem 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120%); background: var(--ink); color: var(--bg); padding:.8em 1.2em; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 90; transition: transform .25s ease; max-width: 92vw; text-align:center; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* Install prompt */
.install-bar { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding:1rem 1.2rem; margin: 1rem 0; box-shadow: var(--shadow); }
.install-bar .grow { flex:1; min-width: 180px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--border); background: var(--bg-2); padding: 2.4rem 0; margin-top: 2rem; }
.foot-grid { display:flex; flex-wrap:wrap; gap:1.5rem 2.5rem; align-items:flex-start; }
.foot-brand { display:flex; align-items:center; gap:.6rem; font-family:var(--font-display); font-weight:600; }
.foot-brand img { width:30px; height:30px; border-radius:7px; }
.foot-col h4 { font-family: var(--font-body); font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color: var(--muted); margin:0 0 .6rem; }
.foot-col a { display:block; color: var(--ink-2); text-decoration:none; padding:.2em 0; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-social { display:flex; gap:.6rem; margin-top:.4rem; }
.foot-social a { width: var(--tap); height: var(--tap); display:grid; place-items:center; border:1px solid var(--border); border-radius:10px; background: var(--surface); }
.foot-social img { width:22px; height:22px; }
.foot-legal { width:100%; margin-top:1.6rem; padding-top:1.2rem; border-top:1px solid var(--border); font-size:.88rem; color: var(--muted); display:flex; flex-wrap:wrap; gap:.4rem 1rem; justify-content:space-between; }

/* print — fridge checklist */
@media print {
  .site-head, .tabbar, .site-foot, .install-bar, .toggles, .btn, .reorder { display:none !important; }
  body { background:#fff; color:#000; }
  .task { break-inside: avoid; border:1px solid #999; box-shadow:none; }
}
