/* Kindwright Studio site pages. Follows brand/README.md: --kw-* tokens only.
   Shared by every page in site/. Reading width for words, page width for cards. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; }
.kw-base h1, .kw-base h2, .kw-base h3, .kw-base p, .kw-base ul { margin: 0; }

.shell { max-width: var(--kw-width-page); margin: 0 auto;
  padding-left: max(var(--kw-gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--kw-gutter), env(safe-area-inset-right, 0px)); }
.band { padding-block: var(--kw-space-12); }
.band--sage { background: var(--kw-surface-alt); }

/* Header: wordmark home link, then a short nav. */
.top { padding-block: var(--kw-space-6) 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--kw-space-4); }
.home { display: inline-flex; }
.home img { height: 1.75rem; width: auto; display: block; }
.nav { display: flex; gap: var(--kw-space-6); font-weight: 600; }
.kw-base .nav a { color: var(--kw-text); text-decoration: none; }
.kw-base .nav a:hover, .kw-base .nav a[aria-current="page"] { color: var(--kw-link); text-decoration: underline; }

.hero { padding-block: var(--kw-space-12); }
.hero-inner { display: grid; gap: var(--kw-space-4); max-width: var(--kw-width-reading); }
.hero h1 { font-size: var(--kw-text-4xl); font-variation-settings: "opsz" 72; }
.lead { font-size: var(--kw-text-lg); color: var(--kw-text-secondary); max-width: var(--kw-measure); }

.kw-base h2.kw-label { font-family: var(--kw-font-body); font-size: var(--kw-text-xs); font-weight: 600; letter-spacing: var(--kw-tracking-label); line-height: 1.4; margin-bottom: var(--kw-space-4); }

/* Short statements in pairs: a label, then one bold line. */
.pairs { display: grid; gap: var(--kw-space-6) var(--kw-space-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.pair { display: grid; gap: var(--kw-space-1); align-content: start; padding-top: var(--kw-space-3); border-top: 2px solid var(--kw-accent); }
.pair p:last-child { font-family: var(--kw-font-display); font-weight: 700; font-variation-settings: "opsz" 36; font-size: var(--kw-text-xl); letter-spacing: var(--kw-tracking-display); line-height: var(--kw-leading-snug); }

.prose { display: grid; gap: var(--kw-space-3); max-width: var(--kw-measure); }

.products { list-style: none; padding: 0; display: grid; gap: var(--kw-space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.product, .kw-base a.product { display: grid; gap: var(--kw-space-2); align-content: start; height: 100%; box-sizing: border-box;
  padding: var(--kw-space-6); background: var(--kw-surface); border: var(--kw-border-width) solid var(--kw-border);
  border-radius: var(--kw-radius-md); color: var(--kw-text); text-decoration: none; }
.kw-base a.product:hover { border-color: var(--kw-accent); }
.kw-base a.product:hover h3 { text-decoration: underline; text-underline-offset: 0.18em; }
.product h3 { font-size: var(--kw-text-xl); }
.product p { color: var(--kw-text-secondary); }
.product .addr { color: var(--kw-link); font-weight: 600; font-size: var(--kw-text-sm); }
.product .addr::after { content: " \2192"; }
.kw-base .more { margin-top: var(--kw-space-4); color: var(--kw-text-secondary); }
.kw-base .go { font-weight: 600; }
.kw-base .go::after { content: " \2192"; }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--kw-space-4);
  padding-block: var(--kw-space-6); border-top: var(--kw-border-width) solid var(--kw-border); color: var(--kw-text-muted); font-size: var(--kw-text-sm); }
.foot img { height: 1.3rem; width: auto; display: block; }

@media (max-width: 639px) {
  .band, .hero { padding-block: var(--kw-space-8); }
  .hero h1 { font-size: var(--kw-text-3xl); }
  .pair p:last-child { font-size: var(--kw-text-lg); }
}

/* Header: the account link sits with the nav. Hidden until account.js knows the state. */
.kw-base .nav a[hidden] { display: none; }

/* Account page: /account/. */
.account { display: grid; gap: var(--kw-space-4); padding-block: var(--kw-space-12); }
.account > div, .account-form { display: grid; gap: var(--kw-space-4); }
.account [hidden] { display: none; }
.account h1 { font-size: var(--kw-text-4xl); font-variation-settings: "opsz" 72; }
.account h1:focus { outline: none; }
.account .lead { max-width: var(--kw-measure); }
.account-section { display: grid; gap: var(--kw-space-4); padding-top: var(--kw-space-8); margin-top: var(--kw-space-4); border-top: var(--kw-border-width) solid var(--kw-border); }
.kw-base .account-section h2.kw-label { margin-bottom: 0; }
.account-form label { font-weight: 600; }
.account-form input { box-sizing: border-box; width: 100%; max-width: 22rem; min-height: 48px; padding: 0 var(--kw-space-3); font: inherit;
  color: var(--kw-text); background: var(--kw-surface); border: var(--kw-border-width) solid var(--kw-border); border-radius: var(--kw-radius-md); }
.account-form input:focus-visible { border-color: var(--kw-focus); }
.account-form .kw-button { justify-self: start; min-height: 48px; }
.inline-field { display: flex; flex-wrap: wrap; gap: var(--kw-space-2); }
.inline-field input { flex: 1 1 12rem; }
.account-rename { gap: var(--kw-space-2); }
.field-note { font-size: var(--kw-text-sm); color: var(--kw-text-muted); min-height: 1.2em; }
.field-error { font-size: var(--kw-text-sm); font-weight: 600; color: var(--kw-link); }
.account-actions { display: flex; flex-wrap: wrap; gap: var(--kw-space-3); }
.account-actions .kw-button { min-height: 48px; box-sizing: border-box; display: inline-flex; align-items: center; }
.account-delete { display: grid; gap: var(--kw-space-3); }
.account-delete summary { cursor: pointer; font-weight: 600; color: var(--kw-link); min-height: 44px; display: flex; align-items: center; }
.account-delete[open] { display: grid; gap: var(--kw-space-3); }
.account-delete p { color: var(--kw-text-secondary); max-width: var(--kw-measure); }
.account-delete .kw-button { justify-self: start; min-height: 48px; }
.meter { height: 8px; border-radius: 999px; background: var(--kw-surface-alt); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--kw-accent); border-radius: inherit; }

@media (max-width: 639px) {
  .account { padding-block: var(--kw-space-8); }
  .account h1 { font-size: var(--kw-text-3xl); }
}
