/* ============================================================
   HK FILM CAMERA LAB — "Engineering Swiss" Interface
   High-contrast near-black on paper · thick ruled lines ·
   monospace data numerals · precise grid · flat, no soft shadow.
   Orange is reserved for LAB (badges + brand "LAB").
   ============================================================ */

:root {
  /* Paper + ink — high contrast, warm-neutral */
  --bg: #f4f3f0;
  --bg-soft: #ecebe7;
  --card: #fcfcfb;
  --card-hi: #efeeea;
  --ink: #131313;         /* near-black */
  --ink-dim: #2c2c2c;
  --muted: #6f6f6a;
  --line: #c9c8c2;        /* light hairline (structure) */
  --line-strong: #1c1c1c; /* thick ruled separators */
  --line-hi: #a9a8a2;

  /* One accent — reserved for LAB */
  --accent: #e05206;
  --accent-ink: #ffffff;
  --accent-soft: #f9e3d3;
  --accent-focus: rgba(224, 82, 6, 0.14);

  --ok: #1f7a3d;   --ok-bg: #e5f2e8;
  --bad: #b3362a;  --bad-bg: #f7e8e4;

  --radius: 2px;         /* sharp, machined */
  --line-width: 1px;
  --rule: 2px;           /* thick Swiss rule */

  /* Swiss: one grotesque body + monospace for all data/numerals */
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI",
               "PingFang HK", "Microsoft JhengHei", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

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

a { color: var(--ink); text-decoration: none; transition: color .12s, border-color .12s; }
a:hover { color: var(--ink); border-color: var(--ink); }

h1, h2, h3 { font-family: var(--font-body); letter-spacing: -0.02em; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* Uppercase micro-labels — the Swiss metadata voice */
.tag-label, .k, .sort-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--mono);
}

/* ============================================================
   Header — thick machined rule, brand + index
   ============================================================ */
.site-header {
  border-bottom: var(--rule) solid var(--ink);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.site-header::before { display: none; }
.nav { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand {
  font-weight: 800; font-size: 15px; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  font-family: var(--mono);
}
.brand span { color: var(--accent); font-weight: 800; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  padding: 9px 11px; text-transform: uppercase; font-family: var(--mono);
  border-top: 3px solid transparent;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a.active { color: var(--ink); border-top-color: var(--ink); }
/* descriptive label ("301 ENTRIES") on the right of the nav */
.nav-index { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }

/* ============================================================
   Home hero — big headline over a thick ruled baseline
   ============================================================ */
.hero { padding: 64px 0 0; margin-bottom: 48px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink);
}
.hero h1 .glow { color: var(--accent); }
.hero .kicker {
  color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; margin: 0 0 20px; font-weight: 700;
}
.hero p.lede { color: var(--ink-dim); font-size: 16px; max-width: 680px; margin: 0 0 40px; line-height: 1.7; }

.stats {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: var(--rule) solid var(--ink);
  border-left: 0; background: var(--card);
}
.stat {
  padding: 16px 16px 14px; position: relative;
  border-left: var(--rule) solid var(--ink);
  border-top: 1px solid var(--line-strong);
}
.stat b {
  font-family: var(--mono); font-size: 28px; display: block; line-height: 1;
  font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--muted); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.09em; margin-top: 8px; display: block; font-weight: 700; font-family: var(--mono);
}

/* ============================================================
   Controls — ruled toolbar, monospace metadata
   ============================================================ */
.controls { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 8px; margin: 8px 0 24px; }
.controls input[type="search"],
.controls select {
  padding: 11px 13px; border: var(--line-width) solid var(--ink); border-radius: 0;
  background: var(--card); color: var(--ink); font-size: 14px; font-family: var(--font-body);
  transition: border-color .12s, background .12s;
  -webkit-appearance: none; appearance: none;
}
.controls input[type="search"] { min-width: 220px; }
.controls input[type="search"]::placeholder { color: var(--muted); }
.controls select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23131313'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.controls select option { background: var(--bg); color: var(--ink); }
.controls input[type="search"]:focus, .controls select:focus {
  outline: none; background: #fff; border-color: var(--accent);
}

/* ============================================================
   Cards — ruled index tiles, flat Swiss
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; align-items: start; }
.card {
  background: var(--card); border: var(--line-width) solid var(--line-strong);
  padding: 17px 17px 14px;
  display: flex; flex-direction: column; gap: 11px;
  text-decoration: none; color: inherit; position: relative;
  min-width: 0;
  transition: background .12s, border-color .12s;
}
.card:hover { background: var(--card-hi); border-color: var(--ink); color: inherit; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.card-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* type badges — machined outline, orange reserved for LAB */
.pill {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  border-radius: 0; padding: 3px 8px; white-space: nowrap; font-family: var(--mono);
  color: var(--ink); border: var(--line-width) solid var(--ink); background: transparent;
}
.pill.shop, .pill.both, .pill.service, .pill.repair, .pill.class, .pill.club {
  color: var(--ink); border-color: var(--ink); background: transparent;
}
.pill.lab { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.meta { color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.meta .cat { color: var(--ink-dim); font-weight: 700; }
.meta .loc { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; }

.tags { display: flex; gap: 5px; flex-wrap: wrap; min-height: 18px; max-width: 100%; }
.tags:empty { display: none; }

.card-bot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.chip {
  font-size: 11px; color: var(--ink-dim); border: var(--line-width) solid var(--line-strong);
  border-radius: 0; padding: 3px 8px; font-weight: 600; font-family: var(--mono);
  max-width: 100%; overflow-wrap: anywhere; white-space: normal; background: transparent;
}
.closed { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
.open { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
/* category tags — neutral (only LAB is orange) */
.chip.tag { color: var(--ink-dim); border-color: var(--line-strong); background: transparent; }
a.chip.tag:hover { color: var(--ink); border-color: var(--ink); }

/* ============================================================
   Empty state
   ============================================================ */
.none {
  padding: 52px; text-align: center; color: var(--muted);
  border: var(--line-width) dashed var(--line-strong); border-radius: 0;
  font-size: 14px; font-family: var(--mono);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: var(--rule) solid var(--ink); margin-top: 60px; padding: 30px 0 46px; color: var(--muted); font-size: 11.5px; text-align: center; font-family: var(--mono); letter-spacing: 0.04em; }

/* ============================================================
   Page hero (sub-pages)
   ============================================================ */
.page-hero { padding: 40px 0 22px; border-bottom: var(--rule) solid var(--ink); margin-bottom: 30px; }
.page-hero h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.02em; font-weight: 800; }
.page-hero p { color: var(--ink-dim); margin: 0; font-size: 14px; }

/* ============================================================
   Detail page — ruled spec sheet
   ============================================================ */
.detail { display: grid; grid-template-columns: 1fr; max-width: 760px; gap: 0; padding: 28px 0 44px; }
.detail h2 {
  font-size: 11px; margin: 30px 0 0; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-family: var(--mono);
}
.kv { list-style: none; margin: 0; padding: 0; border-top: var(--rule) solid var(--ink); }
.kv li { padding: 13px 0; border-bottom: 1px solid var(--line-strong); display: flex; gap: 16px; font-size: 14px; }
.kv li:last-child { border-bottom: 0; }
.kv .k { width: 110px; flex-shrink: 0; font-weight: 700; font-size: 10px; padding-top: 3px; }
.kv a { overflow-wrap: anywhere; color: var(--ink); }
.kv a:hover { color: var(--accent); }

.btn {
  display: inline-block; background: var(--ink); color: #ffffff;
  padding: 12px 20px; border-radius: 0; font-weight: 800; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 14px; font-family: var(--mono);
  transition: background .12s, color .12s;
}
.btn:hover { color: #fff; background: var(--accent); }

/* ============================================================
   Count hint — monospace data
   ============================================================ */
.count-hint { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-bottom: 8px; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .controls { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat:nth-child(odd) { border-left: 0; }
  .nav { height: auto; padding: 14px 0; flex-wrap: wrap; gap: 12px; }
  .nav-links { margin-left: 0; flex-wrap: wrap; }
}

/* hidden json blob */
[hidden] { display: none !important; }