:root { --ink: #111111; --muted: #595959; --bg: #ffffff; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover, button:hover { color: #6b6b6b; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px 32px; padding: 28px 40px;
}
.site-name { font-size: 21px; font-weight: 500; letter-spacing: 0.01em; min-height: 44px; display: flex; align-items: center; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.site-nav a { min-height: 44px; display: flex; align-items: center; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

main { flex: 1; display: flex; flex-direction: column; }

/* Landing */
.landing { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 40px 56px; }
.landing img { max-width: 100%; max-height: calc(100vh - 200px); width: auto; height: auto; }

/* Work grid */
.grid {
  padding: 24px 40px 80px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 40px;
  max-width: 1360px; width: 100%; margin: 0 auto;
}
.grid a { display: block; }
.grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; transition: opacity .2s; }
.grid a:hover img { opacity: .82; }

/* Work detail */
.detail { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 40px 48px; gap: 24px; }
.detail-image { display: flex; align-items: center; justify-content: center; width: 100%; height: calc(100vh - 340px); min-height: 280px; cursor: zoom-in; }
.detail-image img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.detail-info { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.caption { display: flex; flex-direction: column; gap: 2px; min-height: 6em; }
.caption .title { font-style: italic; }
.muted { color: var(--muted); }
.controls { display: flex; align-items: center; gap: 24px; }
.controls button, .controls a { min-height: 44px; display: flex; align-items: center; }
.counter { font-variant-numeric: tabular-nums; }

/* Zoom */
.zoom { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.zoom[hidden] { display: none; }
.zoom-close { position: absolute; inset: 0; width: 100%; height: 100%; cursor: zoom-out; }
.zoom img { position: relative; max-width: 100%; max-height: 100%; width: auto; height: auto; }

/* Text pages */
.text-page { padding: 24px 40px 80px; max-width: 760px; width: 100%; display: flex; flex-direction: column; gap: 36px; }
.text-page p { margin: 0; max-width: 640px; }
.cv-section { display: flex; flex-direction: column; gap: 8px; }
.cv-section h2 { margin: 0; font-size: 15px; font-weight: 500; }
.cv-row { display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.cv-row em { font-style: italic; }
.contact { gap: 6px; }

@media (max-width: 600px) {
  .site-header { padding: 20px 16px; }
  .landing, .detail { padding-left: 16px; padding-right: 16px; }
  .grid { padding: 16px 16px 64px; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .text-page { padding: 16px 16px 64px; }
  .cv-row { grid-template-columns: 80px 1fr; gap: 12px; }
  .detail-image { height: 60vh; }
}
