@font-face { font-family: 'Jost Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/jost-latin.woff2) format('woff2-variations');
  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 {
  /* Futura on Apple devices; Jost (a free Futura-style font, hosted with the site) everywhere else */
  --font: Futura, "Futura PT", "Jost Variable", "Century Gothic", "Trebuchet MS", system-ui, sans-serif;
  --bg: #17181a; --panel: #222427; --text: #f1f1ef; --muted: #a2a5aa; --accent: #6aa9ff; --line: #33363a;
  --row: 260px; --gap: 4px;
  --w-strong: 400; /* Futura has no true regular/bold pair on Macs, so keep everything at regular weight */
}
@media (max-width: 700px) { :root { --row: 170px; --gap: 3px; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.45 var(--font); }
input, button, textarea, select { font-family: inherit; }
h1, h2, h3, b, strong, th { font-weight: var(--w-strong); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* header */
header.top { position: sticky; top: 0; z-index: 5; background: rgba(23,24,26,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
header.top .brand { font-weight: var(--w-strong); font-size: 20px; margin-right: auto; }
header.top nav { display: flex; gap: 6px; }
header.top nav a, header.top .link { text-transform: uppercase; letter-spacing: .1em; font-size: 15px; padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: var(--w-strong); background: none; border: 0; }
header.top nav a.on { background: var(--panel); color: var(--text); }
main { padding: 18px max(16px, env(safe-area-inset-left)) 80px; max-width: 1800px; margin: 0 auto; }
h1 { font-size: 28px; margin: 6px 0 4px; }
.crumbs { color: var(--muted); font-size: 16px; margin-bottom: 6px; }
.crumbs a:hover { color: var(--text); }
.sub { color: var(--muted); margin: 0 0 18px; }
h2.sec { font-size: 20px; margin: 30px 0 12px; color: var(--muted); font-weight: var(--w-strong); }

/* tiles (collections / albums / years) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.tile { position: relative; display: block; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; background: var(--panel); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tile:hover img { transform: scale(1.04); }
.tile .cap { position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.tile .cap b { display: block; font-size: 19px; line-height: 1.2; }
.tile .cap span { font-size: 14px; color: #d0d0d0; }
.tile.empty { display: grid; place-items: center; color: var(--muted); }

/* justified photo grid */
.grid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.grid::after { content: ""; flex-grow: 1000000; }
.ph { position: relative; display: block; flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * var(--row)); background: var(--panel); overflow: hidden; cursor: zoom-in; }
.ph i { display: block; padding-bottom: calc(100% / var(--ar)); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* login + messages */
.center { max-width: 460px; margin: 12vh auto; padding: 0 20px; text-align: center; }
.center h1 { font-size: 32px; }
.center input[type=email] { width: 100%; padding: 16px; font-size: 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); margin: 18px 0 12px; }
.btn { display: inline-block; padding: 16px 28px; border-radius: 12px; border: 0; background: var(--accent); color: #0b1a30; font-weight: var(--w-strong); font-size: 20px; width: 100%; }
.btn.small { width: auto; padding: 8px 16px; font-size: 16px; }
.btn.ghost { background: var(--panel); color: var(--text); }
.btn.danger { background: #7a2a2a; color: #fff; }
.note { background: var(--panel); border-radius: 12px; padding: 16px; margin-top: 18px; color: var(--text); }
.err { color: #ff8a8a; margin-top: 12px; }

/* full-screen viewer: toolbar on top, photo fills the middle, caption below; nothing overlaps the photo */
#viewer { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; touch-action: pan-y pinch-zoom; }
#viewer[hidden] { display: none; }
.v-top { flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); }
.v-btn { background: rgba(255,255,255,.14); color: #fff; border: 0; padding: 10px 18px; border-radius: 999px; font-weight: var(--w-strong); font-size: 17px; }
#v-stage { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; container-type: size; }
#v-img { position: absolute; inset: 0; margin: auto; display: block; max-width: 100%; max-height: 100%; width: min(100cqw, calc(100cqh * var(--ar, 1.5))); height: auto; aspect-ratio: var(--ar, 1.5); object-fit: contain; user-select: none; -webkit-user-drag: none; }
#v-cap { flex: none; max-height: 30vh; overflow: auto; padding: 12px max(18px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom));
  color: #fff; font-size: 19px; line-height: 1.4; text-align: center; white-space: pre-wrap; }
#v-cap[hidden] { display: none; }
#v-cap textarea { width: min(640px, 100%); min-height: 84px; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid #666; background: #111; color: #fff; }
#v-cap .v-btn { margin: 8px 4px 0; }
.v-right { display: flex; gap: 8px; }
.v-nav { position: absolute; top: 64px; bottom: 0; width: 90px; z-index: 2; background: none; border: 0; color: #fff; font-size: 64px; opacity: .0; transition: opacity .2s; }
.v-prev { left: 0; } .v-next { right: 0; }
@media (hover: hover) { .v-nav:hover { opacity: .9; background: linear-gradient(90deg, rgba(0,0,0,.35), transparent); } .v-next:hover { background: linear-gradient(270deg, rgba(0,0,0,.35), transparent); } }
@media (hover: none) { .v-nav { display: none; } }


/* admin: select + tag */
.tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; min-height: 40px; }
.chk { color: var(--muted); font-size: 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chk input { width: 20px; height: 20px; }
body.selecting .ph { cursor: pointer; }
.ph.sel { outline: 4px solid var(--accent); outline-offset: -4px; }
.ph.sel::after { content: "\2713"; position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #0b1a30; font-weight: var(--w-strong); display: grid; place-items: center; }
.tgb { display: none; position: absolute; left: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #8fe0a0; font-size: 14px; place-items: center; }
body.selecting .tgb { display: grid; }
#selbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px max(16px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom));
  background: rgba(34,36,39,.97); border-top: 1px solid var(--line); }
#selbar #sb-n { margin-right: auto; font-weight: var(--w-strong); }
.btn:disabled { opacity: .4; cursor: default; }
#modal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.65); display: grid; place-items: center; padding: 16px; }
.mbox { background: var(--panel); border-radius: 16px; padding: 22px; width: min(520px, 100%); max-height: 92vh; overflow: auto; }
.mbox h2 { margin: 0 0 14px; font-size: 21px; }
.mbox label { display: block; color: var(--muted); font-size: 15px; margin: 12px 0; }
.mbox input { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.mbox .hint { color: var(--muted); font-size: 15px; min-height: 22px; margin: 6px 0 14px; }
.mrow { display: flex; gap: 10px; justify-content: flex-end; }
.chip { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 14px; margin: 0 6px 8px 0; font-size: 16px; }
.chip button { background: none; border: 0; color: var(--muted); font-size: 20px; padding: 0 8px; }

/* sign-in screens: full-bleed photo, portrait or landscape to match the window. Its height is the LARGE viewport (100lvh), so on phones the photo keeps one size whether the browser's toolbar is expanded or collapsed; the toolbar simply covers more or less of it. */
#bg { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; background: #1b1c1f url('bg-landscape.jpg') center / cover no-repeat; }
#bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.55)); }
body.login #bg { display: block; }
@media (orientation: portrait) { #bg { background-image: url('bg-portrait.jpg'); } }
body.login { background: #000; }
/* sign-in card: centred vertically as well as horizontally, in the area the browser is currently showing (dvh follows the phone toolbar) */
body.login { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; }
/* Phone browsers (iOS Safari) paint their top and bottom bars with the colour of fixed elements touching the screen edge, and the photo can't go behind them. These thin strips match the photo's edge colours (dark overlay included) so the bars blend into the picture. */
#edge-t, #edge-b { display: none; position: fixed; left: 0; right: 0; height: 8px; z-index: 5; pointer-events: none; }
body.login #edge-t, body.login #edge-b { display: block; }
#edge-t { top: 0; background: #766f6c; } #edge-b { bottom: 0; background: #2c2828; }
@media (orientation: portrait) { #edge-t { background: #5f7583; } #edge-b { background: #1b2328; } }
.center.glass { margin: 0 auto; padding: 32px 28px; position: relative; background: rgba(18,19,21,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 22px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.center.glass .sub { color: #e6e6e6; margin: .72em 0 .5em; }   /* equal space between the title above and the email box below, measured from the letters themselves */
.center.glass input[type=email] { background: rgba(255,255,255,.92); color: #111; border: 0; }
.center.glass .note { background: rgba(255,255,255,.14); }
/* wide windows: a slightly wider card so "Tap the link we emailed you to access our gallery." fits on one line; the card is the same width on every sign-in screen. Phones keep the narrower card. */
@media (min-width: 700px) { .center.glass { max-width: 520px; } }
/* phones held upright: a card about 12% narrower than full width, so it covers less of the photo */
@media (max-width: 699px) { .center.glass { width: calc((100% - 32px) * .88); } }

/* all-caps treatments */
.center.glass h1, header.top .brand { text-transform: uppercase; letter-spacing: .12em; }
#f .btn { text-transform: uppercase; letter-spacing: .12em; }

.caps { text-transform: uppercase; letter-spacing: .12em; }

h1 + .tiles { margin-top: 20px; }

.v-btn:disabled { opacity: .7; cursor: default; }
@media (max-width: 600px) { .v-top { flex-wrap: wrap; gap: 8px; } .v-right { flex-wrap: wrap; justify-content: flex-end; } .v-btn { padding: 8px 12px; font-size: 15px; } }

/* phones: compact two-row header (name + sign out on top, evenly spaced links below) that slides away when scrolling down */
@media (max-width: 600px) {
  header.top { padding: 8px 14px 4px; gap: 0; row-gap: 2px; transition: transform .22s ease; }
  header.top .brand { order: 1; font-size: 17px; letter-spacing: .1em; margin-right: 0; }
  header.top .link { order: 2; margin-left: auto; padding: 6px 2px; font-size: 13px; letter-spacing: .08em; }
  header.top nav { order: 3; width: 100%; justify-content: space-between; gap: 4px; }
  header.top nav a { flex: 1 1 0; text-align: center; font-size: 13px; letter-spacing: .06em; padding: 8px 4px; }
  header.top.hide { transform: translateY(-100%); }
}

/* admin: reorder albums */
.tilewrap { position: relative; }
.tilewrap .tile { height: 100%; }
.mv { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 30px; line-height: 1; z-index: 2; }
.mv-l { left: 8px; } .mv-r { right: 8px; }
.mv:disabled { opacity: .25; cursor: default; }
.tools .hint { color: var(--muted); font-size: 15px; }

/* reorder photos */
.ph.picked { outline: 4px solid #ffb84d; outline-offset: -4px; }
.ph.picked::after { content: "\2191\2193"; position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: #ffb84d; color: #261800; font-size: 14px; }
.selbar-like { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px max(16px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom));
  background: rgba(34,36,39,.97); border-top: 1px solid var(--line); }
.selbar-like #ob-msg { margin-right: auto; }

#v-img { transition: opacity .2s; }
#v-stage.loading #v-img { opacity: .55; }

/* top bar on every screen size: holds the breadcrumb trail, and slides away when scrolling down / returns when scrolling up */
header.top { transition: transform .22s ease; }
header.top.hide { transform: translateY(-100%); }
header.top .crumbrow { order: 4; flex: 0 0 100%; color: var(--muted); font-size: 15px; padding: 0 0 8px; }
header.top .crumbrow a { color: var(--text); }
header.top .crumbrow a:hover { text-decoration: underline; }

header.top { row-gap: 0; }
header.top .crumbrow { padding-top: 2px; }


/* admin menu in the full-screen toolbar */
.v-admin { position: relative; }
.v-menu { position: absolute; top: 100%; right: 0; margin-top: 8px; min-width: 240px; padding: 6px; z-index: 10;
  background: rgba(30,30,32,.98); border: 1px solid #3a3d42; border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.55); }
.v-menu[hidden] { display: none; }
.v-menu .v-btn { display: block; width: 100%; text-align: left; background: none; border-radius: 10px; padding: 12px 14px; font-size: 16px; }
.v-menu .v-btn:hover { background: rgba(255,255,255,.12); }
.v-menu .v-btn[hidden] { display: none; }
.v-menu .v-btn:disabled { opacity: .55; }

/* the 1980s film-camera date stamp, drawn over the bottom-right corner of the photo */
#v-stamp { position: absolute; z-index: 2; pointer-events: none; visibility: hidden;
  filter: drop-shadow(0 0 1.5px rgba(0,0,0,.95)) drop-shadow(0 1px 2px rgba(0,0,0,.8)) drop-shadow(0 0 3px rgba(255,150,20,.9)) drop-shadow(0 0 8px rgba(255,100,0,.6)); }
#v-stamp[hidden] { display: none; }
#v-stamp svg { display: block; height: 100%; width: auto; }

/* phones: the admin menu opens full-width under the toolbar instead of hanging off the button */
.v-top { position: relative; }
@media (max-width: 600px) {
  .v-admin { position: static; }
  .v-menu { left: 12px; right: 12px; min-width: 0; }
}

.v-menu .v-danger { color: #ff8f8f; margin-top: 4px; border-top: 1px solid #3a3d42; border-radius: 0 0 10px 10px; padding-top: 14px; }
.v-menu .v-danger:hover { background: rgba(255,80,80,.16); }
.mbox .delthumb { display: block; max-width: 100%; max-height: 180px; margin: 4px auto 14px; border-radius: 10px; }

body.selecting { -webkit-user-select: none; user-select: none; }   /* so a shift-click doesn't highlight text */

.qnav { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 24px; padding-top: 20px; border-top: 1px solid var(--line, rgba(255,255,255,.12)); }
.qlink { padding: 12px 18px; border-radius: 999px; background: var(--panel); color: inherit; text-decoration: none; white-space: nowrap; }
.qlink:hover { filter: brightness(1.25); }
