/* Ilya Sorin. Multi-page black and white street portfolio. Edit :root to restyle. */
@view-transition { navigation: auto; }

:root {
  --black: #0A0A0A;
  --black-2: #151515;
  --black-3: #222221;
  --paper: #EDEDE8;
  --grey: #7A7A76;
  --safelight: #E23B2E;
  --line: rgba(237,237,232,.14);

  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --snap: cubic-bezier(0.83, 0, 0.17, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 3vw, 2.5rem);
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; font: 400 1rem/1.55 var(--sans); color: var(--paper); background: var(--black); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.04em; line-height: .92; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 2px solid var(--safelight); outline-offset: 3px; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono { font: 400 .75rem/1.4 var(--mono); letter-spacing: .04em; text-transform: none; }
.muted { color: var(--grey); }

/* Animated film grain, drawn on a tiny canvas and scaled up */
.grain { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; pointer-events: none; opacity: .05; mix-blend-mode: screen; }

/* ---------- Header ---------- */
.head { position: fixed; inset: 0 0 auto; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 1rem var(--gutter); background: linear-gradient(#0A0A0A 40%, rgba(10,10,10,0)); view-transition-name: head; }
.logo { font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.head nav { display: flex; gap: 1.5rem; }
.head nav a { text-decoration: none; color: var(--grey); font-size: .92rem; }
.head nav a[aria-current="page"], .head nav a:hover { color: var(--paper); }
.head nav a[aria-current="page"]::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .4rem; border-radius: 50%; background: var(--safelight); vertical-align: .08em; }
.head .mono { justify-self: end; color: var(--grey); }

/* ---------- Home: title + film strip ---------- */
.home { min-height: 100svh; display: grid; grid-template-rows: 1fr auto auto; padding-top: 5rem; }
.title { display: flex; align-content: end; align-items: end; justify-content: space-between; gap: 2rem; padding: 0 var(--gutter) 2rem; flex-wrap: wrap; }
.title h1 { font-size: clamp(3.6rem, 13vw, 12rem); }
.title h1 span { display: block; color: var(--grey); }
.title p { max-width: 24rem; color: var(--grey); margin: 0; }

.strip { position: relative; overflow: hidden; background: #111; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.strip.is-drag { cursor: grabbing; }
.strip__band { position: relative; height: 1.9rem; background: #111 repeating-linear-gradient(90deg, transparent 0 .9rem, #2a2a28 .9rem 2.2rem, transparent 2.2rem 3.2rem) 0 50% / 3.2rem 1.1rem repeat-x; }
.strip__band .mono { position: absolute; top: .45rem; color: #b8b09a; white-space: nowrap; font-size: .62rem; }
.strip__track { display: flex; gap: .7rem; padding: 0 .35rem; will-change: transform; }
.frame { flex: none; position: relative; width: clamp(15rem, 36vw, 30rem); aspect-ratio: 3 / 2; margin: 0; padding: 0; border: 0; background: #000; overflow: hidden; cursor: pointer; }
.frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); transition: transform 1s var(--out), filter .6s; pointer-events: none; -webkit-user-drag: none; }
.frame:hover img { transform: scale(1.04); filter: grayscale(1) contrast(1.2); }
.frame .num { position: absolute; left: .5rem; bottom: .4rem; color: #b8b09a; }
.strip__foot { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem var(--gutter) 1.2rem; }
.strip__foot button { padding: 0; border: 0; background: none; color: var(--grey); cursor: pointer; }
.strip__foot button:hover { color: var(--paper); }

/* ---------- Big view with shutter ---------- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: var(--paper); }
.viewer::backdrop { background: #000; }
.viewer[open] { display: grid; grid-template-rows: 1fr auto; }
.viewer__stage { position: relative; display: grid; place-items: center; overflow: hidden; }
.viewer__stage img { max-width: 100%; max-height: calc(100dvh - 5rem); object-fit: contain; filter: grayscale(1) contrast(1.08); }
.shutter { position: absolute; inset: 0; background: #000; clip-path: circle(0% at 50% 50%); pointer-events: none; }
.shutter.is-firing { animation: fire .42s var(--snap); }
@keyframes fire { 0% { clip-path: circle(0% at 50% 50%); } 45% { clip-path: circle(75% at 50% 50%); } 55% { clip-path: circle(75% at 50% 50%); } 100% { clip-path: circle(0% at 50% 50%); } }
.viewer__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem var(--gutter); border-top: 1px solid var(--line); }
.viewer__bar h2 { font-size: 1.4rem; letter-spacing: -0.02em; }
.viewer__bar .btns { display: flex; gap: .4rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.2rem; border: 1px solid var(--line); border-radius: .2rem; background: transparent; cursor: pointer; text-decoration: none; transition: background-color .3s, color .3s, border-color .3s; }
.btn:hover { border-color: var(--paper); }
.btn--red { background: var(--safelight); border-color: var(--safelight); color: #fff; }
.btn--red:hover { background: #fff; color: var(--black); border-color: #fff; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Home: series ---------- */
.series { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); padding: clamp(5rem, 10vw, 8rem) var(--gutter); border-top: 1px solid var(--line); }
.series h2 { grid-column: 1 / 5; font-size: clamp(2.2rem, 5vw, 4rem); }
.series p { grid-column: 6 / 12; font-size: clamp(1.2rem, 2.2vw, 1.7rem); line-height: 1.35; color: var(--paper); }
.series .mono { grid-column: 6 / 12; color: var(--grey); }

/* ---------- Contact sheets ---------- */
.page { padding: 6rem var(--gutter) 4rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(3rem, 9vw, 8rem); }
.page-head p { max-width: 28rem; color: var(--grey); margin: 0; }
.sheet { position: relative; padding: 1.6rem; background: #151513; border: 1px solid var(--line); margin-bottom: 2rem; }
.sheet__meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; color: #b8b09a; }
.sheet__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem 0; }
.cell { position: relative; padding: .8rem .25rem; border: 0; border-radius: 0; background: #0c0c0b; color: inherit; cursor: none; }
.cell:nth-child(6n+1) { padding-left: .5rem; } .cell:nth-child(6n) { padding-right: .5rem; }
.cell::before, .cell::after { content: ""; position: absolute; left: 0; right: 0; height: .55rem; background: repeating-linear-gradient(90deg, transparent 0 .25rem, #2a2a28 .25rem .65rem, transparent .65rem 1rem); }
.cell::before { top: .12rem; } .cell::after { bottom: .12rem; }
.cell img { width: 100%; aspect-ratio: 3/2; object-fit: cover; filter: grayscale(1) contrast(1.1); pointer-events: none; }
.cell .num { position: absolute; right: .4rem; bottom: .7rem; color: #b8b09a; font-size: .55rem; z-index: 1; }
.cell .mark { position: absolute; inset: -.2rem; z-index: 2; pointer-events: none; overflow: visible; }
.cell .mark path { fill: none; stroke: var(--safelight); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset .55s var(--out); }
.cell.is-select .mark path { stroke-dashoffset: 0; }
.loupe { position: fixed; z-index: 60; left: 0; top: 0; width: 11rem; height: 11rem; margin: -5.5rem 0 0 -5.5rem; border-radius: 50%; border: 3px solid #d8d4c6; box-shadow: 0 0 0 6px rgba(0,0,0,.6), 0 20px 40px rgba(0,0,0,.6); background: #000 no-repeat; filter: grayscale(1) contrast(1.1); pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--out); }
.loupe.is-on { opacity: 1; transform: scale(1); }
.selects-bar { position: sticky; bottom: 1rem; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; margin-top: 1rem; background: rgba(21,21,21,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); }
.selects-bar b { color: var(--safelight); }
.selects-thumbs { display: flex; gap: .3rem; overflow-x: auto; }
.selects-thumbs img { width: 3rem; aspect-ratio: 3/2; object-fit: cover; filter: grayscale(1); }

/* ---------- Exhibitions + zine ---------- */
.shows { list-style: none; margin: 0 0 clamp(4rem, 8vw, 6rem); padding: 0; }
.shows li { display: grid; grid-template-columns: 9rem 1fr auto; gap: 1.5rem; align-items: baseline; padding: 1.3rem 0; border-top: 1px solid var(--line); }
.shows li:last-child { border-bottom: 1px solid var(--line); }
.shows h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.03em; }
.shows .when { color: var(--grey); }
.shows .tag { padding: .2rem .5rem; border: 1px solid var(--line); border-radius: .2rem; }
.shows .tag.is-now { border-color: var(--safelight); color: var(--safelight); }
.zine { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.book { position: relative; width: 100%; aspect-ratio: 3 / 2; perspective: 2200px; }
.book__page { position: absolute; top: 0; right: 0; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; transition: transform 1.1s var(--snap); }
.book__page.is-turned { transform: rotateY(-180deg); }
.book__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #e9e7e0; overflow: hidden; box-shadow: inset 12px 0 20px -12px rgba(0,0,0,.35); }
.book__face--back { transform: rotateY(180deg); box-shadow: inset -12px 0 20px -12px rgba(0,0,0,.35); }
.book__face img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.book__face.is-text { display: grid; place-content: center; padding: 12%; color: #111; text-align: left; }
.book__face.is-text h3 { font-size: clamp(1.4rem, 3vw, 2.6rem); }
.book__face.is-text p { font-size: clamp(.6rem, 1vw, .85rem); margin-top: .8rem; color: #444; }
.book__base { position: absolute; top: 0; left: 0; width: 50%; height: 100%; background: #e9e7e0; box-shadow: inset -12px 0 20px -12px rgba(0,0,0,.35); display: grid; place-content: center; color: #111; padding: 12%; }
.book__nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }
.zine h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.zine__price { font: 500 2.4rem/1 var(--sans); margin: 1rem 0; }
.form { display: grid; gap: .8rem; margin-top: 1.4rem; }
.form label { display: grid; gap: .25rem; font-size: .8rem; color: var(--grey); }
.form input, .form select { width: 100%; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: .2rem; background: var(--black-2); font-size: 1rem; }
.form input:focus, .form select:focus { outline: none; border-color: var(--paper); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.status { min-height: 1.4rem; margin: 0; color: var(--safelight); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.6rem var(--gutter); border-top: 1px solid var(--line); color: var(--grey); font-size: .82rem; }
.foot p { margin: 0; }

@media (max-width: 820px) {
  .head { grid-template-columns: 1fr auto; }
  .head .mono { display: none; }
  .series h2, .series p, .series .mono { grid-column: 1 / -1; }
  .sheet { padding: .8rem; }
  .sheet__grid { grid-template-columns: repeat(3, 1fr); }
  .cell:nth-child(6n+1), .cell:nth-child(6n) { padding-inline: .25rem; }
  .cell { cursor: pointer; }
  .loupe { display: none; }
  .shows li { grid-template-columns: 1fr; gap: .3rem; }
  .zine { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
