/* The photographer's gallery site. Photos first: white space, a quiet serif,
   nothing competing with the pictures. System fonts only - the page's security
   policy loads nothing from other sites. */
:root {
  --bg: #ffffff; --soft: #f6f5f3; --line: #e6e3de; --text: #1f2226; --muted: #737880;
  --ink: #1f2226; --on-ink: #fff; --accent: #b4553a; --ok: #2f7a3b; --bad: #b3261e; --warn: #9a5b12;
  --ok-bg: #e5f1e6; --bad-bg: #fbe6e3; --warn-bg: #fbf0dc;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 28px rgba(0,0,0,.08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 500; letter-spacing: .2px; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.1; margin: 0 0 10px; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0 0 8px; }
a { color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.msg { min-height: 1.3em; margin: 8px 0 0; font-size: 14px; } .msg.bad { color: var(--bad); } .msg.ok { color: var(--ok); }

.btn { font: inherit; font-weight: 600; font-size: 14.5px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: #3a3f46; }
.btn.danger { color: var(--bad); } .btn.danger:hover { border-color: var(--bad); }
.btn.small-btn { padding: 6px 13px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
label { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: normal; }
label.check input { width: auto; margin: 0; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: normal; padding: 10px 12px;
  border-radius: 9px; border: 1.5px solid var(--line); background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* top bar */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20; }
.brand { font-size: 21px; text-decoration: none; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button.navb { font: inherit; font-size: 14.5px; background: none; border: 0; color: var(--text); padding: 7px 11px;
  border-radius: 8px; cursor: pointer; text-decoration: none; }
.nav a:hover, .nav button.navb:hover, .nav .on { background: var(--soft); }

.page { max-width: 1240px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 64px; }
.narrow { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card + .card { margin-top: 16px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- admin ---------- */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 18px; }
.gal-card { display: block; text-decoration: none; color: inherit; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: #fff; cursor: pointer; transition: box-shadow .15s; }
.gal-card:hover { box-shadow: var(--shadow); }
.gal-card .cover { aspect-ratio: 3 / 2; background: var(--soft) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.gal-card .info { padding: 12px 14px; }
.gal-card .t { font-family: var(--serif); font-size: 18px; }
.editor { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.editor aside .card { padding: 16px; }
.share { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; word-break: break-all; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { font: inherit; font-size: 14.5px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px;
  cursor: pointer; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--ink); font-weight: 600; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--ink); background: var(--soft); color: var(--text); }
.progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.ph { position: relative; aspect-ratio: 1; background: var(--soft) center / cover no-repeat; border-radius: 6px; overflow: hidden;
  cursor: pointer; outline: 3px solid transparent; outline-offset: -3px; }
.ph.sel { outline-color: var(--accent); }
.ph .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11.5px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph .state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; padding: 6px; }
.ph .tick { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(0,0,0,.25); }
.ph.sel .tick { background: var(--accent); }
.ph .star { position: absolute; top: 5px; right: 7px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.selbar { position: sticky; top: 64px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.sets-list { list-style: none; margin: 0; padding: 0; }
.sets-list li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sets-list li:last-child { border-bottom: 0; }
.sets-list .iconb { font: inherit; background: none; border: 0; cursor: pointer; padding: 2px 6px; color: var(--muted); border-radius: 6px; }
.sets-list .iconb:hover { background: var(--soft); color: var(--text); }
.fav-list { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.fav-list textarea { font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; }
table.act { width: 100%; border-collapse: collapse; font-size: 14px; }
table.act td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }

/* ---------- the client's gallery ---------- */
.g-cover { position: relative; height: 100vh; height: 100svh; min-height: 420px; background: #222 center / cover no-repeat;
  display: flex; align-items: flex-end; color: #fff; }
.g-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.55)); }
.g-cover .in { position: relative; z-index: 1; padding: 0 clamp(20px, 6vw, 80px) clamp(40px, 10vh, 90px); max-width: 900px; }
.g-cover .studio { letter-spacing: 3px; text-transform: uppercase; font-size: 12.5px; opacity: .9; }
.g-cover h1 { color: #fff; margin: 8px 0 6px; }
.g-cover .btn { margin-top: 18px; background: transparent; color: #fff; border-color: rgba(255,255,255,.8); }
.g-cover .btn:hover { background: rgba(255,255,255,.15); }
.g-bar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 10px clamp(16px, 3vw, 32px); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.g-bar .t { font-family: var(--serif); font-size: 19px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-sets { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.g-sets button { font: inherit; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; background: none; border: 0;
  padding: 6px 10px; cursor: pointer; color: var(--muted); }
.g-sets button.on { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }
.g-grid { padding: 8px clamp(8px, 2vw, 24px) 60px; columns: 4 260px; column-gap: 8px; }
.g-item { position: relative; break-inside: avoid; margin-bottom: 8px; cursor: zoom-in; background: var(--soft); overflow: hidden; }
.g-item img { display: block; width: 100%; height: auto; }
.g-item .acts { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.g-item:hover .acts, .g-item .acts.keep { opacity: 1; }
.iconbtn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; font-size: 16px;
  display: grid; place-items: center; color: var(--text); text-decoration: none; }
.iconbtn.on { color: var(--accent); }
.g-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.lb { position: fixed; inset: 0; z-index: 50; background: #0c0c0c; display: flex; flex-direction: column; }
.lb .lb-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #ddd; font-size: 13.5px; gap: 10px; }
.lb .lb-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; touch-action: pan-y; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb .nav-b { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #fff; font-size: 40px;
  padding: 20px 14px; cursor: pointer; opacity: .7; }
.lb .nav-b:hover { opacity: 1; } .lb .prev { left: 0; } .lb .next { right: 0; }
.lb .iconbtn { background: rgba(255,255,255,.12); color: #fff; }
.lb .iconbtn.on { color: #ff8a6b; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.modal .card { width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; border-top: 1px solid var(--line); }
@media (max-width: 600px) { .g-grid { columns: 2 140px; column-gap: 4px; } .g-item { margin-bottom: 4px; }
  .g-item .acts { opacity: 1; } .lb .nav-b { display: none; } }

/* the store: choosing and cropping a print */
.buy-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 12px; }
.stage { position: relative; user-select: none; touch-action: none; background: var(--soft); line-height: 0; }
.stage img { width: 100%; height: auto; display: block; }
.rect { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); cursor: move; }
.rect .guide { position: absolute; border: 1px dashed rgba(255,255,255,.8); pointer-events: none; display: none; }
.rect .h { position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; border: 2px solid var(--ink); }
.rect .h[data-h="nw"] { left: -10px; top: -10px; cursor: nwse-resize; } .rect .h[data-h="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.rect .h[data-h="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; } .rect .h[data-h="se"] { right: -10px; bottom: -10px; cursor: nwse-resize; }
.stage { overflow: hidden; }
.choice { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 14px;
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; margin-top: 6px; }
.choice.sel { border-color: var(--ink); background: var(--soft); }
.choice-h { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 12px 0 0; }
.chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.chip.sel { border-color: var(--ink); background: var(--soft); }
.bl { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bl img { width: 54px; height: 54px; object-fit: cover; border-radius: 4px; }
@media (max-width: 700px) { .buy-grid { grid-template-columns: 1fr; } }
