@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;700;800;900&display=swap');

:root {
  --bg-page:      #000000;
  --bg-card:      #0d0d0d;
  --bg-input:     #080808;
  --bg-hover:     #161616;
  --border:       #1f1f1f;
  --border-hover: #2e2e2e;
  --accent:       #7fd957;
  --accent-hover: #96e86e;
  --accent-dim:   rgba(127,217,87,0.12);
  --action:       #7fd957;
  --action-hover: #96e86e;
  --action-text:  #000000;
  --text-h:       #ffffff;
  --text-body:    #cccccc;
  --text-muted:   #555555;
  --text-grey:    #888888;
  --tag-cloud:    rgba(127,217,87,0.12);
  --tag-cloud-t:  #7fd957;
  --tag-mesh:     rgba(127,217,87,0.07);
  --tag-mesh-t:   #96e86e;
  --tag-tour:     rgba(127,217,87,0.05);
  --tag-tour-t:   #7fd957;
  --radius:    12px;
  --radius-sm: 6px;
  --shadow:    0 8px 40px rgba(0,0,0,0.8);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Brand logo ── */
.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 2px;
}
.brand-near {
  font-size: 52px;
  font-weight: 900;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  letter-spacing: -1px;
  line-height: 1;
}
.brand-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  align-self: flex-start;
}
.brand-tec {
  font-size: 18px;
  font-weight: 700;
  color: #7fd957;
  font-family: 'Nunito', sans-serif;
}
.brand-vertical {
  font-size: 18px;
  font-weight: 500;
  color: #888888;
  font-family: 'Nunito', sans-serif;
}
.brand-logo-sm {
  flex-direction: row;
  align-items: baseline;
  gap: 0;
}
.brand-logo-sm .brand-near     { font-size: 22px; letter-spacing: -0.5px; }
.brand-logo-sm .brand-sub      { margin-left: 0; align-self: auto; flex-direction: row; gap: 4px; }
.brand-logo-sm .brand-tec      { font-size: 11px; margin-left: 5px; }
.brand-logo-sm .brand-vertical { font-size: 11px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--action);
  color: var(--action-text);
}
.btn-primary:hover:not(:disabled) { background: var(--action-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-hover);
}
.btn-sm    { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ── Form inputs ── */
.form-group {
  margin-bottom: 14px;
  text-align: left;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-h);
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }

/* ── Tags ── */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.tag-blue   { background: var(--tag-cloud); color: var(--tag-cloud-t); }
.tag-teal   { background: var(--tag-mesh);  color: var(--tag-mesh-t);  }
.tag-purple { background: var(--tag-tour);  color: var(--tag-tour-t);  }

/* ── Header ── */
.portal-header,
.viewer-header {
  height: 60px;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-name    { font-size: 13px; color: var(--text-muted); }

/* ── Login page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 15% 100%, rgba(30,20,120,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 85% 5%,  rgba(20,60,20,0.4)  0%, transparent 55%),
    #000000;
}
.login-card {
  background: rgba(10,10,10,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 48px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 40px; }
.login-card h1   { color: var(--text-h); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.login-subtitle  { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; line-height: 1.7; }
.login-footer    { margin-top: 28px; font-size: 11px; color: var(--text-muted); }

/* ── Dashboard ── */
.dashboard-main { padding: 40px 0 80px; }
.container      { max-width: 1400px; margin: 0 auto; padding: 0 28px; }
.section-title  { color: var(--text-h); font-size: 18px; font-weight: 700; margin-bottom: 24px; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(127,217,87,0.08);
}
.card-thumb {
  height: 190px;
  background-size: cover;
  background-position: center;
  background-color: #080808;
  position: relative;
}
.card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.9));
}
.card-body   { padding: 20px; flex: 1; }
.card-title  { color: var(--text-h); font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.card-desc   { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.card-tags   { display: flex; flex-wrap: wrap; gap: 6px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }

/* ── States ── */
.loading-state, .empty-state, .error-state {
  color: var(--text-muted);
  font-size: 14px;
  padding: 80px 24px;
  text-align: center;
  grid-column: 1 / -1;
}

/* ── Viewer ── */
.viewer-page   { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.viewer-header { flex-shrink: 0; }
.viewer-title  {
  color: var(--text-h);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}
.viewer-tabs {
  flex-shrink: 0;
  display: flex;
  background: #000000;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.tab-btn {
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tab-btn:hover  { color: var(--text-body); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.viewer-body  { flex: 1; position: relative; overflow: hidden; }
.tab-panel    { position: absolute; inset: 0; }
.full-viewer  { width: 100%; height: 100%; border: none; display: block; }

.viewer-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: var(--text-muted);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  z-index: 5;
  flex-direction: column;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid #1f1f1f;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .login-card   { padding: 40px 24px; }
  .header-inner { padding: 0 16px; }
  .container    { padding: 0 16px; }
  .viewer-title { max-width: 160px; }
  .tab-btn      { padding: 12px 10px; font-size: 11px; }
  .brand-near   { font-size: 42px; }
}