/* Personal site. Plain CSS, no build step, no external fonts or scripts. */
/* Dark by default; the toggle sets data-theme="light" for the light palette. */
:root {
  --paper: #151513;
  --ink: #ecebe5;
  --ink-2: #c9c7bf;
  --mute: #8f8d85;
  --rule: #2f2e29;
  --wash: #21201d;
  --serif: "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --column: 42rem;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #f8f6f0;
  --ink: #1a1b1a;
  --ink-2: #3b3d39;
  --mute: #75776f;
  --rule: #e2ded3;
  --wash: #efebe1;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* Layout: one column, footer pinned to the bottom of short pages. */
.page {
  max-width: calc(var(--column) + 4rem);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 7.5rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

.theme-toggle {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.theme-toggle:hover { color: var(--ink); background: var(--paper); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }

h1 { font: 400 3rem/1.05 var(--serif); letter-spacing: -0.028em; margin: 0; text-wrap: balance; }
h2 { font: 500 0.95rem/1.4 var(--sans); color: var(--ink); margin: 0 0 1.2rem; }
.lede { font: 400 1.3rem/1.5 var(--serif); letter-spacing: -0.006em; margin: 0; text-wrap: pretty; }

/* Home: edge-to-edge photo that dissolves into the page, the name set where it fades. */
.hero { position: relative; margin: 0; aspect-ratio: 4 / 1; min-height: 200px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 20% 100%; }
.hero::after { content: ""; position: absolute; inset: 0 0 -2px; background: linear-gradient(to bottom, transparent 88%, var(--paper) 100%); }
:root:not([data-theme="light"]) .hero img { filter: brightness(0.82) saturate(0.9); }
.hero figcaption {
  position: absolute;
  z-index: 1;
  bottom: 0.9rem;
  right: max(2rem, calc((100% - var(--column)) / 2));
  font-size: 0.72rem;
  color: var(--mute);
}
.home { min-height: 0; padding-top: 1.6rem; padding-bottom: 7rem; position: relative; }

.social { display: flex; align-items: center; gap: 0.35rem; margin: 0.9rem 0 0 -0.45rem; }
.social a { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; color: var(--mute); transition: color 0.18s ease, background-color 0.18s ease; }
.social a:hover { color: var(--ink); background: var(--wash); }
.social svg { width: 1.05rem; height: 1.05rem; }

.about { max-width: 34rem; margin-top: 3.5rem; }
.about p { margin: 0 0 1rem; color: var(--ink-2); text-wrap: pretty; }
.about .lede { color: var(--ink); margin-bottom: 1.5rem; }
.bio { list-style: none; margin: 0 0 1.5rem; padding: 0; color: var(--ink-2); }
.bio li { position: relative; padding-left: 1.1rem; margin-bottom: 0.4rem; text-wrap: pretty; }
.bio li::before { content: ""; position: absolute; left: 0; top: 0.82em; width: 0.42rem; height: 1px; background: var(--mute); }

.work { margin-top: 4.5rem; }

/* Project list */
.projects { list-style: none; margin: -0.7rem 0; padding: 0; }
.project {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  gap: 1.1rem;
  align-items: center;
  margin: 0 -0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.18s ease;
}
.project:hover { background: var(--wash); }
.project .name { display: block; font: 400 1.25rem/1.3 var(--serif); letter-spacing: -0.008em; }
.project .desc { display: block; font-size: 0.9rem; line-height: 1.45; color: var(--mute); margin-top: 0.1rem; text-wrap: balance; }
.project .arrow { color: var(--mute); opacity: 0; transform: translateX(-5px); transition: opacity 0.18s ease, transform 0.18s ease; }
.project:hover .arrow, .project:focus-visible .arrow { opacity: 1; transform: none; }
.icon { display: block; width: 2.75rem; height: 2.75rem; color: var(--ink); }

/* Project page */
.back { display: inline-block; font-size: 0.9rem; color: var(--mute); text-decoration: none; margin-bottom: 4.5rem; transition: color 0.18s ease; }
.back:hover { color: var(--ink); }
.detail { max-width: 34rem; }
.detail .icon { width: 3.75rem; height: 3.75rem; margin-bottom: 1.8rem; }
.detail h1 { margin-bottom: 1.1rem; }
.detail .lede { margin-bottom: 1.4rem; }
.detail p { margin: 0 0 1.1rem; color: var(--ink-2); text-wrap: pretty; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 2.4rem 0 0; padding: 0; }
.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.links a:hover { background: var(--wash); border-color: var(--wash); }
.links svg { width: 1rem; height: 1rem; }
.links .ext { color: var(--mute); }

footer.social { margin-top: 5rem; }

@media (max-width: 640px) {
  .page { padding: 4.5rem 1.4rem 2rem; }
  .theme-toggle { top: 0.8rem; right: 0.8rem; }
  h1 { font-size: 2.5rem; }
  .hero { aspect-ratio: auto; height: 210px; }
  .hero img { object-position: 15% 100%; }
  .hero figcaption { right: 1.4rem; bottom: 0.7rem; }
  .home { padding-top: 1.2rem; padding-bottom: 4.5rem; }
  .about { margin-top: 2.6rem; }
  .work { margin-top: 3.5rem; }
  .projects { margin: -0.5rem 0; }
  .project .arrow { display: none; }
  .back { margin-bottom: 3.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
