/* Favorit is licensed: put the files in a "fonts" folder next to index.html */
@font-face { font-family: "Favorit"; src: local("Favorit"), url("fonts/Favorit-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Favorit"; src: local("Favorit Bold"), url("fonts/Favorit-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #fff;
  color: #222;
  font: 13px/16px "Favorit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { width: 44%; padding: 25px 15px 80px; }
@media (max-width: 1000px) { main { width: 100%; } }

p { margin: 0 0 11px; }
h1 { font-size: 13px; line-height: 16px; font-weight: 700; margin: 26px 0 13px; }
h1.contact { margin: 14px 0 0; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color .2s ease;
}
.bio a { text-decoration: none; }
a:hover, a:focus-visible { color: #8a8a8a; }

.row { display: grid; grid-template-columns: 50px 1fr; margin-bottom: 10px; }
.yr, .meta { color: rgba(67, 67, 67, .8); }

details { margin-top: 14px; }
summary { cursor: pointer; list-style: none; margin-bottom: 10px; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
/* triangles are drawn with borders, so phones can never swap them for emoji */
summary::before { content: ""; display: inline-block; width: 0; height: 0; border-style: solid; border-width: 3.5px 0 3.5px 6px; border-color: transparent transparent transparent currentColor; margin-right: 18px; vertical-align: 1px; }
details[open] > summary::before { border-width: 6px 3.5px 0 3.5px; border-color: currentColor transparent transparent transparent; margin-right: 17px; }
summary span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color .2s ease;
}
summary:hover span { color: #8a8a8a; }

/* ---------- Project pages: text left, image gallery right ---------- */
main.project { width: 100%; padding: 0; display: grid; grid-template-columns: 34% 1fr; align-items: start; }
.text { padding: 12px 11px 80px; }
.text p { margin: 0 0 14px; }
.text .head { font-weight: 700; }
.text .head > span { margin-right: 12px; color: rgba(67, 67, 67, .8); }
.text .back { margin-bottom: 7vh; }

.gallery { position: sticky; top: 12px; height: calc(100vh - 24px); margin-right: 5px; background: #fff; overflow: hidden; }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; height: 100%; margin: 0; padding: 12vh 16%; scroll-snap-align: start; display: flex; flex-direction: column; }
.media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.media img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; border: 1px solid #000; }
.ph { width: 100%; height: 100%; background: #fff; border: 1px solid #000; display: flex; align-items: center; justify-content: center; color: rgba(67, 67, 67, .6); }
.slide figcaption { position: absolute; left: 16%; right: 16%; bottom: 14px; min-height: 16px; padding-right: 64px; }
.count { position: absolute; right: 12%; bottom: 14px; color: rgba(67, 67, 67, .8); }
.gallery { --aw: 30px; }
.nav { position: absolute; top: 0; bottom: 40px; width: 50%; padding: 0; border: 0; background: none; color: #222; transition: color .2s ease; }
.nav.prev { left: 0; cursor: w-resize; }
.nav.next { right: 0; cursor: e-resize; }
.nav::before { content: ""; position: absolute; top: var(--at, 50%); width: var(--aw); height: 20px; transform: translateY(-50%); background: currentColor; -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; }
.nav.prev { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath d='M29 10H2M10 2L2 10L10 18' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E"); }
.nav.next { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath d='M1 10H28M20 2L28 10L20 18' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E"); }
.nav.prev::before { left: var(--al, 6px); }
.nav.next::before { right: var(--ar, 6px); }
.nav:hover { color: #8a8a8a; }
@media (hover: none) { .nav { width: 22%; } }

@media (max-width: 1000px) {
  main.project { display: flex; flex-direction: column; }
  .gallery { order: -1; position: relative; top: 0; margin: 0; height: min(80vw, 75vh); }
  .slide { padding: 16px 10% 44px; }
  .slide figcaption { left: 10%; right: 10%; bottom: 12px; }
  .count { right: 10%; bottom: 12px; }
}

/* Tabs inside project text */
.text details { margin-top: 14px; }
.text details[open] summary { margin-bottom: 14px; }

/* ---------- Home: Independent Practice toggle ---------- */
details.top { margin-top: 26px; }
details.top > summary > span:first-child { font-weight: 700; text-decoration: none; }
details.top > summary .sub { display: block; margin-left: 24px; color: rgba(143, 143, 143, .95); text-decoration: none; font-weight: 700; }
details.top > summary:hover .sub { color: #8a8a8a; }
details.top > summary { margin-bottom: 14px; }
details.archive { margin-top: 18px; }
.sym { vertical-align: -0.2em; }

.back a { text-decoration: none; }
.back a:hover { color: #8a8a8a; }
.nav[hidden] { display: none; }
details.archive > summary > span { font-weight: 700; text-decoration: none; }
h1.contact + p a { text-decoration: none; }
.text summary span { text-decoration: none; font-weight: 700; }

@media (max-width: 1000px) {
  html, body { overflow-x: hidden; }
  main.project { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 100%; }
  .text { display: contents; }
  main.project .text > * { margin-left: 12px; margin-right: 12px; min-width: 0; }
  main.project .text .back { order: -2; margin-top: 12px; margin-bottom: 12px; }
  .gallery { order: -1; position: relative; top: 0; width: 100%; max-width: 100%; min-width: 0; margin: 0 0 18px; height: min(86vw, 70vh); --aw: 24px; }
  .slide { padding: 8px 40px 40px; }
  .slide figcaption { left: 12px; right: 12px; bottom: 10px; padding-right: 56px; }
  .count { right: 12px; bottom: 10px; }
  main.project .text > :last-child { margin-bottom: 80px; }
  .nav::before { height: 16px; }
}

/* on phones a tap leaves :hover stuck on, so the grey hover is for mouse devices only */
@media (hover: none) {
  a:hover, summary:hover span, .nav:hover { color: inherit; }
  details.top > summary:hover .sub { color: rgba(143, 143, 143, .95); }
  .nav:hover { color: #222; }
}
