:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #5c6270;
  --ink-faint: #8b91a0;
  --line: #e6e6e2;
  --line-strong: #d8d8d2;
  --accent: #1f5f4b;
  --accent-soft: #eaf2ee;
  --accent-ink: #143c30;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.05);
  --shadow-md: 0 10px 24px -14px rgba(22, 24, 29, 0.22);
  --shadow-lg: 0 28px 60px -30px rgba(22, 24, 29, 0.35);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

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

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 60;
  background: var(--surface); color: var(--ink); padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--line); text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.shell {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 32px;
  padding: 18px 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; flex: none;
}
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  border: 1px solid #dbe8e2;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text {
  display: flex; flex-direction: column; line-height: 1.15;
  font-family: "Fraunces", Georgia, serif; font-size: 18px; letter-spacing: -0.01em;
}
.brand-text strong { font-weight: 600; }
.brand-text small {
  font-family: "Inter", sans-serif; font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
}

.search {
  position: relative; flex: 1; max-width: 620px; margin-left: auto;
}
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--ink-faint); pointer-events: none;
}
.search input {
  width: 100%; padding: 13px 46px 13px 46px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 14.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--ink-faint); }
.search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft);
  transition: background 0.18s var(--ease);
}
.search-clear:hover { background: #f1f1ee; }
.search-clear svg { width: 15px; height: 15px; }

/* Filters */
.filters {
  padding: 34px 0 22px;
  display: flex; flex-direction: column; gap: 16px;
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.chip:hover { color: var(--ink); border-color: #c6c6bf; transform: translateY(-1px); }
.chip[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent);
  color: #fff; box-shadow: var(--shadow-md);
}
.counter { margin: 0; font-size: 13.5px; color: var(--ink-faint); }
.counter b { color: var(--ink); font-weight: 600; }

/* Grid */
.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-bottom: 56px;
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
  animation: rise 0.4s var(--ease) both;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.card:hover .thumb img { transform: scale(1.05); }
.thumb-fallback {
  position: absolute; left: 16px; top: 14px;
  font-family: "Fraunces", serif; font-size: 13px; letter-spacing: 0.02em;
  color: var(--accent-ink); opacity: 0.75;
}
.thumb::after {
  content: ""; position: absolute; inset: 0; background: rgba(18, 22, 20, 0);
  transition: background 0.28s var(--ease);
}
.card:hover .thumb::after { background: rgba(18, 22, 20, 0.12); }

.play {
  position: absolute; inset: 0; margin: auto;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.92); color: var(--accent);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.4);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), background 0.24s var(--ease);
}
.play svg { width: 22px; height: 22px; margin-left: 3px; }
.card:hover .play { transform: scale(1.08); box-shadow: 0 14px 34px -12px rgba(31, 95, 75, 0.6); }
.play:hover, .play:focus-visible { background: #fff; transform: scale(1.12); }

.card-body { padding: 16px 18px 14px; }
.card-cat {
  margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.card-title {
  margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.4;
}
.card-actions {
  display: flex; gap: 8px; padding: 0 18px 16px; margin-top: 14px;
}
.ghost-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font-size: 12.5px; font-weight: 500;
  transition: all 0.18s var(--ease);
}
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn:hover {
  color: var(--accent-ink); border-color: #c3d6cd; background: var(--accent-soft);
}

/* Empty state */
.empty {
  text-align: center; padding: 72px 24px 96px; max-width: 460px; margin-inline: auto;
  animation: rise 0.35s var(--ease) both;
}
.empty-art {
  width: 58px; height: 58px; margin: 0 auto 20px; border-radius: 18px;
  display: grid; place-items: center; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink-faint); box-shadow: var(--shadow-sm);
}
.empty-art svg { width: 26px; height: 26px; }
.empty h2 { margin: 0 0 10px; font-family: "Fraunces", serif; font-size: 24px; font-weight: 600; }
.empty p { margin: 0 0 22px; color: var(--ink-soft); }
.empty q { color: var(--ink); font-weight: 500; }

.btn-primary {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 11px 22px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md); transition: all 0.2s var(--ease);
}
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-1px); }

.site-footer {
  border-top: 1px solid var(--line); padding: 26px 0 40px;
  color: var(--ink-faint); font-size: 13px;
}

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(20, 24, 22, 0.5);
  backdrop-filter: blur(4px); animation: fade 0.22s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative; width: min(960px, 100%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 20px; animation: pop 0.26s var(--ease) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal-head { display: flex; align-items: flex-start; gap: 16px; padding: 4px 4px 16px; }
.modal-eyebrow {
  margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.modal-title { margin: 0; font-family: "Fraunces", serif; font-size: 21px; font-weight: 600; }
.icon-btn {
  margin-left: auto; flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft); transition: all 0.18s var(--ease);
}
.icon-btn:hover { background: #f1f1ee; color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.video-wrap {
  border-radius: var(--radius); overflow: hidden; background: #101311;
  aspect-ratio: 16 / 9;
}
.video-wrap video { width: 100%; height: 100%; }

/* Toasts */
.toasts {
  position: fixed; z-index: 70; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; box-shadow: var(--shadow-lg);
  animation: toast-in 0.26s var(--ease) both;
}
.toast.out { animation: toast-out 0.24s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { width: min(1240px, 100% - 32px); }
  .header-inner { flex-wrap: wrap; gap: 14px; }
  .search { max-width: none; flex-basis: 100%; margin-left: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .filters { padding-top: 24px; }
  .modal { padding: 14px; }
  .modal-panel { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
