/* ── Page-level layout ───────────────────────────────── */
.user-screen {
  min-height: 100vh;
  padding-top: 72px;
  animation: pg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pg-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page hero header ────────────────────────────────── */
.pg-hero {
  padding: 56px 64px 40px;
  background: linear-gradient(180deg, oklch(0.16 0.03 295 / 0.25) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.pg-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--violet);
}
.pg-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: .03em;
  color: var(--text);
  line-height: 1;
  margin: 0 0 12px;
}
.pg-sub {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 520px;
}

/* ── Page body ───────────────────────────────────────── */
.pg-body { padding: 32px 64px 80px; }
.pg-body-narrow { padding: 32px 64px 80px; max-width: 1100px; margin: 0 auto; }

/* ── Back button ─────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: none;
  padding: 0;
  transition: color .2s;
  margin-bottom: 24px;
}
.back-btn:hover { color: var(--text); }

/* ── Tab bar ─────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}
.tab-btn {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: none;
  transition: all .2s;
}
.tab-btn.on {
  background: oklch(0.25 0.04 295 / 0.8);
  color: var(--violet);
  border: 1px solid oklch(0.45 0.2 295 / 0.4);
}
.tab-btn:not(.on):hover { color: var(--text-dim); }

/* ── Search input ────────────────────────────────────── */
.pg-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 16px;
  height: 40px;
  min-width: 260px;
  transition: border-color .2s;
}
.pg-search:focus-within { border-color: oklch(0.5 0.2 295 / 0.6); }
.pg-search-icon { font-size: 13px; opacity: .5; }
.pg-search input {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text);
  width: 100%;
}
.pg-search input::placeholder { color: var(--text-faint); }

/* ── Projects page grid ──────────────────────────────── */
.projects-pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* ── Stat chips row ──────────────────────────────────── */
.stat-chips {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.stat-chip {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}
.stat-chip-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: .02em;
  line-height: 1;
}
.stat-chip-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Project detail ──────────────────────────────────── */
.proj-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}
.proj-detail-visual {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, oklch(0.2 0.04 295), oklch(0.18 0.03 188));
  border: 1px solid var(--border);
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  position: relative;
}
.proj-detail-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, oklch(0.11 0.012 62 / 0.8));
}
.proj-detail-visual-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
}
.proj-detail-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 20px;
  margin-bottom: 24px;
}
.proj-detail-tab {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: none;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.proj-detail-tab.on {
  color: var(--violet);
  border-bottom-color: var(--violet);
}

/* ── Fund sidebar ────────────────────────────────────── */
.fund-sidebar {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: sticky;
  top: 90px;
}
.fund-sidebar-title {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.fund-bar-track {
  height: 6px;
  background: var(--bg-float);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0;
}
.fund-bar-fill-v {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.fund-amount-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  margin: 12px 0;
  transition: border-color .2s;
}
.fund-amount-input:focus { border-color: oklch(0.5 0.2 295 / 0.6); }
.fund-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.fund-preset {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: none;
  transition: all .2s;
}
.fund-preset:hover, .fund-preset.on {
  border-color: var(--violet);
  color: var(--violet);
  background: oklch(0.25 0.04 295 / 0.4);
}

/* ── Funding page ────────────────────────────────────── */
.funding-pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.funding-pg-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color .25s, transform .25s;
  cursor: none;
}
.funding-pg-card:hover {
  border-color: oklch(0.45 0.2 295 / 0.5);
  transform: translateY(-2px);
}

/* ── Community page ──────────────────────────────────── */
.community-pg-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
.community-lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 10px;
  transition: background .15s;
  cursor: none;
}
.community-lb-row:hover { background: oklch(0.2 0.02 295 / 0.5); }

/* ── AR Demo page ────────────────────────────────────── */
.ar-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.ar-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .25s;
  cursor: none;
}
.ar-card:hover { border-color: oklch(0.5 0.2 295 / 0.6); }
.ar-card-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  position: relative;
  background: linear-gradient(135deg, oklch(0.2 0.04 295), oklch(0.18 0.03 188));
}
.ar-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, oklch(0.11 0.012 62 / 0.6), transparent);
}
.ar-card-body { padding: 14px 16px; }

/* ── AR Preview Modal ────────────────────────────────── */
.ar-preview-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.05 0.02 295 / 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pg-in .25s ease both;
}
.ar-preview-box {
  width: min(700px, 95vw);
  position: relative;
  background: oklch(0.1 0.03 295);
  border: 1px solid oklch(0.4 0.2 295 / 0.5);
  border-radius: 20px;
  overflow: hidden;
}
.ar-preview-screen {
  height: 380px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.ar-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(oklch(0.4 0.2 295 / 0.15) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.4 0.2 295 / 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
}
.ar-scan-bar {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
  animation: ar-scan 2.4s ease-in-out infinite;
  box-shadow: 0 0 12px var(--violet);
}
@keyframes ar-scan {
  0%   { top: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.ar-preview-emoji { font-size: 80px; position: relative; z-index: 2; }
.ar-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--violet);
  border-style: solid;
  opacity: .7;
}
.ar-corner.tl { top: 16px; left: 16px; border-width: 2px 0 0 2px; }
.ar-corner.tr { top: 16px; right: 16px; border-width: 2px 2px 0 0; }
.ar-corner.bl { bottom: 16px; left: 16px; border-width: 0 0 2px 2px; }
.ar-corner.br { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; }
.ar-hud-chip {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--violet);
  background: oklch(0.15 0.04 295 / 0.9);
  border: 1px solid oklch(0.4 0.2 295 / 0.5);
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}
.ar-pulse-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime);
  animation: pulse-dot 1.4s ease infinite;
}
.ar-preview-info {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--border);
}

/* ── Submit page ─────────────────────────────────────── */
.submit-pg-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 64px 80px;
}

/* ── Empty state ─────────────────────────────────────── */
.pg-empty {
  text-align: center;
  padding: 80px 40px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.pg-empty-icon { font-size: 40px; display: block; margin-bottom: 16px; }

/* ── Load more button ────────────────────────────────── */
.load-more-btn {
  display: block;
  margin: 32px auto 0;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 28px;
  cursor: none;
  transition: all .2s;
}
.load-more-btn:hover { border-color: var(--violet); color: var(--violet); }

/* ── AR model-viewer panel ───────────────────────────────── */
.ar-model-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 14px;
  flex-wrap: wrap;
}
.ar-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lime);
  background: oklch(0.16 0.06 150 / 0.4);
  border: 1px solid oklch(0.4 0.15 150 / 0.5);
  border-radius: 20px;
  padding: 4px 14px;
}
.ar-model-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ar-model-hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 480px;
}
.ar-model-actions { display: flex; gap: 8px; }

/* ── AR Processing state ─────────────────────────────────── */
.ar-pipeline-state {
  text-align: center;
  padding: 48px 24px;
  background: oklch(0.14 0.03 295 / 0.5);
  border: 1px solid oklch(0.35 0.1 295 / 0.4);
  border-radius: 14px;
}
.ar-pipeline-anim {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ar-pipeline-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--violet);
  border-right-color: oklch(0.6 0.25 295 / 0.4);
  animation: rotate-slow 1.2s linear infinite;
}
.ar-progress-wrap { max-width: 340px; margin: 0 auto; }
.ar-progress-track {
  height: 6px;
  background: var(--bg-float);
  border-radius: 3px;
  overflow: hidden;
}
.ar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px var(--violet);
}

/* ── Submit success pipeline steps ──────────────────────── */
.submit-pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px auto 0;
  max-width: 320px;
  text-align: left;
}
.sps-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
}
.sps-step.done   { color: var(--lime);   border-color: oklch(0.4 0.15 150 / 0.5); }
.sps-step.active { color: var(--violet); border-color: oklch(0.45 0.2 295 / 0.5); }
.sps-spin {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--violet);
  display: inline-block;
  animation: rotate-slow 0.9s linear infinite;
  flex-shrink: 0;
}

/* ══ PAGE RESPONSIVE ═══════════════════════════════════════════════════ */

/* ── ≤ 1024px ── */
@media (max-width: 1024px) {
  .pg-hero        { padding: 48px 40px 32px; }
  .pg-body        { padding: 28px 40px 72px; }
  .pg-body-narrow { padding: 28px 40px 72px; }
  .submit-pg-wrap { padding: 32px 40px 72px; }
}

/* ── ≤ 900px ── */
@media (max-width: 900px) {
  .pg-hero        { padding: 36px 24px 24px; }
  .pg-body        { padding: 24px 24px 60px; }
  .pg-body-narrow { padding: 24px 24px 60px; }
  .submit-pg-wrap { padding: 24px 24px 56px; }

  /* Tab bars — stop overflowing, scroll horizontally */
  .tab-bar { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }

  /* Filter/controls wrapper — reduce side padding and allow wrapping on small screens */
  .community-filter-wrap { padding: 24px 16px 0 !important; flex-wrap: wrap !important; }
  .pg-search { width: 100%; }

  /* Stack two-col form layout */
  .submit-two-col   { grid-template-columns: 1fr !important; gap: 28px !important; }
  .submit-three-col { grid-template-columns: 1fr 1fr !important; }

  /* Project detail */
  .proj-detail-layout { grid-template-columns: 1fr; gap: 20px; }
  .fund-sidebar       { position: static; }

  /* Community */
  .community-pg-grid  { grid-template-columns: 1fr; }
}

/* ── ≤ 600px ── */
@media (max-width: 600px) {
  .pg-hero        { padding: 24px 16px 20px; }
  .pg-body        { padding: 20px 16px 52px; }
  .pg-body-narrow { padding: 20px 16px 52px; }
  .submit-pg-wrap { padding: 16px 16px 52px; }

  .submit-two-col   { grid-template-columns: 1fr !important; gap: 20px !important; }
  .submit-three-col { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

  .pg-title { font-size: clamp(28px, 9vw, 44px); }
  .pg-sub   { font-size: 13px; }

  /* Project cards grid */
  .projects-pg-grid { grid-template-columns: 1fr; }

  /* Stat chips — 2-col on small screens */
  .stat-chips { gap: 8px; }
  .stat-chip  { min-width: 0; flex: 1 1 calc(50% - 4px); }

  /* Funding campaign grid */
  .funding-pg-grid { grid-template-columns: 1fr; }

  /* AR live grid */
  .ar-live-grid { grid-template-columns: 1fr 1fr; }

  /* Project detail tabs */
  .proj-detail-tab  { padding: 10px 12px; font-size: 9px; }
  .proj-detail-visual { height: 200px; font-size: 80px; }

  /* Fund sidebar */
  .fund-presets { flex-wrap: wrap; }

  /* AR model footer */
  .ar-model-footer  { flex-direction: column; align-items: flex-start; }
  .ar-model-actions { flex-wrap: wrap; }

  /* AR processing */
  .ar-pipeline-state { padding: 32px 16px; }

  /* Submit page process time grid */
  .submit-time-grid { flex-wrap: wrap !important; gap: 12px !important; }

  /* Community */
  .community-lb-row { padding: 12px 12px; gap: 10px; }
  .cr-rank  { font-size: 18px; width: 24px; }
  .cr-avatar { width: 36px; height: 36px; font-size: 11px; }
  .cr-rep   { font-size: 20px; }
}
