/* Look taken from the owner's reference (500px "Fresh"): white page, near-black text,
   masonry of square-cornered photos with wide gaps, pill-shaped navigation, black pill buttons. */
:root {
  --bg: #ffffff;
  --panel: #f4f4f4;
  --line: #e4e4e4;
  --text: #131313;
  --muted: #6c6c6c;
  --ink: #131313;       /* buttons */
  --ok: #1f7a3d;
  --bad: #b3261e;
  --gap: 24px;
  --pad: clamp(16px, 2vw, 24px);
  --top: 64px;
  font-family: "Manrope Variable", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.55; font-weight: 500; }
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
a { color: inherit; }
h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 16px; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 40px 0 14px; }
p { margin: 0 0 16px; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--muted); }
.lead { max-width: 66ch; color: var(--muted); }
.lead a { color: var(--text); font-weight: 700; }

/* Header: logo, pill navigation, language */
.top { height: var(--top); display: flex; align-items: center; gap: 20px; padding: 0 var(--pad); position: sticky; top: 0; z-index: 5; background: var(--bg); }
.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 22px; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; padding: 8px 16px; border-radius: 10px; transition: background 0.2s; }
.nav a:hover, .nav a[aria-current] { background: var(--panel); }
.lang { position: relative; font-size: 14px; font-weight: 600; }
.lang summary { cursor: pointer; list-style: none; padding: 8px 14px; border-radius: 10px; background: var(--panel); }
.lang summary::-webkit-details-marker { display: none; }
.lang div { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; min-width: 150px; box-shadow: 0 12px 32px rgba(19, 19, 19, 0.12); }
.lang a { text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.lang a:hover, .lang a[aria-current] { background: var(--panel); }

.foot { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; padding: 24px var(--pad) 28px; color: var(--muted); font-size: 13px; }

/* Home: four tiles and a wide strip fill the screen under the header */
.home .foot { display: none; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 0.5fr; gap: var(--gap); padding: 0 var(--pad) var(--pad); height: calc(100dvh - var(--top)); min-height: 620px; }
.tile { position: relative; overflow: hidden; background: var(--panel); text-decoration: none; display: flex; align-items: flex-end; color: #fff; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.66)); transition: opacity 0.3s; }
.tile-text { position: relative; z-index: 1; padding: clamp(16px, 2.4vw, 30px); display: grid; gap: 4px; }
.tile-text strong { font-size: clamp(22px, 2.8vw, 38px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.tile-text span { color: rgba(255, 255, 255, 0.86); font-size: clamp(13px, 1.2vw, 16px); max-width: 44ch; }
.t-lapse { grid-column: 1 / -1; }
.t-lapse::after { inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 60%); }

/* Inner pages */
.wrap { max-width: 1440px; margin: 0 auto; padding: 24px var(--pad) 72px; }
.wrap.narrow { max-width: 760px; }
.wrap.wide { max-width: 1680px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs i { font-style: normal; opacity: 0.5; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.head-row h1 { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); margin-top: 24px; }
.card { text-decoration: none; display: grid; gap: 12px; }
.card img, .card-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--panel); transition: opacity 0.25s; }
.card:hover img { opacity: 0.86; }
.card-text { display: grid; }
.card-text strong { font-weight: 700; font-size: 17px; }
.card-text span { color: var(--muted); font-size: 14px; }

/* Masonry of photos: columns of equal width, each photo at its own height */
.grid { columns: 4; column-gap: var(--gap); margin-top: 24px; }
.grid a { display: block; break-inside: avoid; margin-bottom: var(--gap); background: var(--panel); position: relative; overflow: hidden; }
.grid img { width: 100%; height: auto; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.grid a:hover img { transform: scale(1.03); }

.pager { display: flex; gap: 10px; align-items: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.pager a { color: var(--text); text-decoration: none; font-weight: 600; padding: 8px 16px; border-radius: 10px; background: var(--panel); transition: background 0.2s; }
.pager a:hover { background: var(--line); }

.shot { margin: 0; }
/* small photos are stretched to the same size as large ones, proportions kept (user, 2026-10-17) */
.shot img { height: calc(100dvh - 230px); width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; background: var(--panel); }
.shot figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 18px; }
.shot h1 { font-size: 24px; margin: 0; }
.shot .pager { margin: 0; }
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }

.strips { display: grid; gap: 36px; margin-top: 24px; }
.strip { text-decoration: none; display: grid; gap: 10px; }
.strip { margin: 0; }
.strip img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: var(--panel); transition: opacity 0.25s; } /* whole panorama, never cropped */
.strip figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.strip figcaption .score { margin-top: 0; }
.strip:hover img { opacity: 0.86; }
.strip strong { font-weight: 700; font-size: 17px; }

.viewer { position: relative; height: calc(100dvh - 260px); min-height: 340px; background: #131313; margin: 8px 0 12px; }
.viewer-tools { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; gap: 6px; }
.viewer-tools button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: #fff; color: var(--text); font: inherit; font-size: 18px; cursor: pointer; transition: transform 0.15s; }
.viewer-tools button:hover { background: var(--panel); }
.viewer-tools button:active { transform: scale(0.94); }

.video-cards img, .video-cards .card-empty { aspect-ratio: 16 / 9; }
.video { position: relative; aspect-ratio: 16 / 9; max-height: calc(100dvh - 240px); margin: 8px auto 12px; background: #131313; display: grid; place-items: center; overflow: hidden; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video .play { position: relative; display: flex; align-items: center; gap: 12px; font: inherit; font-weight: 700; font-size: 17px; color: var(--text); background: #fff; border: 0; border-radius: 999px; padding: 14px 28px 14px 22px; cursor: pointer; transition: transform 0.15s; }
.video .play:hover { transform: scale(1.04); }
.video .play:active { transform: scale(0.98); }
.video-soon { position: relative; margin: 0; padding: 10px 18px; background: #fff; border-radius: 999px; font-weight: 600; }

/* Buttons and forms */
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 15px; color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: 12px; padding: 10px 20px; cursor: pointer; text-decoration: none; transition: background 0.2s, transform 0.15s; }
.btn:hover { background: #333; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel); }
.form { display: grid; gap: 16px; margin-top: 20px; max-width: 620px; }
.form h2 { margin: 0; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form input:not([type="checkbox"]), .form textarea { font: inherit; font-weight: 500; color: var(--text); background: var(--panel); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; transition: border-color 0.2s, background 0.2s; }
.form input:focus, .form textarea:focus { outline: 0; border-color: var(--ink); background: #fff; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.form .check input { margin-top: 4px; accent-color: var(--ink); }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.note { padding: 12px 16px; border-radius: 12px; background: var(--panel); font-weight: 600; }
.note.ok { color: var(--ok); }
.note.bad { color: var(--bad); }
.preview { margin: 0 0 20px; display: flex; gap: 14px; align-items: center; color: var(--muted); }
.preview img { width: 140px; }

/* Arena */
.duel-status { font-weight: 700; margin: 24px 0 12px; min-height: 1.6em; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.duel button { border: 0; padding: 0; background: var(--panel); cursor: pointer; height: min(64vh, 720px); display: flex; align-items: center; justify-content: center; position: relative; transition: transform 0.2s; }
.duel img { width: 100%; height: 100%; object-fit: contain; } /* small photos stretched, proportions kept */
.duel button:hover::after, .duel button:focus-visible::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--ink); pointer-events: none; }
.duel button:active { transform: scale(0.99); }
.duel.busy { opacity: 0.5; pointer-events: none; }
#upload { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.top-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--gap); }
.top-list a { text-decoration: none; display: grid; gap: 10px; position: relative; }
.top-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--panel); transition: opacity 0.25s; }
.top-list a:hover img { opacity: 0.86; }
.rank { position: absolute; top: 10px; left: 10px; background: #fff; border-radius: 999px; min-width: 30px; text-align: center; padding: 3px 9px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.top-text { display: grid; }
.top-text strong { font-weight: 700; }
.top-text span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Forum and admin */
.topics { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.topics a { display: grid; gap: 2px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding 0.2s; }
.topics a:hover { padding-left: 8px; }
.topics strong { font-weight: 700; }
.topics span { color: var(--muted); font-size: 13px; }
.posts { display: grid; gap: 12px; margin: 20px 0 32px; }
.post { background: var(--panel); border-radius: 14px; padding: 16px 18px; }
.post header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 6px; font-size: 14px; }
.post time { color: var(--muted); font-variant-numeric: tabular-nums; }
.post p { margin: 0; overflow-wrap: anywhere; }
.moderation { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.moderation form { display: grid; gap: 6px; }
.table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 8px 20px 8px 0; border-bottom: 1px solid var(--line); }

@media (max-width: 1100px) {
  .grid { columns: 3; }
}

@media (max-width: 720px) {
  :root { --gap: 12px; }
  .top { gap: 10px; }
  .nav a { padding: 8px 12px; }
  /* Phone: one column in reading order 1, 2, 3, 4, 5 */
  .tiles { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 42vh; height: auto; min-height: 0; }
  .t-photos { order: 1; } .t-panos { order: 2; } .t-giga { order: 3; } .t-arena { order: 4; } .t-lapse { order: 5; }
  .home .foot { display: flex; }
  .grid { columns: 2; }
  .duel { grid-template-columns: 1fr; }
  .duel button { height: 36vh; }
  .viewer { height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile img, .grid img { transition: none; }
}

/* Scored two-column grid: a row is two vertical or two horizontal photos of equal height */
.pairs { display: grid; gap: 18px; }
.pair { display: flex; gap: 14px; align-items: flex-start; }
.cell { flex: var(--r) 1 0; min-width: 0; margin: 0; }
.pair.single .cell { flex: 0 0 calc(50% - 7px); }
.cell a { display: block; background: var(--panel); border-radius: 4px; overflow: hidden; }
.cell img { width: 100%; height: auto; transition: opacity 0.25s; }
.cell a:hover img { opacity: 0.88; }
.score { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.score-n { min-width: 3ch; text-align: center; font-weight: 700; font-size: 17px; }
.vote { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 18px; line-height: 1; cursor: pointer; color: inherit; }
.vote:hover:not(:disabled) { background: var(--panel); }
.vote:disabled { opacity: 0.35; cursor: default; }
.score[data-owner] .vote { border-color: currentColor; }
.more { justify-self: center; }
@media (max-width: 420px) { .pair { flex-direction: column; } .pair.single .cell { flex-basis: auto; width: 100%; } }

/* Photographs: 15 topics as a 5 x 3 matrix */
.cards.topics { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .cards.topics { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cards.topics { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

/* "buy it" next to the score, and the cart */
.buy-it { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.buy-it:hover { background: var(--panel); }
.buy-it.in { background: #131313; color: #fff; border-color: #131313; }
.cart-link { position: relative; display: inline-flex; align-items: center; padding: 8px; margin-left: auto; color: inherit; }
.cart-n:not(:empty) { position: absolute; top: 0; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #131313; color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.cart-items { display: grid; gap: 10px; margin: 18px 0; }
.cart-row { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 14px; align-items: center; }
.cart-total { text-align: right; font-weight: 700; font-size: 18px; margin: 6px 0 0; }
.cart-row img { width: 96px; height: 64px; object-fit: cover; background: var(--panel); }

/* titles under grid photos, owner's clean-up buttons */
.cell-title { margin: 8px 0 0; text-align: center; font-size: 15px; color: var(--muted); }
.cell .score { margin-top: 4px; }
.owner-tools { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.owner-tools button { font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px dashed #b33; background: transparent; color: #b33; cursor: pointer; }
.owner-tools button:hover { background: #fbeaea; }
.owner-tools button:disabled { opacity: 0.4; }

/* Buy software (2026-10-24): a button in the top line and the product page */
.soft-btn { white-space: nowrap; text-decoration: none; font-size: 14px; font-weight: 700; color: #fff; background: var(--ink); border-radius: 10px; padding: 8px 14px; }
.soft-btn:hover, .soft-btn[aria-current] { background: #333; }
.soft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); margin: 24px 0; }
.soft-card { background: var(--panel); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; }
.soft-card h2 { font-size: 19px; margin: 0 0 8px; }
.soft-card p { margin: 0 0 12px; line-height: 1.5; }
.soft-price { margin-top: auto !important; font-weight: 800; font-size: 18px; }
.soft-all { background: var(--ink); color: #fff; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 6px; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
@media (max-width: 720px) { .soft-btn { padding: 6px 10px; font-size: 13px; } }

.soft-claude { background: #fff6d6; border: 1px solid #e8d48a; border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; }

/* long site name (2026-10-24): two lines, so the menu keeps its room */
.top .brand { max-width: 170px; font-size: 16px; line-height: 1.15; white-space: normal; }
@media (max-width: 720px) { .top .brand { max-width: 120px; font-size: 14px; } }
