/* Forma: ink-and-poster theme. One locked dark palette, one accent, sharp corners. */

:root {
  --bg: #16140f;
  --bg-elevated: #211d17;
  --bg-elevated-2: #2b2620;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f0e6;
  --text-muted: #b7ae9f;
  --accent: #dc5a2e;
  --accent-ink: #16140f;
  --radius: 2px;
  --font-display: "Futura", "Century Gothic", "Trebuchet MS", "Avenir", sans-serif;
  --font-body: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 16px 32px rgba(8, 6, 3, 0.45);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 100;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  color: var(--text);
  flex-shrink: 0;
}

.logo-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.site-nav a:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: #e6693c;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */

.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
  max-width: 20ch;
}

.hero-sub {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.hero-copy .btn {
  margin-top: 2rem;
}

.hero-media {
  position: relative;
  min-height: 420px;
}

.hero-img {
  position: absolute;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-img-1 {
  top: 0;
  right: 0;
  width: 78%;
  height: 420px;
}

.hero-img-2 {
  bottom: -1.5rem;
  left: 0;
  width: 48%;
  height: 220px;
  border: 6px solid var(--bg);
}

/* Catalog */

.catalog {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.catalog-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.catalog-sub {
  margin-top: 0.75rem;
  color: var(--text-muted);
  max-width: 60ch;
  font-size: 1.05rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: end;
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-field label,
.control-field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

#search-input,
#category-filter {
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  min-width: 220px;
}

#search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

#search-input:focus,
#category-filter:focus {
  border-color: var(--accent);
}

.control-field-toggle {
  margin-left: auto;
}

#saved-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-weight: 600;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

#saved-filter-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Grid + cards */

.grid {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag {
  display: inline-block;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  width: fit-content;
}

.card-saved-badge {
  display: inline-block;
  margin-left: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-tags {
  margin: 0;
}

.card-title {
  font-size: 1.2rem;
}

.card-meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.card-price {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.card-open {
  margin-top: auto;
  padding-top: 1rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-weight: 700;
  text-align: center;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.card-open:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Empty state */

.empty-state {
  margin-top: 2.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state h3 {
  font-size: 1.3rem;
}

.empty-state p {
  margin-top: 0.6rem;
  color: var(--text-muted);
}

.empty-state .btn {
  margin-top: 1.5rem;
}

/* Studio strip */

.studio {
  position: relative;
  max-width: 1400px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.studio-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
}

.studio-copy {
  position: relative;
  margin-top: -140px;
  margin-left: 0;
  max-width: 520px;
  background: rgba(22, 20, 15, 0.88);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius);
}

.studio-copy h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.studio-copy p {
  margin-top: 1rem;
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand p {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.footer-info p {
  color: var(--text-muted);
}

.footer-info p + p {
  margin-top: 0.35rem;
}

/* Detail dialog */

.detail-dialog {
  position: fixed;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0;
  width: min(720px, calc(100vw - 2.5rem));
  max-height: min(88vh, 820px);
  overflow: hidden;
}

.detail-dialog::backdrop {
  background: rgba(8, 7, 4, 0.72);
}

.detail-scroll {
  max-height: min(88vh, 820px);
  overflow-y: auto;
}

.btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(22, 20, 15, 0.85);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.btn-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-media {
  position: relative;
}

.detail-media img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.detail-content {
  padding: 1.75rem 2rem 2.25rem;
}

#detail-category {
  margin-bottom: 0.85rem;
}

.detail-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.detail-body {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 60ch;
}

.detail-facts {
  margin: 1.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem 1.5rem;
}

.detail-facts div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-facts dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-facts dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

#save-toggle {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.8rem 1.4rem;
  font-weight: 700;
  font-size: 1rem;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

#save-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

#save-toggle:hover {
  border-color: var(--accent);
}

/* Mobile collapse (< 768px) */

@media (max-width: 768px) {
  .site-header {
    padding: 1rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 1.25rem 1.25rem 2rem;
    gap: 1.5rem;
  }

  .hero-copy h1 {
    max-width: 16ch;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .hero-media {
    min-height: 220px;
    order: -1;
  }

  .hero-img-1 {
    height: 210px;
  }

  .hero-img-2 {
    height: 110px;
  }

  .catalog {
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .control-field-toggle {
    margin-left: 0;
  }

  #search-input,
  #category-filter {
    min-width: 0;
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .studio {
    padding: 0 1.25rem;
  }

  .studio-img {
    height: 260px;
  }

  .studio-copy {
    margin-top: -80px;
    max-width: none;
    padding: 1.5rem;
  }

  .site-footer {
    padding: 2rem 1.25rem 2.5rem;
  }

  .detail-content {
    padding: 1.5rem 1.25rem 2rem;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
