:root {
  --bg: #f3f0e9; --panel: #fcfaf5; --ink: #24231f; --muted: #6f6b62;
  --line: #d8d2c7; --accent: #a14f35; --accent-ink: #fffaf3; --forest: #31483c;
  --danger: #a33d36; --ready: #49785d; --stored: #98722d; --failed: #a33d36;
  --shadow: 0 18px 55px rgba(42, 37, 29, .08); --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.6 "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(161, 79, 53, .28); outline-offset: 3px; }

.top { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: .85rem clamp(1rem, 4vw, 3rem); background: rgba(252,250,245,.94); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font: 600 clamp(1rem,2vw,1.15rem)/1.2 var(--serif); letter-spacing: .02em; text-decoration: none; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark { width: 22px; height: 22px; display: inline-block; border: 1px solid currentColor; border-radius: 50%; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; background: var(--accent); border-radius: 50%; }
.top-right { display: flex; align-items: center; gap: 1rem; }
.top-right > a { margin: 0; }
.primary-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link { color: var(--muted); padding: .45rem .7rem; border-radius: 99px; text-decoration: none; font-size: .88rem; font-weight: 650; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); background: #e9e4da; text-decoration: none; }

main { width: min(1240px,100%); margin: 0 auto; padding: clamp(1.25rem,4vw,3rem); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; }
h1 { margin: 0 0 .5rem; font-size: clamp(2rem,5vw,3.5rem); letter-spacing: -.035em; }
h2 { margin: 0 0 .75rem; font-size: clamp(1.25rem,2.6vw,1.8rem); }
h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
p { margin: .25rem 0 1rem; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 .9rem; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.crumb { margin: 0 0 .45rem; font-size: .82rem; font-weight: 650; }
.inline { display: inline; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: clamp(1.2rem,3vw,1.8rem); margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.narrow { max-width: 520px; margin: clamp(2rem,8vh,5rem) auto; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label { display: flex; flex-direction: column; gap: .35rem; font-weight: 650; }
fieldset { min-width: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="file"] { width: 100%; background: #fff; color: var(--ink); border: 1px solid #c9c2b6; border-radius: 3px; padding: .72rem .8rem; }
input:focus { border-color: var(--accent); }
input[readonly] { width: 100%; background: #eeeae2; }
button, .button { appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: .68rem 1.05rem; border-radius: 2px; cursor: pointer; text-decoration: none; display: inline-block; transition: transform .15s ease, background .15s ease; }
button:hover, .button:hover { background: #88402b; text-decoration: none; transform: translateY(-1px); }
.ghost { background: transparent; color: var(--ink); border-color: #aaa397; }
.ghost:hover { background: #e6e0d5; }
.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.5rem; }
.toolbar h1 { font-size: clamp(2rem,4vw,3rem); }
.toolbar-actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.site-summary { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-summary .eyebrow { margin-bottom: .35rem; }
.site-summary p:last-child { margin-bottom: 0; }
.studio-controls { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(360px,1.25fr); gap: 1.25rem; }
.studio-controls .panel { min-width: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .8rem .5rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.table tbody tr:hover { background: #f3efe7; }
.dim { opacity: .55; }
.share { display: flex; gap: .5rem; }
.flash.error { color: #842e29; background: #f5ded7; padding: .7rem .8rem; border-left: 3px solid var(--danger); }
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 1rem; }
.client-grid { grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); }
.card { background: var(--panel); border: 1px solid transparent; overflow: hidden; position: relative; }
.card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.thumb-wrap, .thumb-btn { display: block; width: 100%; aspect-ratio: 1; background: #ddd8cf; padding: 0; border: 0; cursor: zoom-in; }
.thumb-wrap img, .thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.card:hover img, .land-card:hover img, .port-card:hover img { transform: scale(1.025); }
.ph { height: 100%; display: grid; place-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; }
.meta { padding: .75rem .85rem .9rem; font-size: .84rem; }
.meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--serif); font-size: 1.05rem; }
.tiny { font-size: .78rem; }
.status-ready { color: var(--ready); } .status-stored { color: var(--stored); } .status-failed { color: var(--failed); }
.pick, .heart { position: absolute; top: .65rem; right: .65rem; width: 2.5rem; height: 2.5rem; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); background: rgba(24,23,20,.74); color: #fff; backdrop-filter: blur(5px); line-height: 1; }
.pick:hover, .heart:hover { transform: scale(1.06); background: rgba(24,23,20,.9); }
.pick.on { color: #f7c66f; border-color: #f7c66f; }
.heart.on { color: #ff8494; border-color: #ff8494; }
.count { background: var(--forest); color: #fff; padding: .28rem .65rem; border-radius: 99px; font-size: .8rem; white-space: nowrap; }
.pick-list { margin: 0; padding-left: 1.1rem; }
#upload-progress { font-size: .85rem; color: var(--muted); }
#upload-progress .bar { height: 5px; background: #ddd6ca; border-radius: 99px; overflow: hidden; margin: .35rem 0 .75rem; }
#upload-progress .bar > span { display: block; height: 100%; background: var(--accent); width: 0; }
dialog { border: 0; background: #181713; color: #fff; max-width: min(96vw,1150px); padding: .75rem; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(24,23,19,.75); }
dialog img { max-width: 100%; max-height: 82vh; display: block; margin: 0 auto .75rem; }
dialog .ghost { color: #fff; }
code { color: var(--forest); background: #e5e1d7; padding: .1em .3em; font-size: .88em; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { font: 500 2.2rem/1 var(--serif); margin: .35rem 0 .5rem; }
.compact { margin: 0; padding-left: 1.1rem; }
#g-signin { margin: .75rem 0 1rem; }

.preview-banner { position: relative; display: flex; align-items: center; justify-content: center; background: var(--forest); color: #fff; text-align: center; padding: .5rem 3rem; font-size: .82rem; letter-spacing: .03em; }
.preview-exit { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); color: inherit; text-decoration: none; font-size: 1.4rem; line-height: 1; }
.choices { border: 1px solid var(--line); padding: .85rem; display: grid; gap: .7rem; }
.stack label.choice, label.choice { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .55rem; font-weight: 400; }
.choice strong { font-weight: 700; white-space: nowrap; }

.film-hero { position: relative; background: #181713; min-height: 54vh; display: flex; align-items: center; justify-content: center; }
.film-hero img { max-width: 100%; max-height: 72vh; display: block; }
.film-hero .pick, .film-hero .heart { top: .85rem; right: .85rem; }
.film-strip { display: flex; gap: .5rem; overflow-x: auto; padding: .8rem 0 .2rem; scrollbar-color: var(--accent) transparent; }
.film-thumb { border: 2px solid transparent; background: none; padding: 0; flex: 0 0 auto; width: 96px; cursor: pointer; border-radius: 0; }
.film-thumb:hover { transform: none; background: none; }
.film-thumb img { display: block; width: 92px; height: 68px; object-fit: cover; opacity: .65; }
.film-thumb.current { border-color: var(--accent); } .film-thumb.current img { opacity: 1; }
.film-thumb.picked { outline: 2px solid #f7c66f; outline-offset: -4px; }

.landing main { max-width: 1360px; }
.folio-hero { padding: clamp(3rem,10vw,8rem) 1rem clamp(2.5rem,6vw,5rem); text-align: center; }
.folio-hero h1 { font-size: clamp(3.2rem,9vw,7.5rem); }
.folio-intro { max-width: 36rem; margin: 1.2rem auto 0; color: var(--muted); font-size: 1.05rem; }
.folio-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(270px,1fr)); gap: 1.25rem; }
.landing-folio .land-card { grid-template-columns: 1fr; }
.landing-folio .land-card .thumb-wrap { width: 100%; height: auto; aspect-ratio: 4/3; }
.land-card-wrap { max-width: 780px; margin: clamp(3rem,10vw,8rem) auto 4rem; text-align: center; }
.land-card-wrap h1 { font-size: clamp(3rem,8vw,6.5rem); }
.land-card-wrap > p:last-child { color: var(--muted); font-size: 1.05rem; }
.land-list { display: grid; gap: 1rem; max-width: 740px; margin: 0 auto 3rem; }
.land-card { display: grid; grid-template-columns: 150px 1fr; gap: 0; align-items: center; color: inherit; text-decoration: none; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.land-card:hover { text-decoration: none; box-shadow: var(--shadow); }
.land-card .thumb-wrap { width: 150px; height: 112px; }
.land-card .thumb-wrap img, .land-card .ph { width: 100%; height: 100%; object-fit: cover; }
.land-card .meta { padding: 1rem 1.25rem; }
.port-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: .7rem; max-width: 980px; margin: 0 auto 3rem; }
.port-card { position: relative; overflow: hidden; background: #ddd8cf; }
.port-card img { width: 100%; height: 190px; object-fit: cover; display: block; transition: transform .3s ease; }
.liked-link { white-space: nowrap; color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 700; }
#liked-count:not([hidden]) { display: inline-block; margin-left: .25rem; background: var(--accent); color: #fff; padding: .05rem .45rem; border-radius: 99px; font-size: .75rem; }
.share-dialog { background: var(--panel); color: var(--ink); padding: 1.4rem; max-width: min(92vw,580px); width: 580px; border: 1px solid var(--line); }
.share-dialog h2 { margin-top: 0; } .share-dialog .share { margin: .75rem 0; } .share-dialog .ghost { color: var(--ink); }

.home main { max-width: none; padding: 0; }
.home-hero { min-height: min(760px,calc(100vh - 72px)); display: grid; place-content: center; justify-items: center; text-align: center; padding: 5rem 1.5rem; background: radial-gradient(circle at 50% 35%,#fffaf0 0,#f3f0e9 45%,#e2ddd2 100%); position: relative; overflow: hidden; }
.home-hero::before, .home-hero::after { content: ""; position: absolute; width: min(32vw,380px); aspect-ratio: 3/4; border: 1px solid rgba(49,72,60,.2); transform: rotate(-7deg); left: -7vw; bottom: -12%; }
.home-hero::after { left: auto; right: -7vw; bottom: auto; top: -10%; transform: rotate(8deg); }
.home-hero h1 { max-width: 850px; font-size: clamp(3.5rem,9vw,8rem); line-height: .95; }
.lede { max-width: 660px; color: var(--muted); font-size: clamp(1rem,2vw,1.22rem); margin: 1.5rem auto 0; }
.home-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 0; }
.home-note { max-width: 270px; color: var(--muted); font-size: .78rem; text-align: left; }
.home-story { background: var(--forest); color: #f8f4eb; padding: clamp(4rem,9vw,8rem) clamp(1.5rem,8vw,7rem); display: grid; grid-template-columns: minmax(240px,.8fr) minmax(360px,1.2fr); gap: clamp(3rem,9vw,9rem); }
.home-story .eyebrow { color: #d8aa87; }
.home-story-intro h2 { font-size: clamp(2.4rem,5vw,4.8rem); }
.home-steps { margin: 0; padding: 0; list-style: none; }
.home-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid rgba(255,255,255,.2); }
.home-steps li:last-child { border-bottom: 1px solid rgba(255,255,255,.2); }
.home-steps li > span { color: #d8aa87; font-size: .75rem; letter-spacing: .1em; }
.home-steps p { margin: 0; color: #bfc7c0; }
.home-client-callout { padding: clamp(3rem,7vw,6rem) clamp(1.5rem,8vw,7rem); display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: end; }
.home-client-callout > p { max-width: 500px; color: var(--muted); }

.user-badge-wrap { position: relative; display: inline-flex; }
.user-badge { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 3px; font-size: .8rem; font-weight: 700; }
.user-badge:hover { border-color: var(--accent); background: #eee9df; transform: none; }
.user-badge .user-avatar, .user-badge .user-avatar-initial { width: 29px; height: 29px; border-radius: 50%; background: var(--forest); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; overflow: hidden; }
.user-badge .user-avatar { object-fit: cover; }
.user-badge-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badge-caret { color: var(--muted); }
.user-menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 270px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 20px 55px rgba(42,37,29,.18); padding: .45rem 0; z-index: 2000; font-size: .82rem; }
.user-menu[hidden] { display: none; }
.user-menu-section { padding: .7rem 1rem .3rem; color: var(--muted); font-size: .65rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }
.user-menu-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: .5rem; padding: .65rem 1rem; cursor: pointer; }
.user-menu-item:hover { background: #eee9df; }
.user-menu-item.is-current { background: #e7e8df; }
.user-menu-item.is-danger { color: var(--danger); }
.user-menu-item .menu-check { color: var(--accent); font-weight: 800; }
.user-menu-item .menu-role { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.user-menu-empty { padding: .5rem 1rem .8rem; color: var(--muted); font-style: italic; }
.user-menu-divider { height: 1px; background: var(--line); margin: .35rem 0; }
.menu-tag { display: inline-block; margin-left: .35rem; font-size: .6rem; font-weight: 800; text-transform: uppercase; color: var(--accent); }

@media (max-width: 720px) {
  .top { align-items: flex-start; flex-wrap: wrap; gap: .65rem; padding: .8rem 1rem; }
  .brand { min-height: 36px; }
  .top-right { width: 100%; justify-content: space-between; gap: .5rem; }
  .primary-nav { min-width: 0; overflow-x: auto; }
  .nav-link { padding: .4rem .55rem; font-size: .8rem; }
  .user-badge-name { display: none; }
  main { padding: 1.25rem 1rem 2rem; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: .85rem; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > * { flex: 1 1 auto; text-align: center; }
  .site-summary { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .site-summary .toolbar-actions { width: 100%; }
  .studio-controls { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 1.1rem; } .narrow { margin: 2rem auto; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .share { flex-direction: column; }
  .client-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
  .grid:not(.client-grid) { grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); }
  .folio-grid { grid-template-columns: 1fr; }
  .land-card { grid-template-columns: 108px 1fr; }
  .land-card .thumb-wrap { width: 108px; height: 92px; }
  .port-grid { grid-template-columns: repeat(2,1fr); } .port-card img { height: 150px; }
  .film-hero { min-height: 40vh; }
  .home-hero { min-height: 650px; } .home-note { text-align: center; }
  .home-story, .home-client-callout { grid-template-columns: 1fr; gap: 2rem; }
  .home-story { padding: 4rem 1.25rem; } .home-client-callout { padding: 3.5rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
