/* Forma — "Chalkboard studio" direction.
   Dark chalkboard hero → cool concrete/paper catalog. Condensed stamped
   display type, monospace ticket data, safety-orange ink accent. */

:root {
  --ink: #181c17;
  --chalk: #f6f3ea;
  --board: #23281f;
  --board-line: rgba(246, 243, 234, 0.16);
  --paper: #eceae1;
  --paper-deep: #e2ded1;
  --card: #f6f5ef;
  --line: rgba(24, 28, 23, 0.14);
  --line-strong: rgba(24, 28, 23, 0.28);
  --muted: #53574c;
  --chalk-muted: #cfc9b8;
  --accent: #e2571c;
  --accent-deep: #a83c0f;
  --mustard: #e0ab3c;

  --cat-ceramics: #8a4419;
  --cat-ceramics-bg: #f1e2d3;
  --cat-painting: #2f4d8f;
  --cat-painting-bg: #dfe4f3;
  --cat-floristry: #3d6b34;
  --cat-floristry-bg: #dfe9d6;
  --cat-baking: #8a4a20;
  --cat-baking-bg: #ecdfcd;

  --display: 'Futura', 'Avenir Next Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --sans: -apple-system, 'system-ui', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;

  --shadow-1: 0 2px 6px -2px rgba(24, 28, 23, 0.22), 0 10px 24px -14px rgba(24, 28, 23, 0.32);
  --shadow-2: 0 8px 16px -6px rgba(24, 28, 23, 0.28), 0 24px 48px -20px rgba(24, 28, 23, 0.4);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

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

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

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

::selection {
  background: var(--accent);
  color: var(--chalk);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--paper-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
  border: 3px solid var(--paper-deep);
}
* {
  scrollbar-color: var(--line-strong) var(--paper-deep);
  scrollbar-width: thin;
}

:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--mustard);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--chalk);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 200;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--board);
  color: var(--chalk);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--board-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.brand-tag {
  margin: 0;
  font-size: 0.82rem;
  color: var(--chalk-muted);
  letter-spacing: 0.01em;
}

/* ---------- Hero ---------- */

.hero {
  background: var(--board);
  color: var(--chalk);
  position: relative;
  overflow: hidden;
  padding: 56px 0 72px;
}
.hero-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(rgba(246, 243, 234, 0.05) 1px, transparent 1px);
  background-size: 5px 5px;
  mix-blend-mode: screen;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero-title {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 800;
  font-size: clamp(2.6rem, 1.2rem + 3.6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.hero-underline {
  display: block;
  width: 220px;
  max-width: 60%;
  height: 18px;
  margin: 6px 0 22px;
  color: var(--accent);
}
.hero-underline path {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: draw-underline 1.1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes draw-underline {
  to {
    stroke-dashoffset: 0;
  }
}
.hero-sub {
  max-width: 46ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--chalk);
  opacity: 0.86;
  margin: 0 0 28px;
}
.hero-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
}
.hero-tag {
  border: 1.5px solid var(--board-line);
  background: transparent;
  color: var(--chalk);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.hero-tag:hover {
  border-color: var(--mustard);
  color: var(--mustard);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--mustard);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero-cta:hover {
  color: var(--chalk);
}
.hero-cta svg {
  width: 16px;
  height: 16px;
}

.hero-photo {
  position: relative;
}
.hero-photo-frame {
  position: relative;
  background: var(--chalk);
  padding: 10px 10px 34px;
  border-radius: 2px;
  box-shadow: var(--shadow-2);
  transform: rotate(2deg);
  max-width: 360px;
  margin: 0 auto;
}
.hero-photo-frame img {
  width: 100%;
  aspect-ratio: 4 / 3.1;
  object-fit: cover;
  border-radius: 1px;
}
.hero-photo-tape {
  position: absolute;
  width: 92px;
  height: 30px;
  background: rgba(232, 217, 178, 0.82);
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.hero-photo-caption {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.68;
  text-align: center;
}

.torn-divider {
  height: 22px;
  width: 100%;
  display: block;
  background: var(--paper);
  clip-path: polygon(
    0% 100%, 0% 40%, 3% 0%, 6% 45%, 9% 5%, 12% 50%, 15% 10%, 18% 42%, 21% 8%,
    24% 48%, 27% 12%, 30% 40%, 33% 6%, 36% 46%, 39% 14%, 42% 44%, 45% 4%,
    48% 50%, 51% 10%, 54% 42%, 57% 8%, 60% 48%, 63% 12%, 66% 40%, 69% 6%,
    72% 46%, 75% 14%, 78% 44%, 81% 4%, 84% 50%, 87% 10%, 90% 42%, 93% 8%,
    96% 48%, 100% 12%, 100% 100%
  );
}

/* ---------- Main / toolbar ---------- */

main {
  background: var(--paper);
}

.browse-head {
  padding: 44px 0 8px;
}
.browse-head h2 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.browse-head p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 18px;
  padding: 20px 0 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.field-search {
  flex: 1 1 260px;
  min-width: 220px;
}
.field-category {
  flex: 0 0 200px;
}
#search,
#filter {
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: var(--sans);
  height: 46px;
}
#search::placeholder {
  color: var(--muted);
}
#search:focus-visible,
#filter:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 2px;
}
#filter {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23181c17' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

.chip-toggle {
  height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip-toggle svg {
  width: 16px;
  height: 16px;
}
.chip-toggle[aria-pressed='true'] {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--chalk);
}

.result-count {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 14px 0 22px;
}

/* ---------- Grid / cards ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 0 0 72px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
}

.card-open {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 0.5s ease forwards;
}
@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card-open:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-deep);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--cat-color-bg, var(--paper));
  color: var(--cat-color, var(--ink));
}

.card-saved-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: var(--chalk);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-1);
}
.card-saved-mark svg {
  width: 15px;
  height: 15px;
}

.card-content {
  padding: 16px 18px 18px;
}
.card-title {
  display: block;
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 1.24rem;
  letter-spacing: 0.005em;
  margin: 0 0 6px;
  color: var(--ink);
}
.card-meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
  font-family: var(--mono);
}
.card-price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.card-seats {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Empty state ---------- */

.empty-state {
  padding: 64px 24px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  margin-bottom: 72px;
}
.empty-state p {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  margin: 0 0 18px;
}
.empty-state button {
  border: none;
  background: var(--accent-deep);
  color: var(--chalk);
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
}
.empty-state button:hover {
  background: var(--ink);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--board);
  color: var(--chalk);
  padding: 36px 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  opacity: 0.7;
}
.footer-mark {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  opacity: 1;
}

/* ---------- Detail dialog ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 28, 23, 0.58);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.overlay.is-open {
  opacity: 1;
}

.detail {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 40px));
  max-height: min(880px, calc(100vh - 48px));
  transform: translate(-50%, -46%) scale(0.97);
  opacity: 0;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.detail.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.detail-scroll {
  overflow-y: auto;
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--chalk);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow-1);
}
.detail-close:hover {
  background: var(--accent-deep);
  color: var(--chalk);
  border-color: var(--accent-deep);
}

.detail-media {
  position: relative;
  aspect-ratio: 16 / 8;
  background: var(--paper-deep);
}
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-body {
  padding: 26px 32px 32px;
}
.detail-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--cat-color-bg, var(--paper));
  color: var(--cat-color, var(--ink));
  margin-bottom: 12px;
}
.detail-title {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 800;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem);
  line-height: 1.04;
  margin: 0 0 14px;
  text-wrap: balance;
}
.detail-desc {
  max-width: 62ch;
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.86;
  margin: 0 0 24px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px 20px;
  margin: 0 0 26px;
  padding: 20px 0;
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
}
.detail-facts dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 4px;
}
.detail-facts dd {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.save-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--accent-deep);
  background: var(--accent-deep);
  color: var(--chalk);
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.save-toggle svg {
  width: 18px;
  height: 18px;
}
.save-toggle[aria-pressed='true'] {
  background: var(--chalk);
  color: var(--accent-deep);
}
.save-toggle:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--chalk);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-photo-frame {
    max-width: 300px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 20px;
  }
  .site-header .wrap {
    min-height: 60px;
  }
  .brand-tag {
    display: none;
  }
  .hero {
    padding: 36px 0 48px;
  }
  .hero-title {
    font-size: clamp(2.1rem, 1.4rem + 6vw, 2.9rem);
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .field-category {
    flex: 1 1 auto;
  }
  .chip-toggle {
    justify-content: center;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .detail {
    width: 100%;
    height: 100%;
    max-height: 100%;
    top: 0;
    left: 0;
    transform: translateY(12px);
    border-radius: 0;
  }
  .detail.is-open {
    transform: translateY(0);
  }
  .detail-body {
    padding: 22px 20px 28px;
  }
  .detail-media {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card-open {
    opacity: 1;
    transform: none;
  }
  .hero-underline path {
    stroke-dashoffset: 0;
  }
}
