/* lohn.cc — personal site */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1d1f23;
  --muted: #5d6169;
  --line: #e3dfd6;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ef;
  --radius: 14px;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Lao", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f24;
    --ink: #ebe8e1;
    --muted: #a3a7ae;
    --line: #2c3038;
    --accent: #5eead4;
    --accent-ink: #0b1f1d;
    --accent-soft: #15302d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.mono {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-family: var(--serif); font-size: 19px;
}
nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; }
nav a:hover { color: var(--ink); background: var(--accent-soft); }

/* Hero */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 7vw, 80px); }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(34px, 5.4vw, 60px); margin: 0 0 22px; max-width: 18ch; letter-spacing: -.01em; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 60ch; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1.5px solid var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 28px; }
h3 { font-size: 20px; margin: 0 0 8px; }
.two-col { display: grid; gap: 8px 48px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 260px 1fr; } }
.prose p { margin: 0 0 1em; max-width: 64ch; }
.prose p:last-child { margin-bottom: 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p { margin: 0; color: var(--muted); }
.tag { display: inline-block; margin: 0 0 12px !important; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent) !important; font-size: 13px; font-weight: 600; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; display: grid; gap: 4px 32px; padding: 0 0 36px 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
@media (min-width: 860px) { .timeline li { grid-template-columns: 300px 1fr; } }
.when { font-weight: 600; }
.when span { color: var(--muted); font-weight: 400; }
.what p { margin: 0; color: var(--muted); max-width: 60ch; }

.topics { margin: 0; padding-left: 1.2em; }
.topics li { margin: .35em 0; }

.contact { text-align: center; }
.contact h2 { margin-bottom: 12px; }
.contact p { color: var(--muted); margin: 0 0 28px; }
.contact .actions { justify-content: center; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 15px; }
.site-footer a { color: var(--muted); }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 8px; }
.notfound h1 { margin: 0 auto 8px; }

/* Footer layout */
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.when .years { display: block; color: var(--muted); font-weight: 400; font-size: 15px; }

/* Contact form */
.contact-form {
  display: grid; gap: 16px; grid-template-columns: 1fr; text-align: left;
  max-width: 720px; margin: 8px auto 0; padding: 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
@media (min-width: 640px) { .contact-form { grid-template-columns: 1fr 1fr; } .field-wide { grid-column: 1 / -1; } }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.form-foot .btn { cursor: pointer; }
.form-note { margin: 0 !important; font-size: 14px; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
altcha-widget { --altcha-max-width: 300px; }

/* Pages, notes and articles */
.page h1, .page-head h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 0 0 20px; }
.page-head { border-top: 0; padding-bottom: 16px; }
.list-body { padding-bottom: 72px; }
.page .prose, .article .prose { max-width: 70ch; }
.prose h2 { font-size: 26px; margin: 1.6em 0 .5em; }
.prose h3 { margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose code { font-size: .92em; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
.prose pre { overflow-x: auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.post-list { list-style: none; padding: 0; margin: 0 0 1em; }
.post-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-list a { font-family: var(--serif); font-size: 20px; font-weight: 600; text-decoration: none; }
.post-list time { display: block; color: var(--muted); font-size: 14px; }
.post-list p { margin: 4px 0 0; color: var(--muted); }
.eyebrow a { color: inherit; }
.disclosure { font-size: 14px; color: var(--muted); border-left: 3px solid var(--accent); padding: 8px 14px; background: var(--accent-soft); border-radius: 0 8px 8px 0; max-width: 70ch; }
.aff-mark { color: var(--muted); }
.ad { margin: 28px 0; min-height: 90px; }
.back { margin-top: 40px; }
