/* Commission Manager — global styles.
 *
 * No framework, no build-time CSS tooling. One file, readable in a diff.
 * Deliberately small: this is a hobby site with a small maintenance budget.
 *
 * Contrast: body text on background is well above the 4.5:1 AA threshold.
 * Focus rings are never removed — see STANDARDS.md, accessibility.
 */

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --border: #dcdfe4;
  --text: #1c1f23;
  --muted: #5a6169;
  --accent: #14507a;
  --accent-soft: #e8f0f7;
  --radius: 8px;
  --wrap: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --surface: #1e2126;
    --border: #333941;
    --text: #ecedef;
    --muted: #a4abb4;
    --accent: #7fb6e0;
    --accent-soft: #1d2a36;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- skip link: visible only when focused, but must be reachable --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* --- focus: never remove the ring --- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

/* --- header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.brand {
  text-decoration: none;
  color: inherit;
}
.brand-name {
  display: block;
  font-weight: 650;
  font-size: 1.05rem;
}
.brand-tag {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.nav-list a:hover {
  border-bottom-color: var(--border);
}
.nav-list a[aria-current="page"] {
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* --- main --- */
main {
  padding-block: 2rem 3.5rem;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin-block: 0 0.5rem;
}
h2 {
  font-size: 1.3rem;
  margin-block: 2rem 0.5rem;
}
h3 {
  font-size: 1.05rem;
  margin-block: 1.5rem 0.35rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 42rem;
}

.muted {
  color: var(--muted);
}

/* --- notices: honest, clearly-marked state --- */
.notice {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-block: 1.5rem;
}
.notice p:last-child {
  margin-bottom: 0;
}

/* --- grids and cards --- */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  padding: 0;
  list-style: none;
  margin-block: 1.5rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.card a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.card-body {
  padding: 0.9rem 1rem;
}
.card-title {
  font-weight: 620;
  margin: 0 0 0.25rem;
}
.card-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}
.card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--border);
}

/**
 * Shown when a project has no thumbnail yet.
 *
 * This rule was MISSING for a while and the failure was quiet in a specific
 * way: ProjectCard.astro correctly stopped emitting a broken <img> and started
 * emitting this div instead, so no console error and no broken-image icon
 * appeared — but with no CSS the div rendered as unstyled text. The card looked
 * unfinished rather than broken, which is easy to mistake for intentional.
 *
 * A test asserts the markup; nothing asserted the style. Keep the two together.
 */
.card-thumb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  background: repeating-linear-gradient(
    135deg,
    var(--surface),
    var(--surface) 12px,
    var(--border) 12px,
    var(--border) 13px
  );
}
.card-thumb-note {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* --- gallery category nav: one link per category, with its project count --- */
.category-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin-block: 1.5rem;
}
.category-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.category-nav a:hover {
  border-color: var(--accent);
}
.category-nav .count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.category-nav .is-empty a {
  color: var(--muted);
}

/* --- placeholder marker: must be impossible to mistake for real work --- */
.placeholder {
  border: 2px dashed #b26a00;
  background: #fff6e5;
  color: #5c3a00;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-block: 1.5rem;
  font-weight: 500;
}
@media (prefers-color-scheme: dark) {
  .placeholder {
    background: #33270f;
    color: #ffd79a;
    border-color: #b26a00;
  }
}

/* --- queue: numbers only, no names, no colours --- */
.queue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin-block: 0.75rem 0;
}
.queue-list li {
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-weight: 600;
}
.queue-list li.is-empty {
  border-style: dashed;
  font-weight: 400;
  color: var(--muted);
}

/* --- forms --- */
.field {
  margin-block: 1rem;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.field .hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.15rem 0 0.4rem;
}
input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea {
  min-height: 7rem;
  resize: vertical;
}
button {
  font: inherit;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
button:hover {
  filter: brightness(1.08);
}

/* --- footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p {
  margin-block: 0.35rem;
}

/* --- 3D viewer: must not trap focus, must have a text fallback --- */
model-viewer {
  width: 100%;
  height: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  --poster-color: transparent;
}
