/* Howard Wang — a quiet, readable home for long-form writing. */
:root {
  color-scheme: light;
  --article-bg: #f7f5ef;
  --article-text: #202b29;
  --article-muted: #68716b;
  --article-accent: #174b45;
  --article-border: #dedfd7;
  --article-width: 46rem;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--article-bg);
  color: var(--article-text);
  font-family: var(--font-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

::selection { color: var(--article-text); background: #d9e6dd; }

a { color: var(--article-accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--article-accent);
  outline-offset: 5px;
  border-radius: 2px;
}

.article-header,
.article-hero,
.article-body,
.article-wrap {
  width: 100%;
  max-width: var(--article-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.article-header { padding-top: 2rem; padding-bottom: 1.75rem; }

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-bottom: clamp(2.5rem, 7vw, 5rem);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}

.article-back:hover { text-decoration: underline; }

.article-title {
  margin: 0 0 1.35rem;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5.8vw, 4.1rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.article-title .grad { color: var(--article-accent); }

.article-date,
.article-subtitle {
  margin: 0.4rem 0 0;
  color: var(--article-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-subtitle { font-size: 1.05rem; }

.article-header::after {
  content: "";
  display: block;
  width: 100%;
  margin-top: 2rem;
  border-bottom: 1px solid var(--article-border);
}

.article-body {
  padding-top: 0.5rem;
  padding-bottom: 6rem;
  font-size: 1rem;
  overflow-wrap: break-word;
}

/* Reading never depends on JavaScript or a scroll animation. */
.article-body.reveal { opacity: 1 !important; transform: none !important; }

.article-body p { margin: 0 0 1.5rem; }
.article-body p:last-child { margin-bottom: 0; }
.article-body .lead { font-size: 1.08rem; line-height: 1.8; }
.article-body strong { font-weight: 600; }

.article-body h2,
.article-body h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
  letter-spacing: -0.025em;
}

.article-body h2 { margin: 2.8rem 0 1rem; font-size: 1.8rem; }
.article-body h3 { margin: 2rem 0 0.8rem; font-size: 1.4rem; }

.article-body a { text-decoration: underline; text-decoration-thickness: 1px; }
.article-body a:hover { text-decoration-thickness: 2px; }

.article-body ul,
.article-body ol { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.article-body li { padding-left: 0.25rem; margin-bottom: 0.65rem; }
.article-body li::marker { color: var(--article-accent); }

.article-body blockquote {
  margin: 2rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 2px solid var(--article-accent);
  font-family: var(--font-heading);
  font-size: 1.22rem;
  line-height: 1.65;
}

.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body img { display: block; max-width: 100%; height: auto; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { margin-top: 0.65rem; color: var(--article-muted); font-size: 0.8rem; }
.article-body hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--article-border); }
.article-body pre { max-width: 100%; padding: 1rem; overflow-x: auto; background: #eeeee6; }

/* Shared navigation for articles with the full site header. */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  width: 0;
  background: var(--article-accent);
}

.site-nav { border-bottom: 1px solid var(--article-border); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.15rem 2rem;
}

.nav-logo { color: var(--article-text); text-decoration: none; line-height: 1.35; }
.logo-text { display: block; font-family: var(--font-heading); font-size: 1.25rem; }
.logo-subtitle { display: block; color: var(--article-muted); font-size: 0.65rem; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.8rem;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.lang-toggle { display: flex; gap: 0.15rem; }
.lang-toggle button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--article-muted);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}
.lang-toggle button.active { border-color: var(--article-border); color: var(--article-accent); }

.article-hero { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: 2rem; }
.article-overline { margin: 0 0 1.2rem; color: var(--article-accent); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; color: var(--article-muted); font-size: 0.78rem; }
.article-meta .author { color: var(--article-text); }
.article-meta .dot { width: 3px; height: 3px; background: var(--article-muted); border-radius: 50%; }
.hero-divider { margin-top: 2rem; border-top: 1px solid var(--article-border); }
.article-wrap { padding-bottom: 4rem; }
.article-wrap .article-body { padding: 0 0 0.5rem; }

.article-body .schedule-list { padding: 0; list-style: none; }
.article-body .schedule-list li { display: flex; align-items: baseline; gap: 1rem; padding: 0.85rem 0; margin: 0; border-bottom: 1px solid var(--article-border); }
.article-body .schedule-list .key { flex: 0 0 5.5rem; color: var(--article-accent); font-size: 0.8rem; font-weight: 600; }

.article-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--article-border); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 46px; padding: 0.7rem 1.1rem; border: 1px solid var(--article-border); border-radius: 4px; font-size: 0.78rem; font-weight: 500; text-decoration: none; }
.btn-primary { background: var(--article-accent); border-color: var(--article-accent); color: var(--article-bg); }
.btn-primary:hover { background: #103e38; }
.btn-ghost:hover { border-color: var(--article-accent); background: #eeeee6; }

.site-footer { padding: 2rem 1.5rem; border-top: 1px solid var(--article-border); color: var(--article-muted); text-align: center; font-size: 0.72rem; }
.site-footer p { margin: 0.75rem 0 0; }
.site-footer .social { display: flex; justify-content: center; gap: 0.65rem; }
.site-footer .social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--article-accent); font-size: 1rem; text-decoration: none; }
.site-footer .social a:hover { background: #eeeee6; border-radius: 50%; }

@media (max-width: 600px) {
  html { font-size: 17px; }
  .article-header,
  .article-hero,
  .article-body,
  .article-wrap { padding-inline: 1.25rem; }
  .article-header { padding-top: 1rem; }
  .article-back { margin-bottom: 2.5rem; }
  .article-title { font-size: clamp(2.15rem, 9vw, 3.2rem); letter-spacing: -0.035em; }
  .article-body { padding-bottom: 4rem; }
  .article-body h2 { font-size: 1.65rem; }
  .article-body .lead { font-size: 1rem; }
  .nav-inner { flex-wrap: wrap; padding: 0.85rem 1.25rem; gap: 0.7rem; }
  .nav-actions { gap: 0.5rem; }
  .logo-subtitle { display: none; }
  .logo-text { font-size: 1.1rem; }
  .article-hero { padding-top: 3rem; }
  .article-body .schedule-list li { display: block; }
  .article-body .schedule-list .key { display: block; margin-bottom: 0.2rem; }
  .article-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  html { font-size: 11pt; }
  body { background: white; color: black; }
  .site-nav, .reading-progress, .article-back, .article-actions, .site-footer { display: none; }
  .article-header, .article-hero { padding-top: 0; }
  .article-body { padding-bottom: 0; }
  .article-body h2, .article-body h3 { break-after: avoid; }
  .article-body p { orphans: 3; widows: 3; }
  a { color: inherit; }
}
