/* =====================================================
   Nimblecode — Main page styles
   ===================================================== */

/* ── Reset & variables ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0b0b14;
  --bg-card:    #131321;
  --bg-card2:   #1a1a2e;
  --accent:     #7c6fde;
  --accent-lt:  #a99af0;
  --accent2:    #43e5c8;
  --text:       #e2e2ee;
  --text-muted: #8888a8;
  --border:     #26263d;
  --radius:     14px;
  --radius-sm:  8px;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --max-width:  1100px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent-lt); text-decoration: none; }
a:hover { color: var(--accent2); }

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

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: background .18s, color .18s, transform .12s, box-shadow .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: #6a5dcc;
  color: #fff;
  box-shadow: 0 4px 18px rgba(124,111,222,.4);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--accent-lt);
  color: var(--accent-lt);
}

.btn--lg { padding: 14px 30px; font-size: 1rem; border-radius: 10px; }

/* ── Section utilities ─────────────────────────────── */
.section         { padding: 96px 0; }
.section--alt    { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.text-center     { text-align: center; }

.section-label {
  display: inline-block;
  background: rgba(124,111,222,.12);
  color: var(--accent-lt);
  border: 1px solid rgba(124,111,222,.25);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.025em;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}

/* ── Navbar ────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,11,20,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -.025em;
}
.navbar__logo .logo-dot { color: var(--accent2); }
.navbar__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar__links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.navbar__links a:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* ── Hero ──────────────────────────────────────────── */
.hero {
  padding: 108px 0 88px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%, rgba(124,111,222,.2) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 85% 65%, rgba(67,229,200,.09) 0%, transparent 55%);
  pointer-events: none;
}
.hero__eyebrow { margin-bottom: 24px; }
.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.04em;
  margin-bottom: 22px;
}
.hero__title .hl  { color: var(--accent-lt); }
.hero__title .hl2 { color: var(--accent2); }

.hero__subtitle {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 40px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}
.hero__scroll-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  opacity: .6;
}

/* ── About grid ────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.about-text h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: 20px; }
.about-text p   { color: var(--text-muted); margin-bottom: 16px; font-size: .97rem; }
.about-text p:last-child { margin-bottom: 0; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.stat-card__value {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent-lt);
  letter-spacing: -.04em;
  margin-bottom: 6px;
  line-height: 1;
}
.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Apps grid ─────────────────────────────────────── */
.apps-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-top: 60px;
}
.apps-grid .app-card {
  flex: 0 0 calc(33.333% - 18.667px);
  min-width: 280px;
}
.apps-grid[data-cols="2"] .app-card {
  flex: 0 0 calc(50% - 14px);
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.app-card:hover {
  border-color: rgba(124,111,222,.45);
  box-shadow: 0 8px 36px rgba(124,111,222,.12);
  transform: translateY(-4px);
}
.app-card__header { display: flex; align-items: center; gap: 14px; }
.app-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
}
.app-card__icon img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.app-card__icon--purple { background: rgba(124,111,222,.15); }
.app-card__icon--teal   { background: rgba(67,229,200,.12); }
.app-card__icon--orange { background: rgba(255,170,80,.1); }
.app-card__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 2px;
}
.app-card__url {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.app-card__desc {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.72;
  flex: 1;
}
.app-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 0.73rem;
  font-weight: 500;
}
.app-card__footer { padding-top: 4px; }

/* ── Values ────────────────────────────────────────── */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 56px;
}
.value-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.value-card__icon { font-size: 2rem; margin-bottom: 14px; }
.value-card__title { font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.value-card__desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* ── Tech stack ────────────────────────────────────── */
.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 40px;
}
.tech-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.tech-badge:hover { border-color: var(--accent-lt); color: var(--text); }

/* ── CTA final ─────────────────────────────────────── */
.cta-section { text-align: center; }
.cta-section .section-title { margin-bottom: 16px; }
.cta-section p { color: var(--text-muted); max-width: 500px; margin: 0 auto 36px; }
.cta-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-group a img { width: 48px; height: 48px; object-fit: contain; }

/* ── Footer ────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { color: var(--text-muted); transition: color .15s; }
.footer__links a:hover { color: var(--text); }

/* ── Origin stories ────────────────────────────────── */
.origin-stories {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.origin-story {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.origin-story:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.origin-story:first-child {
  padding-top: 0;
}

.origin-story__header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.origin-story__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,111,222,.12);
  border-radius: 12px;
}

.origin-story__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.origin-story__header .section-label {
  margin-bottom: 6px;
  display: block;
}

.origin-story__title {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin: 0;
}

.origin-story__body {
  padding-left: 70px;
}

.origin-story__body p {
  color: var(--text-muted);
  font-size: .97rem;
  line-height: 1.75;
  margin-bottom: 14px;
}

.origin-story__body p:last-child {
  margin-bottom: 0;
}

.origin-story__body strong { color: var(--text); }

.origin-story__link {
  display: inline-block;
  margin-top: 14px;
  margin-left: 70px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent-lt);
  transition: color .15s;
}

.origin-story__link:hover { color: var(--accent2); }

@media (max-width: 600px) {
  .origin-story__body,
  .origin-story__link { padding-left: 0; margin-left: 0; }
}

/* ── Guide cards ───────────────────────────────────── */
.guides-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-top: 48px;
}
.guides-grid .guide-card {
  flex: 0 0 calc(33.333% - 18.667px);
  min-width: 280px;
}
.guides-grid[data-cols="2"] .guide-card {
  flex: 0 0 calc(50% - 14px);
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-card__label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-lt);
}

.guide-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.guide-card__body {
  max-height: 8.5rem;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  transition: max-height .4s ease;
}
.guide-card__body.is-expanded {
  -webkit-mask-image: none;
  mask-image: none;
}

.guide-card__toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-lt);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
  margin-top: -2px;
}
.guide-card__toggle:hover { color: var(--text); }
.guide-card__toggle .toggle-arrow { font-style: normal; }

.guide-card__body p,
.guide-card__body li {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
}

.guide-card__body ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-card__body strong { color: var(--text); }
.guide-card__body em { font-style: italic; }
.guide-card__body code {
  background: var(--bg-card2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .875rem;
  font-family: 'Courier New', monospace;
}

.guide-card__link {
  display: inline-block;
  margin-top: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent-lt);
  transition: color .15s;
}
.guide-card__link:hover { color: var(--accent2); }

/* ── FAQ ───────────────────────────────────────────── */
.faq-list {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-item__question {
  cursor: pointer;
  padding: 18px 22px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
  transition: background .15s;
}
.faq-item__question::-webkit-details-marker { display: none; }
.faq-item__question::after {
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent-lt);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] .faq-item__question::after {
  transform: rotate(45deg);
}
.faq-item__question:hover { background: var(--bg-card2); }

.faq-item__answer {
  padding: 0 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item__answer p {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
}
.faq-item__answer strong { color: var(--text); }
.faq-item__answer code {
  background: var(--bg-card2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .875rem;
  font-family: 'Courier New', monospace;
}
.faq-item__answer a { color: var(--accent-lt); }
.faq-item__answer a:hover { color: var(--accent2); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .section { padding: 64px 0; }
  .hero { padding: 80px 0 60px; }
  .guides-grid .guide-card,
  .guides-grid[data-cols="2"] .guide-card { flex: 0 0 100%; min-width: 0; }
}
@media (max-width: 600px) {
  .navbar__links .hide-mobile { display: none; }
  .apps-grid .app-card,
  .apps-grid[data-cols="2"] .app-card { flex: 0 0 100%; min-width: 0; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .values-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .values-grid { grid-template-columns: 1fr; }
}
