/* ============================================================
   Bryant's Lab — design system
   ============================================================ */

:root {
  /* surfaces */
  --bg: #0b0e1a;
  --surface: #151a30;
  --surface-2: #1b2140;
  --line: #2a3157;
  --line-soft: #212747;

  /* text */
  --text: #f0f3ff;
  --muted: #98a2cc;
  --dim: #6f7aa6;

  /* brand */
  --accent: #2ee6a8;
  --accent-deep: #00b585;
  --violet: #8b7cff;
  --cyan: #4cc9f0;
  --gold: #ffc046;
  --danger: #ff6b81;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.75);
  --ring: 0 0 0 3px rgba(46, 230, 168, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(139, 124, 255, 0.22) 0%, transparent 62%),
    radial-gradient(900px 560px at 92% -4%, rgba(46, 230, 168, 0.16) 0%, transparent 58%),
    radial-gradient(700px 500px at 50% 105%, rgba(76, 201, 240, 0.1) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }

a { color: var(--accent); text-underline-offset: 3px; }

code {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.88em;
}

::selection { background: rgba(46, 230, 168, 0.3); }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ============================================================
   Header
   ============================================================ */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 14, 26, 0.75);
  backdrop-filter: blur(14px) saturate(140%);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 1.02rem;
  background: linear-gradient(140deg, var(--accent) 0%, var(--cyan) 55%, var(--violet) 100%);
  box-shadow: 0 6px 18px -6px rgba(46, 230, 168, 0.7);
  transition: transform 0.4s var(--ease);
}

.brand:hover .mark { transform: rotate(-8deg) scale(1.06); }

header.site nav {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ============================================================
   Hero
   ============================================================ */

.hero { padding: 56px 0 34px; max-width: 68ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(46, 230, 168, 0.1);
  border: 1px solid rgba(46, 230, 168, 0.3);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  font-weight: 800;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--cyan) 48%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.page-head { padding: 40px 0 8px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.page-head p { margin: 0; color: var(--muted); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 0.94rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 22px -12px rgba(46, 230, 168, 0.6);
}

.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn:disabled {
  opacity: 0.5;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-color: transparent;
  color: #04241a;
  box-shadow: 0 10px 26px -12px rgba(46, 230, 168, 0.85);
}

.btn.primary:hover { box-shadow: 0 16px 32px -12px rgba(46, 230, 168, 0.95); }

.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }

.btn.lg { padding: 13px 26px; font-size: 1rem; }

/* ============================================================
   Forms
   ============================================================ */

label {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
  margin-bottom: 7px;
}

label .hint {
  display: block;
  font-weight: 400;
  color: var(--dim);
  font-size: 0.83rem;
  margin-top: 2px;
}

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #0d1124;
  color: var(--text);
  font: inherit;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

input::placeholder, textarea::placeholder { color: var(--dim); }

input:hover, textarea:hover { border-color: #38416f; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

input[type="file"] {
  padding: 10px 12px;
  cursor: pointer;
  border-style: dashed;
  border-color: #333c68;
  background: #0c1022;
}

input[type="file"]:hover { border-color: var(--accent); background: #0e1430; }

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 0.87rem;
  cursor: pointer;
  transition: background 0.18s var(--ease);
}

input[type="file"]::file-selector-button:hover { background: #262e55; }

textarea { min-height: 120px; resize: vertical; }

.field { margin-bottom: 20px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

/* ============================================================
   Cards & gallery
   ============================================================ */

.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 26, 48, 0.72) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 24px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 26, 48, 0.7) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(46, 230, 168, 0.55);
  box-shadow: 0 26px 50px -20px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(46, 230, 168, 0.14);
}

.product-card:focus-visible { outline: none; box-shadow: var(--ring); }

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, #121737 0%, #0a0d1c 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}

.product-card:hover .thumb img { transform: scale(1.07); }

.thumb .placeholder { font-size: 3rem; opacity: 0.3; }

.thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(11, 14, 26, 0.85), transparent);
  pointer-events: none;
}

.thumb .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(11, 14, 26, 0.82);
  border: 1px solid rgba(46, 230, 168, 0.45);
  color: var(--accent);
  backdrop-filter: blur(6px);
}

.product-card .body { padding: 16px 18px 20px; }

.product-card h3 {
  margin: 0 0 9px;
  font-size: 1.09rem;
  font-weight: 700;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.87rem;
}

.meta + .meta { margin-top: 11px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.79rem;
  color: var(--muted);
}

.chip.accent {
  color: var(--accent);
  border-color: rgba(46, 230, 168, 0.35);
  background: rgba(46, 230, 168, 0.08);
}

.stars {
  color: var(--gold);
  letter-spacing: 2px;
  font-size: 0.95rem;
}

.stars.dim { color: var(--dim); }

/* ============================================================
   Product detail
   ============================================================ */

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  color: var(--dim);
  margin-bottom: 20px;
}

.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 28px; }
}

.shots { display: grid; gap: 14px; position: sticky; top: 84px; }

@media (max-width: 860px) {
  .shots { position: static; }
}

.shot-main {
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  background: linear-gradient(150deg, #121737, #0a0d1c);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}

.shot-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fade 0.35s var(--ease);
}

@keyframes fade {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.shot-strip { display: flex; gap: 10px; flex-wrap: wrap; }

.shot-strip img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  outline: 1px solid var(--line-soft);
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.shot-strip img:hover { opacity: 1; transform: translateY(-2px); }

.shot-strip img.active {
  border-color: var(--accent);
  outline-color: transparent;
  opacity: 1;
}

.detail h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.6vw, 2.15rem);
  font-weight: 800;
}

.lede {
  white-space: pre-wrap;
  margin: 20px 0 0;
  color: #ccd3f5;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.file-row:hover {
  border-color: var(--accent);
  background: rgba(46, 230, 168, 0.07);
  transform: translateX(3px);
}

.file-row .icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.file-row .name { font-weight: 650; word-break: break-word; }
.file-row .size { color: var(--dim); font-size: 0.82rem; }
.file-row .go { margin-left: auto; color: var(--accent); font-size: 1.1rem; }

/* ============================================================
   Reviews
   ============================================================ */

.review { border-top: 1px solid var(--line-soft); padding: 16px 0; }
.review:first-child { border-top: none; padding-top: 0; }
.review:last-child { padding-bottom: 0; }

.review .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #06231b;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  flex-shrink: 0;
}

.review .who { font-weight: 700; }
.review .when { color: var(--dim); font-size: 0.8rem; }
.review p { margin: 8px 0 0; color: #ccd3f5; white-space: pre-wrap; }

.rating-picker { display: flex; gap: 5px; font-size: 1.95rem; line-height: 1; }

.rating-picker button {
  background: none;
  border: none;
  cursor: pointer;
  color: #333c68;
  padding: 0 1px;
  border-radius: 6px;
  transition: transform 0.15s var(--ease), color 0.15s var(--ease);
}

.rating-picker button.on { color: var(--gold); }
.rating-picker button:hover { transform: scale(1.18); }
.rating-picker button:focus-visible { outline: none; box-shadow: var(--ring); }

.rating-label { color: var(--dim); font-size: 0.85rem; margin-top: 8px; }

.score { display: flex; align-items: baseline; gap: 8px; }

.score .big {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ============================================================
   Utility
   ============================================================ */

.notice {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.93rem;
  animation: slip 0.28s var(--ease);
}

@keyframes slip {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice.error {
  background: rgba(255, 107, 129, 0.1);
  border: 1px solid rgba(255, 107, 129, 0.55);
  color: #ffc4cd;
}

.notice.ok {
  background: rgba(46, 230, 168, 0.1);
  border: 1px solid rgba(46, 230, 168, 0.55);
  color: #b3ffe4;
}

.notice[hidden] { display: none; }

.empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--muted);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}

.empty h2 { margin: 0 0 8px; color: var(--text); }
.empty p { margin: 0 0 22px; }

.section-title {
  margin: 38px 0 16px;
  font-size: 1.22rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 11px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}

.muted { color: var(--muted); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }

footer.site {
  border-top: 1px solid var(--line-soft);
  color: var(--dim);
  font-size: 0.87rem;
  padding: 26px 0;
  margin-top: 40px;
}

footer.site .wrap {
  padding-bottom: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

footer.site .wrap .right { margin-left: auto; }

/* Cards animate in as the gallery renders. */
.product-card { animation: rise 0.45s var(--ease) backwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px 56px; }
  .hero { padding: 36px 0 24px; }
  .card { padding: 20px; }
  header.site nav .btn { padding: 9px 14px; font-size: 0.88rem; }
}

/* ============================================================
   Owner portal
   ============================================================ */

.portal { max-width: 900px; }

.gate-card { max-width: 430px; margin: 0 auto; }

.portal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.portal-bar .page-head { padding-bottom: 0; }
.portal-actions { display: flex; gap: 10px; padding-bottom: 4px; }

.btn.danger {
  border-color: rgba(255, 107, 129, 0.5);
  background: rgba(255, 107, 129, 0.1);
  color: #ffc4cd;
}

.btn.danger:hover {
  border-color: var(--danger);
  background: rgba(255, 107, 129, 0.18);
  box-shadow: 0 10px 22px -12px rgba(255, 107, 129, 0.7);
}

.btn.tiny { padding: 6px 12px; font-size: 0.8rem; }

/* --- model list --- */

.admin-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 26, 48, 0.72) 100%);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.admin-row:hover { border-color: var(--accent); transform: translateY(-2px); }

.admin-thumb {
  width: 92px;
  height: 70px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}

.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-thumb .placeholder { font-size: 1.8rem; opacity: 0.35; }

.admin-row-main { flex: 1; min-width: 0; }
.admin-row-main h3 { margin: 0 0 6px; font-size: 1.08rem; }
.admin-row-main .muted { margin: 6px 0 0; font-size: 0.82rem; }
.admin-row-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --- editing a model --- */

.back-link { margin: 0 0 16px; font-size: 0.9rem; }
.back-link a { color: var(--muted); text-decoration: none; }
.back-link a:hover { color: var(--accent); }

.portal #formView .card + .card,
.portal #extras .card { margin-top: 18px; }

.portal .card .section-title:first-child { margin-top: 0; }
.portal .card .empty { padding: 26px 16px; }

#photoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.asset-tile {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.asset-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

.asset-tile figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}

.asset-name {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The file rows are static here, so the hover nudge from the download list
   would just look like a glitch. */
.portal .file-row:hover { transform: none; background: rgba(255, 255, 255, 0.025); }
.portal .file-row .btn { margin-left: auto; flex-shrink: 0; }

.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.review-head .btn { margin-left: auto; }
.review-head .muted { font-size: 0.82rem; }
.portal .review p { margin: 0; color: var(--muted); }

.danger-zone { border-color: rgba(255, 107, 129, 0.35); }
.danger-zone .muted { margin: 0 0 16px; font-size: 0.9rem; }

@media (max-width: 640px) {
  .admin-row { flex-wrap: wrap; }
  .admin-row-main { flex-basis: 100%; order: 3; }
  .admin-row-actions { margin-left: auto; }
  .portal-bar { align-items: flex-start; }
}
