/* Single stylesheet for the whole site. No web fonts, no frameworks. */

:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-soft: #f2efe7;
  --text: #2b2a26;
  --muted: #5f5b52;
  --accent: #3d6a4d;
  --accent-soft: #e3ebe1;
  --border: #e2ddd1;
  --shadow: 0 1px 2px rgba(43, 42, 38, 0.06), 0 4px 14px rgba(43, 42, 38, 0.05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 46rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1c19;
    --surface: #222521;
    --surface-soft: #2a2e29;
    --text: #e7e5dd;
    --muted: #aaa699;
    --accent: #9cc6a6;
    --accent-soft: #2c3a2f;
    --border: #353a33;
    --shadow: none;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h2 { font-size: 1.55rem; margin: 0 0 1rem; }
h3 { font-size: 1.12rem; margin: 0 0 0.35rem; }

code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-soft); padding: 0.05em 0.3em; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--surface); padding: 0.4rem 0.8rem; }
.skip-link:focus { left: 0.5rem; z-index: 10; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1rem; }

/* Top navigation */
.site-nav { border-bottom: 1px solid var(--border); }
.site-nav .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1.25rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.site-nav .home { font-family: var(--serif); font-weight: 600; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; font-size: 0.95rem; }
.site-nav ul a { color: var(--muted); text-decoration: none; }
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { color: var(--accent); }

/* Intro */
.intro { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; padding: 3rem 0 1.5rem; }
.intro img { width: 7.5rem; height: 7.5rem; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.intro h1 { font-size: 2.3rem; margin: 0; }
.intro .role { margin: 0.3rem 0 0; font-size: 1.12rem; }
.intro .place { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.97rem; }

@media (max-width: 34rem) {
  .intro { grid-template-columns: 1fr; text-align: center; justify-items: center; padding-top: 2rem; gap: 1rem; }
  .intro h1 { font-size: 2rem; }
}

.links { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.links a { display: inline-block; padding: 0.3rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 0.93rem; }
.links a:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

@media (max-width: 34rem) {
  .links { justify-content: center; }
}

/* Sections */
section { padding: 2.25rem 0 0.75rem; scroll-margin-top: 1rem; }
section + section { border-top: 1px solid var(--border); }
.lead { font-size: 1.1rem; }
.note { color: var(--muted); font-size: 0.95rem; }

/* Featured apps */
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem 1.35rem; margin: 0 0 1.25rem; box-shadow: var(--shadow); }
.feature-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.75rem; }
.feature-head img { width: 3.5rem; height: 3.5rem; border-radius: 22%; flex: none; }
.feature h3 { font-size: 1.35rem; margin: 0; }
.feature h3 a { text-decoration: none; }
.feature h3 a:hover { text-decoration: underline; }
.feature .tagline { margin: 0.1rem 0 0; color: var(--muted); }
.feature p { margin: 0 0 0.75rem; }
.feature .points { margin: 0 0 1rem; padding-left: 1.2rem; }
.feature .points li { margin: 0.15rem 0; }
.feature .points li::marker { color: var(--accent); }
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 0 0 1rem; }
.shots img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: block; }
.shots-square img { aspect-ratio: 1 / 1; object-fit: cover; }
.shots-phone { grid-template-columns: repeat(2, minmax(0, 11rem)); justify-content: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.button { display: inline-block; padding: 0.4rem 0.95rem; border-radius: 999px; background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.button + .button { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: calc(0.4rem - 1px) calc(0.95rem - 1px); }
.button:hover { text-decoration: underline; }
.feature .meta { margin: 0; color: var(--muted); font-size: 0.86rem; }
.subhead { font-size: 1.12rem; margin: 1.75rem 0 0.75rem; }

/* Cards (projects, software) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 1rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin: 0 0 0.5rem; font-size: 0.97rem; }
.card .meta { margin: 0; color: var(--muted); font-size: 0.86rem; }

/* Publications and notes lists */
.pubs, .notes-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.pubs li, .notes-list li { margin: 0 0 1rem; padding-left: 0.9rem; border-left: 3px solid var(--accent-soft); }
.pubs .title, .notes-list .title { font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--border); }
.pubs .title:hover, .notes-list .title:hover { color: var(--accent); text-decoration: underline; }
.pubs .meta b { color: var(--text); font-weight: 600; }
.pubs .meta, .notes-list .meta { display: block; color: var(--muted); font-size: 0.92rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13.5rem, 100%), 1fr)); gap: 1rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.gallery figure { margin: 0; }
.gallery a { display: block; text-decoration: none; color: var(--text); }
.gallery .thumb { display: block; aspect-ratio: 4 / 3; background: #ffffff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 0.35rem; }
.gallery a:hover .thumb { border-color: var(--accent); }
.gallery figcaption { font-size: 0.9rem; margin-top: 0.4rem; line-height: 1.4; }
.gallery figcaption span { display: block; color: var(--muted); font-size: 0.83rem; }
.gallery figcaption a { display: inline; color: var(--accent); }

@media (max-width: 34rem) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0.25rem 0; }
