:root {
  /* Dark, worn-paper look taken from the CaliKlutch logo */
  --bg: #262521;
  --card: rgba(20, 19, 17, .55);
  --field: rgba(14, 13, 12, .6);
  --ink: #ece6da;
  --muted: #a39d92;
  --accent: #f3ecdf;
  --line: rgba(236, 230, 218, .14);
  --sale: #c8102e;
  --sale-ink: #ff5a6a;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg) url("texture.jpg") repeat;
  background-size: 512px 512px;
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.site-header { text-align: center; padding: 48px 20px 28px; }
.site-header:has(.logo) { padding: 16px 20px 12px; }
.brand { font: 600 clamp(28px, 5vw, 42px)/1.1 Georgia, "Times New Roman", serif; letter-spacing: .02em; }
/* The logo's own background fades out at the edges into the page texture */
.logo {
  display: block; margin: 0 auto; width: min(420px, 82vw); height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.compact .logo { width: min(240px, 56vw); }
.tagline { margin: 8px 0 0; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.contact { margin: 14px 0 0; color: var(--accent); font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); border-color: rgba(236, 230, 218, .3); }
.thumb { position: relative; aspect-ratio: 1; background: #1a1917; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 99px; }
.sale-badge, .sale-tag {
  background: var(--sale); color: #fff; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 99px; line-height: 1;
}
.sale-badge { position: absolute; top: 10px; left: 10px; font-size: 12px; padding: 6px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.sale-tag { display: inline-block; vertical-align: middle; font-size: 13px; padding: 6px 10px; margin-right: 6px; }
.price .was { color: var(--muted); font-weight: 500; margin-right: 4px; text-decoration-thickness: 2px; }
.price .now { color: var(--sale-ink); }
.info { padding: 14px 16px 18px; }
.info h2 { margin: 0; font: 600 18px/1.3 Georgia, serif; }
.type { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.price { margin: 8px 0 0; color: var(--accent); font-weight: 700; font-size: 18px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.back { display: inline-block; margin-bottom: 18px; color: var(--muted); }
.back:hover { color: var(--ink); }
.item {
  display: grid; gap: 22px 36px; align-items: start;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  grid-template-areas: "hero details" "photos details";
}
.item.no-video { grid-template-areas: "photos details"; }
.hero { grid-area: hero; position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.hero video { display: block; width: 100%; max-height: 82vh; object-fit: contain; background: #000; }
.sound {
  position: absolute; top: 12px; right: 12px;
  border: 0; border-radius: 99px; padding: 8px 14px; cursor: pointer;
  font: 600 14px/1 inherit; color: #fff; background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
}
.details { grid-area: details; position: sticky; top: 20px; }
.photos { grid-area: photos; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.photo { display: block; border-radius: var(--radius); overflow: hidden; background: #1a1917; cursor: zoom-in; }
.photo img { width: 100%; height: auto; display: block; }
.photos .photo:only-child { grid-column: 1 / -1; }

.lightbox { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(0,0,0,.94); }
.lightbox::backdrop { background: rgba(0,0,0,.94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; border-radius: 99px; width: 48px; height: 48px; font-size: 30px; line-height: 1; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.details h1 { margin: 0; font: 600 clamp(26px, 4vw, 36px)/1.15 Georgia, serif; }
.details .type { font-size: 16px; margin-top: 8px; }
.details .price { font-size: 28px; margin-top: 16px; }
.order { margin-top: 28px; padding: 14px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px 40px; }

@media (max-width: 760px) {
  .item, .item.no-video { grid-template-columns: 1fr; gap: 18px; grid-template-areas: "hero" "details" "photos"; }
  .item.no-video { grid-template-areas: "details" "photos"; }
  .details { position: static; }
  .hero { margin: 0 -20px; border-radius: 0; }
  .photos { grid-template-columns: 1fr; margin: 0 -20px; gap: 6px; }
  .photo { border-radius: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .info { padding: 10px 12px 14px; }
  .info h2 { font-size: 15px; }
  .price { font-size: 16px; }
}

/* Search, filter and sort bar */
.controls {
  position: sticky; top: 0; z-index: 5;
  display: grid; gap: 10px;
  grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(140px, 1fr));
  padding: 12px; margin: 0 -12px 6px;
  background: rgba(30, 29, 26, .88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.controls input, .controls select {
  width: 100%; height: 44px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
}
.controls select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a39d92' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.controls input::placeholder { color: var(--muted); }
.controls input:focus, .controls select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.result-bar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 16px; color: var(--muted); font-size: 14px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }

@media (max-width: 760px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .controls input[type="search"] { grid-column: 1 / -1; }
}

/* Access code screen (site.pin in config.yaml) */
html.locked body > :not(.gate) { display: none !important; }
html.locked body { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  display: grid; place-items: center; padding: 24px;
  background: var(--bg) url("texture.jpg") repeat; background-size: 512px 512px;
  transition: opacity .35s ease;
}
.gate.opening { opacity: 0; }
.gate-box { width: min(380px, 100%); text-align: center; }
.gate .logo { width: min(300px, 70vw); margin-bottom: 8px; }
.gate .brand { margin: 0 0 12px; }
.gate h1 { margin: 6px 0 4px; font: 600 26px/1.2 Georgia, "Times New Roman", serif; letter-spacing: .04em; }
.gate-sub { margin: 0 0 22px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }
.pin { position: relative; display: block; width: max-content; margin: 0 auto; cursor: text; }
.pin-boxes { display: flex; gap: 12px; }
.pin-boxes span {
  width: 58px; height: 68px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--line);
  display: grid; place-items: center; transition: border-color .15s, transform .15s;
}
.pin-boxes span.filled::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.pin:focus-within .pin-boxes span.active { border-color: var(--accent); }
.pin:focus-within .pin-boxes span.active { transform: translateY(-2px); }
/* The real input sits invisibly on top of the boxes, so the phone keypad opens on tap */
.pin input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; font-size: 16px; color: transparent; background: transparent; caret-color: transparent;
}
.gate.blocked .pin { opacity: .35; cursor: not-allowed; }
.gate-error { white-space: pre-line; min-height: 1.5em; margin: 16px 0 0; color: var(--sale-ink); font-weight: 600; }
.shake { animation: shake .4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}
@media (max-width: 400px) { .pin-boxes span { width: 52px; height: 62px; } .pin-boxes { gap: 10px; } }
