/* Nicole — photography
   Monochrome chassis; the photographs are the only colour on the page. */

:root {
  --canvas: #ffffff;
  --ink: #000000;
  --graphite: #595959;
  --frame: #e2e2e2;
  --placeholder: #f2f2f2;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --gutter: 32px;
  --bar-h: 72px;
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #000000;
    --ink: #ffffff;
    --graphite: #a6a6a6;
    --frame: #2a2a2a;
    --placeholder: #111111;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #000000;
  --ink: #ffffff;
  --graphite: #a6a6a6;
  --frame: #2a2a2a;
  --placeholder: #111111;
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ——— Bars ——— */

.bar {
  position: fixed;
  left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  height: var(--bar-h);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar--top { top: 0; padding-top: env(safe-area-inset-top); height: calc(var(--bar-h) + env(safe-area-inset-top)); }
.bar--bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bar-h) + env(safe-area-inset-bottom)); }

.mark {
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.meta {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  min-width: 13ch;
}
.meta--hint { text-align: right; transition: opacity .6s var(--ease); }

.progress {
  position: relative;
  flex: 0 1 160px;
  height: 1px;
  background: var(--frame);
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* Theme switch — global nav pill */
.theme {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 34px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50px;
  font-size: 14px;
  font-weight: 480;
  letter-spacing: -0.01em;
  isolation: isolate;
}
.theme__opt {
  position: relative;
  z-index: 1;
  padding: 0 14px;
  line-height: 31px;
  text-align: center;
  transition: color .5s var(--ease);
}
.theme__thumb {
  position: absolute;
  z-index: 0;
  top: 2px; bottom: 2px; left: 2px;
  width: calc(50% - 2px);
  border-radius: 50px;
  background: var(--ink);
  transition: transform .5s var(--ease), background-color .6s var(--ease);
}
.theme[data-active="light"] .theme__opt[data-opt="light"],
.theme[data-active="dark"]  .theme__opt[data-opt="dark"] { color: var(--canvas); }
.theme[data-active="dark"] .theme__thumb { transform: translateX(100%); }
.theme:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ——— Stage ——— */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.stage.is-dragging { cursor: grabbing; }

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

.item {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
  display: block;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  transition: opacity .7s var(--ease);
}
.item:focus { outline: none; }
.item:focus-visible .frame { outline: 2px solid var(--ink); outline-offset: 4px; }

.frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--placeholder);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s var(--ease-out), background-color .6s var(--ease);
}
.is-ready .frame { clip-path: inset(0 0 0 0); }

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.frame img.is-loaded { opacity: 1; }

/* Selection focus: everything else recedes */
.stage.has-selection .item:not(.is-selected) { opacity: .28; }
.stage.has-selection .item:not(.is-selected):hover { opacity: .7; }
@media (hover: hover) {
  .stage:not(.has-selection) .track:hover .item:not(:hover) { opacity: .55; }
}

/* ——— Caption ——— */

.caption {
  position: absolute;
  top: 0; left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: max-content;
  max-width: 420px;
  pointer-events: none;
  will-change: transform;
}
.caption__line { display: block; overflow: hidden; padding-bottom: 2px; }
.caption__line > span {
  display: block;
  transform: translateY(105%);
  transition: transform .9s var(--ease-out);
}
.caption.is-visible .caption__line > span { transform: none; }
.caption.is-visible .caption__line:nth-child(2) > span { transition-delay: .06s; }
.caption.is-visible .caption__line:nth-child(3) > span { transition-delay: .12s; }
.caption.no-anim .caption__line > span { transition: none !important; }
.caption.is-hiding .caption__line > span { transform: translateY(-105%); transition-duration: .45s; transition-timing-function: var(--ease); transition-delay: 0s; }

.caption__index {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.05em;
}
.caption__name {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 520;
  letter-spacing: -0.02em;
}
.caption__note {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -0.005em;
  max-width: 38ch;
  white-space: pre-line;
}
.caption__line:empty, .caption__line:has(> span:empty) { display: none; }

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ——— Phone ——— */

@media (max-width: 699px) {
  :root { --gutter: 16px; --bar-h: 60px; }
  .mark { font-size: 20px; }
  .theme { height: 30px; font-size: 13px; }
  .theme__opt { padding: 0 11px; line-height: 27px; }
  .meta { font-size: 11px; min-width: 0; }
  .progress { flex-basis: 96px; }
  .caption { max-width: calc(100vw - 32px); gap: 8px; }
  .caption__name { font-size: 20px; }
  .caption__note { font-size: 15px; }
  .meta--hint { display: none; }
  .bar--bottom { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
}

.empty[hidden] { display: none; }
