/* ============================================================
   Leyla Mozayen — Archive
   Palette sampled from the artist's own work (mainphoto.jpeg):
   warm brown-black ground, copper/amber mid, ember highlight.
   No cyan. No polaroids. No red string.
   ============================================================ */

:root {
  /* ground — warm black, not blue-black */
  --ink:        #0a0807;
  --ink-raised: #141010;
  --ink-line:   #2a2220;

  /* type */
  --paper:      #ede7e1;
  --paper-dim:  #9d938c;
  --paper-faint:#6b625c;

  /* accent — sampled: #a86030 / #c06030 / #d87848 / #f09060 */
  --ember:      #d8784a;
  --ember-lift: #f0956a;
  --copper:     #a86030;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-script:  'La Belle Aurore', cursive;

  --bar-h: 62px;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --measure: 62ch;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

body[data-booting] .stage { opacity: 0; }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ember); color: var(--ink); padding: .75rem 1.25rem;
}
.skip-link:focus { left: 0; }

/* ---------- atmosphere: her artwork, heavily restrained ---------- */

.atmosphere {
  position: fixed; inset: 0; z-index: -2;
  overflow: hidden; pointer-events: none;
  background: var(--ink);
}
.atmosphere__img {
  position: absolute; inset: -8%;
  background: url('assets/mainphoto.jpeg') center/cover no-repeat;
  /* pushed well back so type always wins */
  filter: brightness(.34) saturate(.9) contrast(1.05);
  transform: scale(1.04);
  animation: drift 48s ease-in-out infinite alternate;
}
.atmosphere::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 18%, rgba(10,8,7,0) 0%, rgba(10,8,7,.72) 58%, var(--ink) 100%),
    linear-gradient(to bottom, rgba(10,8,7,.55) 0%, rgba(10,8,7,.2) 30%, rgba(10,8,7,.9) 100%);
}
@keyframes drift {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to   { transform: scale(1.12) translate3d(-1.5%, -2%, 0); }
}

.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* custom cursor: pointer devices only (never on touch) */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block; position: fixed; top: 0; left: 0;
    width: 26px; height: 26px; border: 1px solid var(--ember);
    border-radius: 50%; z-index: 90; pointer-events: none;
    transform: translate3d(-100px,-100px,0);
    transition: width .3s var(--ease), height .3s var(--ease),
                background-color .3s var(--ease), opacity .3s;
    will-change: transform;
  }
  .cursor[data-hot] {
    width: 52px; height: 52px; background: rgba(216,120,74,.14);
  }
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  /* NOTE: no backdrop-filter / transform / filter on this element.
     Any of them would make .topbar the containing block for its own
     position:fixed children, which collapses the mobile nav overlay to the
     height of the bar. The blur lives on ::before instead. */
}
.topbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(10,8,7,.92), rgba(10,8,7,0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.mark { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.mark__script {
  font-family: var(--font-script);
  font-size: 1.75rem; line-height: 1; color: var(--paper);
  white-space: nowrap;
}
.mark__sub {
  font-size: .62rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--paper-faint); white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); }
.nav a, .nav__studio {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--paper-dim); padding: .5rem 0;
  border-bottom: 1px solid transparent;
  transition: color .3s, border-color .3s;
  white-space: nowrap;
}
.nav a:hover, .nav__studio:hover { color: var(--paper); }
.nav a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--ember); }
.nav__studio { color: var(--paper-faint); }

.burger { display: none; width: 34px; height: 34px; position: relative; flex: 0 0 auto; }
.burger span {
  position: absolute; left: 6px; right: 6px; height: 1px; background: var(--paper);
  transition: transform .34s var(--ease), opacity .2s;
}
.burger span:first-child { top: 13px; }
.burger span:last-child  { top: 20px; }

/* ---------- stage / views ---------- */

.stage {
  position: relative; z-index: 1;
  padding: calc(var(--bar-h) + 2rem) var(--pad) 6rem;
  min-height: 100svh;
  transition: opacity .5s var(--ease);
  outline: none;
}

.view { animation: rise .7s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- hero (index) ---------- */

.hero {
  min-height: calc(100svh - var(--bar-h) - 4rem);
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: 3rem;
}

.hero__eyebrow {
  font-size: .68rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ember); margin-bottom: 1.75rem;
}

/* The name. Always legible — no scroll-tied opacity, ever. */
.hero__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 13vw, 10rem);
  line-height: .92;
  letter-spacing: -.02em;
  color: var(--paper);
}
.hero__name em {
  display: block; font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1px rgba(237,231,225,.62);
  padding-left: .06em;
}
@supports not (-webkit-text-stroke: 1px red) {
  .hero__name em { color: var(--paper-dim); }
}

.hero__blurb {
  margin-top: 2.5rem;
  max-width: 46ch;
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  color: var(--paper-dim);
  line-height: 1.75;
}

.hero__meta {
  margin-top: 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem;
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper-faint);
}
.hero__meta b { color: var(--ember); font-weight: 400; }

/* ---------- section heading ---------- */

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding-bottom: 1.25rem; margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--ink-line);
}
.sec-head h2 {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -.01em;
}
.sec-head__count {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--paper-faint);
}

/* ---------- series index (replaces the polaroid wall) ----------
   An editorial catalogue index: numbered rows, image reveals on
   hover for pointer devices, always-visible thumb on touch.      */

.index-list { border-top: 1px solid var(--ink-line); }

.index-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: clamp(1.1rem, 2.4vw, 1.9rem) .25rem;
  border-bottom: 1px solid var(--ink-line);
  position: relative;
  transition: padding-left .4s var(--ease), color .3s;
}
.index-row:hover, .index-row:focus-visible { padding-left: 1.25rem; }
.index-row:hover .index-row__title { color: var(--ember-lift); }

.index-row__num {
  font-family: var(--font-display);
  font-size: .8rem; color: var(--paper-faint); font-variant-numeric: tabular-nums;
}
.index-row__title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.25rem, 3.4vw, 2.1rem);
  line-height: 1.15; letter-spacing: -.01em;
  transition: color .3s;
}
.index-row__sub {
  display: block; margin-top: .4rem;
  font-family: var(--font-body); font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--paper-faint);
}
.index-row__n {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper-faint); white-space: nowrap;
}

/* floating preview follows the pointer — desktop only */
.peek {
  position: fixed; z-index: 55; width: 300px; aspect-ratio: 4/5;
  pointer-events: none; opacity: 0; transform: translate3d(-50%,-50%,0) scale(.94);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.75);
}
.peek img { width: 100%; height: 100%; object-fit: cover; }
.peek[data-on] { opacity: 1; transform: translate3d(-50%,-50%,0) scale(1); }
@media (hover: none), (pointer: coarse) { .peek { display: none; } }

/* ---------- work grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

.card { display: block; position: relative; }
.card__frame {
  position: relative; overflow: hidden;
  aspect-ratio: 4/5; background: var(--ink-raised);
}
.card__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), filter .6s;
  filter: brightness(.92);
}
.card:hover .card__frame img { transform: scale(1.045); filter: brightness(1.04); }
.card__title {
  margin-top: .9rem;
  font-family: var(--font-display); font-weight: 300; font-size: 1.05rem;
  line-height: 1.3;
}
.card__meta {
  margin-top: .3rem; font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--paper-faint);
}
.card__empty {
  display: grid; place-items: center; height: 100%;
  color: var(--paper-faint); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase;
}

/* ---------- single work ---------- */

.work { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
@media (min-width: 900px) {
  .work { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
  .work__side { position: sticky; top: calc(var(--bar-h) + 2rem); }
}

.work__plates { display: grid; gap: 1.25rem; }
.work__plate { background: var(--ink-raised); }
.work__plate img { width: 100%; height: auto; }

.work__title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.08;
  letter-spacing: -.015em;
}
.work__facts {
  margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--ink-line);
  display: grid; gap: .7rem;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper-faint);
}
.work__facts b { color: var(--paper-dim); font-weight: 400; }

/* the writing — she is writing about several hundred pieces */
.prose {
  margin-top: 2rem; max-width: var(--measure);
  font-family: var(--font-display);
  font-weight: 300; font-size: 1.02rem; line-height: 1.85;
  color: #cfc6bf;
}
.prose p + p { margin-top: 1.15em; }

/* ---------- back link ---------- */

.back {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--paper-faint); margin-bottom: 2.25rem;
  transition: color .3s, gap .3s var(--ease);
}
.back:hover { color: var(--ember); gap: 1rem; }

/* ---------- empty state ---------- */

.empty {
  border: 1px dashed var(--ink-line); padding: clamp(2rem, 6vw, 4rem);
  text-align: center; color: var(--paper-faint);
}
.empty h3 {
  font-family: var(--font-display); font-weight: 300; font-size: 1.35rem;
  color: var(--paper-dim); margin-bottom: .75rem;
}
.empty p { font-size: .9rem; max-width: 42ch; margin: 0 auto; }

/* ---------- prose page (about / contact) ---------- */

.page { max-width: var(--measure); }
.page h1 {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05;
  margin-bottom: 2rem; letter-spacing: -.015em;
}
.page a[href^="mailto"], .page a[href^="http"] {
  color: var(--ember); border-bottom: 1px solid rgba(216,120,74,.4);
}

.contact-list { display: grid; gap: 1rem; margin-top: 2.5rem; }
.contact-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--ink-line);
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper-dim); transition: color .3s;
}
.contact-list a:hover { color: var(--ember); }
.contact-list span:last-child { color: var(--paper-faint); text-transform: none; letter-spacing: normal; }

/* ============================================================
   STUDIO (admin)
   ============================================================ */

.studio { max-width: 900px; }
.studio__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: 1.25rem; margin-bottom: 2rem;
  border-bottom: 1px solid var(--ink-line);
}
.studio__bar h1 {
  font-family: var(--font-display); font-weight: 300; font-size: 1.75rem;
}
.studio__tag {
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink); background: var(--ember); padding: .3rem .6rem;
}

.panel {
  background: rgba(20,16,16,.72); border: 1px solid var(--ink-line);
  padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.5rem;
}
.panel > h2 {
  font-family: var(--font-display); font-weight: 300; font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.field { display: grid; gap: .45rem; margin-bottom: 1.1rem; }
.field > label {
  font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper-faint);
}
/* Type-agnostic on purpose. Enumerating input types meant adding type="email"
   for the sign-in form silently fell through to the browser default, painting a
   white box on a black page. Anything that is not a checkbox or radio is a text
   field here. */
.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select {
  width: 100%; background: #0d0a09; border: 1px solid var(--ink-line);
  color: var(--paper); padding: .8rem .9rem; font-family: var(--font-body);
  font-size: .95rem; border-radius: 0;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--ember);
}
.field__hint { font-size: .72rem; color: var(--paper-faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; background: var(--ember); color: var(--ink);
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 500; transition: background .3s, opacity .3s;
}
.btn:hover { background: var(--ember-lift); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--ghost {
  background: none; border: 1px solid var(--ink-line); color: var(--paper-dim);
}
.btn--ghost:hover { background: none; border-color: var(--ember); color: var(--ember); }
.btn--danger { background: none; border: 1px solid #6b2a22; color: #c9705c; }
.btn--danger:hover { background: #6b2a22; color: var(--paper); }

.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* drop zone */
.drop {
  border: 1px dashed var(--ink-line); padding: 2rem 1rem; text-align: center;
  color: var(--paper-faint); transition: border-color .3s, background .3s;
  cursor: pointer;
}
.drop[data-over] { border-color: var(--ember); background: rgba(216,120,74,.06); }
.drop strong { display: block; color: var(--paper-dim); font-weight: 400; margin-bottom: .35rem; }
.drop small { font-size: .72rem; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; margin-top: 1rem; }
.thumb { position: relative; aspect-ratio: 1; background: var(--ink-raised); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
  background: rgba(10,8,7,.85); color: var(--paper); font-size: .8rem; line-height: 1;
}
.thumb button:hover { background: #6b2a22; }

/* admin list rows */
.admin-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 0; border-bottom: 1px solid var(--ink-line);
}
.admin-row__thumb { width: 46px; height: 46px; object-fit: cover; background: var(--ink-raised); flex: 0 0 auto; }
.admin-row__main { flex: 1; min-width: 0; }
.admin-row__main strong { display: block; font-weight: 400; font-size: .95rem; }
.admin-row__main small { color: var(--paper-faint); font-size: .72rem; }
.admin-row__acts { display: flex; gap: .4rem; flex: 0 0 auto; }
.admin-row__acts button {
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper-faint); padding: .4rem .6rem; border: 1px solid var(--ink-line);
}
.admin-row__acts button:hover { color: var(--ember); border-color: var(--ember); }

.storage-note {
  font-size: .72rem; color: var(--paper-faint); line-height: 1.7;
  border-left: 2px solid var(--copper); padding-left: .9rem; margin-top: 1rem;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 130%);
  background: var(--ink-raised); border: 1px solid var(--ink-line);
  border-left: 2px solid var(--ember);
  padding: .85rem 1.25rem; font-size: .82rem; z-index: 120;
  transition: transform .4s var(--ease); max-width: calc(100vw - 2rem);
}
.toast[data-on] { transform: translate(-50%, 0); }
.toast[data-kind="error"] { border-left-color: #c9705c; }

/* ============================================================
   MOBILE — the thing that was broken
   ============================================================ */

@media (max-width: 820px) {
  .burger { display: block; z-index: 80; }

  .nav {
    position: fixed; inset: 0;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.75rem;
    padding: 0 var(--pad);
    background: rgba(10,8,7,.97);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transform: translateY(-100%);
    transition: transform .5s var(--ease);
    z-index: 75;
  }
  .nav[data-open] { transform: none; }
  .nav a, .nav__studio {
    font-family: var(--font-display); font-size: 2rem; letter-spacing: 0;
    text-transform: none; color: var(--paper-dim); border: none; padding: 0;
  }
  .nav a[aria-current="page"] { color: var(--ember); }

  .burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

  /* the mark must never collide with the nav again */
  .mark__sub { display: none; }

  .index-row {
    grid-template-columns: 2.25rem 1fr;
    gap: .9rem;
  }
  .index-row__n { grid-column: 2; margin-top: .1rem; }
  .index-row:hover, .index-row:focus-visible { padding-left: .25rem; }
}

@media (max-width: 420px) {
  .mark__script { font-size: 1.45rem; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .atmosphere__img { animation: none; }
}

/* example-content notice — removed with the demo data */
.demo-note {
  border-left: 2px solid var(--copper);
  padding: .85rem 0 .85rem 1rem;
  margin-bottom: 2.5rem;
  font-size: .82rem;
  line-height: 1.7;
  color: var(--paper-faint);
  max-width: 62ch;
}
.demo-note strong { color: var(--paper-dim); font-weight: 400; }
.demo-note a { color: var(--ember); border-bottom: 1px solid rgba(216,120,74,.4); }

/* ============================================================
   Archive-scale Studio + lightbox (wave 2)
   ============================================================ */

.statgrid {
  display: flex; flex-wrap: wrap; gap: .75rem 2rem;
  font-size: .78rem; color: var(--paper-faint);
}
.statgrid b { color: var(--paper); font-weight: 400; }
.statgrid .stat--flag b { color: var(--ember); }

.panel--intake { border-color: rgba(216,120,74,.32); }

.drop--lg { padding: 3rem 1rem; }

.intake-progress {
  margin-top: 1rem; font-size: .78rem; color: var(--ember);
  font-variant-numeric: tabular-nums;
}

/* toolbar: search + filter tabs */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.25rem;
}
.toolbar input[type="search"] {
  flex: 1 1 220px; min-width: 0;
  background: #0d0a09; border: 1px solid var(--ink-line); color: var(--paper);
  padding: .7rem .85rem; font-family: var(--font-body); font-size: .9rem;
}
.toolbar input[type="search"]:focus { outline: none; border-color: var(--ember); }

.tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.tabs button {
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper-faint); padding: .5rem .7rem;
  border: 1px solid var(--ink-line); white-space: nowrap;
  transition: color .25s, border-color .25s;
}
.tabs button:hover { color: var(--paper-dim); }
.tabs button[aria-selected="true"] {
  color: var(--ink); background: var(--ember); border-color: var(--ember);
}

.pill {
  display: inline-block; margin-left: .45rem; padding: .1rem .4rem;
  font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--ink-line); color: var(--paper-faint);
}
.pill--draft { border-color: rgba(216,120,74,.5); color: var(--ember); }

/* inline series editor */
.inline-edit {
  border-left: 2px solid var(--ember);
  padding: 1.25rem 0 1.25rem 1.25rem;
  margin: 0 0 1rem;
  background: rgba(216,120,74,.04);
}

.newseries { margin-top: 1.5rem; border-top: 1px solid var(--ink-line); padding-top: 1.25rem; }
.newseries > summary {
  cursor: pointer; list-style: none;
  font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ember); padding: .35rem 0;
}
.newseries > summary::-webkit-details-marker { display: none; }
.newseries > summary::before { content: '+ '; }
.newseries[open] > summary::before { content: '– '; }

/* thumbs gain a caption field */
.thumb { display: flex; flex-direction: column; aspect-ratio: auto; }
.thumb img { aspect-ratio: 1; object-fit: cover; }
.thumb__cap {
  width: 100%; background: #0d0a09; border: 1px solid var(--ink-line);
  border-top: none; color: var(--paper-dim);
  padding: .4rem .5rem; font-family: var(--font-body); font-size: .68rem;
}
.thumb__cap:focus { outline: none; border-color: var(--ember); }

.plate-cap {
  margin-top: .6rem; font-size: .72rem; color: var(--paper-faint);
  letter-spacing: .02em;
}

/* zoomable plate */
.work__zoom {
  display: block; width: 100%; padding: 0; cursor: zoom-in;
  background: none; border: none;
}
.work__zoom img { transition: opacity .3s; }
.work__zoom:hover img { opacity: .9; }

/* ---------------- lightbox ---------------- */

.lb {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(6,5,4,.97);
  padding: clamp(1rem, 4vw, 3rem);
}
.lb[data-on] { display: flex; }

.lb__stage {
  max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.lb__img {
  max-width: 100%; max-height: calc(100svh - 8rem);
  width: auto; height: auto; object-fit: contain;
}
.lb__cap {
  font-size: .78rem; color: var(--paper-dim); text-align: center;
  max-width: 60ch;
}

.lb__close, .lb__prev, .lb__next {
  position: absolute; color: var(--paper-dim);
  width: 56px; height: 56px; display: grid; place-items: center;
  font-size: 2rem; line-height: 1; transition: color .25s;
}
.lb__close:hover, .lb__prev:hover, .lb__next:hover { color: var(--ember); }
.lb__close { top: .5rem; right: .75rem; font-size: 2.4rem; }
.lb__prev { left: .25rem; top: 50%; transform: translateY(-50%); font-size: 3rem; }
.lb__next { right: .25rem; top: 50%; transform: translateY(-50%); font-size: 3rem; }
.lb__count {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  font-size: .68rem; letter-spacing: .18em; color: var(--paper-faint);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  /* flex-basis becomes the HEIGHT once the toolbar stacks — without this the
     search field renders 220px tall. */
  .toolbar input[type="search"] { flex: 0 0 auto; }
  .tabs { justify-content: flex-start; }
  /* Admin rows: thumb + title on one line, actions on the next. Four buttons
     beside the text at 390px squeezed titles into four-line wraps. */
  .admin-row { flex-wrap: wrap; }
  .admin-row__main { flex: 1 1 auto; min-width: 0; }
  .admin-row__acts {
    flex: 1 1 100%; justify-content: flex-start; margin-top: .6rem;
  }
  .admin-row__acts button { padding: .5rem .7rem; }
  .lb__prev, .lb__next { width: 44px; font-size: 2.2rem; }
}

/* ============================================================
   Server backend: sign-in, notes inbox, feedback widget
   ============================================================ */

.btn--sm { padding: .55rem .9rem; font-size: .62rem; }

.studio__bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.studio__bar h1 { margin-right: auto; }

/* ---------------- sign-in ---------------- */

.panel--signin { max-width: 30rem; }
.signin__msg {
  border-left: 2px solid var(--ember);
  background: rgba(216,120,74,.06);
  padding: .75rem 1rem; margin-bottom: 1.25rem;
  font-size: .82rem; color: var(--paper-dim);
}

/* ---------------- notes inbox ---------------- */

.note {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 0; border-bottom: 1px solid var(--ink-line);
}
.note__body { flex: 1; min-width: 0; }
.note__body p { font-size: .88rem; color: var(--paper); white-space: pre-wrap; }
.note__body small {
  display: block; margin-top: .4rem;
  font-size: .68rem; color: var(--paper-faint);
}
.note__body small a { color: var(--ember); }
.note__acts { display: flex; gap: .35rem; flex: 0 0 auto; }
.note__acts button {
  font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--paper-faint); border: 1px solid var(--ink-line);
  padding: .4rem .6rem; transition: color .25s, border-color .25s;
}
.note__acts button:hover { color: var(--ember); border-color: var(--ember); }
.note--done { opacity: .45; }
.note--done .note__body p { text-decoration: line-through; }

/* ---------------- feedback widget ---------------- */

.fb {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  z-index: 120; display: flex; flex-direction: column; align-items: flex-end; gap: .75rem;
}

.fb__btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--ink-raised); border: 1px solid var(--ink-line);
  color: var(--paper-dim);
  padding: .7rem 1.05rem;
  font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  transition: color .3s, border-color .3s, background-color .3s;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.fb__btn:hover { color: var(--paper); border-color: var(--ember); }
.fb__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ember);
  flex: 0 0 auto;
}
.fb--hint .fb__dot { animation: fbpulse 2.4s ease-in-out infinite; }
@keyframes fbpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216,120,74,.55); }
  50%      { box-shadow: 0 0 0 7px rgba(216,120,74,0); }
}

.fb__panel {
  width: min(24rem, calc(100vw - 2rem));
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  padding: 1.1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  animation: rise .3s var(--ease) both;
}
.fb__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem;
}
.fb__head strong {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper);
}
.fb__x { font-size: 1.5rem; line-height: 1; color: var(--paper-faint); padding: 0 .25rem; }
.fb__x:hover { color: var(--ember); }

.fb__ctx { font-size: .68rem; color: var(--paper-faint); margin-bottom: .75rem; }
.fb__ctx span { color: var(--ember); }

.fb__panel textarea {
  width: 100%; background: #0d0a09; border: 1px solid var(--ink-line);
  color: var(--paper); padding: .7rem .8rem; resize: vertical;
  font-family: var(--font-body); font-size: .85rem; line-height: 1.55;
}
.fb__panel textarea:focus { outline: none; border-color: var(--ember); }

.fb__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-top: .75rem;
}
.fb__count { font-size: .66rem; color: var(--paper-faint); }
.fb__note { margin-top: .6rem; font-size: .64rem; color: var(--paper-faint); line-height: 1.5; }
.fb__err {
  margin-top: .6rem; font-size: .7rem; color: var(--ember-lift);
}
.fb__done { text-align: center; padding: 1rem .5rem; }
.fb__done strong {
  display: block; font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ember); margin-bottom: .5rem;
}
.fb__done p { font-size: .8rem; color: var(--paper-dim); margin-bottom: 1rem; }

@media (max-width: 620px) {
  .fb { right: 1rem; bottom: 1rem; left: 1rem; align-items: stretch; }
  .fb__btn { align-self: flex-end; }
  .fb__panel { width: 100%; }
  .note { flex-wrap: wrap; }
  .note__acts { flex: 1 1 100%; margin-top: .5rem; }
}

.hb { display: block; margin-top: .5rem; color: var(--paper-faint); font-weight: 400; }
.hb--stale { color: var(--ember); }

/* Chrome paints autofilled inputs white, which broke the sign-in form against
   the dark ground. There is no way to set the background directly — the inset
   shadow trick is the only reliable override. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--paper);
  -webkit-box-shadow: 0 0 0 1000px #0d0a09 inset;
  box-shadow: 0 0 0 1000px #0d0a09 inset;
  caret-color: var(--paper);
  transition: background-color 9999s ease-in-out 0s;
}
