/* components.css — shared components that must exist on EVERY page.
   Loaded from _components/partials/head-tail.html (single-sourced), after tokens.css and
   before theme.css. Exists because nav styling is duplicated across solutions.css AND 9
   inline <style> blocks — putting shared component CSS in either would mean 10 edits and
   guaranteed drift. Everything here uses design tokens, so both themes work with no patch. */

/* ---------- brand mark ----------
   Canonical logo: https://appd-assets.pages.dev/logo.gif (Ankit's instruction). Width/height are
   set on the tag so the nav never shifts while it loads, and the source is square so
   object-fit keeps it undistorted. NOTE: the asset is ~953 KB and animated, and its host sends
   Cache-Control: max-age=0, must-revalidate — so it re-checks on every page view. */
.brand-mark { flex-shrink: 0; display: block; width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.brand { gap: 8px; }
@media (max-width: 480px) { .brand-mark { width: 22px; height: 22px; } }

/* ---------- nav dropdown ---------- */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > .nav-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 14px; color: var(--color-text2);
  background: none; border: none; padding: 0; cursor: pointer; transition: color 150ms;
}
.nav-item > .nav-trigger:hover, .nav-item.open > .nav-trigger { color: var(--color-text); }
.nav-item > .nav-trigger .chev { transition: transform 180ms; flex-shrink: 0; }
.nav-item.open > .nav-trigger .chev { transform: rotate(180deg); }
.nav-item > .nav-trigger.active { color: var(--color-primary); }

.nav-panel {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(-6px);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(11, 46, 99, .18);
  padding: 16px; z-index: 200; opacity: 0; visibility: hidden;
  transition: opacity 160ms, transform 160ms, visibility 160ms;
}
/* Desktop open state is pure CSS — :hover for mouse, :focus-within for keyboard. No JS, so it
   cannot break when the soft-nav router swaps the page. JS is only used for the mobile accordion. */
@media (min-width: 901px) {
  .nav-item:hover > .nav-panel,
  .nav-item:focus-within > .nav-panel { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
  .nav-item:hover > .nav-trigger .chev,
  .nav-item:focus-within > .nav-trigger .chev { transform: rotate(180deg); }
}
/* invisible bridge so the pointer can cross the gap without the panel closing */
.nav-panel::before { content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }

.nav-panel-grid { display: grid; gap: 18px 26px; }
.nav-panel-grid.cols-4 { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.nav-panel-grid.cols-1 { grid-template-columns: minmax(230px, 1fr); }
.nav-group-title {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--color-primary);
  margin-bottom: 9px;
}
.nav-panel a {
  display: block; padding: 6px 8px; margin: 0 -8px; border-radius: 7px;
  font-size: 13.5px; line-height: 1.35; color: var(--color-text2);
  transition: background 140ms, color 140ms;
}
.nav-panel a:hover, .nav-panel a:focus-visible { background: var(--color-surface2); color: var(--color-text); }
.nav-panel a b { display: block; font-weight: 600; color: var(--color-text); font-size: 13.5px; }
.nav-panel a span { display: block; font-size: 11.5px; color: var(--color-text3); margin-top: 1px; }

/* Mobile: the nav already collapses to a hamburger under 900px. Render the dropdown as an
   inline accordion inside that panel instead of a floating layer. */
@media (max-width: 900px) {
  .nav-item { display: block; }
  .nav-item > .nav-trigger { width: 100%; justify-content: space-between; padding: 13px 2px; font-size: 16px; border-bottom: 1px solid var(--color-border); }
  .nav-panel {
    position: static; transform: none; opacity: 1; visibility: visible; display: none;
    border: none; box-shadow: none; background: none; padding: 4px 0 10px 10px; border-radius: 0;
  }
  .nav-item.open > .nav-panel { display: block; transform: none; }
  .nav-panel::before { display: none; }
  .nav-panel-grid.cols-4, .nav-panel-grid.cols-1 { grid-template-columns: 1fr; gap: 14px; }
  .nav-panel a { padding: 9px 4px; font-size: 15px; }
  .nav-panel a span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-panel, .nav-item > .nav-trigger .chev { transition: none; }
}

/* ---------- niche case showcase (home + /work/) ---------- */
.niche { margin-top: var(--space-2xl); }
.niche-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.niche-head h3 { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.01em; }
.niche-head p { color: var(--color-text2); font-size: 15px; margin: 0; }
.niche-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.ncase {
  display: block; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 22px; transition: border-color 200ms, transform 200ms, box-shadow 200ms;
}
.ncase:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(11, 46, 99, .10); }
.ncase-tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text3); }
.ncase h4 { font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.3; margin: 9px 0 12px; color: var(--color-text); }
.ncase-ba { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; line-height: 1.45; }
.ncase-before { color: var(--color-text3); }
.ncase-arrow { color: var(--color-primary); flex-shrink: 0; }
.ncase-after { color: var(--color-text); font-weight: 600; }
.ncase-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--color-primary); }

/* headline number for a flagship case visual */
.case-stat { display: grid; place-content: center; text-align: center; gap: 8px; padding: 30px 20px; }
.case-stat b { font-family: var(--font-display); font-size: clamp(46px, 7vw, 76px); line-height: 1; color: var(--color-primary); }
.case-stat span { color: var(--color-text2); font-size: 14.5px; max-width: 260px; margin: 0 auto; }

/* ---------- FAQ (used by product pages today; available to every page) ---------- */
.faq { max-width: 800px; }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 22px 0; }
.faq-q { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--color-text); margin-bottom: 8px; }
.faq-a { color: var(--color-text2); font-size: 15px; }
