/* ── Variables ───────────────────────────────────────────────────────────────── */
:root {
  --bg:        #0a0a0c;
  --bg2:       #111116;
  --bg3:       #18181f;
  --surface:   #1e1e28;
  --border:    #2a2a38;
  --gold:      #c9a84c;
  --gold2:     #e8c96e;
  --gold-dim:  rgba(201,168,76,0.15);
  --text:      #f0ede6;
  --text2:     #9a9490;
  --text3:     #5a5660;
  --red:       #e05555;
  --green:     #4caf7d;
  --blue:      #5b8af5;

  --font-head: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 30px rgba(201,168,76,0.2);
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold2); }
img { display: block; max-width: 100%; }

/* ── Grain overlay ───────────────────────────────────────────────────────────── */
.grain {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem 2.5rem;
  background: rgba(10,10,12,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: .4rem;
}
.brand-icon { font-size: 1.1rem; }
.nav-links { display: flex; gap: 1.5rem; margin-left: auto; }
.nav-links a { color: var(--text2); font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.nav-links a:hover { color: var(--gold); }
.nav-actions { display: flex; gap: .75rem; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .55rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-body); font-size: .88rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.btn-primary {
  background: var(--gold); color: #0a0a0c; border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold2); color: #0a0a0c; box-shadow: var(--shadow-gold); }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { opacity: .85; }
.btn-success { background: var(--green); color: #fff; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201,168,76,0.08) 0%, transparent 70%),
              radial-gradient(ellipse 60% 80% at 20% 80%, rgba(91,138,245,0.05) 0%, transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 2; max-width: 760px; }
.hero-label {
  display: inline-block;
  font-size: .75rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-dim);
  padding: .3rem 1rem; border-radius: 100px; margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1.2rem;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero p { font-size: 1.15rem; color: var(--text2); max-width: 520px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Section ─────────────────────────────────────────────────────────────────── */
.section { padding: 5rem 2.5rem; max-width: 1280px; margin: 0 auto; }
.section-header { margin-bottom: 3rem; }
.section-label {
  font-size: .75rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .5rem;
}
.section-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--text);
}

/* ── Tier Filter ─────────────────────────────────────────────────────────────── */
.tier-filter {
  display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.tier-pill {
  padding: .45rem 1.2rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: var(--font-body); font-size: .85rem;
  cursor: pointer; transition: all .2s;
}
.tier-pill:hover, .tier-pill.active { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.tier-pill[data-tier="basic"].active    { border-color: var(--blue); color: var(--blue); background: rgba(91,138,245,.12); }
.tier-pill[data-tier="advanced"].active { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.tier-pill[data-tier="premium"].active  { border-color: #c084fc; color: #c084fc; background: rgba(192,132,252,.12); }

/* ── Photo Grid ──────────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  cursor: pointer;
}
.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--gold);
}
.photo-card-img {
  position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg3);
}
.photo-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photo-card:hover .photo-card-img img { transform: scale(1.05); }

.photo-lock-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(10,10,12,0.85) 100%);
  display: flex; align-items: flex-end; padding: 1rem;
}
.photo-lock-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(10,10,12,0.8);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .3rem .8rem;
  font-size: .78rem; color: var(--text2);
  backdrop-filter: blur(8px);
}
.photo-unlocked-badge {
  background: rgba(76,175,125,0.2);
  border-color: var(--green);
  color: var(--green);
}

.tier-badge {
  position: absolute; top: .75rem; right: .75rem;
  padding: .25rem .7rem;
  border-radius: 100px; font-size: .72rem; font-weight: 500; letter-spacing: .06em;
}
.tier-basic    { background: rgba(91,138,245,.2);  color: #7ba7f7; }
.tier-advanced { background: rgba(201,168,76,.2);  color: var(--gold); }
.tier-premium  { background: rgba(192,132,252,.2); color: #c084fc; }

.photo-card-body { padding: 1rem 1.2rem 1.2rem; }
.photo-card-body h3 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: .25rem; }
.photo-card-body p  { font-size: .82rem; color: var(--text2); margin-bottom: .75rem; }
.photo-card-footer  { display: flex; align-items: center; justify-content: space-between; }
.photo-price { font-size: 1.15rem; font-weight: 700; color: var(--gold); }

/* ── Photo Detail ────────────────────────────────────────────────────────────── */
.detail-layout {
  display: grid; grid-template-columns: 1fr 400px; gap: 3rem;
  max-width: 1200px; margin: 3rem auto; padding: 0 2.5rem;
}
.detail-img-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg3); }
.detail-img-wrap img { width: 100%; }
.detail-blur { filter: blur(12px); transform: scale(1.05); transition: filter .4s; }
.detail-info { display: flex; flex-direction: column; gap: 1.5rem; }
.detail-tier { display: inline-block; margin-bottom: .5rem; }
.detail-info h1 { font-family: var(--font-head); font-size: 2rem; line-height: 1.2; }
.detail-desc { color: var(--text2); font-size: .95rem; line-height: 1.7; }
.detail-meta { display: flex; flex-direction: column; gap: .5rem; }
.detail-meta-row { display: flex; justify-content: space-between; font-size: .88rem; }
.detail-meta-row span:first-child { color: var(--text3); }
.detail-price-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.price-big { font-family: var(--font-head); font-size: 2.2rem; color: var(--gold); margin-bottom: .25rem; }
.price-note { font-size: .82rem; color: var(--text3); margin-bottom: 1rem; }
.payment-methods { display: flex; flex-direction: column; gap: .75rem; }

/* ── Checkout ────────────────────────────────────────────────────────────────── */
.checkout-wrap { max-width: 560px; margin: 4rem auto; padding: 0 2rem; }
.checkout-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
}
.checkout-photo-preview { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; aspect-ratio: 16/9; }
.checkout-photo-preview img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px); transform: scale(1.05); }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.checkout-row { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .6rem; }
.checkout-row .label { color: var(--text2); }
.checkout-total { font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.payment-btn-group { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }
.btn-stripe { background: #635bff; color: #fff; border-color: #635bff; }
.btn-stripe:hover { background: #7b74ff; color: #fff; }
.btn-binance { background: #f3ba2f; color: #0a0a0c; border-color: #f3ba2f; }
.btn-binance:hover { background: #ffca3a; color: #0a0a0c; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .85rem; color: var(--text2); margin-bottom: .4rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  color: var(--text); font-family: var(--font-body); font-size: .95rem;
  outline: none; transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text2); cursor: pointer; }
.form-check input[type=checkbox] { width: auto; }

/* ── Auth ────────────────────────────────────────────────────────────────────── */
.auth-wrap { max-width: 440px; margin: 6rem auto; padding: 0 1.5rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; }
.auth-title { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: .5rem; }
.auth-sub { color: var(--text2); font-size: .9rem; margin-bottom: 2rem; }
.auth-footer { margin-top: 1.5rem; font-size: .88rem; color: var(--text2); text-align: center; }
.error-msg { background: rgba(224,85,85,.1); border: 1px solid var(--red); border-radius: var(--radius); padding: .65rem 1rem; font-size: .88rem; color: var(--red); margin-bottom: 1.25rem; }

/* ── Admin Layout ────────────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 2rem 1.5rem; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 2rem;
}
.admin-sidebar-brand { font-family: var(--font-head); font-size: 1.2rem; color: var(--gold); }
.admin-nav { display: flex; flex-direction: column; gap: .25rem; }
.admin-nav a {
  padding: .6rem .9rem; border-radius: var(--radius);
  color: var(--text2); font-size: .9rem;
  transition: all .2s; display: flex; align-items: center; gap: .5rem;
}
.admin-nav a:hover, .admin-nav a.active { background: var(--gold-dim); color: var(--gold); }
.admin-content { padding: 2.5rem 3rem; overflow-y: auto; }
.admin-header { margin-bottom: 2rem; }
.admin-header h1 { font-family: var(--font-head); font-size: 1.8rem; }
.admin-header p  { color: var(--text2); font-size: .9rem; }

/* ── Stat Cards ──────────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.stat-label { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); margin-bottom: .4rem; }
.stat-value { font-family: var(--font-head); font-size: 2rem; color: var(--gold); }
.stat-sub    { font-size: .8rem; color: var(--text3); margin-top: .2rem; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; }
.table-title { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); font-family: var(--font-head); font-size: 1.1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem 1.5rem; text-align: left; font-size: .88rem; border-bottom: 1px solid var(--border); }
th { color: var(--text3); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: .75rem; background: var(--bg3); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.td-actions { display: flex; gap: .5rem; }

/* ── Status Badges ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .7rem;
  border-radius: 100px; font-size: .75rem; font-weight: 500;
}
.badge-completed { background: rgba(76,175,125,.15); color: var(--green); }
.badge-pending   { background: rgba(248,190,80,.15);  color: #f8be50; }
.badge-failed    { background: rgba(224,85,85,.15);   color: var(--red); }

/* ── Success Page ────────────────────────────────────────────────────────────── */
.success-wrap { max-width: 560px; margin: 6rem auto; padding: 0 2rem; text-align: center; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.success-wrap h1 { font-family: var(--font-head); font-size: 2.2rem; margin-bottom: .75rem; }
.success-wrap p  { color: var(--text2); margin-bottom: 2rem; }

/* ── Flash ───────────────────────────────────────────────────────────────────── */
.flash { padding: .75rem 1.5rem; text-align: center; font-size: .9rem; }
.flash-error   { background: rgba(224,85,85,.15); color: var(--red); }
.flash-success { background: rgba(76,175,125,.15); color: var(--green); }

/* ── Upload Zone ─────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 3rem; text-align: center; cursor: pointer; transition: border-color .2s;
}
.upload-zone:hover { border-color: var(--gold); }
.upload-zone-icon { font-size: 2.5rem; margin-bottom: .75rem; color: var(--text3); }
.upload-zone p { color: var(--text2); font-size: .9rem; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr; }
  .admin-layout  { grid-template-columns: 1fr; }
  .admin-sidebar { height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav     { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg2); padding: 1rem 2rem; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .section { padding: 3rem 1.5rem; }
  .admin-content { padding: 1.5rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .5s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* ── Loading spinner ─────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.2); border-top-color: currentColor;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── BLUR FEATURE 2: Progressive blur overlay ── */
.photo-card.locked .photo-card-img {
  position: relative;
  overflow: hidden;
}

.photo-card.locked .photo-card-img img {
  filter: none; /* image itself stays sharp */
}

/* Frosted glass gradient that gets denser toward the bottom */
.photo-card.locked .photo-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 25%,
    rgba(10,10,12,0.2) 45%,
    rgba(10,10,12,0.6) 65%,
    rgba(10,10,12,0.92) 100%
  );
  backdrop-filter: blur(0px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 20%,
    black 70%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 20%,
    black 70%
  );
  pointer-events: none;
  z-index: 3;
}

/* SVG blur filter approach for true progressive blur */
.photo-card.locked .photo-card-img img {
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 30%,
    rgba(0,0,0,0.6) 60%,
    rgba(0,0,0,0.1) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    black 30%,
    rgba(0,0,0,0.6) 60%,
    rgba(0,0,0,0.1) 100%
  );
}

/* Hidden bottom with price + unlock CTA */
.progressive-blur-cta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 4;
  padding: 1.5rem 1rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.progressive-blur-cta .pb-price {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--gold);
}

.progressive-blur-cta .pb-label {
  font-size: 0.78rem;
  color: var(--text2);
  letter-spacing: 0.06em;
}