/* ============================================================
   Cannavate — Features hub + feature detail stubs
   ============================================================ */

/* Never inherit Store HQ app-shell scroll lock if modal.css is linked by mistake. */
html:has(body.features-body),
body.features-body {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.features-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse 70% 42% at 8% -8%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 58%),
    var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  --fill: #e9e8e4;
  --fill-quiet: rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.05), 0 4px 12px rgba(20, 20, 20, 0.04);
}

/* Site chrome comes from landing.css (.landing-header is fixed). */
.features-site-header.landing-header {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(1.05) blur(10px);
  -webkit-backdrop-filter: saturate(1.05) blur(10px);
}

.features-main {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: calc(var(--header-h, 56px) + 40px) clamp(16px, 4vw, 28px) 80px;
  animation: featuresEnter 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes featuresEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .features-main { animation: none; }
}

.features-hero {
  margin-bottom: 36px;
  max-width: 640px;
}
.features-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.features-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.features-hero p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.features-group {
  margin-bottom: 34px;
}
.features-group h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.feature-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.feature-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--fill);
}
.feature-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}
.feature-card:hover .feature-card-cover img {
  transform: scale(1.04);
}
.feature-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 16px 16px 14px;
}
.feature-card-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.feature-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.feature-card p {
  margin: 0;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.feature-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
}
.feature-card-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--fill-quiet);
  border-radius: 999px;
  padding: 3px 8px;
}

/* ---------- Detail pages ---------- */

.feature-detail-main {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: calc(var(--header-h, 56px) + 40px) clamp(16px, 4vw, 28px) 80px;
}
.feature-detail-back {
  display: inline-flex;
  margin-bottom: 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.feature-detail-back:hover { text-decoration: underline; }
.feature-detail-hero {
  margin-bottom: 8px;
  max-width: 640px;
}
.feature-detail-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.feature-detail-hero p {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.feature-section {
  margin: 34px 0 0;
}
.feature-section h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.feature-section > p {
  margin: 0 0 16px;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.feature-shot {
  margin: 0;
}
.feature-shot-frame img { cursor: zoom-in; }

/* Related features + demo CTA on feature detail pages */
.feature-related { margin-top: 44px; }
.feature-related h2 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.feature-related-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.feature-related-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feature-related-link:hover { border-color: var(--accent); background: var(--accent-tint); }
.feature-related-link span { font-weight: 650; letter-spacing: -0.01em; }
.feature-related-link small { color: var(--muted); font-size: 12.5px; }

.feature-cta {
  margin-top: 28px;
  padding: 34px 30px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  text-align: center;
}
.feature-cta h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; color: #fff; }
.feature-cta p { margin: 10px auto 0; max-width: 52ch; color: rgba(255, 255, 255, 0.85); }
.feature-cta-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 13px 26px;
  border-radius: 10px;
  background: #fff;
  color: var(--accent-deep, #24322a);
  font-weight: 700;
  text-decoration: none;
}
.feature-cta-btn:hover { background: #f0efe9; }

/* Screenshot lightbox */
.feature-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(15, 15, 15, 0.88);
  cursor: zoom-out;
}
.feature-lightbox[hidden] { display: none; }
.feature-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

@media (max-width: 720px) {
  .feature-related-links { grid-template-columns: 1fr; }
}

.feature-shot-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--fill) 70%, var(--surface)), var(--surface));
  box-shadow: var(--shadow-sm);
}
.feature-shot img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.feature-shot figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.feature-shot-fallback {
  display: none;
  min-height: 220px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}
.feature-shot-fallback span {
  display: block;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.feature-shot-fallback small {
  display: block;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.45;
  font-size: 12.5px;
}
.feature-shot-fallback code {
  font-size: 12px;
  color: var(--ink);
}
.feature-shot.is-missing img { display: none; }
.feature-shot.is-missing .feature-shot-fallback { display: block; }

.features-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.features-foot a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}
.features-foot a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .features-main,
  .feature-detail-main {
    padding-top: calc(var(--header-h, 48px) + 28px);
  }
}
