:root {
  --black: #0b0b0b;
  --offwhite: #f2efe8;
  --accent: #ff3b1f;
  /* American Typewriter ships with macOS/iOS; Cutive is the free stand-in elsewhere */
  --font: "American Typewriter", "Cutive", "Courier New", Courier, monospace;
  --gutter: clamp(16px, 5vw, 64px);
}

.dark {
  --bg: var(--black);
  --ink: #ecebe6;
  --dim: #8a877f;
  --rule: rgba(236, 235, 230, 0.14);
}
.paper {
  --bg: var(--offwhite);
  --ink: #141210;
  --dim: #6f6b63;
  --rule: rgba(20, 18, 16, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--black);
  font-family: var(--font);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.65;
  overflow-x: hidden;
}

section { background: var(--bg); color: var(--ink); }

::selection { background: var(--accent); color: var(--offwhite); }

a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--accent); }
a:hover { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* faint dot lattice over the whole page; difference-blend keeps it subtle on black and on paper */
#lattice {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: difference;
}

/* ---------- typed opening ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 64px var(--gutter) 22vh;
  overflow: hidden;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.typed { position: relative; max-width: min(34em, 52vw); }

h1 {
  font-weight: 400;
  font-size: clamp(36px, 5.6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.7em;
}

.typed p { font-size: clamp(15px, 1.35vw, 20px); }
.typed p + p { margin-top: 0.6em; }

/* until the typewriter reaches a line, keep it hidden (only when JS runs) */
.js [data-type] { visibility: hidden; }
.js [data-type].on { visibility: visible; }

.w { white-space: nowrap; }
.ch { display: inline-block; }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */

.page { padding: 110px var(--gutter); }
.page > * { max-width: 46em; }
.page.contact { padding-bottom: 160px; }

h2 {
  font-weight: 400;
  font-size: 1em;
  color: var(--accent);
  margin: 3.4em 0 0.9em;
  text-transform: lowercase;
}
h2::before { content: "— "; }
.page > h2:first-child { margin-top: 0; }

ul, ol { list-style: none; }

.plain li + li { margin-top: 0.35em; }

.board {
  max-width: 880px;
  margin-top: 64px;
  transform: rotate(-1.2deg);
}
.board img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.pubs li {
  display: flex;
  flex-direction: column;
  padding: 0.9em 0;
  border-top: 1px solid var(--rule);
}
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pubs a { border-bottom: 0; }
.authors, .venue { font-size: 0.82em; color: var(--dim); }
.authors { margin-top: 0.3em; }
.authors b { font-weight: 400; color: var(--ink); border-bottom: 1px solid var(--accent); }

.dated li {
  display: flex;
  justify-content: space-between;
  gap: 1.5em;
  padding: 0.4em 0;
  border-top: 1px solid var(--rule);
}
.dated li:last-child { border-bottom: 1px solid var(--rule); }
.dated a { border-bottom: 0; }
.date { color: var(--dim); font-size: 0.82em; white-space: nowrap; padding-top: 0.15em; }

.more { margin-top: 0.9em; font-size: 0.9em; }
.more a::after { content: " →"; }

details summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0.9em;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "[+] "; color: var(--accent); }
details[open] summary::before { content: "[–] "; }
summary i { font-style: normal; }

/* ---------- gallery: two rows drifting in opposite directions ---------- */

.gallery { padding: 40px 0 110px; }
.gallery .wrap { margin: 0 var(--gutter) 1.6em; }

.marquee {
  --gap: 16px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee + .marquee { margin-top: var(--gap); }

.track {
  display: flex;
  gap: var(--gap);
  width: max-content;
  animation: drift 60s linear infinite;
}
.marquee.reverse .track { animation-direction: reverse; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(calc(-50% - var(--gap) / 2)); } }

.shot {
  position: relative;
  flex: none;
  height: clamp(180px, 24vw, 320px);
  overflow: hidden;
  background: #151515;
}

/* the photo sets the frame's width from its own proportions */
.shot img {
  height: 100%;
  width: auto;
  display: block;
  filter: grayscale(0.25) contrast(1.05);
  transition: filter 0.4s, transform 0.6s;
}
.shot:hover img { filter: none; transform: scale(1.04); }

.shot figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px 12px 10px;
  font-size: 13px;
  color: #ecebe6;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: opacity 0.3s;
}
.shot:hover figcaption { opacity: 1; }


/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .hero { align-items: flex-end; padding-bottom: 20vh; }
  .typed { max-width: none; }
  .page { padding: 80px var(--gutter); }
}

@media (max-width: 520px) {
  .dated li { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .track { animation: none; }
  .marquee { overflow-x: auto; }
}

.socials { display: flex; flex-wrap: wrap; gap: 0.6em 1.8em; }
.socials a::after { content: " ↗"; color: var(--accent); }

h2 .asof { color: var(--dim); }
