/* ==========================================================================
   HandMI Labs — shared stylesheet
   Human AND Machine Intelligence
   ========================================================================== */

:root {
  --bg: #0a0e17;
  --bg-elevated: #0d1220;
  --bg-card: #121729;
  --bg-card-hover: #161d33;
  --border: #212a3d;
  --border-hover: #2c3a56;
  --text: #e8ebf2;
  --text-dim: #9aa3b8;
  --text-faint: #626d85;
  --accent: #29e2c9;
  --accent-2: #6f7bf7;
  --accent-soft: rgba(41, 226, 201, 0.12);
  --accent-2-soft: rgba(111, 123, 247, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px circle at 15% -5%, rgba(111, 123, 247, 0.16), transparent 60%),
    radial-gradient(900px circle at 85% 10%, rgba(41, 226, 201, 0.10), transparent 55%);
  pointer-events: none;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--text-dim); }

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.brand .mark {
  width: auto;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-logo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.hero-logo-wrap::before {
  content: "";
  position: absolute;
  inset: 2%;
  background: radial-gradient(ellipse at center,
    rgba(248, 250, 255, 0.96) 0%,
    rgba(248, 250, 255, 0.92) 50%,
    rgba(248, 250, 255, 0.55) 78%,
    rgba(248, 250, 255, 0) 100%);
  filter: blur(10px);
  border-radius: 32px;
  z-index: 0;
}

.brand .sub {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 0.85em;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-links a.active { color: var(--text); background: var(--bg-card); }

.nav-cta {
  border: 1px solid var(--border-hover) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-body);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111a;
}

.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-secondary:hover { border-color: var(--accent); }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

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

.hero {
  padding: 96px 0 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(41, 226, 201, 0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 820px;
}

.hero .lead {
  font-size: 1.15rem;
  max-width: 640px;
  color: var(--text-dim);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Sections ---------- */

section { padding: 72px 0; }

.section-head { max-width: 640px; margin-bottom: 44px; }

.section-head .eyebrow-sm {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---------- Cards / grids ---------- */

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

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-2-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  margin-bottom: 18px;
}

.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Tags / pills ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-concept { background: rgba(111, 123, 247, 0.15); color: #a5abfa; }
.status-development { background: rgba(41, 226, 201, 0.14); color: var(--accent); }
.status-beta { background: rgba(250, 204, 21, 0.14); color: #facc15; }
.status-production { background: rgba(74, 222, 128, 0.14); color: #4ade80; }

/* ---------- Filter bar (products page) ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111a;
  border-color: transparent;
}

.product-card { display: flex; flex-direction: column; }

.product-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.product-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.product-card .footer-row {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.hidden { display: none !important; }

/* ---------- Contact form ---------- */

.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

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

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

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

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

.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-links a:hover { color: var(--text); }

.footer-bottom {
  font-size: 0.85rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Misc page bits ---------- */

.timeline { border-left: 2px solid var(--border); padding-left: 28px; margin-left: 6px; }

.timeline-item { position: relative; padding-bottom: 36px; }

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.timeline-item h3 { font-size: 1.05rem; margin-bottom: 6px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { flex-direction: column; }
}

.stat-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.stat-row .stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--text);
}

.stat-row .stat span {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.blog-card { display: flex; flex-direction: column; }

.blog-card .meta {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.dim { color: var(--text-dim); }

.cta-band {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 56px;
  text-align: center;
}

@media (max-width: 640px) {
  .cta-band { padding: 36px 24px; }
  .hero { padding: 64px 0 48px; }
}

/* ==========================================================================
   Project detail pages + JSON-driven products
   ========================================================================== */

.loading-state {
  color: var(--text-faint);
  font-size: 0.95rem;
  padding: 40px 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--text); }

.project-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.project-description {
  font-size: 0.98rem;
  color: var(--text-dim);
  line-height: 1.75;
  margin: 8px 0 40px;
  padding: 20px 24px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Screenshots */

.screenshots-section { margin: 40px 0; }

.screenshot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .screenshot-grid { grid-template-columns: 1fr; }
}

.screenshot-slot {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.screenshot-slot.main-shot { aspect-ratio: 16/9; grid-row: span 1; }

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

.screenshot-slot .ss-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.screenshot-slot .ss-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 14, 23, 0.78);
  color: var(--text);
  font-size: 0.75rem;
  padding: 6px 10px;
  text-align: center;
}

.ss-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 16, 0.92);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

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

.ss-lightbox-img {
  max-width: min(90vw, 900px);
  max-height: 75vh;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.ss-lightbox-caption {
  color: var(--text-dim);
  margin-top: 16px;
  font-size: 0.9rem;
}

.ss-lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* Info grid: stack + highlights */

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

@media (max-width: 640px) {
  .info-grid { grid-template-columns: 1fr; }
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.info-card .info-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.stack-list, .highlights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-list li, .highlights-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.stack-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  margin-top: 7px;
  flex-shrink: 0;
}

.highlights-list li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* Restricted info */

.restricted-section { margin-top: 8px; }

.restricted-block {
  display: flex;
  gap: 16px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.restricted-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-2-soft);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.restricted-body strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.restricted-items {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.restricted-items li {
  font-size: 0.85rem;
  color: var(--text-faint);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.restricted-items li::before {
  content: "—";
  color: var(--text-faint);
  flex-shrink: 0;
}
