@import url("../fonts/fonts.css");

/* ============================================================
   The Bailey Perspective — Prints
   Darkroom, not a black box: warm charcoal ground, mat-board
   cream, and one chinagraph orange for selects and price only.
   ============================================================ */

:root {
  --ink:        #16130F;   /* darkroom ground — warm, never #000 */
  --ink-2:      #1E1A15;   /* raised surface */
  --ink-3:      #262019;   /* bench / card */
  --ash:        #37302A;   /* hairline */
  --paper:      #EDE6D8;   /* mat board — primary text */
  --paper-dim:  #C4BAA9;
  --muted:      #8C8175;   /* captions, EXIF */
  --chinagraph: #D4512B;   /* grease pencil. selects + price. nothing else. */

  --stage: 4 / 3;
  --r: 2px;                /* prints have square corners. so does this UI. */
  --ease: cubic-bezier(.22, .61, .36, 1);

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

.wrap { width: min(1440px, 100% - 3rem); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: min(1440px, 100% - 1.75rem); } }

/* --- the label voice: tracked-out mono caps. used for every eyebrow. --- */
.label {
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================== masthead ============================== */
.masthead {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: .9rem 0;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--ash);
}
.masthead__inner { display: flex; align-items: center; gap: 2rem; width: min(1440px, 100% - 3rem); margin-inline: auto; }
.brand { display: flex; align-items: baseline; gap: .6rem; margin-right: auto; }
.brand__mark {
  font-family: var(--display); font-weight: 800; font-size: .95rem;
  letter-spacing: -.01em; text-transform: uppercase;
}
.brand__sub { font-family: var(--mono); font-size: .625rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; gap: 1.6rem; }
.nav a {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  transition: color .2s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--paper); }
@media (max-width: 860px) { .nav { display: none; } }

.cart-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .8rem;
  border: 1px solid var(--ash); border-radius: var(--r);
  background: transparent; color: var(--paper);
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.cart-btn:hover { border-color: var(--paper-dim); background: var(--ink-2); }
.cart-btn__n {
  min-width: 1.15rem; padding: 0 .25rem;
  background: var(--chinagraph); color: #fff;
  border-radius: 999px; text-align: center;
  font-size: .625rem; line-height: 1.15rem;
}
.cart-btn__n[hidden] { display: none; }

/* ================================ hero ================================ */
.hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: grid; align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--ash);
}
.hero__plate { position: absolute; inset: 0; }
.hero__plate img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.6s var(--ease);
}
.hero__plate img.is-on { opacity: 1; }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ink) 55%, transparent) 0%, transparent 32%),
    linear-gradient(0deg, var(--ink) 2%, color-mix(in srgb, var(--ink) 70%, transparent) 34%, transparent 68%);
}
.hero__body { position: relative; padding: 3rem 0 3.2rem; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.2vw, 5.25rem);
  line-height: .93;
  letter-spacing: -.035em;
  margin: .9rem 0 1.1rem;
  max-width: 16ch;
}
.hero p {
  max-width: 46ch; margin: 0 0 1.8rem;
  color: var(--paper-dim); font-size: 1.0625rem;
}
.hero__now {
  position: absolute; right: 0; bottom: 3.2rem;
  text-align: right;
}
@media (max-width: 860px) { .hero__now { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .85rem 1.4rem;
  border: 1px solid var(--paper); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); background: #fff; }
.btn--ghost {
  background: transparent; color: var(--paper); border-color: var(--ash);
}
.btn--ghost:hover { background: var(--ink-2); border-color: var(--paper-dim); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn--wide { width: 100%; justify-content: center; }

/* ========================= the contact sheet ==========================
   The grid is a contact sheet: frames butted close on a dark ground,
   numbered, with a grease-pencil ring on the select. */
.sheet { padding: 3.5rem 0 5rem; }
.sheet__head {
  display: flex; align-items: baseline; gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--ash);
}
.sheet__title { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; margin: 0 auto 0 0; }

.filters { display: flex; gap: .35rem; flex-wrap: wrap; }
.filters button {
  padding: .4rem .75rem;
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.filters button:hover { color: var(--paper); }
.filters button[aria-pressed="true"] { color: var(--paper); border-color: var(--ash); background: var(--ink-2); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem 1.25rem;
}

.frame { position: relative; display: block; }
.frame__plate {
  position: relative;
  aspect-ratio: 1;                       /* contact sheets are a uniform grid */
  background: var(--ink-2);
  overflow: hidden;
  border-radius: var(--r);
}
.frame__plate img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .7s var(--ease), transform .9s var(--ease), filter .4s var(--ease);
}
.frame__plate img.is-in { opacity: 1; transform: scale(1); }
.frame:hover .frame__plate img { transform: scale(1.035); }

/* the grease-pencil ring: the one flourish. draws on over the select. */
.frame__ring {
  position: absolute; inset: 4%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.frame__ring ellipse {
  fill: none;
  stroke: var(--chinagraph);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  filter: url(#waxy);
}
.frame:hover .frame__ring,
.frame:focus-visible .frame__ring { opacity: .9; }
.frame:hover .frame__ring ellipse,
.frame:focus-visible .frame__ring ellipse {
  animation: draw .55s var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.frame__meta {
  display: flex; align-items: baseline; gap: .6rem;
  padding-top: .6rem;
}
.frame__n {
  font-family: var(--mono); font-size: .625rem; color: var(--muted);
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.frame__name {
  font-family: var(--display); font-weight: 500; font-size: .9375rem;
  letter-spacing: -.005em;
  margin-right: auto;
}
.frame__from { font-family: var(--mono); font-size: .6875rem; color: var(--muted); }
.frame:hover .frame__name { color: #fff; }

/* ============================= piece page ============================= */
.piece {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .95fr);
  gap: 3.5rem;
  padding: 2.5rem 0 5rem;
  align-items: start;
}
@media (max-width: 1080px) { .piece { grid-template-columns: 1fr; gap: 2.5rem; } }

.back {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 1.75rem 0 0;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.back:hover { color: var(--paper); }

/* ---- the stage: where the object is rendered ---- */
.stage {
  position: relative;
  aspect-ratio: var(--stage);
  border: 1px solid var(--ash);
  border-radius: var(--r);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #2A241D 0%, #1B1712 55%, #131009 100%);
  container-type: inline-size;
}
/* a soft key light from the upper left, consistent across every object */
.stage::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 24% 10%, rgba(255,244,224,.10), transparent 70%);
  pointer-events: none;
}
.stage__obj {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.stage__obj.is-on { opacity: 1; }

/* ---- object switcher: each chip is the photo on that object ---- */
.objs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: .5rem;
  margin-top: .75rem;
}
.obj-chip {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  background: var(--ink-2);
  border: 1px solid var(--ash);
  border-radius: var(--r);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.obj-chip:hover { border-color: var(--paper-dim); }
.obj-chip[aria-pressed="true"] { border-color: var(--chinagraph); background: var(--ink-3); }
.obj-chip__name {
  position: absolute; inset: auto 0 0 0;
  padding: .2rem;
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
  font-family: var(--mono); font-size: .5rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--paper-dim);
}
.obj-chip[aria-pressed="true"] .obj-chip__name { color: var(--paper); }

/* ---- the placard: real capture data. the signature. ---- */
.placard {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  background: var(--ink-2);
  border: 1px solid var(--ash);
  border-left: 2px solid var(--chinagraph);
  border-radius: var(--r);
}
.placard dl {
  display: grid; grid-template-columns: auto 1fr; gap: .3rem 1.25rem;
  margin: .6rem 0 0; font-family: var(--mono); font-size: .75rem;
}
.placard dt { color: var(--muted); letter-spacing: .06em; }
.placard dd { margin: 0; color: var(--paper-dim); font-variant-numeric: tabular-nums; }

.piece h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  line-height: 1.02; letter-spacing: -.03em;
  margin: .5rem 0 .35rem;
}
.piece__place { font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .06em; }
.piece__blurb { color: var(--paper-dim); margin: 1.1rem 0 0; }

/* ---- buy controls ---- */
.buy { border-top: 1px solid var(--ash); padding-top: 1.5rem; }
.field { margin-bottom: 1.1rem; }
.field > .label { display: block; margin-bottom: .5rem; }

.opts { display: flex; gap: .4rem; flex-wrap: wrap; }
.opt {
  padding: .5rem .85rem;
  background: var(--ink-2); border: 1px solid var(--ash); border-radius: var(--r);
  color: var(--paper-dim); cursor: pointer;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.opt:hover { border-color: var(--paper-dim); color: var(--paper); }
.opt[aria-pressed="true"] {
  border-color: var(--chinagraph); color: var(--paper); background: var(--ink-3);
}
.opt__dpi { display: block; font-size: .5625rem; color: var(--muted); letter-spacing: .06em; }

.price {
  display: flex; align-items: baseline; gap: .6rem;
  margin: 1.4rem 0 1rem;
}
.price__n {
  font-family: var(--display); font-weight: 800; font-size: 2rem;
  letter-spacing: -.02em; color: var(--chinagraph);
  font-variant-numeric: tabular-nums;
}
.price__note { font-family: var(--mono); font-size: .6875rem; color: var(--muted); }

/* ============================== cart ============================== */
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 100;
  width: min(430px, 100%);
  background: var(--ink-2);
  border-left: 1px solid var(--ash);
  transform: translateX(100%);
  transition: transform .34s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer__head {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--ash);
}
.drawer__head h2 { font-family: var(--display); font-size: 1rem; margin: 0 auto 0 0; letter-spacing: .02em; }
.drawer__close {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: .2rem .4rem;
}
.drawer__close:hover { color: var(--paper); }
.drawer__body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer__foot { padding: 1.25rem 1.5rem; border-top: 1px solid var(--ash); }

.line { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--ash); }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r); }
.line__t { font-family: var(--display); font-weight: 500; font-size: .9375rem; }
.line__d { font-family: var(--mono); font-size: .6875rem; color: var(--muted); }
.line__x { background: none; border: 0; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; padding: 0; }
.line__x:hover { color: var(--chinagraph); }
.line__p { font-family: var(--mono); font-size: .8125rem; font-variant-numeric: tabular-nums; }

.empty { padding: 3rem 0; text-align: center; color: var(--muted); }
.empty p { max-width: 30ch; margin: .75rem auto 0; font-size: .875rem; }

.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.total__n { font-family: var(--display); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.scrim-bg {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(8, 6, 4, .6);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
  backdrop-filter: blur(2px);
}
.scrim-bg.is-open { opacity: 1; pointer-events: auto; }

/* ============================== footer ============================== */
.foot {
  border-top: 1px solid var(--ash);
  padding: 3rem 0 4rem;
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  color: var(--muted); font-size: .8125rem;
}
.foot__col { min-width: 160px; }
.foot h3 { font-family: var(--mono); font-size: .625rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; font-weight: 500; }
.foot a { display: block; padding: .18rem 0; color: var(--paper-dim); }
.foot a:hover { color: var(--paper); }
.foot__note { margin-left: auto; max-width: 34ch; }

/* related */
.related { padding: 3rem 0 4rem; border-top: 1px solid var(--ash); }
.related h2 { font-family: var(--display); font-size: 1.125rem; margin: 0 0 1.5rem; letter-spacing: -.01em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .frame__ring ellipse { stroke-dashoffset: 0; }
}
