:root {
  --primary: #2f7bf5;
  --primary-dark: #1e5fd6;
  --navy: #101828;
  --text: #101828;
  --text-muted: #5b667a;
  --border: #e4e8f0;
  --background: #ffffff;
  --surface: #f6f8fb;
  --surface-blue: #eaf1fe;
  --badge-orange-bg: #fde8d7;
  --badge-orange-text: #b45a1f;
  --success: #1a9c5a;
  --success-bg: #e4f7ec;
  --pending-text: #b98a12;
  --pending-bg: #fdf3d9;
  --hold-text: #8a4bd6;
  --hold-bg: #f1e6fc;
  --running-text: #2f7bf5;
  --running-bg: #e6f0fe;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
  --max-width: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------------------------------- Header ------------------------------ */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

/* ---------------------- Site header/footer logo ---------------------- */

.brand-logo-img {
  display: block;
  height: 84px;
  width: auto;
  max-width: 300px;
  object-fit: contain;
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--navy);
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
  color: var(--navy);
}

.main-nav a.nav-active {
  background: var(--surface-blue);
  color: var(--primary);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  position: relative;
}

.nav-toggle {
  flex-direction: column;
  gap: 4px;
}

/* ------------------------------ Buttons ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--background);
  color: var(--navy);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------------------- Hero ----------------------------------- */

.hero {
  background: linear-gradient(180deg, var(--surface-blue) 0%, #ffffff 100%);
  padding: 64px 0 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-orange-bg);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
}

.hero-heading {
  font-size: 44px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--navy);
  margin: 0 0 18px;
  max-width: 640px;
}

.hero-heading .accent {
  color: var(--primary);
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ------------------------------- Stats ----------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0 8px;
}

.stats-grid.stats-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  min-width: 0;
}

.stat-number {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
}

.stat-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ------------------------------ Section ----------------------------------- */

.section {
  padding: 56px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 4px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ------------------------------ Filter bar --------------------------------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.search-field {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}

.search-field input {
  width: 100%;
  padding: 11px 16px 11px 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
}

.search-field input::placeholder {
  color: #9aa4b5;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa4b5;
  pointer-events: none;
  font-size: 14px;
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill.pill-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.status-select-wrap {
  position: relative;
  margin-left: auto;
}

.status-select-wrap select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 34px 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.status-select-wrap::after {
  content: "\25BE";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 12px;
}

/* ------------------------------ Project grid ------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--background);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  overflow: hidden;
}

.project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-media-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #b7c2d6;
  background: var(--surface);
}

.project-card-media.media-fallback .project-card-media-fallback {
  display: flex;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
}

.badge-type {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(16, 24, 40, 0.82);
  color: #fff;
  z-index: 2;
}

.project-card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.project-card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--navy);
}

.project-card-subtitle {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.project-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--surface-blue);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 34px;
  text-align: right;
}

.project-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.badge-status {
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-running {
  background: var(--running-bg);
  color: var(--running-text);
}

.status-pending {
  background: var(--pending-bg);
  color: var(--pending-text);
}

.status-completed {
  background: var(--success-bg);
  color: var(--success);
}

.status-on-hold {
  background: var(--hold-bg);
  color: var(--hold-text);
}

/* ------------------------------ States ------------------------------------ */

.state-block {
  text-align: center;
  padding: 64px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.state-icon {
  font-size: 30px;
  margin-bottom: 10px;
}

.state-title {
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
}

.state-text {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.skeleton-block {
  background: linear-gradient(90deg, var(--surface) 25%, #eef1f6 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: 6px;
  margin-bottom: 10px;
}

.skeleton-media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 12px;
}

@keyframes skeleton-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ------------------------------ Footer ------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 14px;
}

.footer-col p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.8;
}

/* -------------------------------- Toasts ------------------------------------ */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.toast {
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 320px;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  background: #b3261e;
}

.toast-success {
  background: var(--success);
}

/* ---------------------------- Breadcrumb ------------------------------------ */

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 0 0;
}

.breadcrumb a {
  color: var(--primary);
}

.breadcrumb .sep {
  margin: 0 6px;
  color: #b7c2d6;
}

/* ---------------------------- Project details -------------------------------- */

.details-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
  padding: 24px 0 64px;
}

.details-banner {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Responsive height cap only — the image itself is never cropped to fill
     this box, see object-fit: contain below. */
  height: clamp(200px, 32vw, 420px);
}

.details-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 8px;
}

.details-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.details-subtitle {
  color: var(--text-muted);
  margin: 4px 0 0;
  font-size: 14px;
}

.details-about {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 16px 0 28px;
}

.details-block {
  margin-bottom: 28px;
}

.details-block h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
  margin: 0 0 12px;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.screenshot-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.screenshot-thumb:hover,
.screenshot-thumb:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.screenshot-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}

/* ------------------------------ Screenshot lightbox ------------------------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-img {
  display: block;
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}

.updates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.updates-list li {
  border-left: 2px solid var(--surface-blue);
  padding-left: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
  position: sticky;
  top: 90px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.info-row:last-of-type {
  border-bottom: none;
}

.info-row .info-label {
  color: var(--text-muted);
}

.info-row .info-value {
  font-weight: 600;
  color: var(--navy);
}

.info-card .btn {
  margin-top: 16px;
}

/* ------------------------------ Forms ---------------------------------------- */

.form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
}

.form-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 24px;
}

.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: 0 0 14px;
}

.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.type-toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--background);
  transition: all 0.15s ease;
}

.type-toggle-option:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.type-toggle-option.active {
  border-color: var(--primary);
  background: var(--surface-blue);
  color: var(--primary-dark);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.field .required {
  color: #d1453d;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="date"],
.field input[type="number"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  background: var(--background);
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--primary);
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.field-error {
  font-size: 12px;
  color: #d1453d;
  margin-top: 6px;
  display: none;
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: #d1453d;
}

.field.has-error .field-error {
  display: block;
}

.screenshot-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.screenshot-input-row input {
  flex: 1;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

.icon-btn:hover {
  border-color: #d1453d;
  color: #d1453d;
}

.add-link-btn {
  border: 1px dashed var(--border);
  background: var(--background);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

.add-link-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tag-input-field {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.tag-input-field:focus-within {
  border-color: var(--primary);
}

.tag-input-field input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 140px;
  font-size: 14px;
  padding: 6px;
  font-family: inherit;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-blue);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
  font-size: 12px;
  font-weight: 600;
}

.chip button {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.chip button:hover {
  background: rgba(47, 123, 245, 0.2);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.form-status-msg {
  font-size: 13px;
  color: var(--text-muted);
}

/* -------------------------------- Admin -------------------------------------- */

.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 68px);
}

.admin-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 16px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav a,
.admin-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.admin-nav a:hover,
.admin-nav button:hover {
  background: #eef1f6;
  color: var(--navy);
}

.admin-nav a.nav-active {
  background: var(--surface-blue);
  color: var(--primary);
  font-weight: 700;
}

/* Mobile-only admin header controls (three-dot nav + account menu).*/

.admin-header-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.admin-header-menu-wrap {
  position: relative;
}

.admin-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.admin-icon-btn svg {
  width: 20px;
  height: 20px;
}

.admin-icon-btn:hover,
.admin-icon-btn[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-blue);
}

.admin-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}

.admin-dropdown.show {
  display: flex;
}

.admin-dropdown a,
.admin-dropdown button {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.admin-dropdown a:hover,
.admin-dropdown button:hover {
  background: var(--surface);
  color: var(--navy);
}

.admin-dropdown a.nav-active {
  background: var(--surface-blue);
  color: var(--primary);
  font-weight: 700;
}

.admin-main {
  padding: 32px;
}

.admin-page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 4px;
}

.admin-page-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.admin-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  padding: 20px;
}

.admin-panel h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 16px;
}

.admin-login-wrap {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
}

.admin-login-inner {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.admin-login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  text-align: center;
}

.admin-login-logo-img {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
}

.logo-word {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  position: relative;
}

.logo-blue {
  background: linear-gradient(180deg, #4fa3f7, #1e5fd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-orange {
  background: linear-gradient(180deg, #ffb35c, #e8792a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-star {
  position: absolute;
  top: -4px;
  right: -14px;
  font-size: 13px;
  color: #ffb35c;
}

.logo-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.rule-line {
  width: 28px;
  height: 2px;
  border-radius: 999px;
}

.rule-blue {
  background: linear-gradient(90deg, transparent, #2f7bf5);
}

.rule-orange {
  background: linear-gradient(90deg, #e8792a, transparent);
}

.logo-tagline {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--primary-dark);
}

.admin-login-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  background: var(--background);
  box-shadow: var(--shadow);
}

.admin-login-card #login-form .field:last-of-type {
  margin-bottom: 20px;
}

.admin-login-card #login-form label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--primary-dark);
}

.admin-login-card #login-form input {
  background: var(--surface);
}

.admin-login-notice {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  margin: 16px 0 0;
}

.auth-message {
  font-size: 13px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: none;
}

.auth-message.show {
  display: block;
}

.auth-message.error {
  background: #fdeceb;
  color: #b3261e;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-row-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button,
.row-actions a {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
}

.row-actions .danger:hover {
  border-color: #d1453d;
  color: #d1453d;
}

.row-actions a:hover,
.row-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.confirm-overlay.show {
  display: flex;
}

.confirm-card {
  background: var(--background);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.confirm-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 8px 0 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
}

.btn-danger {
  background: #d1453d;
  color: #fff;
}

.btn-danger:hover {
  background: #b3372f;
}

.not-found-block {
  text-align: center;
  padding: 100px 20px;
}

.not-found-block h1 {
  font-size: 22px;
  color: var(--navy);
}

.not-found-block p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* -------------------------------- Responsive ---------------------------------- */

@media (max-width: 960px) {
  .project-grid,
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .details-layout {
    grid-template-columns: 1fr;
  }
  .info-card {
    position: static;
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .stats-grid,
  .stats-grid.stats-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-heading {
    font-size: 32px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    gap: 2px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .main-nav.nav-menu-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }
  .nav-toggle {
    display: flex;
  }
  .project-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid,
  .stats-grid.stats-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .status-select-wrap {
    margin-left: 0;
  }
  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-card {
    padding: 20px;
  }
}

/* ---------------------- Admin header logo ---------------------- */

.brand-admin-logo {
  display: flex;
  align-items: center;
}

.admin-header-logo {
  height: 80px;
  width: auto;
  max-width: 300px;
  object-fit: contain;
}

/* ---------------------- Admin — compact mobile nav ---------------------- */

@media (max-width: 768px) {
  .admin-header-logo {
    height: 100px;
    max-width: 200px;
  }
  .admin-header-actions.is-authed {
    display: flex;
  }
  .admin-sidebar {
    display: none;
  }
  .admin-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .admin-main {
    padding: 20px 16px 40px;
  }
  .admin-page-title {
    font-size: 19px;
  }
  .admin-topbar {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  /* Compact 2-column stat grid (was a single huge full-width column). */
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-box {
    padding: 14px 12px;
    text-align: left;
    min-width: 0;
  }
  .stat-number {
    font-size: 20px;
    line-height: 1.15;
  }
  .stat-label {
    margin-top: 2px;
    font-size: 10px;
  }

  .form-card {
    padding: 20px 16px;
  }
  .admin-login-wrap {
    padding: 32px 16px;
  }
  .tag-input-field input {
    min-width: 90px;
  }

  .admin-table-wrap {
    overflow-x: visible;
  }
  .admin-table {
    min-width: 0;
    width: 100%;
    border: none;
  }
  .admin-table thead {
    display: none;
  }
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--background);
  }
  .admin-table tr:last-child {
    margin-bottom: 0;
  }
  .admin-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: none;
    font-size: 13px;
    text-align: right;
  }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }
  .admin-table-thumb-cell,
  .admin-table td.admin-table-thumb-cell {
    justify-content: flex-start;
    padding-bottom: 10px !important;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .admin-row-thumb {
    width: 40px;
    height: 40px;
  }
  .admin-table td[data-label="Actions"] {
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
  }
  .row-actions {
    justify-content: flex-end;
    width: 100%;
  }
}