/* ────────────────────────────────────────────────────────────
   TOKENS
   ──────────────────────────────────────────────────────────── */
:root{
  --paper: #F0EFE9;
  --ink: #121212;
  --grey: #6E6D67;
  --line: #C7C5BB;
  --viewer-bg: #121212;

  --sans: "Archivo", Arial, sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body{
  margin: 0;
  padding-bottom: 3rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }
a:focus-visible, button:focus-visible{
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.hero a:focus-visible{
  outline-color: var(--paper);
}

h1,h2,h3,p,ol,ul{ margin: 0; }

/* ────────────────────────────────────────────────────────────
   RUNNING HEAD — mimics a book's printed running header
   ──────────────────────────────────────────────────────────── */
.runhead{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.5em;
  align-items: center;
  padding: 0.5rem var(--gutter);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  background: var(--paper);
  color: var(--grey);
}
.runhead-mid{ opacity: 0.6; }
.runhead-progress-track{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--line);
}
.runhead-progress-fill{
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
}

/* ────────────────────────────────────────────────────────────
   HERO
   ──────────────────────────────────────────────────────────── */
.hero{
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 92vh;
  padding: var(--gutter);
  background: var(--paper);
  color: var(--ink);
}

.hero-nav{
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  justify-content: flex-end;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.hero-nav a{ text-decoration: none; border-bottom: 1px solid transparent; }
.hero-nav a:hover{ border-bottom-color: var(--ink); }

.hero-main{
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 1rem;
  padding-block: 2rem;
}
.hero-name{
  font-weight: 900;
  font-size: clamp(3.2rem, 13vw, 10.5rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.hero-side{
  max-width: 34ch;
  border-left: 3px solid var(--ink);
  padding-left: 1rem;
}
.hero-role{
  font-family: var(--mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hero-tagline{
  margin-top: 0.6rem;
  font-size: 1.05rem;
  color: var(--grey);
}

.hero-foot{
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--grey);
}

@media (min-width: 780px){
  .hero-main{
    grid-template-columns: 3fr 1fr;
  }
}

/* ────────────────────────────────────────────────────────────
   CONTENTS — literal S / M / L / XL index
   ──────────────────────────────────────────────────────────── */
.contents{
  padding: var(--gutter);
  border-bottom: 1px solid var(--line);
}
.contents-label{
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.contents-number{
  font-family: var(--mono);
  color: var(--grey);
}
.contents-label h2{
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.contents-list{
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.contents-row{
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.45, 0, 0.55, 1);
}
.contents-row:hover{
  transform: translateX(10px);
}
.contents-row:hover .toc-title{
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.toc-num{
  flex: 0 0 auto;
  width: 2.4rem;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--ink);
}

.contents-thumb{
  flex: 0 0 auto;
  display: block;
  width: 4.25rem;
  height: 2.8rem;
  overflow: hidden;
}
.contents-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.contents-thumb.is-empty{
  background: repeating-linear-gradient(135deg, var(--paper) 0 2px, var(--line) 2px 3px);
}
.contents-thumb.is-logo img{
  object-fit: contain;
  padding: 0.35rem;
  box-sizing: border-box;
}

.toc-title{
  flex: 1 1 auto;
  min-width: 7rem;
  font-weight: 800;
  font-size: clamp(1.2rem, 3.2vw, 2.1rem);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62%;
}

.toc-leader{
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--line);
  font-family: var(--mono);
  letter-spacing: 0.3em;
}
.toc-leader::after{
  content: "......................................................................................................................................................................................................................................................................................";
}

.toc-year{
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--grey);
}

@media (max-width: 500px){
  .contents-thumb{ display: none; }
  .contents-row{ gap: 0.6rem; }
  .toc-title{ max-width: 72%; }
}
/* floating image preview that follows the cursor when hovering
   a contents row on desktop; hidden entirely on touch devices */
.cursor-preview{
  position: fixed;
  width: 240px;
  height: 160px;
  left: 0;
  top: 0;
  background: var(--paper);
  overflow: hidden;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cursor-preview.is-visible{ opacity: 1; }
.cursor-preview img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ────────────────────────────────────────────────────────────
   WORK — one entry per project, asymmetric two-column layout
   ──────────────────────────────────────────────────────────── */
.project{
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 3rem;
}
.project-rail{
  padding: var(--gutter);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.project-scale-mark{
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.8;
  color: var(--ink);
}
.project-def{
  font-size: 0.95rem;
  max-width: 32ch;
}
.project-def .term{
  font-weight: 700;
  text-transform: lowercase;
}
.project-def .pos{
  font-family: var(--mono);
  color: var(--grey);
  font-size: 0.8rem;
}
.project-spec{
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--grey);
  display: grid;
  gap: 0.35rem;
}

/* ---- alternate rail format: chapter index (Arsvita) ---- */
.project-chapters{
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.project-chapters-list{
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.project-chapters-list li{
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.ch-num{
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--grey);
  width: 1.5rem;
  flex-shrink: 0;
}
.ch-title{ font-size: 0.95rem; }
.project-chapters-meta{
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--grey);
}

/* ---- alternate rail format: field-guide stat grid (Pecking Order) ---- */
.project-statgrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.project-statgrid .stat{
  padding: 0.6rem 0.7rem;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-label{
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--grey);
}
.stat-value{
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---- logo breakdown (rail) ---- */
.project-logobreak{
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.logobreak-full{
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.logobreak-full img{
  max-width: 32%;
  height: auto;
  display: block;
}
.logobreak-full.is-revealed{
  opacity: 1;
  transform: scale(1);
}

.project-main{
  padding: var(--gutter);
}
.project-image{
  aspect-ratio: 16 / 10;
  width: 100%;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-image.is-revealed{
  opacity: 1;
  transform: scale(1);
}

/* ---- flipbook: drag-to-turn page viewer ---- */
.flipbook{
  width: 100%;
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: var(--viewer-bg);
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}
.flipbook--wide{ aspect-ratio: 1.412 / 1; }
.flipbook--standard{ aspect-ratio: 1.333 / 1; }
.flipbook.is-dragging{
  cursor: grabbing;
}
.flipbook-stack{
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 2600px;
}
.flipbook-page{
  position: absolute;
  inset: 0;
  transform-origin: left center;
  backface-visibility: hidden;
  box-shadow: -6px 0 18px rgba(0,0,0,0.18);
}
.flipbook-page img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.flipbook-page.is-animating{
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

.flipbook-hint{
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 999;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--paper);
  background: rgba(0,0,0,0.55);
  padding: 0.3rem 0.6rem;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.flipbook-hint.is-hidden{ opacity: 0; }

.flipbook-slider{
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 1.2rem;
  margin: 0 0 1.5rem;
  background: transparent;
  cursor: pointer;
}
.flipbook-slider::-webkit-slider-runnable-track{
  height: 2px;
  background: var(--line);
}
.flipbook-slider::-moz-range-track{
  height: 2px;
  background: var(--line);
}
.flipbook-slider::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 3px;
  height: 1.1rem;
  margin-top: -0.55rem;
  background: var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.flipbook-slider::-moz-range-thumb{
  width: 3px;
  height: 1.1rem;
  background: var(--ink);
  border: none;
  border-radius: 0;
  cursor: pointer;
}

/* ---- bird picker ---- */
.bird-picker-prompt{
  font-size: 0.95rem;
  color: var(--grey);
  margin-bottom: 1rem;
}
.bird-picker-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.bird-picker-grid[hidden]{ display: none; }
@media (min-width: 640px){
  .bird-picker-grid{ grid-template-columns: repeat(4, 1fr); }
}
.bird-thumb{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  color: var(--ink);
}
.bird-thumb-img{
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--viewer-bg);
}
.bird-thumb-img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.bird-thumb:hover .bird-thumb-img img{ transform: scale(1.05); }
.bird-thumb-label{
  font-size: 0.9rem;
  font-weight: 700;
}
.bird-thumb.is-inprogress{ cursor: default; }
.bird-thumb.is-inprogress .bird-thumb-img{ opacity: 0.4; }
.bird-thumb.is-inprogress .bird-thumb-label{ color: var(--grey); }
.bird-thumb-status{
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--grey);
}

.bird-viewer-back{
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  cursor: pointer;
}
.bird-viewer-back:hover{ color: var(--grey); border-bottom-color: var(--grey); }
.bird-viewer-title{
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.project-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-image.placeholder{
  background:
    repeating-linear-gradient(135deg, var(--paper) 0 2px, var(--line) 2px 3px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.project-image.placeholder .ph-label{
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--grey);
  background: var(--paper);
  padding: 0.25rem 0.5rem;
  margin: 0.6rem;
  border: 1px solid var(--line);
}

.project-title{
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
  max-width: 26ch;
}
.project-credits{
  max-width: var(--measure);
  font-size: 0.95rem;
  color: var(--grey);
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  margin-bottom: 1.75rem;
}

.project-block{
  max-width: var(--measure);
  margin-bottom: 1.5rem;
}
.project-block-label{
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey);
  margin-bottom: 0.4rem;
}
.project-block-text{
  font-size: 1.05rem;
}

.project-block-outcome{
  padding-left: 1rem;
  border-left: 3px solid var(--ink);
}
.project-block-outcome .project-block-label{
  color: var(--ink);
}

.project-process{
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.project-process .project-block-label{
  margin-bottom: 1rem;
}

.project-gallery{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px;
  grid-auto-flow: dense;
  gap: 0.5rem;
  margin-top: 2rem;
}
.project-gallery-item{
  overflow: hidden;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-gallery-item.is-revealed{
  opacity: 1;
  transform: scale(1);
}
.project-gallery-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* asymmetric sizing: first image is the big feature tile,
   fourth/fifth/sixth run wide, second/third stay small */
.project-gallery-item:nth-child(1){
  grid-column: span 2;
  grid-row: span 2;
}
.project-gallery-item:nth-child(4),
.project-gallery-item:nth-child(5),
.project-gallery-item:nth-child(6){
  grid-column: span 2;
}

@media (min-width: 700px){
  .project-gallery{ grid-auto-rows: 160px; }
}

/* ---- brand crossfade strip ---- */
.brand-strip{
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.brand-strip-label{
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey);
}
.brand-strip-stage{
  display: block;
  height: 1.6rem;
  overflow: hidden;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  filter: grayscale(1) contrast(1.1);
}
.brand-strip-name{
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s cubic-bezier(0.45, 0, 0.55, 1),
              transform 0.5s cubic-bezier(0.45, 0, 0.55, 1);
}
.brand-strip-name.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ────────────────────────────────────────────────────────────
   BACK TO TOP FOOTER
   ──────────────────────────────────────────────────────────── */
.backtotop{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  padding: 0.6rem var(--gutter);
  text-align: center;
}
.backtotop a{
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.1rem;
}
.backtotop a:hover{
  color: var(--grey);
  border-bottom-color: var(--grey);
}

@media (min-width: 900px){
  .project{ grid-template-columns: 1fr 2fr; }
  .project-rail{
    border-bottom: none;
    border-right: 1px solid var(--line);
    position: sticky;
    top: 2.75rem;
    align-self: start;
  }
}

/* empty scale state */
.project-empty{
  padding: var(--gutter);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}
.project-empty .empty-mark{
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.8;
  color: var(--line);
}
.project-empty p{
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--grey);
  max-width: 40ch;
}

/* ────────────────────────────────────────────────────────────
   ABOUT — pull quote treatment via yellow block
   ──────────────────────────────────────────────────────────── */
.about{
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}
.about-number{
  padding: var(--gutter);
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.8;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.about-grid{
  padding: var(--gutter);
  display: grid;
  gap: 1.5rem;
}
.about-heading{
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.about-bio{
  max-width: var(--measure);
  font-size: 1.15rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--ink);
}
.about-contactline{
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--grey);
}

@media (min-width: 900px){
  .about{ grid-template-columns: 1fr 3fr; }
  .about-number{ border-bottom: none; border-right: 1px solid var(--line); }
}

/* ────────────────────────────────────────────────────────────
   CONTACT
   ──────────────────────────────────────────────────────────── */
.contact{
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}
.contact-number{
  padding: var(--gutter);
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.8;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.contact-main{
  padding: var(--gutter);
}
.contact-main h2{
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
  margin-bottom: 1rem;
}
.contact-status{
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--grey);
  margin-bottom: 1rem;
}
.contact-email{
  display: inline-block;
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 1.5rem;
}
.contact-social{
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.contact-social a{ text-decoration: underline; }

@media (min-width: 900px){
  .contact{ grid-template-columns: 1fr 3fr; }
  .contact-number{ border-bottom: none; border-right: 1px solid var(--line); }
}


