/* ==========================================================================
   Diwas Pandit — Dual Exposure
   ink darkroom base · safelight orange = photography · glacier blue = code
   ========================================================================== */

:root {
  --ink: #131110;
  --surface: #1d1917;
  --line: #2c2723;
  --paper: #efe7db;
  --muted: #8d8378;
  --safelight: #f25c2a;
  --glacier: #9fc0cf;
  --serif: "Fraunces", georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1080px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  /* strong curves — built-in easings are too weak (animations.dev) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--safelight); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

/* the [hidden] attribute must always win — otherwise a component's own
   `display:` declaration (flex/grid) silently defeats it at equal specificity */
[hidden] { display: none !important; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--glacier); color: var(--ink);
  padding: 0.5rem 1rem; font-family: var(--mono);
}
.skip-link:focus { left: 0; }

.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }

/* ==========================================================================
   Aperture load reveal
   ========================================================================== */

.iris {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink);
  display: grid; place-content: center; justify-items: center; gap: 1.25rem;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.iris.is-open { opacity: 0; visibility: hidden; }

.iris-mark { width: clamp(72px, 12vw, 120px); }
.iris-blades path {
  fill: none; stroke: var(--safelight); stroke-width: 1.5;
  transform-origin: 50px 50px;
  animation: iris-open 1.1s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}
.iris-blades path:nth-child(2n) { stroke: var(--glacier); }

@keyframes iris-open {
  0%   { transform: rotate(0deg) scale(0.4); opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: rotate(70deg) scale(1.25); opacity: 0; }
}

.iris-label {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  letter-spacing: 0.12em;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.95rem; font-weight: 500;
  text-decoration: none; letter-spacing: 0.02em;
}
.nav-brand em { color: var(--safelight); font-style: normal; }

/* the aperture mark stops down as you scroll (tracks the f-stop readout) */
.brand-mark {
  width: 22px; color: var(--paper);
  transform: rotate(calc(var(--scrollrot, 0deg) + var(--hoverrot, 0deg)));
  transition: transform 0.5s var(--ease-out);
}
.nav-brand:hover .brand-mark { --hoverrot: 60deg; }
.brand-blades path { fill: none; stroke: var(--safelight); stroke-width: 4; }
.brand-blades path:nth-child(2n) { stroke: var(--glacier); }

.nav-links {
  display: flex; gap: 1.4rem; margin-left: auto;
  font-family: var(--mono); font-size: 0.85rem;
}
.nav-links a {
  text-decoration: none; color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--glacier); }
.nav-links a.is-photo:hover { color: var(--safelight); }

.nav-fstop {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-fstop { margin-left: auto; }
}

/* ==========================================================================
   Hero — dual exposure
   ========================================================================== */

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: calc(3.5rem + 1px) 0 0;
}

.exposure {
  --split: 50%;
  position: relative;
  flex: 1;
  overflow: hidden;
  user-select: none;
}

.pane { position: absolute; inset: 0; }

/* --- code side --- */
.pane-code {
  background:
    radial-gradient(120% 90% at 15% 10%, #1a2026 0%, var(--ink) 60%);
  display: grid; place-items: center;
  padding: var(--gutter);
}

/* the code side's mountains: wireframe terrain behind the editor */
.terrain {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.terrain.is-on { opacity: 1; }

.editor {
  width: min(560px, calc(100% - 2rem));
  background: #16191d;
  border: 1px solid #262b31;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  /* resting 3D pose, angled toward the photo like a window pane */
  transform: perspective(1100px) translateY(-6%) rotateY(5deg) rotateX(1.5deg);
  transition: transform 0.6s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .editor:hover { transform: perspective(1100px) translateY(-6%) rotateY(0deg) rotateX(0deg); }
}
.editor-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #262b31;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #33393f; }
.editor-bar .dot:first-child { background: #e0604f; }
.editor-file {
  margin-left: 0.5rem;
  font-family: var(--mono); font-size: 0.72rem; color: #79838e;
}
.editor-body {
  padding: 1.1rem 1.25rem 1.3rem;
  font-family: var(--mono); font-size: clamp(0.72rem, 1.6vw, 0.86rem);
  line-height: 1.75; color: #c6cdd4;
  white-space: pre-wrap; overflow-wrap: anywhere;
  min-height: 15.5em;
}
.editor-body .tok-kw { color: #c792ea; }
.editor-body .tok-str { color: #ecc48d; }
.editor-body .tok-fn { color: #82aaff; }
.editor-body .tok-cm { color: #79838e; font-style: italic; }
.editor-body .tok-pn { color: #89ddff; }

.caret {
  display: inline-block; width: 0.55em; height: 1.1em;
  background: var(--glacier); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-line {
  position: absolute; left: var(--gutter); bottom: clamp(1.5rem, 5vh, 3.5rem);
  font-size: clamp(2rem, 5.4vw, 4.2rem);
  line-height: 1.05; letter-spacing: -0.01em;
  pointer-events: none;
}
.hero-line-code {
  font-family: var(--mono); font-weight: 500; color: var(--paper);
}
.hero-line-code span { color: var(--glacier); }

/* --- photo side --- */
.pane-photo {
  clip-path: inset(0 0 0 var(--split));
  background: var(--ink);
}
.pane-photo img {
  width: 100%; height: 100%; object-fit: cover;
  /* slight overscale gives the drag parallax room to move */
  transform: scale(1.03);
}
.exposure.is-anim .pane-photo img { transition: transform 0.6s var(--ease-in-out); }
.pane-photo-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19, 17, 16, 0.25) 0%, rgba(19, 17, 16, 0) 40%, rgba(19, 17, 16, 0.55) 100%);
}

/* the typed code executes shoot() — the camera fires once */
.shutter {
  position: absolute; inset: 0;
  background: #fdf6e9;
  opacity: 0;
  pointer-events: none;
}
.shutter.fire { animation: shutter-fire 0.42s var(--ease-out); }
@keyframes shutter-fire {
  0% { opacity: 0; }
  12% { opacity: 0.95; }
  100% { opacity: 0; }
}
.hero-line-photo {
  font-family: var(--serif); font-weight: 300; color: var(--paper);
  left: auto; right: var(--gutter); text-align: right;
}
.hero-line-photo em { font-style: italic; color: var(--safelight); }

.exif-plate {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--paper);
  background: rgba(19, 17, 16, 0.55);
  padding: 0.35rem 0.7rem;
  width: fit-content;
}
.pane-photo .exif-plate {
  position: absolute; right: 1.25rem; top: 1.25rem;
}

/* programmatic split moves (keyboard, intro nudge) glide; drag stays 1:1 */
.exposure.is-anim .pane-photo { transition: clip-path 0.6s var(--ease-in-out); }
.exposure.is-anim .divider { transition: left 0.6s var(--ease-in-out); }

/* --- divider --- */
.divider {
  position: absolute; top: 0; bottom: 0;
  left: var(--split);
  width: 44px; margin-left: -22px;
  cursor: ew-resize;
  display: grid; place-items: center;
  touch-action: none;
}
.divider-line {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: var(--paper); opacity: 0.85;
}
.divider-handle {
  position: relative; z-index: 1;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper); color: var(--ink);
  display: grid; place-items: center;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  transition: transform 160ms var(--ease-out);
}
.divider:hover .divider-handle,
.divider:focus-visible .divider-handle { transform: scale(1.12); }
.divider:active .divider-handle { transform: scale(0.95); }

.hero-hint {
  text-align: center;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  padding: 0.8rem 0 1rem;
  letter-spacing: 0.1em;
  transition: opacity 0.6s ease;
}
.hero-hint.is-dismissed { opacity: 0; }

.hero-lines-m { display: none; }

@media (max-width: 720px) {
  .editor { transform: perspective(1100px) translateY(-16%) rotateY(4deg) rotateX(1deg); }
  .editor-body { min-height: 17em; }
  .exif-extra { display: none; }
  /* swap in-pane headlines for a lockup outside the clipped panes */
  .pane .hero-line { display: none; }
  .hero-lines-m {
    display: block;
    position: absolute; left: var(--gutter); right: var(--gutter);
    bottom: 1.3rem; z-index: 5;
    pointer-events: none;
    text-shadow: 0 2px 18px rgba(19, 17, 16, 0.7);
  }
  .hero-lines-m p {
    font-size: clamp(1.65rem, 8vw, 2.3rem);
    line-height: 1.2;
  }
  .hero-lines-m-code { font-family: var(--mono); font-weight: 500; color: var(--paper); }
  .hero-lines-m-code span { color: var(--glacier); }
  .hero-lines-m-photo { font-family: var(--serif); font-weight: 300; color: var(--paper); }
  .hero-lines-m-photo em { color: var(--safelight); }
}

/* ==========================================================================
   Ticker
   ========================================================================== */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
  background: var(--surface);
}
.ticker-track {
  display: flex; width: max-content;
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em;
  color: var(--muted);
  animation: ticker 38s linear infinite;
}
@media (hover: hover) and (pointer: fine) {
  .ticker:hover .ticker-track { animation-play-state: paused; }
}
.ticker-track span { white-space: nowrap; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(4.5rem, 10vh, 7.5rem) var(--gutter) 0;
}
.section-wide { max-width: 1240px; }

.eyebrow {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em;
  margin-bottom: 1rem;
}
.eyebrow-code { color: var(--glacier); }
.eyebrow-photo { color: var(--safelight); }

.section h2 {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.section-lede { max-width: 56ch; color: var(--muted); margin-bottom: 2rem; text-wrap: pretty; }

.section-outro {
  font-family: var(--mono); font-size: 0.9rem;
  margin-top: 2.5rem; color: var(--muted);
}
.section-outro a { color: var(--safelight); text-decoration-color: transparent; transition: text-decoration-color 0.2s; }
.section-outro a:hover { text-decoration-color: var(--safelight); }

/* ==========================================================================
   README
   ========================================================================== */

.readme-grid {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.readme-photo { position: relative; transition: transform 140ms var(--ease-out); }
.readme-photo img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  filter: saturate(0.92);
  border: 1px solid var(--line);
}
.readme-photo .exif-plate { position: absolute; left: 0.9rem; bottom: 0.9rem; z-index: 2; }
/* same specular sheen as the gallery prints */
.readme-photo::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(260px circle at var(--shx, 50%) var(--shy, 50%),
              rgba(239, 231, 219, 0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .readme-photo:hover::after { opacity: 1; }
}

.readme-body h2 { margin-bottom: 1.2rem; }
.readme-body p { max-width: 58ch; margin-bottom: 1.1rem; text-wrap: pretty; }
.readme-body a { color: var(--glacier); text-underline-offset: 3px; }

.terminal {
  font-family: var(--mono); font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1.6rem 0;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  /* window family: same resting pose language as the hero editor */
  transform: perspective(1000px) rotateY(-2.5deg) rotateX(0.8deg);
}
.js .terminal.reveal { transform: translateY(14px) perspective(1000px) rotateY(-2.5deg) rotateX(0.8deg); }
.js .terminal.reveal.is-in { transform: perspective(1000px) rotateY(-2.5deg) rotateX(0.8deg); }
@media (hover: hover) and (pointer: fine) {
  .terminal:hover, .js .terminal.reveal.is-in:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
  }
}
.terminal-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.terminal-bar .dot { background: var(--line); }
.terminal-bar .dot:first-child { background: var(--glacier); }
.terminal-title {
  margin-left: 0.5rem;
  font-size: 0.72rem; color: var(--muted);
}
.terminal-body {
  padding: 1.1rem 1.3rem 1.2rem;
  display: grid; gap: 0.8rem;
}
.terminal .prompt { color: var(--glacier); }
.terminal .out { color: var(--muted); }
.terminal-live { color: var(--safelight); font-style: normal; }

/* live terminal input */
.terminal-body { max-height: 340px; overflow-y: auto; }
#termOut p { margin-bottom: 0.8rem; overflow-wrap: anywhere; }
#termOut a { color: var(--glacier); }
#termOut .err { color: var(--safelight); }
.term-line { display: flex; align-items: baseline; gap: 0.5rem; }
.term-line input {
  flex: 1;
  background: none; border: none; outline: none;
  font: inherit; color: var(--paper);
  caret-color: var(--glacier);
  padding: 0;
}
.term-line input::placeholder { color: #6b6259; }
.term-ref {
  font-family: var(--mono); font-size: 0.85em;
  color: var(--safelight);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* ==========================================================================
   Darkroom
   ========================================================================== */

.darkroom {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(19, 17, 16, 0.95);
  display: grid; place-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  opacity: 1;
  transition: opacity 0.15s var(--ease-out), display 0.15s allow-discrete;
}
.darkroom:not([hidden]) { transition-duration: 0.25s; }
.darkroom[hidden] { display: none; opacity: 0; }
@starting-style {
  .darkroom:not([hidden]) { opacity: 0; }
}

.darkroom-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 1.5rem;
  align-items: center;
  max-width: 1150px; width: 100%;
}

.darkroom-stage { position: relative; margin: 0; }
.darkroom-stage img {
  width: 100%; max-height: 78vh; object-fit: contain;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.darkroom-stage .exif-plate { position: absolute; left: 0.9rem; bottom: 0.9rem; z-index: 2; }
.dk-grain {
  position: absolute; inset: 0; z-index: 1;
  background-repeat: repeat;
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
}

.darkroom-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.3rem 1.2rem 1.1rem;
  font-family: var(--mono);
}
.darkroom-title {
  font-size: 0.8rem; color: var(--glacier); letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}
.dk-control { margin-bottom: 1rem; }
.dk-control label {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted);
  margin-bottom: 0.35rem;
}
.dk-val { color: var(--paper); font-variant-numeric: tabular-nums; }

.dk-control input[type="range"] {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  height: 3px; border-radius: 2px;
  background: var(--line);
  outline-offset: 6px;
}
.dk-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--safelight);
  cursor: ew-resize;
  transition: transform 140ms var(--ease-out);
}
.dk-control input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.dk-control input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--safelight);
  cursor: ew-resize;
}

.dk-actions { display: grid; gap: 0.5rem; margin: 1.3rem 0 0.9rem; }
.dk-btn {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em;
  padding: 0.55rem 0.9rem;
  background: none; color: var(--paper);
  border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 140ms var(--ease-out);
}
.dk-btn:hover { border-color: var(--muted); }
.dk-btn:active { transform: scale(0.97); }
.dk-btn-primary { border-color: var(--safelight); color: var(--safelight); }
.dk-btn-primary:hover { background: var(--safelight); color: var(--ink); }

.darkroom-note { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.05em; }

/* --- upload --- */
.dk-upload {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  display: grid; gap: 0.55rem;
}
.dk-btn-upload {
  display: block; text-align: center;
  border-color: var(--glacier); color: var(--glacier);
}
.dk-btn-upload:hover { background: var(--glacier); color: var(--ink); }
.dk-btn-ghost { font-size: 0.72rem; padding: 0.4rem 0.8rem; color: var(--muted); }
.dk-hint {
  font-size: 0.68rem; color: var(--muted); letter-spacing: 0.02em;
  line-height: 1.5;
}
.dk-hint-privacy { color: #6f9c76; }
.dk-error {
  font-size: 0.72rem; color: var(--safelight);
  border: 1px solid var(--safelight); border-radius: 4px;
  padding: 0.5rem 0.7rem;
}

/* --- background removal --- */
.dk-bg {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  display: grid; gap: 0.6rem;
}
.dk-bg-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.dk-bg-row label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em; }
.dk-bg-row input[type="color"] {
  width: 32px; height: 26px;
  border: 1px solid var(--line); border-radius: 4px;
  background: none; padding: 0; cursor: pointer;
}
.dk-bg-status { font-size: 0.68rem; color: var(--glacier); letter-spacing: 0.02em; line-height: 1.5; }
.dk-bg-status.is-err { color: var(--safelight); }

.dk-btn-loading { position: relative; color: transparent !important; }
.dk-btn-loading::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 13px; height: 13px; margin: -7px 0 0 -7px;
  border: 2px solid var(--muted); border-right-color: transparent;
  border-radius: 50%;
  animation: dk-spin 0.7s linear infinite;
}
@keyframes dk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .dk-btn-loading::after { animation: none; border-style: dotted; }
}

/* --- drop veil --- */
.dk-dropveil {
  position: absolute; inset: 0; z-index: 3;
  display: none; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 1rem; letter-spacing: 0.08em;
  color: var(--paper);
  background: rgba(159, 192, 207, 0.16);
  border: 2px dashed var(--glacier);
}
.darkroom-stage.is-dragover .dk-dropveil { display: flex; }

@media (max-width: 860px) {
  .darkroom { overflow-y: auto; place-items: start center; }
  .darkroom-inner { grid-template-columns: 1fr; max-width: 560px; }
  .darkroom-stage img { max-height: 52vh; }
}

.offset-list {
  list-style: none;
  font-size: 0.95rem; color: var(--muted);
  display: grid; gap: 0.5rem;
}
.offset-list .offset-year {
  font-family: var(--mono); font-size: 0.8rem; color: var(--safelight);
  margin-right: 0.6rem;
}

@media (max-width: 820px) {
  .readme-grid { grid-template-columns: 1fr; }
  .readme-photo { max-width: 420px; }
}

/* ==========================================================================
   git log
   ========================================================================== */

.gitlog {
  list-style: none;
  font-family: var(--mono); font-size: 0.92rem;
  position: relative;
  margin-left: 0.4rem;
  display: grid; gap: 1.4rem;
  padding: 0.5rem 0 0.5rem 0;
}
/* the history line draws itself down the log as it enters view */
.gitlog::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--line);
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.1s var(--ease-out) 0.15s;
}
.gitlog.is-drawn::before { transform: scaleY(1); }
html:not(.js) .gitlog::before { transform: none; }

.commit {
  position: relative;
  padding-left: 2rem;
  line-height: 1.6;
}
.commit::before {
  content: "";
  position: absolute; left: -5px; top: 0.5em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--glacier);
}
.commit:first-child::before {
  background: var(--glacier);
  animation: head-pulse 3.2s ease-in-out infinite;
}
@keyframes head-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(159, 192, 207, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(159, 192, 207, 0); }
}

.commit-hash { color: var(--safelight); margin-right: 0.6rem; }
.commit-ref { color: var(--glacier); margin-right: 0.6rem; }
.commit-tag { color: #d8b64f; }
.commit-msg { color: var(--paper); }
.commit-date {
  display: block;
  font-size: 0.78rem; color: var(--muted);
}

/* ==========================================================================
   stack.json
   ========================================================================== */

.stack-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.1rem, 3vw, 2rem);
  overflow-x: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  transform: perspective(1200px) rotateY(2deg) rotateX(0.6deg);
}
.js .stack-card.reveal { transform: translateY(14px) perspective(1200px) rotateY(2deg) rotateX(0.6deg); }
.js .stack-card.reveal.is-in { transform: perspective(1200px) rotateY(2deg) rotateX(0.6deg); }
@media (hover: hover) and (pointer: fine) {
  .stack-card:hover, .js .stack-card.reveal.is-in:hover {
    transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
  }
}
.stack-card pre {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.9vw, 0.95rem);
  line-height: 1.9;
  color: var(--muted);
}
.stack-card .k { color: var(--glacier); }
.stack-card .s { color: var(--paper); }
.stack-card .b { color: var(--safelight); }

/* ==========================================================================
   Builds — repo list
   ========================================================================== */

.repos {
  list-style: none;
  border-top: 1px solid var(--line);
}
.repo {
  padding: 1.4rem 0.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .repo:hover { background: var(--surface); padding-left: 0.9rem; }
}
/* live-status pulse on the production badge's dot */
.repo-badge-live { animation: head-pulse 3.2s ease-in-out infinite; border-radius: 50%; display: inline-block; width: 7px; height: 7px; background: var(--safelight); margin-right: 0.35rem; vertical-align: 1px; }
.repo-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.2rem;
  margin-bottom: 0.45rem;
}
.repo-name {
  font-family: var(--mono); font-weight: 500; font-size: 1.05rem;
  color: var(--glacier);
}
.repo-badge {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--safelight);
}
.repo-desc { max-width: 62ch; margin-bottom: 0.5rem; text-wrap: pretty; }
.repo-stack {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
}

/* ==========================================================================
   Contact sheet
   ========================================================================== */

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }

.chip {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 140ms var(--ease-out);
}
.chip:hover { color: var(--paper); border-color: var(--muted); }
.chip:active { transform: scale(0.96); }
.chip.is-active { color: var(--ink); background: var(--safelight); border-color: var(--safelight); }

.sheet {
  columns: 3;
  column-gap: 1.1rem;
}
@media (max-width: 980px) { .sheet { columns: 2; } }
@media (max-width: 560px) { .sheet { columns: 1; } }

.frame {
  break-inside: avoid;
  margin-bottom: 1.1rem;
}
.frame.is-hidden { display: none; }

.frame-btn {
  position: relative; display: block; width: 100%;
  padding: 0; border: 1px solid var(--line); background: var(--surface);
  cursor: zoom-in;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 140ms var(--ease-out);
}
.frame-btn:active { transform: scale(0.98); }

/* specular sheen — light moving across a glossy print (position set by JS) */
.frame-btn::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(240px circle at var(--shx, 50%) var(--shy, 50%),
              rgba(239, 231, 219, 0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .frame-btn:hover::after { opacity: 1; }
}
.frame-btn img {
  width: 100%;
  transition: transform 0.45s var(--ease-out), filter 0.3s ease;
  filter: saturate(0.9);
}

.frame-plate {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 1.6rem 0.9rem 0.7rem;
  background: linear-gradient(180deg, transparent, rgba(19, 17, 16, 0.85));
  text-align: left;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
/* hover motion gated — touch fires false hovers on tap */
@media (hover: hover) and (pointer: fine) {
  .frame-btn:hover img { transform: scale(1.035); filter: saturate(1.05); }
  .frame-btn:hover .frame-plate { opacity: 1; transform: none; }
}
.frame-btn:focus-visible .frame-plate { opacity: 1; transform: none; }

.frame-plate span {
  display: block;
  font-family: var(--serif); font-style: italic;
  font-size: 1.05rem; color: var(--paper);
}
.frame-plate small {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--safelight);
}

/* ==========================================================================
   Contact
   ========================================================================== */

.channels {
  list-style: none;
  border-top: 1px solid var(--line);
}
.channels a {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding: 1.05rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.2s ease, transform 140ms var(--ease-out);
}
.channels a:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .channels a { transition: background 0.2s ease, padding-left 0.25s var(--ease-out), transform 140ms var(--ease-out); }
  .channels a:hover { background: var(--surface); padding-left: 0.9rem; }
}

.channel-key {
  font-family: var(--mono); font-size: 0.8rem; color: var(--glacier);
  min-width: 6.5em;
}
.channels a:hover .channel-key { color: var(--safelight); }
.channel-val { font-size: 1.05rem; }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  margin-top: clamp(4.5rem, 10vh, 7.5rem);
  padding: 0 0 3.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
/* the mountains return: still wireframe ridge as the sign-off */
.ridgeline {
  display: block;
  width: 100%; height: 92px;
  margin-bottom: 2.2rem;
  opacity: 0.9;
}
.footer-sign { font-size: 1.35rem; }
.footer-sign .amp-photo { color: var(--safelight); font-family: var(--serif); font-style: italic; }
.footer-meta {
  margin-top: 0.6rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
}
.footer-meta a { color: var(--muted); }
.footer-meta a:hover { color: var(--paper); }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(19, 17, 16, 0.93);
  display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 1;
  /* enter 220ms, exit faster (150ms); transitions stay interruptible */
  transition: opacity 0.15s var(--ease-out), display 0.15s allow-discrete;
}
.lightbox:not([hidden]) { transition-duration: 0.22s; }
.lightbox[hidden] { display: none; opacity: 0; }
.lightbox figure {
  position: relative;
  max-width: min(1100px, 100%);
  transform: scale(1);
  transition: transform 0.22s var(--ease-out);
}
/* modal scales from center (origin-aware exemption) — never from scale(0) */
@starting-style {
  .lightbox:not([hidden]) { opacity: 0; }
  .lightbox:not([hidden]) figure { transform: scale(0.97); }
}
.lightbox img {
  max-height: 82vh; max-width: 100%;
  margin: 0 auto;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  transition: opacity 130ms ease, filter 130ms ease;
}
/* rack-focus between frames: blur masks the swap into one movement */
.lightbox img.is-swapping { opacity: 0.35; filter: blur(6px); }
.lightbox .exif-plate { position: absolute; left: 0.9rem; bottom: 0.9rem; }

.lightbox-close {
  position: absolute; top: 1rem; right: 1.4rem;
  background: none; border: none; color: var(--paper);
  font-size: 2.4rem; line-height: 1; cursor: pointer;
  transition: color 0.2s ease, transform 0.2s var(--ease-out);
}
.lightbox-close:hover { color: var(--safelight); transform: rotate(90deg); }
.lightbox-close:active { transform: rotate(90deg) scale(0.9); }

.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 1;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(29, 25, 23, 0.7);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--serif); font-size: 1.7rem; line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 140ms var(--ease-out);
}
.lightbox-prev { left: clamp(0.6rem, 2.5vw, 2rem); }
.lightbox-next { right: clamp(0.6rem, 2.5vw, 2rem); }
.lightbox-nav:hover { background: var(--surface); color: var(--safelight); }
.lightbox-nav:active { transform: translateY(-50%) scale(0.92); }

.lightbox-count {
  position: absolute; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  color: var(--muted);
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

/* only hide-for-reveal when JS is running (html.js set by main.js) */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  transition-delay: var(--stagger, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* reveals are typed to their content, not one uniform fade-rise:
   headings pull focus like a lens; photos develop like film */
.js .section h2.reveal {
  transform: none;
  filter: blur(7px);
  transition: opacity 0.5s var(--ease-out), filter 0.5s var(--ease-out);
}
.js .section h2.reveal.is-in { filter: blur(0); }

.js .frame.reveal {
  transform: none;
  clip-path: inset(0 0 14% 0);
  filter: grayscale(0.65) brightness(0.82);
  transition: opacity 0.55s var(--ease-out), clip-path 0.65s var(--ease-out),
              filter 0.8s ease;
  transition-delay: var(--stagger, 0ms);
}
.js .frame.reveal.is-in { clip-path: inset(0 0 0 0); filter: none; }

/* reveal must never gate content in non-interactive renderers */
@media print {
  .js .reveal { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .iris { display: none; }
  .ticker-track { animation: none; }
  .caret { animation: none; }
  .reveal, .js .reveal { opacity: 1; transform: none; transition: none; filter: none; clip-path: none; }
  .frame-btn img { transition: none; }
  .frame-plate { opacity: 1; transform: none; }
  .shutter { display: none; }
  .commit:first-child::before { animation: none; }
  .brand-mark { transition: none; }
  /* 3D flattens under reduced motion */
  .editor { transform: translateY(-6%); transition: none; }
  .frame-btn::after { display: none; }
  .pane-photo img { transform: none; }
  /* keep the lightbox opacity fade (aids comprehension), drop movement */
  .lightbox figure { transition: none; }
  .lightbox img { transition: opacity 130ms ease; }
  .lightbox img.is-swapping { filter: none; }
  .gitlog::before { transform: none; transition: none; }
  .repo-badge-live { animation: none; }
  .repo { transition: background 0.2s ease; }
  .exposure.is-anim .pane-photo, .exposure.is-anim .divider { transition: none; }
  .chip, .frame-btn, .channels a, .divider-handle { transition-property: color, border-color, background; }
  * { animation-duration: 0.01ms !important; }
}
