/* ==========================================================
   Daria Koshkina — Archive
   White, quiet, 12-column grid. Content reveals on scroll.
   ========================================================== */

/* Linden Hill by Barry Schwartz — SIL Open Font License (fonts/LindenHill-OFL.txt) */
@font-face {
  font-family: "Linden Hill";
  src: url("../fonts/LindenHill-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Linden Hill";
  src: url("../fonts/LindenHill-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;  /* 5.3:1 on white, passes WCAG AA */
  --rule: #e6e6e6;
  --placeholder: #f3f3f1;

  --cols: 12;
  --gutter: clamp(12px, 1.6vw, 24px);
  --margin: clamp(16px, 3vw, 48px);
  --space: clamp(96px, 16vw, 240px);   /* space between works */

  --serif: "Linden Hill", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.5 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }

img, video { display: block; width: 100%; height: auto; }
video { aspect-ratio: 16 / 9; background: var(--placeholder); object-fit: contain; }

h1, h2, h3, p, dl, dd, ol, figure { margin: 0; padding: 0; }
ol { list-style: none; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.label { color: var(--muted); font-weight: 400; }

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  align-items: baseline;
  padding-block: 18px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
}
.site-name  { grid-column: 1 / 4; font-size: 21px; display: flex; align-items: baseline; gap: 24px; }
.site-artist { color: var(--muted); }
.site-artist:hover, .site-artist[aria-current="page"] { color: var(--ink); }
.site-nav   {
  grid-column: 4 / 13;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 28px;
}
.site-nav a, .site-artist, .menu a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.menu-projects a { text-underline-offset: 8px; }
.site-nav a { color: var(--muted); transition: color .2s; }
.site-nav a:hover, .site-nav a.is-current { color: var(--ink); }

/* ---------- Intro ---------- */

.intro { padding-block: clamp(24px, 4vw, 64px) var(--space); row-gap: clamp(48px, 8vw, 120px); }
.intro-network { grid-column: 1 / -1; }
.intro-text {
  grid-column: 5 / 11;
  font-size: 20px;
  line-height: 1.5;
}
.intro-network iframe {
  display: block;
  width: 100%;
  /* the network's own viewBox is 1200 × 700 */
  height: min(85vh, calc((100vw - 2 * var(--margin)) * 7 / 12));
  border: 0;
}
.intro .label { grid-column: 1 / -1; }
.intro-statement {
  grid-column: 1 / 10;
  font-size: clamp(30px, 4.2vw, 62px);
  line-height: 1.1;
  font-weight: 400;
}

/* ---------- Index ---------- */

.index { padding-bottom: var(--space); row-gap: 20px; }
.index > .label { grid-column: 1 / -1; }
.index-list { grid-column: 1 / -1; border-top: 1px solid var(--ink); }
.index-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: baseline;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  transition: padding .4s var(--ease), color .2s;
}
.index-row > :nth-child(1) { grid-column: 1 / 2; }
.index-row > :nth-child(2) { grid-column: 2 / -1; font-size: 22px; }
.index-row:hover { padding-left: 12px; color: var(--ink); }

/* ---------- Work ---------- */

.work {
  padding-block: var(--space) 0;
  row-gap: clamp(48px, 7vw, 112px);
  align-items: start;
}

.work-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  border-top: 1px solid var(--ink);
  padding-top: 14px;
}
.work-no    { grid-column: 1 / 2; }
.work-title {
  grid-column: 2 / 11;
  font-size: clamp(34px, 5.2vw, 76px);
  line-height: 1.02;
  font-weight: 400;
}

/* Recognition under a work title */
.awards {
  grid-column: 2 / 9;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
}

/* Sub-project titles inside a work */
.sub-title {
  grid-column: 2 / -1;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1.1;
  font-weight: 400;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.photo-credit { grid-column: 2 / 12; margin-top: -24px; font: 400 11px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Media placements — deliberately asymmetric, like a hung wall */
.span-hero { grid-column: 1 / 10; }
.span-a    { grid-column: 2 / 7; }
.span-b    { grid-column: 8 / 12; margin-top: 18vh; }
.span-c    { grid-column: 4 / 13; }

.media figcaption { margin-top: 10px; color: var(--muted); }

/* Placeholder when an image file has not been added yet */
.media { position: relative; }
.media.is-missing { aspect-ratio: 4 / 3; }
.media.is-missing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--placeholder);
}
.span-hero.is-missing, .span-c.is-missing { aspect-ratio: 16 / 9; }
.span-b.is-missing, .portrait.is-missing { aspect-ratio: 3 / 4; }
.media.is-missing img { display: none; }
.media.is-missing::before {
  content: attr(data-missing);
  position: absolute;
  inset: auto 14px 14px 14px;
  font: 400 10px/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #b4b4b0;
}
.media.is-missing figcaption { position: absolute; top: 100%; }


/* Free compositions (Data rollers, home collage).
   Every piece keeps its own proportions; nothing is cropped.
   Positions are in units of the container's width: --x, --y, --w,
   with the container's height given as --h in the same units. */
.compose {
  position: relative;
  aspect-ratio: 100 / var(--h);
  max-width: 100%;
}
.compose > .media {
  position: absolute;
  margin: 0;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) / var(--h) * 100%);
  width: calc(var(--w) * 1%);
}
.compose > .media img, .compose > .media video { width: 100%; height: auto; aspect-ratio: auto; }
.compose > .label { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) / var(--h) * 100%); }
.rollers { grid-column: 1 / -1; --h: 102; }

/* Home collage — follows the opening text */
.home-collage { padding-bottom: var(--space); }
.home-collage .collage { grid-column: 4 / 10; }

/* Diary pages — an even archive grid, four across */
.pages {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: clamp(40px, 5vw, 80px);
}
.page { grid-column: span 3; }
.page.is-missing { aspect-ratio: 2 / 3; }

/* Black-and-white type — a tight, even grid, three across */
.type-grid {
  grid-column: 2 / 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
.type-grid .media img { height: auto; }
.type-cap { grid-column: 1 / -1; }

.type-text {
  grid-column: 5 / 11;
  display: grid;
  row-gap: 1.1em;
  font-size: 20px;
  line-height: 1.5;
}

/* Credits */
.credits {
  grid-column: 5 / 11;
  font-size: 16px;
  line-height: 1.5;
}
.credits-wide { grid-column: 5 / 11; font-size: 15px; }
.credits-body { display: grid; grid-template-columns: 1fr 1fr; gap: 32px var(--gutter); }
.credits .label { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }

/* Technical details */
/* Technical details: one row of four, directly above each story */
.specs {
  grid-column: 2 / 12;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  border-top: 1px solid var(--rule);
}
.specs > div { border-bottom: 0 !important; }
.specs > div {
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}
.specs dt {
  font: 400 11px/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.specs dd { font-size: 17px; line-height: 1.4; }

.spec-list { margin: 0; padding-left: 1.2em; list-style: decimal; display: grid; row-gap: 6px; }

/* Technical-detail labels: a rainbow passes letter by letter, then settles to black.
   Hues are deep enough to stay readable on white. */
@keyframes spec-glow {
  0%, 55%, 100% { color: var(--ink); text-shadow: none; }
  10% { color: #c2185b; text-shadow: 0 0 6px rgba(194, 24, 91, .35); }
  18% { color: #bf360c; text-shadow: 0 0 6px rgba(191, 54, 12, .35); }
  26% { color: #9a6a00; text-shadow: 0 0 6px rgba(154, 106, 0, .35); }
  34% { color: #2e7d32; text-shadow: 0 0 6px rgba(46, 125, 50, .35); }
  42% { color: #1565c0; text-shadow: 0 0 6px rgba(21, 101, 192, .35); }
  50% { color: #6a1b9a; text-shadow: 0 0 6px rgba(106, 27, 154, .35); }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.specs dt .gl {
  display: inline-block;
  white-space: pre;
  animation: spec-glow 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms);
}
@media (prefers-reduced-motion: reduce) { .specs dt .gl { animation: none; } }

.video-embed { position: relative; aspect-ratio: 16 / 9; background: var(--placeholder); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Two videos side by side: interface recording and the film */
.video-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: var(--gutter);
  align-items: start;
}
.video-pair .media { margin: 0; }
@media (max-width: 640px) { .video-pair { grid-template-columns: 1fr; row-gap: 40px; } }
.yt { display: block; overflow: hidden; background: var(--ink); color: var(--bg); }
.yt-title { position: absolute; left: 20px; top: 16px; font-size: clamp(18px, 2vw, 26px); color: var(--bg); }
.yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--bg); }
.yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  min-height: 44px; padding: 0 22px; display: inline-flex; align-items: center;
  background: var(--bg); color: var(--ink); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  transition: transform .3s var(--ease);
}
.yt:hover .yt-play, .yt:focus-visible .yt-play { transform: translate(-50%, -50%) scale(1.06); }
.video-link { display: inline-block; margin-top: 10px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* Story text */
.story {
  grid-column: 5 / 11;
  display: grid;
  row-gap: 1.1em;
  font-size: 20px;
  line-height: 1.5;
}
.story .label { margin-bottom: .4em; }

/* ---------- Artist ---------- */

.artist { padding-block: var(--space); row-gap: 40px; align-items: start; }
.artist > .label { grid-column: 1 / -1; border-top: 1px solid var(--ink); padding-top: 14px; }
.artist { grid-template-rows: auto auto auto auto 1fr; }
.artist > h1.label { font-size: 11px; font-weight: 400; }
.artist-bio { grid-row: 3 !important; }
.artist-aside { grid-column: 1 / 4; grid-row: 2 / span 3; display: grid; row-gap: 32px; align-self: start; }
.artist-nav { display: flex; flex-direction: column; gap: 8px; }

.artist-text {
  grid-column: 5 / 11;
  grid-row: 2;
  display: grid;
  row-gap: 1.1em;
  font-size: 20px;
  line-height: 1.5;
}
.artist-text .label { margin-top: 2.4em; }
.artist-text .label:first-child { margin-top: 0; }

/* About-me list: exhibitions, awards, collections, publications */
.cv {
  grid-column: 5 / 11;
  grid-row: 4;
  display: block;
  font-size: 15px;
  line-height: 1.4;
}
.cv ul { list-style: none; margin: 0; padding: 0; display: grid; row-gap: 8px; }
.cv .label { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.cv-year {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  column-gap: 8px;
  margin-bottom: 14px;
}
.cv-y { color: var(--muted); }
.cv-place { color: var(--muted); }

/* CV — closed by default, opened by its underlined label */
.cv > summary, .fold > summary {
  list-style: none;
  cursor: pointer;
  width: max-content;
  font-size: 20px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.cv > summary::-webkit-details-marker, .fold > summary::-webkit-details-marker { display: none; }
.cv > summary:hover, .fold > summary:hover { color: var(--muted); }
.cv > summary:focus-visible, .fold > summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.cv[open] > summary, .fold[open] > summary { margin-bottom: 28px; }
.cv-body { display: grid; grid-template-columns: 1fr 1fr; gap: 40px var(--gutter); align-items: start; }
.cv-body > section:nth-child(-n+3) { grid-column: 1 / -1; }

.artist-page { padding-top: clamp(48px, 8vw, 120px); }
.cv-sub { font-size: 15px; font-weight: 400; font-style: italic; margin: 14px 0 8px; }
.cv-sub:first-of-type { margin-top: 0; }
.cv-pubs { row-gap: 12px; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: var(--space) 32px;
  row-gap: 16px;
  border-top: 1px solid var(--ink);
}
.site-footer > * { grid-column: 1 / -1; }
.footer-mail { font-size: clamp(28px, 4.6vw, 66px); padding-bottom: 12vh; }
.footer-copy { color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
/* Only hidden when JS is running, so the page is readable without it. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 1s var(--ease),
    transform 1.2s var(--ease);
  transition-delay: calc(var(--d, 0) * 180ms);
}
/* Images wipe in from the bottom. The clip sits on the figure's contents,
   not the figure, so the observer can still see the figure's box. */
.js [data-reveal="image"] { transform: none; transition: opacity .6s var(--ease); }
.js [data-reveal="image"] > img,
.js [data-reveal="image"] > video,
.js [data-reveal="image"]::after {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.4s var(--ease);
  transition-delay: calc(var(--d, 0) * 180ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal].is-in > img,
.js [data-reveal].is-in > video,
.js [data-reveal].is-in::after { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js [data-reveal="image"],
  .js [data-reveal="image"] > img, .js [data-reveal="image"] > video,
  .js [data-reveal="image"]::after {
    opacity: 1; transform: none; clip-path: none; transition: none;
  }
}

/* ---------- Tablet (8 columns) ---------- */

@media (max-width: 1024px) {
  :root { --cols: 8; }
  .site-name  { grid-column: 1 / 3; }
  .site-nav   { grid-column: 3 / 9; }
  .intro-statement { grid-column: 1 / -1; }
  .index-row > :nth-child(2) { grid-column: 2 / -1; }
  .work-title { grid-column: 2 / -1; }
  .span-hero, .span-c { grid-column: 1 / -1; }
  .span-a { grid-column: 1 / 5; }
  .span-b { grid-column: 6 / 9; margin-top: 12vh; }
  .specs  { grid-column: 1 / -1; }
  .story  { grid-column: 3 / 9; }
  .artist { grid-template-rows: none; }
  .artist-aside { grid-column: 1 / 3; }
  .artist-text { grid-column: 3 / 9; grid-row: 2; }
  .artist-bio { grid-column: 3 / 9; }
  .page { grid-column: span 4; }
  .home-collage .collage { grid-column: 1 / -1; }
  .type-grid, .credits, .credits-wide { grid-column: 1 / -1; }
  .intro-text, .type-text { grid-column: 3 / 9; }
  .cv { grid-column: 3 / 9; grid-row: auto; margin-top: 24px; }
}

/* ---------- Phone (4 columns) ---------- */

@media (max-width: 640px) {
  :root { --cols: 4; }
  body { font-size: 17px; }
  .site-name { grid-column: 1 / -1; }
  .site-nav  { grid-column: 1 / -1; justify-content: flex-start; gap: 4px 16px; margin-top: 8px; font-size: 10px; }
  .index-row > :nth-child(2) { grid-column: 2 / 5; font-size: 19px; }
  .work-title { grid-column: 1 / -1; margin-top: 8px; }
  .sub-title, .photo-credit, .awards { grid-column: 1 / -1; }
  .work-no { grid-column: 1 / -1; }
  .span-hero, .span-a, .span-b, .span-c,
  .specs, .story, .artist-aside, .artist-text, .cv { grid-column: 1 / -1; margin-top: 0; }
  .specs { grid-template-columns: 1fr 1fr; row-gap: 4px; }
  .artist-aside, .artist-text { grid-row: auto; }
  .artist-bio { grid-row: auto !important; }
  .span-a { grid-column: 1 / 4; }
  .span-b { grid-column: 2 / 5; }
  .page { grid-column: span 2; }
  /* The top menu already lists the projects on phones */
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credits-body { grid-template-columns: 1fr; }
  .intro-text, .type-text { grid-column: 1 / -1; font-size: 18px; }
  .story, .artist-text { font-size: 18px; }
}


/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  left: var(--margin);
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  font: 400 13px/1 var(--mono);
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
main:focus { outline: none; }

/* ---------- Full-screen menu ---------- */

.menu-toggle {
  display: none;
  grid-column: -2 / -1;
  justify-self: end;
  min-height: 44px;
  padding: 0 0 0 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 96px) var(--margin) calc(env(safe-area-inset-bottom, 0px) + 40px);
  background: var(--bg);
}
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu-projects { display: grid; row-gap: 14px; }
.menu-projects a {
  display: block;
  font-size: clamp(34px, 9vw, 64px);
  line-height: 1.05;
  text-wrap: balance;
}
.menu-projects a.is-current { color: var(--muted); }
.menu-more { display: grid; row-gap: 4px; margin-top: 48px !important; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.menu-more a, .menu-more button { display: inline-flex; align-items: center; min-height: 44px; }
.menu[hidden] { display: none; }
.menu:not([hidden]) .menu-projects li { animation: menu-in .5s var(--ease) both; }
.menu-projects li:nth-child(2) { animation-delay: 60ms !important; }
.menu-projects li:nth-child(3) { animation-delay: 120ms !important; }
.menu-projects li:nth-child(4) { animation-delay: 180ms !important; }
@keyframes menu-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { z-index: 60; background: var(--bg); }

.motion-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .site-header { align-items: center; padding-block: 10px; }
  .site-nav, .site-artist { display: none !important; }
  .site-name { grid-column: 1 / -2; font-size: 22px; }
  .menu-toggle { display: inline-flex; align-items: center; }
}

/* ---------- Pause motion ---------- */

.motion-off *, .motion-off *::before, .motion-off *::after { animation-play-state: paused !important; }
.motion-off .specs dt .gl { animation: none !important; }

/* ---------- Headings rise word by word ---------- */

.js .split .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.45em);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--wi) * 70ms + var(--d, 0) * 180ms);
}
.js .split.is-in .w { opacity: 1; transform: none; }
.js [data-reveal].split { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js .split .w { opacity: 1; transform: none; transition: none; }
}

/* Hero network on phones: portrait frame, tall enough to play with */
@media (max-width: 640px) {
  .intro-network iframe { height: min(130vw, 72vh); }
}

/* Touch screens: every control at least 44px tall */
@media (pointer: coarse) {
  .video-link, .footer-copy .motion-toggle, .cv > summary, .fold > summary { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 1024px) {
  .cv-body { grid-template-columns: 1fr; }
  .credits-wide { grid-column: 1 / -1; }
}
details { overflow-anchor: none; }

/* No blue tap flash on phones; focus for keyboard users stays visible (:focus-visible above) */
html { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }
