/* ══════════════════════════════════════════════════════════════════════════
   Organic — the gallery's design system.

   The conceit: your photos are physical prints. Every tile is a sheet of
   paper with a torn edge, hung slightly crooked, that straightens and lifts
   when you reach for it. Warm cream ground, terracotta accent, sage foil.

   Self-hosted everything: the CSP is `default-src 'self'`, so no CDN fonts
   and no remote anything.
   ══════════════════════════════════════════════════════════════════════ */

/* — Fonts, latin + latin-ext. latin-ext is NOT optional here: the library is
     full of Croatian names (Sjećate li se ovog dana, lonček.mp4) and
     č/ć/ž/đ/š live in that range. Separate faces with unicode-range mean a
     visitor only downloads the block they actually render. — */
@font-face {
  font-family: 'Caprasimo'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/caprasimo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caprasimo'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/caprasimo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('fonts/figtree-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('fonts/figtree-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:       #f5ead8;
  --surface:  #ebddc5;
  --ink:      #201e1d;
  --accent:   #c67139;
  --accent-2: #7a8a5e;
  --divider:  color-mix(in srgb, #201e1d 16%, transparent);

  /* Tonal ramps generated on one shared lightness scale, so the same step of
     any role matches the others in visual value. */
  --n-100: #f9f4ed; --n-200: #eee7db; --n-300: #dcd3c4;
  --n-400: #c0b6a5; --n-500: #a19786; --n-600: #82796a;
  --n-700: #645c50; --n-800: #474238; --n-900: #2e2b25;

  --a-100: #fff2eb; --a-200: #ffe1d0; --a-300: #ffc6a5;
  --a-400: #f6a06b; --a-500: #d67f48; --a-600: #b2622d;
  --a-700: #8c491a; --a-800: #643312; --a-900: #402310;

  --g-100: #f0fae1; --g-200: #e1eecc; --g-300: #ccdbb2;
  --g-400: #aebf92; --g-500: #8fa073; --g-600: #728157;
  --g-700: #56633f; --g-800: #3d472b; --g-900: #272e1b;

  --display: 'Caprasimo', Georgia, serif;
  --body:    'Figtree', system-ui, -apple-system, sans-serif;

  --r-sm: 8px; --r-md: 16px; --r-lg: 28px;

  --sh-sm: 0 1px 2px   color-mix(in srgb, #2e2b25 14%, transparent);
  --sh-md: 0 3px 10px  color-mix(in srgb, #2e2b25 16%, transparent);
  --sh-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

  --pad: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* The UA gives [hidden] a plain `display: none`, which any author rule with
   more specificity silently beats — the lightbox sets `display: block` on its
   img and video, so a hidden <video> rendered anyway. Enforce it once here
   rather than per-element. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display); font-weight: 400;
  line-height: 1.1; letter-spacing: -0.028em; margin: 0;
}
h1 { font-size: clamp(40px, 5vw, 62px); }
h2 { font-size: 30px; }
h3 { font-size: 22px; }

a { color: var(--a-700); text-decoration: none; }
a:hover { color: var(--a-600); }
img { display: block; max-width: 100%; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--a-200); }

.lede {
  font-size: 17px; line-height: 28px; margin: 14px 0 0; max-width: 48ch;
  color: color-mix(in srgb, var(--ink) 76%, transparent);
}

/* ── header ─────────────────────────────────────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--n-100) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
}
.brand {
  display: flex; align-items: center; gap: 12px; margin-right: auto;
  font-family: var(--display); font-size: 23px; line-height: 1;
  color: var(--ink); white-space: nowrap;
}
.brand::before {
  content: ''; width: 22px; height: 22px; flex: none;
  border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 5px var(--a-200);
}
.bar nav { display: flex; gap: 6px; }
.bar nav a {
  font-size: 15px; font-weight: 600; color: var(--ink);
  padding: 9px 18px; border-radius: 999px;
  transition: background 140ms ease, color 140ms ease;
}
.bar nav a:hover { background: var(--a-200); color: var(--ink); }
.bar nav a[aria-current='page'] { background: var(--accent); color: var(--n-100); }

.logout { display: flex; align-items: center; gap: 12px; margin: 0; }
.who {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border-radius: 999px;
  background: var(--a-100); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.who::before {
  content: attr(data-initial);
  width: 28px; height: 28px; border-radius: 999px; background: var(--a-300);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 14px; color: var(--a-900);
}
.logout button {
  border: 0; background: none; cursor: pointer;
  font-family: var(--display); font-size: 14px; color: var(--accent);
  padding: 8px 6px; border-radius: var(--r-md); white-space: nowrap;
}
.logout button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* On phones the top nav collapses into a floating tab bar at the bottom,
   where a thumb can actually reach it. */
.tabbar { display: none; }
@media (max-width: 760px) {
  .bar nav { display: none; }
  .bar { gap: 12px; padding: 12px 16px; }
  .who { padding: 5px 12px 5px 5px; font-size: 13px; }
  .who span { display: none; }
  .tabbar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50;
    display: flex; gap: 4px; padding: 7px; border-radius: 999px;
    background: color-mix(in srgb, var(--n-100) 94%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--sh-lg);
  }
  .tabbar a {
    flex: 1; text-align: center; font-size: 13px; font-weight: 700;
    padding: 12px 4px; border-radius: 999px; color: var(--ink);
  }
  .tabbar a[aria-current='page'] { background: var(--accent); color: var(--n-100); }
  body { padding-bottom: 84px; }
}

main { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero { position: relative; padding: 62px 0 8px; }
/* The sage disc behind every page title. Decorative; never hit-testable. */
.hero::before {
  content: ''; position: absolute; right: -40px; top: -70px;
  width: 300px; height: 300px; border-radius: 999px;
  background: var(--g-200); z-index: 0; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
@media (max-width: 760px) {
  .hero { padding-top: 44px; }
  .hero::before { width: 210px; height: 210px; right: -80px; top: -50px; }
}

/* ── stat bubbles ───────────────────────────────────────────────────────── */

.stats { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; padding: 40px 0 4px; }
.bubble {
  aspect-ratio: 1; border-radius: 999px; width: 136px; padding: 20px;
  display: grid; place-content: center; text-align: center;
  background: var(--a-200);
}
.bubble .n {
  display: block; font-family: var(--display); font-size: 30px;
  line-height: 1.1; color: var(--a-900); font-variant-numeric: tabular-nums;
}
.bubble .l {
  display: block; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; margin-top: 8px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}
/* Deliberately uneven sizes and drops, so the row reads as objects on a
   table rather than as a bar chart. */
.bubble:nth-child(1) { width: 170px; background: var(--accent); }
.bubble:nth-child(1) .n { font-size: 38px; color: var(--n-100); }
.bubble:nth-child(1) .l { color: color-mix(in srgb, #ffffff 82%, transparent); }
.bubble:nth-child(2) { background: var(--g-200); transform: translateY(14px); }
.bubble:nth-child(2) .n { color: var(--g-900); }
.bubble:nth-child(3) { background: var(--n-200); width: 124px; }
.bubble:nth-child(3) .n { color: var(--n-900); font-size: 26px; }
.bubble.warn { background: var(--a-100); width: 124px; transform: translateY(8px); }
.bubble.warn .n { font-size: 25px; }
.bubble.bad  { background: var(--n-300); width: 118px; }
.bubble.bad .n { font-size: 24px; }
@media (max-width: 560px) {
  .bubble, .bubble:nth-child(1), .bubble:nth-child(3), .bubble.warn, .bubble.bad {
    width: 104px; padding: 12px; transform: none;
  }
  .bubble .n, .bubble:nth-child(1) .n { font-size: 22px; }
  .bubble .l { font-size: 9.5px; margin-top: 5px; }
}

/* ── the print: a photograph as a sheet of paper ────────────────────────── */

.tile {
  --rot: 0deg;
  display: block; position: relative; width: 100%;
  padding: 10px 10px 30px;                /* wide bottom margin = a Polaroid */
  background: var(--n-100);
  border: 0; border-radius: 5px;
  cursor: pointer;
  transform: rotate(var(--rot));
  /* drop-shadow rather than box-shadow: a filter follows the torn clip-path,
     whereas box-shadow would be sliced off flat by it. */
  filter: drop-shadow(0 3px 8px color-mix(in srgb, #2e2b25 18%, transparent));
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), filter 240ms ease;
}
.tile:hover, .tile:focus-visible {
  transform: rotate(0deg) translateY(-9px) scale(1.02);
  filter: drop-shadow(0 14px 26px color-mix(in srgb, #2e2b25 26%, transparent));
  z-index: 2;
}
.tile img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 2px; background: var(--n-200);
}
/* The filename sits in that bottom margin, like a caption in pencil. */
.tile .cap {
  display: block; text-align: left; font-size: 12px; font-weight: 600;
  margin-top: 9px; padding: 0 1px;
  color: color-mix(in srgb, var(--ink) 58%, transparent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile .badge {
  position: absolute; right: 18px; top: 18px;
  font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--n-900) 72%, transparent); color: var(--n-100);
}
/* Why a search result matched. Top-LEFT, because top-right is the video
   badge and the bottom margin now carries the filename. */
.tile .why {
  position: absolute; left: 18px; top: 18px; max-width: calc(100% - 46px);
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: var(--a-200); color: var(--a-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Crookedness is assigned from the photo id, so a tile keeps its angle
   across re-renders instead of jittering on every repaint. */
.rot-0 { --rot: -2.3deg; }
.rot-1 { --rot: -1.15deg; }
.rot-2 { --rot: 0deg; }
.rot-3 { --rot: 1.15deg; }
.rot-4 { --rot: 2.3deg; }

/* Torn-paper outlines: four edges walked with sub-2% insets. Six baked
   variants rather than one polygon per photo — at this jitter they are
   indistinguishable, and 27k inline clip-paths would not be. */
.rip-0{clip-path:polygon(0.00% 0.33%, 11.11% 1.40%, 22.22% 0.58%, 33.33% 0.99%, 44.44% 0.38%, 55.56% 1.44%, 66.67% 0.65%, 77.78% 0.56%, 88.89% 0.72%, 100.00% 1.43%, 98.92% 11.11%, 99.46% 22.22%, 99.05% 33.33%, 98.95% 44.44%, 99.97% 55.56%, 98.65% 66.67%, 98.90% 77.78%, 98.70% 88.89%, 99.76% 100.00%, 88.89% 99.65%, 77.78% 99.52%, 66.67% 98.74%, 55.56% 99.06%, 44.44% 98.80%, 33.33% 99.48%, 22.22% 99.52%, 11.11% 98.91%, 0.00% 99.84%, 1.09% 88.89%, 0.76% 77.78%, 0.79% 66.67%, 0.42% 55.56%, 0.85% 44.44%, 0.04% 33.33%, 0.57% 22.22%, 0.47% 11.11%)}
.rip-1{clip-path:polygon(0.00% 0.10%, 11.11% 0.75%, 22.22% 1.33%, 33.33% 0.42%, 44.44% 1.04%, 55.56% 1.00%, 66.67% 0.70%, 77.78% 1.50%, 88.89% 0.54%, 100.00% 0.05%, 98.76% 11.11%, 99.43% 22.22%, 99.39% 33.33%, 99.10% 44.44%, 99.78% 55.56%, 100.00% 66.67%, 98.91% 77.78%, 99.88% 88.89%, 99.65% 100.00%, 88.89% 99.05%, 77.78% 99.10%, 66.67% 99.23%, 55.56% 98.91%, 44.44% 99.83%, 33.33% 99.60%, 22.22% 99.35%, 11.11% 99.94%, 0.00% 98.64%, 0.25% 88.89%, 1.19% 77.78%, 1.27% 66.67%, 0.51% 55.56%, 1.20% 44.44%, 0.77% 33.33%, 0.56% 22.22%, 0.71% 11.11%)}
.rip-2{clip-path:polygon(0.00% 1.38%, 11.11% 0.11%, 22.22% 0.59%, 33.33% 1.36%, 44.44% 0.21%, 55.56% 0.55%, 66.67% 0.75%, 77.78% 0.93%, 88.89% 0.35%, 100.00% 0.18%, 98.60% 11.11%, 99.41% 22.22%, 99.73% 33.33%, 99.25% 44.44%, 99.58% 55.56%, 99.84% 66.67%, 98.92% 77.78%, 99.55% 88.89%, 99.55% 100.00%, 88.89% 99.96%, 77.78% 98.69%, 66.67% 99.72%, 55.56% 98.75%, 44.44% 99.37%, 33.33% 99.72%, 22.22% 99.17%, 11.11% 99.47%, 0.00% 98.94%, 0.90% 88.89%, 0.13% 77.78%, 0.26% 66.67%, 0.60% 55.56%, 0.06% 44.44%, 1.50% 33.33%, 0.54% 22.22%, 0.95% 11.11%)}
.rip-3{clip-path:polygon(0.00% 1.16%, 11.11% 0.96%, 22.22% 1.35%, 33.33% 0.79%, 44.44% 0.87%, 55.56% 0.11%, 66.67% 0.80%, 77.78% 0.37%, 88.89% 0.16%, 100.00% 0.31%, 99.93% 11.11%, 99.38% 22.22%, 98.56% 33.33%, 99.41% 44.44%, 99.38% 55.56%, 99.69% 66.67%, 98.92% 77.78%, 99.22% 88.89%, 99.45% 100.00%, 88.89% 99.36%, 77.78% 99.77%, 66.67% 98.71%, 55.56% 98.59%, 44.44% 98.90%, 33.33% 99.84%, 22.22% 98.99%, 11.11% 99.00%, 0.00% 99.23%, 0.06% 88.89%, 0.56% 77.78%, 0.75% 66.67%, 0.69% 55.56%, 0.42% 44.44%, 0.73% 33.33%, 0.53% 22.22%, 1.18% 11.11%)}
.rip-4{clip-path:polygon(0.00% 0.93%, 11.11% 0.31%, 22.22% 0.61%, 33.33% 0.23%, 44.44% 0.04%, 55.56% 1.16%, 66.67% 0.86%, 77.78% 1.30%, 88.89% 1.47%, 100.00% 0.44%, 99.77% 11.11%, 99.36% 22.22%, 98.90% 33.33%, 99.56% 44.44%, 99.18% 55.56%, 99.54% 66.67%, 98.93% 77.78%, 98.89% 88.89%, 99.34% 100.00%, 88.89% 98.76%, 77.78% 99.35%, 66.67% 99.19%, 55.56% 99.93%, 44.44% 99.94%, 33.33% 99.96%, 22.22% 98.82%, 11.11% 98.53%, 0.00% 99.53%, 0.71% 88.89%, 1.00% 77.78%, 1.24% 66.67%, 0.78% 55.56%, 0.77% 44.44%, 1.46% 33.33%, 0.52% 22.22%, 1.42% 11.11%)}
.rip-5{clip-path:polygon(0.00% 0.71%, 11.11% 1.17%, 22.22% 1.36%, 33.33% 1.17%, 44.44% 0.70%, 55.56% 0.72%, 66.67% 0.91%, 77.78% 0.74%, 88.89% 1.28%, 100.00% 0.56%, 99.61% 11.11%, 99.33% 22.22%, 99.24% 33.33%, 99.71% 44.44%, 98.99% 55.56%, 99.38% 66.67%, 98.94% 77.78%, 98.56% 88.89%, 99.24% 100.00%, 88.89% 99.67%, 77.78% 98.93%, 66.67% 99.68%, 55.56% 99.78%, 44.44% 99.47%, 33.33% 98.58%, 22.22% 98.64%, 11.11% 99.56%, 0.00% 99.82%, 1.37% 88.89%, 1.43% 77.78%, 0.22% 66.67%, 0.87% 55.56%, 1.13% 44.44%, 0.69% 33.33%, 0.50% 22.22%, 0.16% 11.11%)}

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 30px 22px; padding-bottom: 8px;
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 14px; }
  .tile { padding: 7px 7px 22px; }
  .tile .badge { right: 13px; top: 13px; }
  /* The tear and the per-tile filter are the expensive parts. On a phone
     scrolling tens of thousands of tiles, smoothness beats paper texture. */
  .tile { clip-path: none !important; filter: none; box-shadow: var(--sh-md); }
  .tile:hover, .tile:focus-visible { filter: none; box-shadow: var(--sh-lg); }
}

/* ── clothesline (dashboard "Lately") ───────────────────────────────────── */

.line-wrap { position: relative; padding: 30px 0 8px; }
.line-wrap::before {
  content: ''; position: absolute; left: 0; right: 0; top: 16px;
  height: 3px; border-radius: 999px; background: var(--g-400);
}
.line {
  position: relative; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 18px;
}
.line .tile { transform-origin: 50% -8px; }
/* The peg holding each print to the line. */
.line .tile::before {
  content: ''; position: absolute; left: 50%; top: -13px;
  width: 12px; height: 22px; margin-left: -6px;
  border-radius: 4px; background: var(--a-600);
  box-shadow: var(--sh-sm); z-index: 2;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; margin-bottom: 2px;
}
.more { font-size: 15px; font-weight: 700; color: var(--a-700); white-space: nowrap; }

.dash {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px; align-items: start; padding: 44px 0 0;
}
@media (max-width: 960px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.side { display: grid; gap: 18px; }

/* ── cards ──────────────────────────────────────────────────────────────── */

.card {
  display: flex; flex-direction: column;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--n-100); box-shadow: var(--sh-sm);
}
.card-kicker {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0;
}
.card-title { font-family: var(--display); font-size: 19px; margin: 8px 0 0; }
.card p { margin: 0; }
.card .body { font-size: 13.5px; line-height: 21px; margin-top: 10px; opacity: .82; }

.meter { height: 12px; border-radius: 999px; background: var(--n-200); overflow: hidden; margin: 14px 0 10px; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

.rows { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.row .dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--accent); }
.row .dot.g { background: var(--g-500); }
.row .dot.n { background: var(--n-400); }
.row .t { flex: 1; }

.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 3px 10px; border-radius: 12px; }
.tag-g { background: var(--g-100); color: var(--g-800); }
.tag-o { border: 1px solid var(--accent); color: var(--accent); }
.tag-n { background: var(--n-200); color: var(--n-800); }

/* ── search + filters ───────────────────────────────────────────────────── */

.searchbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 26px 0 14px;
}
.searchwrap { flex: 1; min-width: 220px; max-width: 460px; }
input[type=search] {
  width: 100%; min-height: 44px; padding: 8px 18px;
  font: inherit; font-size: 15px; color: var(--ink); caret-color: var(--accent);
  background: var(--n-100);
  border: 1px solid var(--divider); border-radius: 999px;
  -webkit-appearance: none; appearance: none;
}
input[type=search]::placeholder { color: color-mix(in srgb, var(--ink) 45%, transparent); }
input[type=search]:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
input[type=search]:focus-visible { border-color: var(--accent); outline-offset: 0; }

#q-clear {
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 14px; font-weight: 700; color: var(--a-700);
  padding: 9px 12px; border-radius: var(--r-md);
}
#q-clear:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.searchnote { font-size: 13px; margin: 0 0 12px; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.suggests {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 18px; font-size: 13px;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}
.suggests button {
  border: 1px solid var(--divider); background: var(--n-100); cursor: pointer;
  font: inherit; font-size: 13px; padding: 5px 14px; border-radius: 999px; color: var(--ink);
  transition: background 140ms ease, border-color 140ms ease;
}
.suggests button:hover { background: var(--a-100); border-color: var(--a-300); }

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips:not(:empty) {
  padding: 4px; background: var(--n-200); border-radius: 999px;
  width: fit-content; max-width: 100%;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; cursor: pointer; font: inherit;
  font-size: 14px; font-weight: 600; padding: 8px 16px;
  border-radius: 999px; white-space: nowrap;
  background: transparent; color: var(--ink);
  transition: background 140ms ease, color 140ms ease;
}
.chip:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.chip[aria-pressed='true'] { background: var(--accent); color: var(--n-100); }
.chip .n { font-size: 11px; font-weight: 700; opacity: .62; font-variant-numeric: tabular-nums; }
.chips.months .chip { font-size: 13px; padding: 7px 13px; }

.status {
  font-size: 13.5px; padding: 24px 0 40px; text-align: center;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}
.empty { color: color-mix(in srgb, var(--ink) 60%, transparent); }

/* ── lightbox ───────────────────────────────────────────────────────────── */

dialog#lightbox {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  max-width: min(1040px, 94vw); max-height: 94vh; overflow: visible;
}
dialog#lightbox::backdrop {
  background: color-mix(in srgb, #2e2b25 62%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
/* The opened photo is a print too, just a much larger one. */
.sheet {
  background: var(--n-100); border-radius: 5px;
  padding: 14px 14px 16px; box-shadow: var(--sh-lg);
}
dialog#lightbox img, dialog#lightbox video {
  display: block; max-width: 100%; max-height: 72vh;
  width: auto; margin: 0 auto; background: var(--n-200); border-radius: 2px;
}
.lb-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 2px 0; font-size: 13.5px; }
#lb-name { font-weight: 700; word-break: break-word; }
.lb-note { color: var(--a-700); flex: 1; }
#lb-dl {
  font-family: var(--display); font-size: 14px;
  background: var(--accent); color: var(--n-100);
  padding: 9px 18px; border-radius: var(--r-md); white-space: nowrap;
}
#lb-dl:hover { background: var(--a-600); color: var(--n-100); }
#lb-close {
  position: absolute; right: -8px; top: -48px;
  width: 38px; height: 38px; border: 0; border-radius: 999px;
  background: var(--n-100); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--sh-md);
}
#lb-close:hover { background: var(--a-200); }

/* ── map ────────────────────────────────────────────────────────────────── */

#map {
  height: min(70vh, 620px); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-sm); background: var(--g-100); margin-top: 26px;
}
.leaflet-container { font-family: var(--body) !important; background: var(--g-100) !important; }
.leaflet-popup-content-wrapper {
  border-radius: var(--r-md) !important; background: var(--n-100) !important;
  box-shadow: var(--sh-lg) !important;
}
.leaflet-popup-content { margin: 8px !important; }
.leaflet-popup-tip { background: var(--n-100) !important; }
.marker-cluster div { font-family: var(--display) !important; }

/* ── upload ─────────────────────────────────────────────────────────────── */

.drop {
  border-radius: var(--r-lg); border: 2px dashed var(--a-300);
  background: var(--a-100); padding: 46px 34px; text-align: center;
}
.drop .arrow {
  display: inline-grid; place-items: center; width: 76px; height: 76px;
  border-radius: 999px; background: var(--a-200);
  font-family: var(--display); font-size: 30px; color: var(--a-800);
}
.drop h2 { margin: 18px 0 8px; }
.drop .hint {
  font-size: 15px; line-height: 25px; margin: 0 auto; max-width: 42ch;
  color: color-mix(in srgb, var(--ink) 74%, transparent);
}
.drop input[type=file] { display: block; margin: 22px auto 0; max-width: 100%; font: inherit; font-size: 14px; }
.drop input[type=file]::file-selector-button {
  font-family: var(--display); font-size: 14px; cursor: pointer;
  background: var(--a-200); color: var(--a-900);
  border: 0; border-radius: var(--r-md); padding: 9px 18px; margin-right: 12px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font-family: var(--display); font-size: 15px;
  background: var(--accent); color: var(--n-100);
  padding: 12px 24px; border-radius: var(--r-md);
  transition: background 140ms ease;
}
.btn:hover { background: var(--a-600); color: var(--n-100); }
.where { border-radius: var(--r-lg); background: var(--g-100); padding: 26px 30px; margin-top: 22px; }
.where h3 { margin: 0 0 14px; }
.where .tags { display: flex; flex-wrap: wrap; gap: 10px; }

.ok    { color: var(--g-800); font-weight: 600; }
.error { color: #8c2f1a; font-weight: 600; }
.result { margin-bottom: 22px; }
.result ul { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; }

/* ── login ──────────────────────────────────────────────────────────────── */

.login-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 100vh; align-items: center; gap: 40px;
  padding: clamp(28px, 6vw, 72px); max-width: 1240px; margin: 0 auto;
}
@media (max-width: 900px) {
  .login-main { grid-template-columns: minmax(0, 1fr); min-height: auto; padding-top: 40px; }
}
.login-pitch { position: relative; max-width: 460px; }
.login-pitch::before {
  content: ''; position: absolute; left: -140px; top: -160px;
  width: 300px; height: 300px; border-radius: 999px;
  background: var(--g-200); z-index: 0; pointer-events: none;
}
.login-pitch > * { position: relative; z-index: 1; }
.login-pitch .tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.login {
  background: var(--n-100); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: clamp(26px, 4vw, 40px); width: 100%; max-width: 420px; justify-self: end;
}
@media (max-width: 900px) { .login { justify-self: start; } }
.login h2 { font-size: 26px; }
.login .fine { font-size: 12.5px; line-height: 20px; margin: 20px 0 0; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.login form { display: flex; flex-direction: column; margin-top: 20px; }
.login label {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  margin: 14px 0 6px; color: color-mix(in srgb, var(--ink) 70%, transparent);
}
.login input {
  width: 100%; min-height: 44px; padding: 8px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); caret-color: var(--accent);
  border: 1px solid var(--divider); border-radius: var(--r-md);
}
.login input:focus-visible { border-color: var(--accent); outline-offset: 0; }
.login button[type=submit] {
  margin-top: 24px; width: 100%; border: 0; cursor: pointer;
  font-family: var(--display); font-size: 15px;
  background: var(--accent); color: var(--n-100);
  padding: 13px; border-radius: var(--r-md); transition: background 140ms ease;
}
.login button[type=submit]:hover { background: var(--a-600); }

/* ── motion ─────────────────────────────────────────────────────────────── */

/* Both keyframes resolve to rotate(var(--rot)) so a tile lands on its own
   assigned angle rather than snapping back to zero. */
@keyframes dropIn { from { opacity: 0; transform: translateY(-18px) rotate(-6deg); }
                    to   { opacity: 1; transform: rotate(var(--rot)); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px) rotate(var(--rot)); }
                    to   { opacity: 1; transform: rotate(var(--rot)); } }

.grid .tile { animation: fadeUp 520ms cubic-bezier(.2,.8,.2,1) both; }
.line .tile { animation: dropIn 620ms cubic-bezier(.2,.8,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
  .tile { transform: rotate(var(--rot)); }
}
