:root {
  /* color */
  --bg: #0f0f14; --surface: #16161d; --surface-2: #1e1e27;
  --border: #2a2a33; --text: #e8e8ee; --muted: #9a9aa6;
  --accent: #3a7bd5; --accent-hover: #4f8ce0; --accent-text: #5a92e0;
  --accent-ink: #fff; /* text on accent fills */
  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 32px;
  /* radius */
  --radius: 8px; --radius-sm: 6px; --radius-pill: 9999px;
  /* motion + elevation */
  --trans: .15s ease; --shadow: 0 10px 30px rgba(0,0,0,.45);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --maxw: 1500px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-text); text-decoration: none; transition: color var(--trans); }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-sm);
  padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; display: inline-block;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans); }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; transform: none; pointer-events: none; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #262630; border-color: #3a3a45; }
.label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
}

/* Nav */
.nav { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 56px; }
.nav .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .04em; color: var(--text); }
.nav .brand svg { width: 20px; height: 20px; color: var(--accent-text); flex: none; }
.nav .brand:hover { text-decoration: none; }
.nav .brand b { color: var(--accent-text); }
.nav a.navlink { color: var(--muted); font-weight: 600; padding: 4px 12px; border-radius: var(--radius-pill);
  transition: color var(--trans), background var(--trans); }
.nav a.navlink:hover, .nav a.navlink.active { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav .spacer { flex: 1; }
.search { display: flex; gap: var(--s2); }
.search input { min-width: 200px; }

/* Layout with sidebar */
.page { display: flex; gap: 22px; padding: 20px 0; }
.sidebar { width: 230px; flex: 0 0 230px; position: sticky; top: 72px; align-self: flex-start; }
.content { flex: 1; min-width: 0; }

/* Justified-ish photo grid: rows of cards sized by aspect ratio */
.grid { display: flex; flex-wrap: wrap; gap: 6px; }
.card { position: relative; height: 200px; flex-grow: 1; background: var(--surface-2);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); z-index: 1; }
.card img { height: 200px; width: 100%; object-fit: cover; display: block; }
.card .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 12px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); opacity: 0; transition: opacity .15s; }
.card:hover .cap { opacity: 1; }
.grid::after { content: ""; flex-grow: 999999; }

/* Facets */
.facet { margin-bottom: 16px; }
.facet h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facet select, .facet input,
.search input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px;
  font: inherit; transition: border-color var(--trans), box-shadow var(--trans);
}
.facet select:hover, .search input:hover { border-color: #3a3a45; }
.facet select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235a92e0' stroke-width='1.8' stroke-linecap='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.facet select option { background: var(--surface-2); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 3px 10px; font-size: 12px; }

/* Detail */
.detail { display: flex; gap: 20px; padding: 18px 0; }
.detail .photo { flex: 1; min-width: 0; background: #000; border-radius: var(--radius); overflow: hidden; }
.detail .photo img { width: 100%; height: auto; display: block; max-height: 82vh; object-fit: contain; }
.detail .panel { width: 320px; flex: 0 0 320px; }
.detail h1 { font-size: 18px; margin: 0 0 2px; }
.detail .when { color: var(--muted); margin-bottom: 14px; }
.blk { margin-bottom: 12px; } .blk h4 { margin: 0 0 3px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.exif { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 18px 0; }
@media (max-width: 800px) { .page { flex-direction: column; } .sidebar { width: auto; } .detail { flex-direction: column; } .detail .panel { width: auto; } }

/* Hero (home) */
.hero { position: relative; height: 62vh; min-height: 360px; overflow: hidden; background: #000; }
.hero .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.hero .slide.on { opacity: 1; }
.hero .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .scrim { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.45), transparent 30%, transparent 60%, rgba(0,0,0,.75)); z-index: 1; }
.hero .hcap { position: absolute; left: 28px; bottom: 34px; z-index: 2; text-shadow: 0 2px 14px rgba(0,0,0,.8); }
.hero .hcap .t { font-size: 30px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.hero .hcap .s { font-size: 12px; letter-spacing: .18em; color: #dfe2ea; margin-top: 6px; text-transform: uppercase; }
.hero .dots { position: absolute; right: 26px; bottom: 30px; z-index: 2; display: flex; gap: 7px; }
.hero .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: width var(--trans), background var(--trans); }
.hero .dots i.on { background: #fff; width: 18px; border-radius: 4px; }
/* Stats strip + latest */
.stats { display: flex; gap: 28px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.stats .stat b { display: block; font-size: 20px; color: var(--text); }
.stats .stat span { font-size: 13px; color: var(--muted); }
.home-sec { padding: 20px 0; }
.home-sec .head { display: flex; align-items: baseline; margin-bottom: 12px; }
.home-sec .head h2 { margin: 0; font-size: 16px; }
.home-sec .head a { margin-left: auto; font-size: 13px; }
@media (max-width: 800px) { .hero .hcap .t { font-size: 22px; } }

/* Tom Select (dark theme to match the app) */
.ts-wrapper { font: inherit; }
/* .ts-wrapper-scoped selectors outrank Tom Select's own .full/.input-active .ts-control { background:#fff }.
   Use background-color (not the shorthand) so the caret/decorations aren't wiped. */
.ts-wrapper .ts-control { background-color: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 7px 10px; box-shadow: none; min-height: 0; }
.ts-wrapper.full .ts-control { background-color: var(--surface-2); }
.ts-wrapper.single.input-active .ts-control { background-color: var(--surface-2); } /* stay dark while open */
.ts-wrapper .ts-control:hover { border-color: #3a3a45; }
.ts-wrapper.focus .ts-control { border-color: var(--accent); box-shadow: var(--ring); }
.ts-wrapper .ts-control, .ts-wrapper .ts-control input, .ts-wrapper .ts-control .item { color: var(--text); }
.ts-wrapper .ts-control input::placeholder { color: var(--muted); }
/* Caret: Tom Select hides the native <select> that carried our chevron, so draw one.
   ::after is independent of background, so it survives the open (input-active) state. */
.ts-wrapper.single { --ts-pr-caret: 22px; }
.ts-wrapper.single .ts-control::after { content: ""; position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); width: 0; height: 0; pointer-events: none;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--accent-text); }
.ts-dropdown { background-color: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); margin-top: 4px; }
.ts-dropdown .option { color: var(--text); }
.ts-dropdown .option:hover, .ts-dropdown .active { background: var(--accent); color: var(--accent-ink); }
.ts-dropdown .no-results { color: var(--muted); }

/* Active-filter chips */
.chip-remove { display: inline-flex; align-items: center; gap: 6px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); transition: border-color var(--trans), background var(--trans); }
.chip-remove:hover { border-color: var(--accent); text-decoration: none; }
.chip-remove .x { color: var(--muted); font-weight: 700; }
.chip-remove:hover .x { color: var(--accent-text); }
.chip-clear { color: var(--accent-text); background: transparent; border: 1px dashed var(--border); }
.chip-clear:hover { text-decoration: none; border-color: var(--accent); }

/* Filter sidebar actions (Apply + Clear in one row) */
.filter-actions { display: flex; gap: var(--s2); margin-top: 12px; }
.filter-actions .btn { flex: 1; text-align: center; }

/* Detail prev/next */
.detail-nav { display: flex; gap: var(--s2); margin-bottom: 14px; }
.detail-nav .btn { flex: 1; text-align: center; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.92); }
.lightbox.open { display: flex; }
.lightbox .lb-img { max-width: 94vw; max-height: 92vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lb-btn { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; cursor: pointer;
  font-size: 28px; line-height: 1; width: 48px; height: 48px; border-radius: 50%; transition: background var(--trans); }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) { .lb-btn { transition: none; } }

/* Detail polish */
.detail .photo img { cursor: zoom-in; }
.detail-share { margin-bottom: 14px; }

/* Detail spec table */
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 0 18px; margin: 8px 0 0; }
.specs dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 0; white-space: nowrap; }
.specs dd { margin: 0; padding: 9px 0; min-width: 0; }
.specs dt, .specs dd { border-top: 1px solid var(--border); }
.specs dt:first-of-type, .specs dd:first-of-type { border-top: 0; }
.specs dd > div { margin-bottom: 2px; }
.specs .exif { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }

/* Camera info (Flickr-style icon block) */
.camera-info { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.cam-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; text-align: center; }
.cam-head > svg { width: 40px; height: 34px; color: var(--muted); flex: none; }
.cam-model { color: var(--accent-text); font-weight: 600; line-height: 1.25; }
.cam-lens { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cam-grid { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 14px 28px; }
.cam-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cam-item > svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.cam-item > span { font-size: 14px; }
.iso-badge { width: 22px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--muted); border-radius: 3px; color: var(--muted); font-size: 8px; font-weight: 700; }

/* Detail info cards */
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.panel-card > h3 { margin: -14px -18px 14px; padding: 9px 18px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; }
.detail .panel h1 { margin-bottom: 14px; text-align: center; }

/* Scenic gallery (justified) */
.gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery .gtile { position: relative; height: 240px; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: zoom-in; transition: transform var(--trans), box-shadow var(--trans); }
.gallery .gtile:hover { transform: translateY(-2px); box-shadow: var(--shadow); z-index: 1; }
.gallery .gtile img { height: 100%; width: 100%; object-fit: cover; display: block; }
.gallery::after { content: ""; flex-grow: 999999999; }

/* Contact form */
.contact-wrap { max-width: 560px; padding: 40px 18px; }
.contact-wrap h1 { margin: 0 0 6px; }
.contact-wrap .lead { color: var(--muted); margin: 0 0 20px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.contact-form .field { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.contact-form input:hover, .contact-form textarea:hover { border-color: #3a3a45; }
.contact-form textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.contact-form .cf-turnstile { min-height: 65px; }
.contact-form .contact-submit { width: 100%; padding: 11px 16px; margin-top: 2px; }
.contact-form .validation-message { color: #ef6f80; font-size: 12px; }
.contact-error {
  color: #ef6f80; background: rgba(239,111,128,.09); border: 1px solid rgba(239,111,128,.35);
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; font-size: 13px;
}
.contact-form .hp { position: absolute; left: -9999px; }
.contact-done { text-align: center; margin-top: 20px; }
.contact-done p { margin: 0; }
