/* ==========================================================================
   Dale Wiggins Portfolio - single stylesheet, no framework.
   Layout strategy:
     .grid      justified rows, pure CSS via flex-grow proportional to aspect
     .fastgrid  dense uniform squares for the landing page's fast mode
     .frame     aspect-ratio box + LQIP blur-up, so nothing ever reflows
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg:        #0c0d10;
  --bg-2:      #12141a;
  --bg-3:      #191c24;
  --line:      #262a34;
  --fg:        #eef0f4;
  --fg-dim:    #a2a8b8;
  --fg-mute:   #6d7486;
  --accent:    #e4572e;
  --accent-2:  #f2a65a;
  --love:      #ff4d6d;
  --radius:    10px;
  /* Target height for a justified row. Drives how many photos fit per row:
     ~1 on phones, 2-3 on tablets, 3-4 on desktop. */
  --row-h:     clamp(150px, 17vw, 255px);
  --gap:       clamp(6px, 0.9vw, 14px);
  --wrap:      1680px;
  --pad:       clamp(16px, 4vw, 48px);
  --ease:      cubic-bezier(.2, .7, .2, 1);
  --head-h:    64px;
}

/* Respect a light-mode preference unless the page pins dark. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbfbfc; --bg-2: #f2f3f6; --bg-3: #e8eaef;
    --line: #d9dce4; --fg: #14161b; --fg-dim: #4c5261; --fg-mute: #7d8496;
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: fixed; top: -100px; left: 12px; z-index: 200;
  padding: 10px 16px; background: var(--accent); color: #fff; border-radius: 6px;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.head-inner {
  min-height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; letter-spacing: -0.015em; font-size: 1.05rem; }
.brand-sub { font-size: 0.72rem; color: var(--fg-mute); text-transform: uppercase; letter-spacing: 0.14em; }

.nav-list {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0;
  font-size: 0.88rem;
}
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 999px; color: var(--fg-dim);
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-link:hover { color: var(--fg); background: var(--bg-3); }
.nav-link[aria-current="page"],
.nav-link[data-current] { color: var(--fg); background: var(--bg-3); }
.nav-chev {
  width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4;
  opacity: .55; transition: transform .2s var(--ease);
}
.nav-item.is-open .nav-chev { transform: rotate(180deg); }

/* "Login to my gallery" reads as an action, not another gallery. */
.nav-link--cta {
  margin-left: 6px; padding: 8px 15px;
  border: 1px solid var(--line); color: var(--fg);
}
.nav-link--cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.nav-link--cta:hover { border-color: var(--accent-2); background: transparent; color: var(--accent-2); }

/* ---- category submenu ---- */
.subnav {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 70;
  min-width: 216px; padding: 7px; margin: 0;
  list-style: none;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2);
  box-shadow: 0 18px 44px rgb(0 0 0 / .45);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.nav-item.is-open > .subnav { opacity: 1; transform: none; pointer-events: auto; }
/* Keyboard users who tab into the list get it opened too. */
.nav-item:focus-within > .subnav { opacity: 1; transform: none; pointer-events: auto; }
/* Hover-to-open in plain CSS as well as JS, so the galleries stay reachable
   with JavaScript disabled. Desktop + real hover only: on touch, :hover
   sticks after a tap. */
@media (hover: hover) and (min-width: 1025px) {
  .nav-item.has-sub:hover > .subnav { opacity: 1; transform: none; pointer-events: auto; }
}
.subnav a {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 12px; border-radius: 8px; color: var(--fg-dim);
  transition: color .15s var(--ease), background .15s var(--ease);
}
.subnav a:hover { color: var(--fg); background: var(--bg-3); }
.subnav a[aria-current="page"] { color: var(--fg); background: var(--bg-3); }
.subnav-all {
  color: var(--fg) !important;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0; margin-bottom: 4px;
  font-weight: 550;
}
.subnav-count {
  font-size: .7rem; color: var(--fg-mute); font-variant-numeric: tabular-nums;
}
/* An invisible bridge stops the menu closing as the pointer crosses the gap. */
.nav-item.has-sub::after {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 10px;
}

.nav-toggle { display: none; width: 42px; height: 42px; padding: 10px; }
.nav-toggle span {
  display: block; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .22s var(--ease), opacity .18s var(--ease);
}
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Six categories plus Contact and Login need room; collapse earlier than a
   typical nav would. */
@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .nav-list {
    position: absolute; inset: var(--head-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--pad) 18px;
    max-height: calc(100vh - var(--head-h)); overflow-y: auto;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .18s var(--ease), transform .18s var(--ease);
  }
  .nav-list.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link {
    width: 100%; justify-content: space-between;
    padding: 14px 10px; font-size: 1rem; border-radius: 8px;
  }
  .nav-link--cta { margin: 10px 0 0; justify-content: center; }

  /* Submenus become inline accordions rather than floating panels. */
  .subnav {
    position: static; opacity: 1; transform: none; pointer-events: auto;
    min-width: 0; padding: 0 0 6px 10px; margin: 0 0 4px;
    border: 0; border-left: 2px solid var(--line); border-radius: 0;
    background: none; box-shadow: none;
    display: none;
  }
  .nav-item.is-open > .subnav { display: block; }
  /* :focus-within must not force-open every accordion on touch. */
  .nav-item:focus-within > .subnav { display: none; }
  .nav-item.is-open:focus-within > .subnav { display: block; }
  .subnav a { padding: 12px 10px; }
  .subnav-all { border-bottom: 0; }
  .nav-item.has-sub::after { display: none; }
}

/* ---------- frames: aspect box, instant colour, LQIP blur-up ---------- */
.frame {
  position: relative; display: block; overflow: hidden;
  background-color: var(--c, var(--bg-3));
  border-radius: var(--radius);
  aspect-ratio: var(--ar, 3 / 2);
}
/* The blurred placeholder sits behind the real image and fades out on load. */
.frame::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--lqip, none);
  background-size: cover; background-position: center;
  filter: blur(14px) saturate(120%); transform: scale(1.08);
  transition: opacity .5s var(--ease); opacity: 1;
}
.frame.is-loaded::after { opacity: 0; }
.frame .pic, .frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.frame img { opacity: 0; transition: opacity .45s var(--ease); }
.frame.is-loaded img { opacity: 1; }
/* No-JS / cached-decode safety net: never leave an image invisible. The
   blur-up fade is driven by an inline onload handler, so without JS we must
   both show the image and drop the placeholder that paints on top of it. */
.no-js .frame img, .frame img[data-shown] { opacity: 1; }
.no-js .frame::after { opacity: 0; }
.frame--square { aspect-ratio: 1; }
.frame--card { aspect-ratio: 4 / 3; }
.frame--solo { aspect-ratio: var(--ar, 3 / 2); max-height: 82vh; }
.frame--solo img { object-fit: contain; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg {
  position: absolute; inset: 0; opacity: .3;
}
.hero-bg-cell { position: relative; overflow: hidden; background: var(--c); }
/* <picture> is not inside a .frame here, so give it explicit box sizing or the
   images collapse to their intrinsic height and leave gaps. */
.hero-bg-cell .pic { display: block; width: 100%; height: 100%; }
.hero-bg-cell img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 20%, var(--bg) 92%),
    linear-gradient(to top, var(--bg) 6%, transparent 60%);
}
.hero-inner {
  position: relative; z-index: 2;
  /* Kept deliberately tight: the ranked rows below are the point of the
     homepage, so they should be at or near the fold. */
  padding-block: clamp(44px, 7vw, 92px);
  text-align: center;
}
.hero-title {
  font-size: clamp(2.6rem, 8.5vw, 6.4rem); font-weight: 680;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--fg), color-mix(in srgb, var(--fg) 62%, var(--bg)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tag {
  margin-top: 10px; color: var(--accent-2);
  text-transform: uppercase; letter-spacing: 0.32em; font-size: clamp(.66rem, 1.5vw, .82rem);
}
.hero-desc { margin: 18px auto 0; max-width: 56ch; color: var(--fg-dim); }
.hero-counts {
  margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center;
  font-size: .82rem; color: var(--fg-mute);
}
.hero-counts b { color: var(--fg); font-weight: 600; }

/* ---------- section furniture ---------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.sec-head h2 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); }
.sec-head h2 a:hover { color: var(--accent-2); }
.sec-meta, .page-meta { font-size: .78rem; color: var(--fg-mute); }
.sec-desc { max-width: 68ch; color: var(--fg-dim); margin: -4px 0 16px; }
.cat-block { margin-block: clamp(38px, 6vw, 72px); }
.cat-block--more { border-top: 1px solid var(--line); padding-top: 34px; }

.page-head { padding-block: clamp(20px, 4vw, 40px); position: relative; }
.page-head h1 { font-size: clamp(1.8rem, 5vw, 3.2rem); }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.page-desc { margin-top: 14px; max-width: 70ch; color: var(--fg-dim); }
.tag {
  padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
}
.crumbs {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding-top: 20px; font-size: .78rem; color: var(--fg-mute);
}
.crumbs a:hover { color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  background: var(--fg); color: var(--bg); font-size: .88rem; font-weight: 550;
  transition: transform .16s var(--ease), opacity .16s var(--ease);
}
.btn:hover { transform: translateY(-1px); opacity: .9; }

/* ---------- mode switcher ---------- */
.modebar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px; margin-block: 8px 24px;
  border: 1px solid var(--line); border-radius: 999px; width: fit-content;
  background: var(--bg-2);
}
.modebar--right { position: absolute; right: var(--pad); bottom: 18px; margin: 0; }
.mode {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; font-size: .85rem; color: var(--fg-dim);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.mode svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.mode:hover { color: var(--fg); }
.mode.is-on { background: var(--fg); color: var(--bg); }
.modebar-hint { padding-inline: 10px; font-size: .74rem; color: var(--fg-mute); }
@media (max-width: 700px) {
  .modebar--right { position: static; margin-top: 16px; }
  .modebar-hint { display: none; }
}

/* ---------- gallery cards ---------- */
.cards {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.cards--roomy { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.card { display: block; transition: transform .28s var(--ease); }
.card:hover { transform: translateY(-3px); }
.card .frame::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to top, rgb(0 0 0 / .55), transparent 55%);
  opacity: 0; transition: opacity .28s var(--ease);
}
.card:hover .frame::before { opacity: 1; }
.card .frame img { transition: opacity .45s var(--ease), transform .5s var(--ease); }
.card:hover .frame img { transform: scale(1.035); }
.card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 2px 4px; }
.card-cat { font-size: .66rem; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-2); }
.card-title { font-size: 1.02rem; font-weight: 580; letter-spacing: -0.01em; }
.card-count { font-size: .76rem; color: var(--fg-mute); }

/* ---------- justified photo grid (no JS) ----------
   flex-basis proportional to the aspect ratio + flex-grow lets each row fill
   the width while every image keeps a near-constant height. */
.grid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.grid .tile {
  position: relative; display: block;
  flex: var(--ar, 1.5) 1 calc(var(--ar, 1.5) * var(--row-h));
  transition: transform .22s var(--ease);
}
.grid .tile .frame { height: 100%; aspect-ratio: var(--ar, 3 / 2); }
.grid .tile:hover { transform: translateY(-2px); z-index: 2; }
/* Stop the final row stretching its few images to absurd widths. */
.grid::after { content: ""; flex-grow: 1e4; }

.tile-meta {
  position: absolute; inset: auto 0 0 0; z-index: 3;
  display: flex; justify-content: flex-end; gap: 6px; padding: 10px;
  opacity: 0; transition: opacity .2s var(--ease);
  background: linear-gradient(to top, rgb(0 0 0 / .5), transparent);
  border-radius: 0 0 var(--radius) var(--radius);
  pointer-events: none;
}
.tile:hover .tile-meta, .tile:focus-visible .tile-meta { opacity: 1; }
.tile-stat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .6);
}
.tile-stat svg { width: 13px; height: 13px; fill: #fff; }
.tile-stat[hidden] { display: none; }

/* Dense layout: a uniform square grid, toggled on gallery pages. */
.grid.is-dense { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.grid.is-dense::after { display: none; }
.grid.is-dense .tile { flex: none; }
.grid.is-dense .tile .frame { aspect-ratio: 1; height: auto; }

/* ---------- fast gallery (landing page) ---------- */
.fastgrid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(31%, 170px), 1fr));
}
.fcell { display: block; transition: transform .2s var(--ease); }
.fcell:hover { transform: scale(1.02); z-index: 2; }
.fast-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-block: 40px; }
.fast-status { font-size: .78rem; color: var(--fg-mute); }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: 1fr auto;
  background: color-mix(in srgb, #06070a 94%, transparent);
  backdrop-filter: blur(6px);
  animation: lb-in .2s var(--ease);
}
@keyframes lb-in { from { opacity: 0; } }
.lb-stage {
  position: relative; display: grid; place-items: center;
  /* minmax(0,1fr) rather than the implicit `auto` track: an auto track is
     sized by its content, which leaves the percentage heights below
     indefinite, so the photo's max-height:100% is ignored and it overflows
     onto the action bar. */
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  min-height: 0; padding: clamp(10px, 2.4vw, 34px);
  touch-action: pan-y pinch-zoom;
}
/* Flex, not grid: the photo reaches this box through a display:contents
   <picture>, and Chrome will not resolve its max-height:100% against a grid
   area in that case - the image overflows onto the action bar. Under flex the
   percentage resolves correctly. */
.lb-figure {
  margin: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; min-height: 0;
}
/* <picture> must not create its own auto-height box here: if it does, the
   image's max-height:100% has no definite height to resolve against, the photo
   overflows its grid row and covers the action bar below it. */
.lb-figure picture { display: contents; }
.lb-figure img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 4px;
  opacity: 0; transition: opacity .22s var(--ease);
  box-shadow: 0 24px 70px rgb(0 0 0 / .6);
}
.lb-figure img.is-on { opacity: 1; }
/* Blurred stand-in while the full-resolution file streams in. */
.lb-figure .lb-ph {
  position: absolute; max-width: 100%; max-height: 100%;
  filter: blur(18px); transform: scale(1.03); opacity: .85;
}
.lb-figure.is-ready .lb-ph { opacity: 0; transition: opacity .3s var(--ease); }
.lb-spin {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .22); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lb-btn {
  position: absolute; z-index: 3; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgb(255 255 255 / .08); color: #fff;
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.lb-btn:hover { background: rgb(255 255 255 / .2); }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { top: 50%; left: 14px; transform: translateY(-50%); }
.lb-next { top: 50%; right: 14px; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }
.lb-btn[disabled] { opacity: .25; pointer-events: none; }

.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px clamp(14px, 3vw, 28px) max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(255 255 255 / .09);
  background: rgb(10 11 15 / .7);
}
.lb-titles { min-width: 0; }
.lb-titles strong { display: block; font-size: .98rem; font-weight: 560; color: #fff; }
.lb-titles span { font-size: .76rem; color: rgb(255 255 255 / .55); }
.lb-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px;
  background: rgb(255 255 255 / .07); color: rgb(255 255 255 / .82);
  font-size: .8rem; font-variant-numeric: tabular-nums;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.act:hover { background: rgb(255 255 255 / .16); color: #fff; }
.act svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.act[data-act="love"] svg { fill: none; stroke: currentColor; }
.act[data-act="love"][aria-pressed="true"] { background: color-mix(in srgb, var(--love) 26%, transparent); color: #fff; }
.act[data-act="love"][aria-pressed="true"] svg { fill: var(--love); stroke: var(--love); }
.act[data-act="save"][aria-pressed="true"] { background: color-mix(in srgb, var(--accent-2) 26%, transparent); color: #fff; }
.act[data-act="save"][aria-pressed="true"] svg { fill: var(--accent-2); stroke: var(--accent-2); }
.act--static { pointer-events: none; background: none; }
.act.is-pop { animation: pop .32s var(--ease); }
@keyframes pop { 40% { transform: scale(1.22); } }

.lb-info {
  position: absolute; right: 14px; bottom: 84px; z-index: 4;
  width: min(320px, calc(100vw - 28px)); padding: 16px 18px;
  border-radius: 12px; border: 1px solid rgb(255 255 255 / .12);
  background: rgb(14 16 22 / .95); color: #fff; font-size: .8rem;
}
.lb-info dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.lb-info dt { color: rgb(255 255 255 / .5); }
.lb-info dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.lb-counter {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: .78rem; color: rgb(255 255 255 / .6); font-variant-numeric: tabular-nums;
}
body.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  .lb-prev, .lb-next { display: none; }   /* swipe instead */
  .lb-bar { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .act b { display: none; }
  .act { padding: 11px; }
}

/* ---------- solo photo page ---------- */
.solo { padding-block: 24px 60px; }
.solo-head { padding-top: 20px; }
.solo-head h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); }
.solo-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 8px; font-size: .78rem; color: var(--fg-mute); }

/* ---------- footer / 404 ---------- */
.site-foot { margin-top: 70px; border-top: 1px solid var(--line); }
.foot-inner {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding-block: 26px; font-size: .78rem; color: var(--fg-mute);
}
.foot-stats { display: flex; gap: 18px; }
.foot-stats b { color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.notfound { padding-block: 16vh; text-align: center; display: grid; gap: 16px; justify-items: center; }
.notfound h1 { font-size: clamp(4rem, 18vw, 10rem); color: var(--bg-3); }

/* ---------- homepage feature rows (Top Rated / Latest) ---------- */
.feature-row { margin-block: clamp(34px, 5vw, 60px); }
.sec-icon {
  width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px;
  fill: var(--accent-2); stroke: var(--accent-2);
}
.sec-head h2 .sec-icon { stroke-width: 2; }
.feats {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1100px) { .feats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .feats { grid-template-columns: 1fr; } }

.feat { display: block; transition: transform .26s var(--ease); }
.feat:hover { transform: translateY(-3px); }
.frame--feat { aspect-ratio: 4 / 3; }
.feat .frame::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to top, rgb(0 0 0 / .5), transparent 60%);
  opacity: 0; transition: opacity .26s var(--ease);
}
.feat:hover .frame::before { opacity: 1; }
.feat .frame img { transition: opacity .45s var(--ease), transform .5s var(--ease); }
.feat:hover .frame img { transform: scale(1.03); }

.feat-rank {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgb(10 11 15 / .72); color: #fff;
  font-size: .78rem; font-weight: 650; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}
.feat-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 2px 4px; }
.feat-gal { font-size: .66rem; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-2); }
.feat-title { font-size: 1.02rem; font-weight: 570; letter-spacing: -0.01em; }
.feat-stats {
  display: flex; align-items: center; gap: 14px;
  margin-top: 2px; font-size: .76rem; color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.feat-stat { display: inline-flex; align-items: center; gap: 5px; }
.feat-stat svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.feat-date { margin-left: auto; }

/* ---------- client gallery login ---------- */
.login { padding-block: 10px 70px; }
.login-card {
  max-width: 470px; padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2);
}
.login-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 18px;
  border-radius: 12px; background: var(--bg-3);
}
.login-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-2); stroke-width: 2; }
.login-form { display: grid; gap: 9px; }
.login-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--fg-mute);
}
.login-input {
  width: 100%; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--fg);
  font: inherit; font-size: 1.02rem; letter-spacing: .06em;
  text-transform: uppercase;
  transition: border-color .18s var(--ease);
}
.login-input::placeholder { color: var(--fg-mute); letter-spacing: .04em; text-transform: none; }
.login-input:focus { outline: none; border-color: var(--accent-2); }
.login-help { font-size: .78rem; color: var(--fg-mute); }
.login-submit { justify-content: center; margin-top: 6px; }
.login-submit[disabled] { opacity: .6; pointer-events: none; }
.login-msg { font-size: .82rem; color: var(--fg-dim); }
.login-msg.is-warn { color: var(--accent-2); }
.login-msg.is-ok { color: #5ec98a; }
.login-foot { margin-top: 16px; font-size: .78rem; color: var(--fg-mute); }
.login-foot a, .login-help a { color: var(--accent-2); }
.login-recent {
  max-width: 470px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line); display: grid; gap: 8px;
}
.login-recent-link {
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2); font-size: .92rem; font-weight: 540;
}
.login-recent-link:hover { border-color: var(--accent-2); }

/* ---------- commerce / delivery ---------- */
.delivery-note {
  margin: 18px 0 8px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); color: var(--fg-dim); font-size: .92rem;
}
.delivery-note strong { color: var(--fg); }
.commerce-note { margin-top: 8px; color: var(--fg-mute); font-size: .9rem; }
.inquiry-banner {
  margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2));
}
.inquiry-banner .inquiry-meta { margin-top: 6px; font-size: .85rem; color: var(--fg-mute); }
.act--purchase { gap: 6px; }
.act--purchase .act-label {
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; white-space: nowrap;
}
@media (max-width: 720px) {
  .act--purchase .act-label { display: none; }
}

/* ---------- contact ---------- */
.contact { padding-block: 10px 70px; }
.contact-card {
  max-width: 520px; padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2);
  display: grid; gap: 14px; justify-items: start;
}
.contact-lead { color: var(--fg-dim); font-size: .9rem; }
.contact-note { font-size: .8rem; color: var(--accent-2); }
.contact-details { display: grid; gap: 10px; width: 100%; }
.contact-line {
  display: block; padding: 13px 18px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-size: 1.02rem; font-weight: 550; letter-spacing: -0.01em;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.contact-line:hover { border-color: var(--accent-2); transform: translateY(-1px); }
/* Honeypot: off-screen for people, still a link to a naive crawler. */
.hp {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: auto;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 150;
  padding: 11px 20px; border-radius: 999px;
  background: var(--fg); color: var(--bg); font-size: .84rem; font-weight: 550;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- portfolio hub, sections, projects ---------- */
.hub-hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 85% -20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(700px 360px at 5% 120%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%);
}
.hub-hero-bg {
  position: absolute; inset: 0; opacity: .32;
}
.hub-hero-cell { overflow: hidden; background: var(--bg-3); }
.hub-hero-cell img { width: 100%; height: 100%; object-fit: cover; min-height: 120px; }
.hub-hero-inner { position: relative; z-index: 1; }
.hub-kicker {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--fg-mute); margin: 0 0 10px;
}
.hub-kicker a { color: var(--accent-2); }
.hub-kicker a:hover { text-decoration: underline; }
.hub-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 12px; }
.hub-intro { font-size: 1.15rem; color: var(--fg-dim); max-width: 52ch; margin-bottom: 10px; }
.hub-bio { color: var(--fg-mute); max-width: 62ch; font-size: .95rem; }
.hub-sections, .hub-featured { padding: 36px 0 20px; }
.hub-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.hub-card {
  position: relative; display: grid; gap: 8px; padding: 0 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.hub-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.hub-card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.hub-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hub-card .hub-card-title,
.hub-card .hub-card-sum,
.hub-card .hub-card-meta { padding-inline: 16px; }
.hub-card .hub-card-accent { top: auto; bottom: 0; height: 3px; }
.proj-grid--hub { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.hub-card-accent {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent, var(--accent));
}
.hub-card-title { font-size: 1.1rem; }
.hub-card-sum { color: var(--fg-dim); font-size: .9rem; line-height: 1.45; }
.hub-card-meta { color: var(--fg-mute); font-size: .78rem; margin-top: 4px; }

.proj-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.proj-grid--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.proj-card {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.proj-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); }
.proj-thumb { border-radius: 0; aspect-ratio: 16 / 9; }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-thumb--empty {
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--bg-3), color-mix(in srgb, var(--accent) 35%, var(--bg-3)));
}
.proj-body { padding: 0 14px 14px; display: grid; gap: 6px; }
.proj-status {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-2); font-weight: 600;
}
.proj-status--hero { margin-bottom: 4px; }
.proj-title { font-size: 1.05rem; }
.proj-sum { color: var(--fg-dim); font-size: .88rem; line-height: 1.45; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.proj-tags--hero { margin: 10px 0 0; }
.tag {
  font-size: .72rem; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg-mute);
}

.work-hero {
  padding: 40px 0 32px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--bg)) 0%, var(--bg) 100%);
}
.work-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.work-lede { font-size: 1.05rem; color: var(--fg-dim); max-width: 58ch; }
.work-desc { color: var(--fg-mute); max-width: 62ch; margin-top: 10px; font-size: .92rem; }
.work-cta { margin-top: 18px; }
.work-projects, .work-gallery-block, .work-more { padding: 32px 0; }
.work-prose { padding: 28px 0; max-width: 66ch; color: var(--fg-dim); line-height: 1.65; }
.work-hero-img { margin: 0 0 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.work-hero-img img { width: 100%; height: auto; display: block; }
.work-gallery {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.work-shot { margin: 0; }
.work-shot img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.work-shot figcaption { font-size: .82rem; color: var(--fg-mute); margin-top: 6px; }
.btn--primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border-radius: 8px; font-weight: 600;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.btn--primary:hover { filter: brightness(1.08); text-decoration: none; }



/* ---------- carousels ---------- */
.carousel { position: relative; margin-block: 4px; }
.carousel--static .carousel-btn { display: none; }
.carousel-track {
  display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; padding-block: 2px 8px;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-btn {
  position: absolute; top: 38%; transform: translateY(-50%); z-index: 4;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  color: var(--fg); cursor: pointer;
  box-shadow: 0 4px 18px rgb(0 0 0 / .22);
  transition: border-color .18s var(--ease), opacity .18s var(--ease);
}
.carousel-btn:disabled { opacity: .35; pointer-events: none; }
.carousel-btn:hover:not(:disabled) { border-color: var(--accent-2); }
.carousel-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.carousel-btn--prev { left: -6px; }
.carousel-btn--next { right: -6px; }

.carousel[data-carousel-kind="feat"] .carousel-track > * {
  flex: 0 0 clamp(260px, 77vw, 400px); scroll-snap-align: start;
}
.carousel[data-carousel-kind="hub"] .carousel-track > * {
  flex: 0 0 clamp(220px, 72vw, 280px); scroll-snap-align: start;
}
.carousel[data-carousel-kind="proj"] .carousel-track > .proj-card {
  flex: 0 0 clamp(240px, 78vw, 310px); scroll-snap-align: start;
}
.carousel[data-carousel-kind="card"] .carousel-track > .card {
  flex: 0 0 clamp(260px, 84vw, 360px); scroll-snap-align: start;
}
.carousel[data-carousel-kind="shot"] .carousel-track > .work-shot {
  flex: 0 0 clamp(240px, 80vw, 320px); scroll-snap-align: start;
}

.carousel[data-carousel-kind="hero"] {
  position: absolute; inset: 0; height: 100%; margin: 0;
}
.carousel[data-carousel-kind="hero"] .carousel-btn { display: none; }
.carousel[data-carousel-kind="hero"] .carousel-track {
  height: 100%; gap: 0; padding: 0;
}
.carousel[data-carousel-kind="hero"] .hub-hero-cell,
.carousel[data-carousel-kind="hero"] .hero-bg-cell {
  flex: 0 0 25vw; min-width: 200px; height: 100%; scroll-snap-align: start;
}
.hub-hero-bg, .hero-bg { display: block; }
.hub-hero-bg .carousel, .hero-bg .carousel { width: 100%; }

@media (max-width: 768px) {
  .carousel-btn--prev { left: 2px; }
  .carousel-btn--next { right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
