/* Casio F-91W Family gallery — dark theme, mobile-first, no external deps */

:root {
  --bg: #12151a;
  --bg-elevated: #1b2027;
  --bg-tile: #20262f;
  --text: #e8eaed;
  --text-muted: #9aa4b2;
  --accent: #5fd4c8;
  --accent-soft: #2a4542;
  --border: #2a313c;
  --badge-bg: #273040;
  --badge-text: #c7d4e0;
  --confidence-low: #6b7280;
  --confidence-medium: #c9a227;
  --confidence-high: #4caf6b;
  --free-license: #4caf6b;
  --unknown-license: #d98a3d;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

.site-header {
  padding: 2rem 1.25rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Sticky category nav */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.category-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.category-nav-total {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  padding-right: 0.3rem;
  border-right: 1px solid var(--border);
}

.category-nav a {
  font-size: 0.82rem;
  color: var(--badge-text);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.15rem 0;
}

.category-nav a:hover {
  color: var(--accent);
}

.category-nav a.nav-candidates-link {
  color: var(--accent);
}

.nav-count {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Category sections */
.category-section {
  scroll-margin-top: 4.5rem;
  margin: 2.25rem 0;
}

.category-section:first-of-type {
  margin-top: 1.25rem;
}

.category-section h2 {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.section-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1rem;
}

.section-blurb {
  color: var(--text-muted);
  max-width: 75ch;
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.card-see-also {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.site-header h1 {
  font-size: 1.6rem;
  margin: 0 0 0.6rem;
  line-height: 1.25;
}

.intro {
  color: var(--text-muted);
  max-width: 70ch;
  margin: 0;
  font-size: 0.98rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-media {
  width: 100%;
  height: 200px;
  background: var(--bg-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-tile);
  padding: 0.75rem;
}

.placeholder-tile {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 0.35rem;
}

.placeholder-icon {
  font-size: 2.2rem;
  opacity: 0.6;
}

.placeholder-text {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.card-model {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--accent);
}

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

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0;
}

.badge {
  display: inline-block;
  max-width: 100%;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.badge-wr {
  background: var(--accent-soft);
  color: var(--accent);
}

.card-case {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-features {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.9;
}

.card-notes {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-variation {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

.card-evidence {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text);
}

/* Candidates section — visually distinct */
.candidates-section {
  margin-top: 2.5rem;
  padding: 1.5rem 1.25rem;
  background: linear-gradient(180deg, rgba(95, 212, 200, 0.07), transparent);
  border: 1px solid var(--accent-soft);
  border-radius: 14px;
}

.candidates-section h2 {
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
  color: var(--accent);
}

.candidates-intro {
  color: var(--text-muted);
  max-width: 75ch;
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}

.candidate-card {
  border-color: var(--accent-soft);
}

.badge-confidence-low {
  background: rgba(107, 114, 128, 0.25);
  color: var(--confidence-low);
}

.badge-confidence-medium {
  background: rgba(201, 162, 39, 0.2);
  color: var(--confidence-medium);
}

.badge-confidence-high {
  background: rgba(76, 175, 107, 0.2);
  color: var(--confidence-high);
}

/* Footer */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
}

.site-footer h2 {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 1.25rem 0 0.6rem;
}

.credit-group-heading {
  font-size: 0.88rem;
  color: var(--accent);
  margin: 1.1rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.footer-disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 75ch;
  margin: 0 0 1rem;
}

.credits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.credit-row {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px dotted var(--border);
  padding-bottom: 0.35rem;
}

.credit-model {
  color: var(--text);
  font-weight: 600;
  margin-right: 0.3rem;
}

.credit-license {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.3rem;
}

.credit-license-free {
  background: rgba(76, 175, 107, 0.18);
  color: var(--free-license);
}

.credit-license-unknown {
  background: rgba(217, 138, 61, 0.18);
  color: var(--unknown-license);
}

/* Responsive breakpoints */
@media (min-width: 640px) {
  .site-header h1 {
    font-size: 2rem;
  }
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* Light theme support, in case a user forces it */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --bg-elevated: #ffffff;
    --bg-tile: #eceff2;
    --text: #1b2027;
    --text-muted: #5a6472;
    --border: #dde1e6;
    --badge-bg: #eef1f5;
    --badge-text: #3a4451;
  }
}
