/* Japan From Here — single stylesheet, no build step.
   Long-form reading is the priority: generous measure, high contrast,
   tables that scroll instead of breaking the page. */

:root {
  --bg: #fdfcfa;
  --fg: #1c1b19;
  --muted: #6b6862;
  --rule: #e3ded6;
  --accent: #9c4221;
  --accent-soft: #fdf3ee;
  --max: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #eae7e1;
    --muted: #9a958c;
    --rule: #2f2d29;
    --accent: #e8916b;
    --accent-soft: #241d19;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.7 ui-serif, Georgia, "Times New Roman", serif;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------- chrome */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
}

.brand {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}

.brand:hover { color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2rem 1.5rem 3rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.site-footer a { color: var(--muted); }

/* ---------------------------------------------------------- home */

.home {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
}

.home h1 { font-size: 2rem; margin: 0 0 0.5rem; }

.tagline {
  color: var(--muted);
  font-size: 1.0625rem;
  margin: 0 0 3rem;
}

.cards { list-style: none; padding: 0; margin: 0; }

.card { border-top: 1px solid var(--rule); }

.card a {
  display: block;
  padding: 1.75rem 0;
  text-decoration: none;
  color: inherit;
}

.card h2 {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0 0 0.4rem;
}

.card a:hover h2 { color: var(--accent); }

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9688rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------- article */

.prose {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
}

.prose h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.byline {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

.byline:empty { display: none; }

.prose h2 {
  font-size: 1.4375rem;
  line-height: 1.3;
  margin: 3rem 0 1rem;
}

.prose h3 {
  font-size: 1.125rem;
  margin: 2.25rem 0 0.75rem;
}

.prose p { margin: 0 0 1.25rem; }

.prose a { color: var(--accent); text-decoration-thickness: 1px; }

.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.25rem; }

.prose li { margin-bottom: 0.5rem; }

.prose strong { font-weight: 700; }

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

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

/* Affiliate callouts and asides. The 🔗 blocks in the articles land here. */
.prose blockquote {
  margin: 2rem 0;
  padding: 1.125rem 1.25rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote em { color: inherit; }

/* Tables are load-bearing in these articles (tax brackets, peak dates).
   They must scroll on their own rather than force the page sideways. */
.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.75rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9063rem;
  line-height: 1.5;
}

.prose thead th {
  text-align: left;
  border-bottom: 2px solid var(--rule);
  padding: 0.625rem 0.875rem 0.625rem 0;
  white-space: nowrap;
}

.prose tbody td {
  border-bottom: 1px solid var(--rule);
  padding: 0.625rem 0.875rem 0.625rem 0;
  vertical-align: top;
}

.prose tbody tr:last-child td { border-bottom: 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 2rem 0;
}

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .prose h1, .home h1 { font-size: 1.625rem; }
  .prose h2 { font-size: 1.3125rem; }
}
