/* shishirg.com
   Film contact strip + drawing title block. Monochrome, one safelight red. */

:root {
  --paper: #EEEEEA;
  --ink: #000000;
  --graphite: #55585B;
  --silver: #B9BBB7;
  --frame: #D8D9D5;
  --safelight: #C4231A;
  --strip: #000000;
  --strip-ink: #EEEEEA;

  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 62ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000;
    --ink: #EEEEEA;
    --graphite: #A4A7A3;
    --silver: #3C3E3D;
    --frame: #1E1F1E;
    --safelight: #E5483E;
    --strip: #1A1A1A;
    --strip-ink: #EEEEEA;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000;
  --ink: #EEEEEA;
  --graphite: #A4A7A3;
  --silver: #3C3E3D;
  --frame: #1E1F1E;
  --safelight: #E5483E;
  --strip: #1A1A1A;
  --strip-ink: #EEEEEA;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--graphite); }
:focus-visible { outline: 2px solid var(--safelight); outline-offset: 3px; }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 50;
}
.skip:focus { top: 12px; }

/* Narrow-width labels: the condensed cut of the same family. */
.label {
  font-variation-settings: 'wdth' 70;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--graphite);
}

/* ---------- Header ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px;
  padding: 20px var(--gutter);
}
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1.5px solid var(--ink);
  font-weight: 700; font-variation-settings: 'wdth' 112; font-size: 16px; letter-spacing: 0.04em;
  text-decoration: none;
}
.top nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.top nav a {
  text-decoration: none; font-variation-settings: 'wdth' 85; font-weight: 500; font-size: 16px;
  padding: 10px 0;
}

/* ---------- Hero ---------- */
.hero { padding: 24px 0 0; }
.name {
  margin: 0;
  padding: 0 var(--gutter);
  font-weight: 800;
  font-variation-settings: 'wdth' 125;
  font-size: clamp(48px, 10.6vw, 176px);
  line-height: 0.86;
  letter-spacing: -0.035em;
}
.intro {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 28px 48px;
  padding: 28px var(--gutter) 40px;
}
.intro p {
  margin: 0; max-width: 34ch;
  font-size: clamp(20px, 2.1vw, 26px); line-height: 1.32;
}

/* The Now panel: a small exposure log. */
.now {
  flex: 0 1 380px;
  border-top: 1.5px solid var(--ink);
  padding-top: 12px;
}
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.now-head h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.live {
  width: 9px; height: 9px; border-radius: 50%; background: var(--safelight);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 60%, 100% { opacity: 1; } 75% { opacity: 0.25; } }
.now dl { margin: 0; display: grid; grid-template-columns: 92px 1fr; }
.now dt, .now dd { padding: 7px 0; border-bottom: 1px solid var(--silver); margin: 0; }
.now dd { font-size: 16px; }

/* ---------- Contact strip ---------- */
.strip-wrap { position: relative; }
.film-base { position: relative; background: var(--strip); }
/* Sprocket holes: one row along each edge of the film. */
.film-base::before, .film-base::after {
  content: ''; position: absolute; left: 0; right: 0; height: 26px; pointer-events: none; z-index: 1;
  background: radial-gradient(circle at 50% 50%, var(--paper) 0 4px, transparent 5px) 6px 0 / 26px 26px repeat-x;
}
.film-base::before { top: 0; }
.film-base::after { bottom: 0; }
.strip {
  display: flex; gap: 10px;
  margin: 0; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 34px var(--gutter) 62px;
  cursor: grab;
  user-select: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; }
.strip .cell { flex: 0 0 auto; position: relative; }
.strip button {
  display: block; padding: 0; border: 0; background: none; cursor: inherit;
}
.strip img {
  height: clamp(220px, 34vw, 400px); width: auto;
  -webkit-user-drag: none;
}
.strip .num {
  position: absolute; left: 0; bottom: -28px;
  color: var(--strip-ink); font-variation-settings: 'wdth' 70; font-weight: 600; font-size: 13px;
}
.strip .num span { margin-left: 10px; opacity: 0.6; }
.strip-hint {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px var(--gutter) 0;
}
.strip-hint button {
  border: 0; background: none; padding: 8px 0; cursor: pointer;
  font-variation-settings: 'wdth' 85; font-weight: 500; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Winding the film on first load: the one orchestrated moment. */
@media (prefers-reduced-motion: no-preference) {
  .strip.wind .cell { animation: advance 1.1s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes advance { from { transform: translateX(38vw); } to { transform: none; } }
}

/* ---------- Sections ---------- */
main section { padding: 120px var(--gutter) 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px;
  border-top: 1.5px solid var(--ink);
  padding-top: 14px; margin-bottom: 36px;
}
.section-head h2 {
  margin: 0; font-weight: 800; font-variation-settings: 'wdth' 118;
  font-size: clamp(32px, 4.4vw, 56px); line-height: 1; letter-spacing: -0.02em;
}
.section-head p { margin: 0; max-width: 46ch; color: var(--graphite); }

/* Photographs: columns of different heights, like a light table. */
.photos { columns: 3 280px; column-gap: 14px; }
.photos figure { margin: 0 0 14px; break-inside: avoid; }
.photos button { display: block; width: 100%; padding: 0; border: 0; background: var(--frame); cursor: zoom-in; }
.photos img { width: 100%; height: auto; transition: opacity .25s; }
.photos button:hover img { opacity: 0.86; }
.photos figcaption { padding: 8px 0 0; }

/* Films */
.films { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 32px 20px; }
.film { margin: 0; }
.film button {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--frame);
  aspect-ratio: 16 / 9; overflow: hidden; cursor: pointer;
}
.film video { width: 100%; height: 100%; object-fit: cover; }
.film .badge {
  position: absolute; left: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); color: var(--ink); padding: 6px 10px;
  font-variation-settings: 'wdth' 80; font-weight: 600; font-size: 14px;
}
.film .badge svg { width: 12px; height: 12px; }
.film figcaption { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0 0; }
.film figcaption strong { font-weight: 600; }

/* Projects: a parts list. */
.parts { width: 100%; border-collapse: collapse; }
.parts th, .parts td { text-align: left; vertical-align: top; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--silver); }
.parts th { font-variation-settings: 'wdth' 70; font-weight: 500; font-size: 14px; color: var(--graphite); padding-top: 0; }
.parts td:first-child { width: 48px; color: var(--graphite); font-variation-settings: 'wdth' 70; }
.parts .pname { font-weight: 700; font-variation-settings: 'wdth' 112; font-size: 22px; line-height: 1.2; white-space: nowrap; }
.parts .status { white-space: nowrap; }
@media (max-width: 680px) {
  .parts thead { display: none; }
  .parts tr { display: grid; grid-template-columns: 40px 1fr; padding: 14px 0; border-bottom: 1px solid var(--silver); }
  .parts td { border: 0; padding: 2px 0; }
  .parts td:first-child { grid-row: span 3; }
}

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px 64px; align-items: start; }
.about .portrait { background: var(--frame); aspect-ratio: 4 / 5; }
.about .portrait img { width: 100%; height: 100%; object-fit: cover; }
.about .copy p { margin: 0 0 1.1em; max-width: var(--measure); }
.about .copy p:first-child { font-size: clamp(21px, 2vw, 25px); line-height: 1.38; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } .about .portrait { max-width: 420px; } }

/* ---------- Title block footer ---------- */
.titleblock {
  margin: 140px var(--gutter) var(--gutter);
  border: 1.5px solid var(--ink);
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
}
.titleblock > div { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 10px 14px 12px; min-width: 0; }
.titleblock > div:nth-child(4n) { border-right: 0; }
.titleblock .tb-title { grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.titleblock .tb-title strong { font-weight: 800; font-variation-settings: 'wdth' 125; font-size: clamp(26px, 3vw, 40px); line-height: 1; letter-spacing: -0.02em; }
.titleblock .tb-title a { font-size: clamp(18px, 1.6vw, 22px); }
.titleblock .v { display: block; font-size: 16px; margin-top: 2px; overflow-wrap: anywhere; }
.titleblock .wide { grid-column: span 4; border-right: 0; border-bottom: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.titleblock .wide nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.titleblock .wide a { padding: 6px 0; display: inline-block; }
@media (max-width: 760px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div:nth-child(4n) { border-right: 1px solid var(--ink); }
  .titleblock > div:nth-child(2n) { border-right: 0; }
  .titleblock .tb-title { grid-column: span 2; grid-row: auto; border-right: 0; }
  .titleblock .wide { grid-column: span 2; }
}

/* ---------- Full-screen viewer ---------- */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #000; color: #EEEEEA;
}
.viewer::backdrop { background: #000; }
.viewer[open] { display: grid; grid-template-rows: auto 1fr auto; }
.viewer header, .viewer footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
}
.viewer .count { font-variation-settings: 'wdth' 70; font-weight: 600; font-size: 15px; }
.viewer .stage {
  position: relative; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 var(--gutter); touch-action: pan-y;
}
.viewer .stage img, .viewer .stage video, .viewer .stage iframe {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.viewer .stage iframe { width: min(100%, 1280px); aspect-ratio: 16 / 9; height: auto; border: 0; }
.viewer .stage img.swap { animation: fade .22s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.viewer .btn {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: 1px solid #55585B; color: #EEEEEA; cursor: pointer; padding: 0 14px;
}
.viewer .btn:hover { border-color: #EEEEEA; }
.viewer .btn svg { width: 18px; height: 18px; }
.viewer .caption { color: #A4A7A3; font-size: 15px; }
.viewer .nav { display: flex; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Work page ---------- */
.work main section:first-child { padding-top: 40px; }
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: rev; }
.timeline li {
  display: grid; grid-template-columns: 56px 150px minmax(0, 1fr); gap: 8px 20px;
  padding: 20px 0; border-bottom: 1px solid var(--silver);
}
.timeline li::before {
  counter-increment: rev; content: 'Rev ' counter(rev, upper-alpha);
  font-variation-settings: 'wdth' 70; font-weight: 500; font-size: 14px; color: var(--graphite); padding-top: 5px;
}
.timeline .when { color: var(--graphite); padding-top: 3px; }
.timeline h3 { margin: 0 0 4px; font-weight: 700; font-variation-settings: 'wdth' 112; font-size: 22px; line-height: 1.2; }
.timeline p { margin: 0; max-width: var(--measure); }
.timeline ul { margin: 8px 0 0; padding-left: 18px; max-width: var(--measure); }
@media (max-width: 680px) { .timeline li { grid-template-columns: 1fr; } }
.download {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600;
}
.download:hover { color: var(--paper); opacity: 0.85; }
