:root {
  --ink: #14161f;
  --ink-soft: #1d2030;
  --paper: #ede9df;
  --paper-dim: #dbd5c6;
  --amber: #e8a33d;
  --slate: #6b7080;
  --signal: #d1553f;
  --line: rgba(237, 233, 223, 0.14);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* Prevent casual drag-and-drop saving of preview images (best-effort deterrent only) */
img { -webkit-user-drag: none; user-drag: none; user-select: none; -webkit-touch-callout: none; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.demo-banner {
  background: var(--amber);
  color: var(--ink);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 16px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 22, 31, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 2px;
}
.brand .dot { color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; white-space: nowrap; margin-left: auto; }
.nav-link-btn {
  background: none; border: none; color: var(--paper); font-size: 14px;
  font-family: var(--font-body); display: flex; align-items: center;
}
.cart-count {
  background: var(--signal); color: var(--paper); font-family: var(--font-mono);
  font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 6px;
}
.btn {
  font-family: var(--font-mono); font-size: 13px; padding: 9px 16px; border-radius: 3px;
  border: 1px solid var(--line); background: transparent; color: var(--paper);
  transition: border-color .15s ease; display: inline-block;
}
.btn:hover { border-color: var(--amber); }
.btn-primary { background: var(--amber); color: var(--ink); border-color: var(--amber); font-weight: 500; }
.btn-primary:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero: search-forward ---------- */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 900px 400px at 20% -10%, rgba(232,163,61,0.14), transparent),
    var(--ink);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero .eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--amber);
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08; margin: 14px 0 12px;
}
.hero .sub { color: var(--slate); max-width: 46ch; font-size: 16px; line-height: 1.55; margin: 0 0 28px; }

.hero-collage {
  position: relative; height: 420px;
}
.hero-collage img {
  position: absolute; border-radius: 6px; object-fit: cover;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4); border: 1px solid var(--line);
}
.hero-collage img:nth-child(1) { width: 62%; height: 90%; top: 0; right: 0; }
.hero-collage img:nth-child(2) { width: 46%; height: 46%; bottom: 0; left: 0; }
.hero-collage img:nth-child(3) { width: 34%; height: 34%; top: 6%; left: 4%; }

.search-panel {
  max-width: 100%;
  background: var(--paper);
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.search-tabs { display: flex; gap: 4px; padding: 4px 4px 10px; }
.search-tab {
  font-family: var(--font-mono); font-size: 12px; padding: 7px 14px; border-radius: 4px;
  border: none; background: none; color: var(--ink); opacity: 0.55;
}
.search-tab.active { background: var(--ink); color: var(--paper); opacity: 1; }
.search-row { display: flex; gap: 8px; padding: 0 4px 4px; }
.search-row input {
  flex: 1; border: none; outline: none; background: #fff; border-radius: 4px;
  padding: 15px 16px; font-family: var(--font-body); font-size: 15px; color: var(--ink);
}
.search-row .btn-primary { padding: 0 22px; border-radius: 4px; font-size: 14px; }
.trending { margin-top: 18px; font-family: var(--font-mono); font-size: 12.5px; color: var(--slate); }
.trending a { text-decoration: underline; text-underline-offset: 3px; margin-left: 8px; color: var(--paper-dim); }
.trending a:hover { color: var(--amber); }

/* ---------- Category tiles ---------- */
.section-heading { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin: 36px 0 16px; }
.category-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-bottom: 8px;
}
.category-tile {
  position: relative; border-radius: 4px; overflow: hidden; height: 96px; cursor: pointer;
  border: 1px solid var(--line);
}
.category-tile img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6) saturate(0.9); transition: filter .15s ease; }
.category-tile:hover img { filter: brightness(0.75) saturate(1); }
.category-tile span {
  position: absolute; bottom: 10px; left: 12px; font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 500; color: var(--paper);
}

/* ---------- Similar photos ---------- */
.similar-wrap { padding: 0 28px 28px; border-top: 1px solid var(--line); margin-top: 8px; }
.similar-wrap h3 { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin: 18px 0 12px; }
.similar-strip { display: flex; gap: 12px; overflow-x: auto; }
.similar-strip img { width: 130px; height: 90px; object-fit: cover; border-radius: 3px; cursor: pointer; border: 1px solid var(--line); }

/* ---------- Pro upgrade popup ---------- */
.pro-modal { max-width: 420px; }
.pro-body { padding: 32px; text-align: center; }
.pro-body h2 { font-family: var(--font-display); font-size: 26px; margin: 8px 0 16px; }
.pro-price { font-family: var(--font-mono); margin-bottom: 20px; }
.pro-price .amount { font-size: 34px; color: var(--amber); font-weight: 600; }
.pro-features { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; }
.pro-features li {
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--paper-dim);
}
.pro-features li::before { content: "✓ "; color: var(--amber); font-weight: 700; }

/* ---------- Sign-in ---------- */
#signedOutLinks, #signedInLinks { display: flex; align-items: center; gap: 10px; }
.google-btn { display: flex; align-items: center; gap: 8px; background: #fff; color: #1f1f1f; border-color: #dcdcdc; font-family: var(--font-body); font-weight: 500; }
.google-btn:hover { border-color: #bbb; }
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 22px 0; border-bottom: 1px solid var(--line); }
.chip {
  font-family: var(--font-mono); font-size: 12px; white-space: nowrap; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 20px; color: var(--slate); background: none;
}
.chip.active { border-color: var(--amber); color: var(--amber); }

/* ---------- Contact sheet grid ---------- */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; padding: 32px 0 60px; }
.frame { position: relative; border: 1px solid var(--line); background: var(--ink-soft); border-radius: 2px; overflow: hidden; cursor: pointer; }
.frame .sprockets {
  display: flex; justify-content: space-between; padding: 0 8px; height: 10px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 14px);
}
.frame-img-wrap { position: relative; overflow: hidden; }
.frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; filter: saturate(0.94); }
.frame-watermark {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    -28deg,
    rgba(255,255,255,0) 0px, rgba(255,255,255,0) 90px,
    rgba(255,255,255,0.16) 90px, rgba(255,255,255,0.16) 92px
  );
  display: flex; align-items: center; justify-content: center;
}
.frame-watermark span {
  font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.55);
  transform: rotate(-28deg); white-space: nowrap; letter-spacing: 0.08em;
}
.frame-badge {
  position: absolute; top: 14px; left: 14px; background: rgba(232,163,61,0.92); color: var(--ink);
  font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 3px; font-weight: 600;
}
.frame-meta { padding: 10px 12px 12px; font-family: var(--font-mono); font-size: 11px; color: var(--slate); }
.frame-title { font-family: var(--font-body); font-size: 13.5px; color: var(--paper); margin: 0 0 4px; font-weight: 500; }
.frame-price { color: var(--amber); }
.frame-add {
  position: absolute; top: 14px; right: 14px; background: rgba(20,22,31,0.82);
  border: 1px solid var(--line); color: var(--paper); font-family: var(--font-mono);
  font-size: 11px; padding: 6px 10px; border-radius: 3px; opacity: 0; transition: opacity .15s ease;
}
.frame:hover .frame-add { opacity: 1; }

/* ---------- Modal (asset detail) ---------- */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,11,16,0.72);
  z-index: 40; align-items: center; justify-content: center; padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--ink); border: 1px solid var(--line); border-radius: 4px;
  max-width: 880px; width: 100%; max-height: 88vh; overflow-y: auto; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  color: var(--paper); font-size: 24px; z-index: 2;
}
.modal-body { display: grid; grid-template-columns: 1.3fr 1fr; }
.modal-body .modal-img-wrap { position: relative; }
.modal-body img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-info { padding: 28px; }
.modal-info h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; }
.modal-meta { font-family: var(--font-mono); font-size: 12px; color: var(--slate); margin-bottom: 20px; }
.license-option { border: 1px solid var(--line); border-radius: 3px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.license-option.selected { border-color: var(--amber); background: rgba(232,163,61,0.06); }
.license-option .name { font-weight: 500; }
.license-option .price { font-family: var(--font-mono); color: var(--amber); float: right; }
.license-option p { color: var(--slate); font-size: 13px; margin: 6px 0 0; }

/* ---------- Cart drawer ---------- */
.drawer-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,11,16,0.6); z-index: 40;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--ink); border-left: 1px solid var(--line); padding: 24px; overflow-y: auto;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.drawer-head h2 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.lt-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lt-row img { width: 60px; height: 46px; object-fit: cover; border-radius: 2px; }
.lt-row-remove { background: none; border: none; color: var(--slate); font-size: 18px; }
.lt-total { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; font-family: var(--font-mono); }
.lt-total .amount { font-size: 22px; color: var(--amber); }
.fine-print { font-size: 11px; color: var(--slate); font-family: var(--font-mono); margin-top: 10px; line-height: 1.5; }

.footer { border-top: 1px solid var(--line); padding: 40px 0 0; color: var(--slate); font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer-blurb { max-width: 32ch; line-height: 1.6; margin-top: 10px; }
.footer h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-dim); margin: 0 0 12px; }
.footer a { display: block; padding: 4px 0; color: var(--slate); }
.footer a:hover { color: var(--amber); }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 18px 0; text-align: center;
  font-family: var(--font-mono); font-size: 12px;
}

/* ---------- Auth / login page ---------- */
.auth-page { max-width: 420px; margin: 0 auto; padding: 56px 28px 100px; }
.auth-card {
  border: 1px solid var(--line); border-radius: 6px; padding: 32px;
  background: var(--ink-soft);
}
.auth-card h1 { font-family: var(--font-display); font-size: 26px; margin: 0 0 8px; }
.auth-sub { color: var(--slate); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.social-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.social-buttons .btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; font-family: var(--font-body); font-weight: 500; }
.social-btn-dark { background: var(--ink-soft); color: var(--paper); border-color: var(--line); }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--slate); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-toggle { text-align: center; margin-top: 16px; font-size: 13px; color: var(--slate); }
.auth-toggle a { color: var(--amber); text-decoration: underline; margin-left: 4px; }
.error-banner {
  background: rgba(209, 85, 63, 0.12); border: 1px solid var(--signal); color: #f2b3a6;
  padding: 10px 14px; border-radius: 3px; font-size: 13px; margin-bottom: 16px;
}
.account-page { max-width: 900px; margin: 0 auto; padding: 56px 28px 100px; }
.account-page h1 { font-family: var(--font-display); font-size: 28px; margin: 0; }
.account-header { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; }
.account-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: var(--ink-soft);
}
.nav-avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); vertical-align: middle;
}
.upload-page { max-width: 540px; margin: 0 auto; padding: 56px 28px 100px; }
.upload-page h1 { font-family: var(--font-display); font-size: 28px; margin: 10px 0 24px; }
.upload-page p { color: var(--slate); line-height: 1.6; }
.field { margin-bottom: 16px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 11px; color: var(--slate);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em;
}
.field input, .field select {
  width: 100%; background: var(--ink-soft); border: 1px solid var(--line); border-radius: 3px;
  color: var(--paper); padding: 10px 12px; font-size: 14px; outline: none; font-family: var(--font-body);
}
.field input:focus, .field select:focus { border-color: var(--amber); }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-preview { width: 100%; border-radius: 3px; margin-bottom: 16px; border: 1px solid var(--line); position: relative; }
.upload-preview img { width: 100%; display: block; border-radius: 3px; }
.success-box {
  border: 1px solid var(--amber); background: rgba(232,163,61,0.08); border-radius: 4px;
  padding: 20px; margin-top: 20px; font-size: 14px;
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

@media (max-width: 780px) {
  .modal-body { grid-template-columns: 1fr; }
  .nav-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .search-row { flex-direction: column; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-collage { display: none; }
}

/* ---------- Legal pages ---------- */
.legal-page { max-width: 700px; margin: 0 auto; padding: 56px 28px 100px; }
.legal-page h1 { font-family: var(--font-display); font-size: 30px; margin-bottom: 4px; }
.legal-updated { color: var(--slate); font-family: var(--font-mono); font-size: 12px; margin-bottom: 28px; }
.legal-page h2 { font-family: var(--font-display); font-size: 19px; margin: 32px 0 10px; font-weight: 500; }
.legal-page p, .legal-page li { color: var(--paper-dim); line-height: 1.7; font-size: 14.5px; }
.legal-page ul { padding-left: 20px; }
.legal-page a { color: var(--amber); }
