@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin-italic.woff2") format("woff2");
}

:root {
  --bg: #f3efe6;
  --text: #141414;
  --muted: #5c5850;
  --faint: #8a857a;
  --link: #1a2a4a;
  --rule: #ddd6c8;
  --serif: "Newsreader", "Iowan Old Style", "Times New Roman", Times, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.62);
    --faint: rgba(255, 255, 255, 0.45);
    --link: #ffffff;
    --rule: rgba(255, 255, 255, 0.12);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.12rem/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page { max-width: 39rem; margin: 0 auto; padding: 72px 24px 56px; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }

h1 { font-size: 2.25rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 22px; }
p { margin: 0 0 14px; }
.intro p { max-width: 36rem; }
.avatar { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; }

section { margin-top: 44px; }
h2 {
  font: 500 0.75rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}

.entries { list-style: none; margin: 0; padding: 0; }
.entry { padding: 10px 0 12px; }
.entry + .entry { border-top: 1px dashed var(--rule); }
.entry__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-weight: 600; }
.entry__head .date { font: 400 0.78rem/1 var(--mono); color: var(--faint); white-space: nowrap; }
.entry p { color: var(--muted); font-size: 1.02rem; margin: 4px 0 0; }

details { margin-top: 4px; }
summary {
  cursor: pointer; list-style: none; display: inline-block;
  font: 400 0.78rem/1.6 var(--mono); color: var(--faint);
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+ "; }
details[open] summary::before { content: "− "; }
summary:hover { color: var(--text); }
details ul { margin: 6px 0 2px; padding-left: 18px; color: var(--muted); font-size: 1rem; }
details li { margin: 4px 0; }

.hero-photo { margin: 36px 0 0; }
.hero-photo img { display: block; width: 100%; height: auto; border-radius: 4px; }

.project { padding: 6px 0 22px; }
.project + .project { border-top: 1px dashed var(--rule); padding-top: 22px; }
h3 { font-size: 1.22rem; line-height: 1.3; font-weight: 650; margin: 0 0 4px; letter-spacing: -0.005em; }
.project .meta { font: 400 0.76rem/1.6 var(--mono); color: var(--faint); margin: 0 0 14px; }
.project .meta a { color: var(--muted); }
.project p { margin: 0 0 12px; }
code { font: 400 0.86em/1 var(--mono); }

.numbers { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 0.95rem; }
.numbers caption { caption-side: bottom; text-align: left; font: 400 0.72rem/1.5 var(--mono); color: var(--faint); padding-top: 8px; }
.numbers th { font: 500 0.7rem/1.35 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); text-align: right; padding: 0 0 8px; vertical-align: bottom; }
.numbers th:first-child, .numbers td:first-child { text-align: left; }
.numbers td { padding: 7px 0; border-top: 1px solid var(--rule); text-align: right; font-variant-numeric: tabular-nums; }
.numbers td + td, .numbers th + th { padding-left: 16px; }
.numbers tr:last-child td { font-weight: 650; }

.project--short { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: start; }
.project--short.project--text { grid-template-columns: 1fr; }
.project--short .inline-photo { grid-column: 1 / -1; margin: 4px 0 0; }
.inline-photo img { display: block; width: 100%; height: auto; border-radius: 4px; }
.project--short p { font-size: 1.04rem; }

.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 4px; }
.photo-pair img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.pair-caption { grid-column: 1 / -1; font-size: 0.9rem; color: var(--faint); font-style: italic; line-height: 1.45; margin: 0; }

.entry--poster { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: start; }
.thumb { display: block; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: #fff; line-height: 0; }
.thumb img { width: 100%; height: auto; transition: opacity .15s ease; }
.thumb:hover img { opacity: .85; }
.entry__title { font-weight: 600; color: var(--text); line-height: 1.35; display: inline-block; }
.entry .meta { font: 400 0.74rem/1.5 var(--mono); color: var(--faint); margin-top: 6px; }
.entry .links { font: 400 0.8rem/1.6 var(--mono); margin-top: 8px; }
.entry .links a { color: var(--muted); }

.skills { margin-top: 14px; color: var(--muted); font-size: 1rem; line-height: 1.8; }
.skills span { font: 400 0.74rem/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 8px; }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
figcaption { font-size: 0.9rem; color: var(--faint); margin-top: 6px; line-height: 1.45; font-style: italic; }

.footer {
  margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font: 400 0.78rem/1 var(--mono); color: var(--faint);
}
.footer > a { color: var(--link); text-decoration: none; font-weight: 600; }
.icons { display: flex; gap: 14px; }
.icons a { color: var(--text); display: inline-flex; }
.icons a:hover { opacity: .65; }

.viewer { width: min(1100px, 94vw); height: min(92vh, 1200px); padding: 0; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); color: var(--text); }
.viewer::backdrop { background: rgba(10, 10, 10, 0.6); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--rule); font: 400 0.8rem/1.3 var(--mono); }
.viewer__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__actions { display: flex; gap: 14px; flex-shrink: 0; }
.viewer__actions a, .viewer__actions button { font: inherit; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.viewer__frame { flex: 1; min-height: 0; background: #fff; }
.viewer__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 640px) {
  body { font-size: 1.06rem; }
  .page { padding: 48px 20px 40px; }
  h1 { font-size: 2rem; }
  .entry__head { flex-direction: column; gap: 4px; }
  .entry--poster, .project--short { grid-template-columns: 1fr; gap: 12px; }
  .entry--poster .thumb, .project--short .thumb { max-width: 280px; }
  .hero-photo { margin-top: 28px; }
  .numbers { font-size: 0.88rem; }
  .photos { grid-template-columns: 1fr; }
  .footer { font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) { .thumb img { transition: none; } }
