/* amacay.com
   Built from Amapola's mockup: white page, outlined pills for the fixed
   top bar, black pills for titles and headers, grey pills for tags.
   Alte Haas Grotesk for labels, Clarendon Extra Narrow for reading. */

@font-face {
  font-family: "Alte Haas Grotesk";
  src: url("fonts/alte-haas-grotesk.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Alte Haas Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "clarendon-urw-extra-narrow", "Roboto Slab", Georgia, serif;
  --ink: #000;
  --bg: #fff;
  --grey: #d9d9d9;
  --pad: clamp(14px, 2vw, 28px);
  --big: clamp(18px, 1.8vw, 27px);   /* name + C.V. pills */
  --small: clamp(13px, 1.05vw, 16px); /* title, info and tag pills */
  --read: clamp(14px, 1.15vw, 17px);  /* project and C.V. text */
  --ease: cubic-bezier(.6, 0, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--small);
  line-height: 1.2;
  overflow-x: clip;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.serif { font-family: var(--serif); }
:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

/* ---------- pills ---------- */
.pill, .tag {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  line-height: 1;
}
.pill--big {
  font-size: var(--big);
  padding: .22em .55em .2em;
  border: 1.5px solid var(--ink);
  background: var(--bg);
}
.pill--btn { transition: background .2s, color .2s; }
.pill--btn:hover { background: var(--ink); color: var(--bg); }

.tag {
  font-size: var(--small);
  padding: .3em .7em .28em;
  text-decoration: none;
}
.tag--black { background: var(--ink); color: var(--bg); }
.tag--grey { background: var(--grey); color: var(--ink); }
.tag--line { border: 1px solid var(--ink); background: var(--bg); padding: calc(.3em - 1px) calc(.7em - 1px); }
.tag--line[aria-pressed="true"] { background: var(--grey); border-color: var(--grey); }
a.tag--grey:hover, button.tag--line:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- top bar (stays at the top of the page) ---------- */
.top {
  position: absolute; /* scrolls away with the page */
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--pad);
  pointer-events: none;
}
.top > * { pointer-events: auto; }


/* ---------- projects ---------- */
main { padding-top: calc(var(--pad) * 2 + var(--big) * 1.6 + 10px); padding-bottom: 12vh; }

.project { margin-bottom: clamp(28px, 4vw, 56px); }

.titlerow {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 var(--pad);
  margin-bottom: calc(var(--small) * -.8);
}
.titlerow .tag--black, .lb__title .tag--black { display: inline-block; white-space: normal; text-align: left; line-height: 1.15; } /* inline-block keeps the space before "(publication)" */

/* one long strip per project, full width, dragged sideways */
.strip {
  --strip-h: clamp(260px, calc(100svh - 170px), 800px); /* images are made 1600px tall: twice this, for sharp screens */
  height: var(--strip-h);
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; }
.strip img { height: 100%; width: auto; flex: none; display: block; pointer-events: none; }
.strip img + img { margin-left: -1px; } /* hides hairline seams between the pieces of one strip */

/* info: the pill turns into a dot, the text opens and pushes the next project down */
.below {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  padding: 8px var(--pad) 0;
}
.info {
  justify-self: start;
  height: calc(var(--small) * 1.6);
  padding: 0 .7em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--small);
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: width .45s var(--ease), height .45s var(--ease), padding .45s var(--ease),
              color .2s, margin .45s var(--ease);
}
.info.is-dot {
  width: 14px !important;
  height: 14px;
  padding: 0;
  color: transparent;
  margin-top: calc(var(--small) * .3);
}

.panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .55s var(--ease);
}
.panel.open { grid-template-rows: 1fr; }
.panel > div { overflow: hidden; }
.panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 62ch) minmax(0, 1fr);
  gap: 24px 48px;
  padding-bottom: 8px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s .1s, transform .45s var(--ease);
}
.panel.open .panel__grid { opacity: 1; transform: none; }
.panel__text { font-family: var(--serif); font-size: var(--read); line-height: 1.3; }
.panel__text p { margin: 0; text-indent: 3em; }
.panel__text p + p { margin-top: .6em; }
.panel__meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 10px; justify-self: end; }
/* year + type: always visible, right-aligned on the info line */
.tags { position: absolute; top: 8px; right: var(--pad); display: flex; gap: 6px; }
.panel__meta { padding-top: calc(var(--small) * 2.2); }
.panel__meta p { margin: 0; font-family: var(--serif); font-size: calc(var(--read) * .9); line-height: 1.3; white-space: pre-line; }

/* ---------- C.V. ---------- */
.cv {
  position: fixed;
  inset: 0 0 0 29.6%; /* left part of the page stays uncovered, as in the mockup */
  z-index: 20;
  background: rgba(255, 255, 255, .95);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .6s var(--ease), visibility 0s .6s;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cv.open { transform: none; visibility: visible; transition: transform .6s var(--ease), visibility 0s; }
.cv__inner {
  display: grid;
  grid-template-columns: minmax(0, 43%) minmax(0, 1fr);
  gap: 48px;
  padding: calc(var(--pad) + 6px) var(--pad) 48px 26px;
  min-height: 100%;
}
.cv__colA { grid-column: 1; display: flex; flex-direction: column; gap: 22px; min-height: calc(100vh - 2 * var(--pad) - 60px); }
.cv__colB { grid-column: 2; padding-top: calc(var(--big) * 2.6); max-width: 34em; }
.cv__close { align-self: flex-start; font-size: var(--small); }
.cv__close:hover { text-decoration: underline; }
.cv__bio { margin: 0; font-size: var(--read); line-height: 1.3; hyphens: auto; }
.cv__contact { margin: 0 0 1em; font-size: var(--read); line-height: 1.35; white-space: pre-line; }
.cv__contact a { text-decoration: none; }
.cv__contact a:hover { text-decoration: underline; }
.cv__pdf { display: inline-flex; margin-bottom: 2.6em; }
.cv__section { margin-bottom: 2em; }
.cv__section .tag { margin-bottom: 1.1em; }
.cv__section ul { list-style: none; margin: 0; padding: 0 0 0 .7em; font-size: calc(var(--small) * 1.1); line-height: 1.25; }
.cv__section li { margin-bottom: 1.1em; padding-left: 1.6em; text-indent: -1.6em; }
.cv__section li::before { content: "•"; display: inline-block; width: .9em; text-indent: 0; }
.cv__section li span { display: block; text-indent: 0; }
.cv__section li span:first-child { display: inline; }

/* ---------- full view: the whole strip at full resolution, drag to move, scroll or pinch to zoom ---------- */
.strip { cursor: zoom-in; }
.strip.dragging { cursor: grabbing; }
.lb {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s .35s;
}
.lb.open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }
.lb__top, .lb__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: var(--pad);
}
.lb__title { display: flex; flex-wrap: wrap; gap: 6px; }
.lb__top .tag { white-space: normal; line-height: 1.15; }
.lb__close { font-size: var(--small); flex: none; }
.lb__close:hover { text-decoration: underline; }
.lb__stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: #f4f4f4; }
.lb__stage.dragging { cursor: grabbing; }
.lb__canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.lb__piece { position: absolute; top: 0; height: 3200px; background-repeat: no-repeat; }
.lb__piece img { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
.lb__piece img.on { opacity: 1; }
.lb__tags { display: flex; gap: 6px; margin-left: auto; }

/* line break used only on phones */
.mbr { display: none; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  /* phones: "(online archive)" etc. starts on its own line, with room inside the pill's rounded ends */
  .titlerow .tag--black, .lb__title .tag--black { padding: .4em 1em .38em; border-radius: 1.1em; max-width: 100%; }
  .titlerow .tag--black .sub, .lb__title .tag--black .sub { display: block; }
  .mbr { display: inline; }
  /* titles with their own phone line break keep "(publication)" on the last line */
  .titlerow .tag--mbr .sub, .lb__title .tag--mbr .sub { display: inline; }
  .strip { --strip-h: clamp(220px, 55svh, 560px); }
  .below { grid-template-columns: 44px minmax(0, 1fr); }
  .panel__grid { grid-template-columns: minmax(0, 1fr); }
  .panel__meta { align-items: flex-start; text-align: left; order: -1; padding-top: calc(var(--small) * 2.4); }
  .cv { inset: 0; }
  .cv__inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-left: var(--pad); padding-top: calc(var(--pad) * 2 + var(--big) * 1.6 + 6px); }
  .cv__colA, .cv__colB { grid-column: 1; min-height: 0; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
  .track { scroll-behavior: auto; }
}
