/* ============ FORMA — night-studio ledger ============ */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("assets/space-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("assets/space-mono-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #14120a;
  --ink-2: #1d1a10;
  --ink-3: #262216;
  --paper: #f0ead9;
  --dim: #a29a81;
  --line: #38331f;
  --acid: #d7f24b;
  --baking: #f0b429;
  --ceramics: #c98f6b;
  --floristry: #8fd08a;
  --painting: #ff6f52;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }

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

/* focus */
:is(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--acid); color: var(--ink); padding: .6rem 1rem;
  font-family: var(--mono); font-size: .8rem;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--paper); text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--acid); }
.wordmark { font-weight: 700; font-size: 1.25rem; letter-spacing: .22em; text-transform: uppercase; }
.topbar-note { margin: 0 0 0 auto; color: var(--dim); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.topbar-cta { color: var(--acid); text-decoration: none; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.topbar-cta:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem) clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.kicker { color: var(--acid); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 1.4rem; }
.hero-title {
  margin: 0 0 1.4rem;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: .98;
  font-weight: 700;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--acid);
}
@supports not (-webkit-text-stroke: 1px black) {
  .outline { color: var(--acid); }
}
.hero-lede { max-width: 46ch; color: var(--dim); font-size: 1.05rem; margin: 0 0 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  border: 1px solid var(--acid); background: transparent; color: var(--acid);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .8rem 1.4rem; cursor: pointer; text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.btn:hover { background: var(--acid); color: var(--ink); }
.btn-solid { background: var(--acid); color: var(--ink); }
.btn-solid:hover { background: var(--paper); border-color: var(--paper); }
.btn .ico { width: 1em; height: 1em; }

.hero-art { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; align-items: end; }
.ph { position: relative; margin: 0; overflow: hidden; background: var(--ink-3); }
.ph img {
  width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: luminosity; opacity: .85;
  filter: grayscale(1) contrast(1.05);
  transition: filter .3s ease, opacity .3s ease;
}
.ph:hover img, .row:hover .ph img, .row:focus-within .ph img { filter: none; mix-blend-mode: normal; opacity: 1; }
.ph figcaption {
  position: absolute; left: 0; bottom: 0; z-index: 1;
  background: var(--ink); color: var(--acid);
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .35rem .6rem;
}
.ph-a { aspect-ratio: 4 / 3; }
.ph-b { aspect-ratio: 3 / 5; margin-bottom: 1.6rem; }
.hero-art .ph { background: var(--baking); }
.hero-art .ph-b { background: var(--ceramics); }

/* ---------- ticker ---------- */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); padding: .55rem 0; background: var(--ink-2); }
.ticker-track { display: flex; gap: 2.5rem; white-space: nowrap; width: max-content; color: var(--dim); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; animation: tick 40s linear infinite; }
.ticker-track b { color: var(--acid); font-weight: 400; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- schedule ---------- */
.schedule { padding: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 4vw, 3rem) 4rem; }
.schedule-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.schedule-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); text-transform: uppercase; letter-spacing: -.01em; }
.schedule-count { margin: 0; color: var(--dim); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.schedule-count span { color: var(--acid); }

/* toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 1rem; align-items: end; flex-wrap: wrap;
  padding: 1rem 0;
  background: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-label { font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.field input, .field select {
  background: var(--ink-2); border: 1px solid var(--line); color: var(--paper);
  padding: .65rem .9rem; min-height: 44px; border-radius: 0;
}
.field input { width: min(320px, 100%); }
.field input::placeholder { color: #948b6e; }
.field select { cursor: pointer; }
.field select:focus, .field input:focus { border-color: var(--acid); }
.field-cat select { width: 200px; }

.btn-toggle { min-height: 44px; padding: .6rem 1.1rem; }
.btn-toggle[aria-pressed="true"] { background: var(--acid); color: var(--ink); }
.badge { background: var(--ink); color: var(--acid); padding: .05rem .45rem; font-size: .72rem; }
.btn-toggle[aria-pressed="true"] .badge { background: var(--ink); color: var(--acid); }

/* ---------- ledger rows ---------- */
.ledger { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 2.6rem 92px 1fr auto auto auto;
  gap: 1.4rem; align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s ease;
}
.row:hover, .row:focus-within { background: var(--ink-2); }
.row-idx { font-family: var(--mono); color: #8a8163; font-size: .8rem; }
.row .ph { width: 92px; height: 74px; flex: none; }
.row-1 .ph { background: var(--ceramics); }
.row-2 .ph { background: var(--painting); }
.row-3 .ph { background: var(--floristry); }
.row-4 .ph { background: var(--baking); }
.row-5 .ph { background: var(--ceramics); }
.row-6 .ph { background: var(--painting); }

.row-main { min-width: 0; }
.row-title { margin: 0 0 .35rem; font-size: 1.35rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.row:hover .row-title { text-decoration: underline; text-decoration-color: var(--acid); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.row-meta { margin: 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.row-meta b { color: var(--acid); font-weight: 400; }

.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .3rem .65rem; border: 1px solid var(--line); white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--acid)); }
.chip[data-cat="Baking"] { --c: var(--baking); color: var(--baking); }
.chip[data-cat="Ceramics"] { --c: var(--ceramics); color: var(--ceramics); }
.chip[data-cat="Floristry"] { --c: var(--floristry); color: var(--floristry); }
.chip[data-cat="Painting"] { --c: var(--painting); color: var(--painting); }

.row-price { text-align: right; font-family: var(--mono); }
.row-price .amount { font-size: 1.15rem; font-weight: 700; color: var(--paper); }
.row-price .per { display: block; font-size: .62rem; color: #948b6e; letter-spacing: .12em; text-transform: uppercase; }

.btn-open { white-space: nowrap; padding: .6rem 1rem; font-size: .72rem; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 4rem 1rem; border-bottom: 1px solid var(--line); }
.empty-mark { color: var(--acid); font-size: 2.4rem; margin: 0 0 1rem; }
.empty-title { margin: 0 0 .6rem; font-size: 1.5rem; text-transform: uppercase; }
.empty-copy { color: var(--dim); max-width: 46ch; margin: 0 auto 1.8rem; }

/* ---------- footer ---------- */
.footer { padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; color: #948b6e; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; border-top: 1px solid var(--line); }
.footer p { margin: 0; }

/* ---------- detail sheet ---------- */
.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(620px, 100%);
  max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border: 0; border-left: 1px solid var(--line);
  background: var(--ink-2); color: var(--paper);
  padding: 0;
  overflow: hidden;
}
.sheet::backdrop { background: rgba(8, 7, 2, .72); }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .28s cubic-bezier(.2, .8, .25, 1); }
  .sheet[open]::backdrop { animation: fade-in .28s ease; }
}
@keyframes sheet-in { from { transform: translateX(60px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet-inner { height: 100%; overflow-y: auto; padding: 1.4rem clamp(1.2rem, 3vw, 2.2rem) 2.5rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.btn-ghost { border-color: var(--line); color: var(--dim); padding: .55rem .9rem; font-size: .72rem; }
.btn-ghost:hover { border-color: var(--paper); color: var(--paper); background: transparent; }
.btn-ghost .x { color: var(--acid); }

.sheet-ph { aspect-ratio: 3 / 2; background: var(--acid); margin: 0 0 1.6rem; }
.sheet-ph img { filter: none; mix-blend-mode: normal; opacity: 1; }

.sheet-title { margin: 0 0 1.4rem; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.02; letter-spacing: -.02em; text-transform: uppercase; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0 0 1.6rem; }
.fact { background: var(--ink-2); padding: .8rem .9rem; }
.fact dt { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: #948b6e; margin: 0 0 .3rem; }
.fact dd { margin: 0; font-size: .92rem; color: var(--paper); }
.fact-price { background: var(--acid); color: var(--ink); }
.fact-price dt { color: rgba(20, 18, 10, .6); }
.fact-price dd { font-weight: 700; font-size: 1.2rem; }

.sheet-body { color: var(--dim); font-size: 1.02rem; line-height: 1.65; margin: 0 0 2rem; max-width: 58ch; }

.sheet-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.btn-save { padding: .85rem 1.4rem; }
.btn-save[aria-pressed="true"] { background: var(--acid); color: var(--ink); }
.btn-save .ico { fill: currentColor; stroke: none; }
.btn-save[aria-pressed="true"] .ico path { stroke: var(--ink); fill: var(--ink); }
.sheet-note { margin: 0; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #948b6e; }

.live { position: absolute; left: -999px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 560px; }
  .row { grid-template-columns: 64px 1fr auto; grid-template-areas: "ph main price" "ph main btn" "ph chip btn"; row-gap: .5rem; }
  .row-idx { display: none; }
  .row .ph { grid-area: ph; width: 64px; height: 64px; }
  .row-main { grid-area: main; }
  .row .chip { grid-area: chip; align-self: start; justify-self: start; }
  .row-price { grid-area: price; }
  .btn-open { grid-area: btn; align-self: center; }
}
@media (max-width: 640px) {
  .topbar { gap: .8rem; }
  .topbar-note { display: none; }
  .hero-title { font-size: clamp(2.3rem, 11vw, 3.2rem); }
  .hero-art { grid-template-columns: 1fr 1fr; }
  .ph-b { margin-bottom: 0; }
  .toolbar { gap: .7rem; }
  .field-search { flex: 1 1 100%; }
  .field-search input { width: 100%; }
  .field-cat { flex: 1; }
  .field-cat select { width: 100%; }
  .btn-toggle { flex: 1; justify-content: center; }
  .row { grid-template-columns: 56px 1fr auto; }
  .row .ph { width: 56px; height: 56px; }
  .row-title { font-size: 1.1rem; }
  .row .chip { display: none; }
  .btn-open { padding: .5rem .8rem; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact-price { grid-column: 1 / -1; }
}

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