/* Worth & Why — single hand-written stylesheet. Served as /assets/style.css.
   No web fonts, no imports, no remote assets. */

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #565656;
  --rule: #e3e3e3;
  --accent: #0b5cc0;
  --accent-fg: #ffffff;
  --card-bg: #f7f7f8;
  --focus: #0b5cc0;
  --maxw: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --fg: #ededed;
    --muted: #b4b8c0;
    --rule: #2b2f39;
    --accent: #86b7ff;
    --accent-fg: #10131a;
    --card-bg: #1a1d25;
    --focus: #86b7ff;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 6px 0;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.site-header,
.site-footer,
main {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.brand-line { margin: 0; }

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--fg);
}

.site-nav ul,
.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-nav a,
.site-footer a {
  text-decoration: none;
  color: var(--accent);
}
.site-nav a:hover,
.site-footer a:hover,
main a:hover { text-decoration: underline; }

main {
  padding-block: 1.5rem 2.5rem;
}

main a { color: var(--accent); }

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0.2rem 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-top: 2rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--rule);
}

h3 { font-size: 1.08rem; margin-top: 1.5rem; }

p, ul, ol { margin: 0.75rem 0; }

ul, ol { padding-left: 1.4rem; }

li { margin: 0.35rem 0; }

.lede {
  font-size: 1.15rem;
  color: var(--fg);
}

.reviewed {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0;
}

.note {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 1rem;
}

.card-list > li {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 0;
}

.card-list h2,
.card-list h3 {
  border: 0;
  margin: 0 0 0.35rem;
  padding: 0;
  font-size: 1.12rem;
}

/* One link per card: the heading link is stretched over the whole card via a
   pseudo-element, so the entire card is one click target with no nested links. */
.card-list h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.card-cta {
  margin: 0.6rem 0 0;
  font-weight: 600;
  color: var(--accent);
}

/* Progressive enhancement: on browsers that support :has(), show the focus ring
   on the whole card for keyboard focus. Where :has() is unsupported this rule is
   ignored and the anchor's own :focus-visible outline still applies. */
.card-list > li:has(a:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.checklist {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.1rem 1rem 2.4rem;
}

.muted { color: var(--muted); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-note { margin: 0.75rem 0 0; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 30rem) {
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.18rem; }
  body { font-size: 1rem; }
}
