:root {
  --bg: #15171B;
  --bg-elevated: #1D2024;
  --paper: #ECE6D8;
  --ink: #262420;
  --teal: #4B7C74;
  --amber: #C98A3C;
  --muted: #9A9C9F;
  --border: #2C2F34;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: #E8E6E1;
  font-family: 'Inter', sans-serif;
}

.site-header {
  padding: 48px 24px 32px;
  text-align: center;
}

.site-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.site-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 0 24px 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--teal);
  outline: none;
}

.card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.card-title {
  display: block;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.overlay[hidden] { display: none; }

.spec-sheet {
  background: var(--bg-elevated);
  border-radius: 10px;
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.spec-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px 0 0 10px;
}

.spec-prompt {
  background: var(--paper);
  color: var(--ink);
  padding: 32px 28px;
  border-radius: 0 10px 10px 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin-bottom: 12px;
}

.prompt-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  margin: 0 0 20px;
}

.copy-btn {
  align-self: flex-start;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover { background: var(--teal); }
.copy-btn.copied { background: var(--amber); }

.tear-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-image: linear-gradient(var(--muted) 60%, transparent 0%);
  background-size: 1px 10px;
  background-repeat: repeat-y;
  opacity: 0.4;
}

@media (max-width: 720px) {
  .spec-sheet {
    grid-template-columns: 1fr;
  }
  .spec-image img {
    border-radius: 10px 10px 0 0;
    max-height: 320px;
  }
  .spec-prompt {
    border-radius: 0 0 10px 10px;
  }
  .tear-line {
    left: 0; right: 0; top: 0; bottom: auto; height: 1px; width: auto;
    background-image: linear-gradient(90deg, var(--muted) 60%, transparent 0%);
    background-size: 10px 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
