/* Shared styles for the home page and the project pages. */
:root {
  --paper: #ffffff;
  --ink: #111111;
  --soft: #555555;
  --line: #e6e6e6;
  --tint: #f6f6f4;
  --link: #1a4f8a;
  --ocean: #2d5f9f;
  --land: #4c7d4a;
  --ice: #8b98a3;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body { margin: 0; }

#site { font-family: var(--sans); line-height: 1.55; font-size: 16px; padding-bottom: 48px; }
/* while letters are forming the page, the real page stays hidden underneath */
html.lf-forming #site { visibility: hidden; }
#site.lf-fadein { animation: lf-fadein 0.4s ease-out; }
@keyframes lf-fadein { from { opacity: 0; } to { opacity: 1; } }
#site a { color: var(--link); }
.container { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.topnav { position: sticky; top: env(safe-area-inset-top, 0px); background: var(--paper); border-bottom: 1px solid var(--line); z-index: 10; }
.topnav .container { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; padding-block: 10px; }
#site .topnav a { text-decoration: none; color: var(--ink); }
#site .topnav a:hover { text-decoration: underline; }
.header { padding-block: 32px; }
.header .portrait { float: right; margin: 0 0 12px 16px; width: 180px; height: 180px; object-fit: cover; }
.header .name { margin: 0; font-size: 2em; line-height: 1.15; }
.tagline { color: #444; margin: 6px 0 0; }
.cta { margin: 12px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
#site .btn { display: inline-block; padding: 9px 16px; border: 1px solid #000; text-decoration: none; color: var(--ink); }
#site .btn:hover { background: #000; color: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; clear: both; }
h2 { margin: 32px 0 12px; font-size: 1.5em; }
ul.pubs { list-style: none; padding-left: 0; margin: 0; }
ul.pubs li { margin: 10px 0; }
.yr { display: inline-block; min-width: 3ch; font-variant-numeric: tabular-nums; color: var(--soft); margin-right: 4px; }
section { padding-bottom: 8px; scroll-margin-top: 56px; }
.muted { color: var(--soft); }

/* every thumbnail gets the same box, fitted not cropped */
.frame { background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; background: var(--tint); font-family: var(--mono); color: #3b4148; font-size: 13px; line-height: 1.35; padding: 8px; }
.ph b { display: block; font-size: 22px; letter-spacing: 0.02em; color: var(--ink); }
.plinks a + a::before { content: '·'; color: var(--soft); margin: 0 7px; display: inline-block; text-decoration: none; }

/* project cards: equal size, two per row; the whole card opens the project page */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { position: relative; transition: border-color 0.15s, background 0.15s; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; border: 1px solid var(--line); background: #fcfcfb; padding: 10px; }
.card:hover { border-color: #bdbdbd; background: #fff; }
.card:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.card .frame { width: 112px; height: 112px; }
.card .txt { display: flex; flex-direction: column; min-width: 0; }
.card h3 { margin: 0 0 3px; font-size: 1em; line-height: 1.3; }
#site .card h3 a { color: var(--ink); text-decoration: none; }
#site .card h3 a:focus-visible { outline: none; }
/* the title link stretches over the whole card; the small links stay clickable on top */
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card .plinks { position: relative; z-index: 1; }
.card .short { margin: 0; font-size: 0.92em; color: #333; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.9em; }
.more { color: var(--link); white-space: nowrap; }
.card:hover .more { text-decoration: underline; }

/* project pages */
.projpage { padding-top: 20px; }
.crumb { margin: 0 0 14px; }
.projpage h1 { margin: 0 0 16px; font-size: 2em; line-height: 1.15; }
.hero { margin: 0 0 18px; max-width: 340px; aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; }
.hero img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero .ph { font-size: 16px; }
.hero .ph b { font-size: 40px; }
.lede { max-width: 65ch; margin: 0 0 10px; }

@media (max-width: 640px) {
  .header .portrait { float: none; margin: 0 0 12px; width: 120px; height: 120px; }
  .cards { grid-template-columns: 1fr; }
}

#lf-canvas { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 30; }
