/* ==========================================================================
   Digital Social — pages.css
   Page-level layouts.
   ========================================================================== */

/* ---------- Page hero ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #FBF9F1, var(--white));
  color: var(--text);
  padding: var(--space-7) 0 var(--space-6);
  border-bottom: 1px solid var(--line);
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(50% 70% at 88% 0%, rgba(219, 190, 108, 0.16), transparent 70%);
  pointer-events: none;
}
.page-hero > .container { position: relative; }
.page-hero-title { font-size: clamp(1.9rem, 1.3rem + 3.4vw, 3.4rem); letter-spacing: -0.035em; margin: 0 0 1rem; max-width: 22ch; }
.page-hero-lead { font-size: clamp(1.02rem, 0.95rem + 0.5vw, 1.2rem); color: var(--text-muted); max-width: 60ch; margin-bottom: 0; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.page-hero .section-lead, .page-hero .section-lead-lg { color: var(--text-muted); max-width: 66ch; }
.page-hero .section-lead p { margin-bottom: 0.85rem; }

/* ---------- Jump nav (services) ---------- */
.jump-nav { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.jump-nav a { padding: 0.55rem 1rem; border: 1px solid var(--border-gold); border-radius: 999px; font-size: 0.9rem; }
.jump-nav a:hover { border-color: var(--gold-strong); }

.service-group { scroll-margin-top: calc(var(--header-height) + 20px); }
.service-detail-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.service-detail { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; background: var(--surface); display: flex; flex-direction: column; }
.section-dark .service-detail { background: var(--surface); border-color: var(--line); }
.service-detail-title { font-size: 1.35rem; margin-bottom: 0.4rem; }
.service-detail-summary { color: var(--text-muted); }
.section-dark .service-detail-summary { color: var(--text-muted); }
.service-detail-list { display: grid; grid-template-columns: 1fr; gap: 0.25rem; margin: 0.5rem 0 1.25rem; }
.service-detail-list dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-strong); margin-top: 0.75rem; }
.service-detail-list dd { margin: 0; color: var(--ink-soft); }
.section-dark .service-detail-list dd { color: var(--ink-soft); }
.service-detail-list dd ul { display: flex; flex-direction: column; gap: 0.3rem; }
.service-detail-list dd ul li { padding-left: 1rem; position: relative; }
.service-detail-list dd ul li::before { content: ""; position: absolute; left: 0; top: 0.6rem; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.service-detail .link-arrow { margin-top: auto; }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.work-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.work-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--light-2); }
.work-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.work-card:hover .work-card-media img { transform: scale(1.03); }
.work-card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.work-card-industry { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-strong); margin: 0; }
.work-card-title { font-size: 1.3rem; margin: 0; }
.work-card-title a:hover { color: var(--gold-strong); }
.work-card-text { color: var(--text-muted); margin: 0; font-size: 0.96rem; }
.work-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.work-card-tags li { font-size: 0.78rem; padding: 0.3rem 0.6rem; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); }
.work-card .link-arrow { margin-top: auto; padding-top: 0.5rem; }

/* ---------- Case study ---------- */
.case-facts { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.case-facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.case-facts dd { margin: 0.2rem 0 0; color: var(--text); }
.case-hero-image { margin: var(--space-6) 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.case-hero-image img { width: 100%; }
.case-block { margin-bottom: 2rem; }
.case-block h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold-strong); margin-bottom: 0.5rem; }
.case-block p { color: var(--ink-soft); }
.case-note { font-size: 0.88rem; color: var(--text-muted); border-top: 1px solid var(--line); padding-top: 0.9rem; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1rem; }
.metrics dt { font-size: 0.8rem; color: var(--text-muted); }
.metrics dd { margin: 0; font-size: 1.6rem; font-weight: 680; }
.content-placeholder { font-family: var(--font-mono); font-size: 0.9rem; background: var(--surface-alt); border: 1px dashed var(--gold-strong); border-radius: 8px; padding: 0.8rem 1rem; color: var(--ink-soft); }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.6rem; }
.section-dark .price-card { background: var(--surface); border-color: var(--line); }
.price-card-title { font-size: 1.25rem; margin: 0; }
.price-card-price { font-size: 1.5rem; font-weight: 680; margin: 0; color: var(--text); }
.section-dark .price-card-price { color: var(--gold-strong); }
.price-unit { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.price-card-desc { color: var(--text-muted); margin: 0; }
.section-dark .price-card-desc, .section-dark .price-card-best { color: var(--text-muted); }
.price-card-best { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.price-card .btn { margin-top: auto; }
.price-card-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-strong); margin: 0; font-weight: 640; }

/* ---------- Engagement model cards ---------- */
.model-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.model-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.model-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.model-card.is-featured { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), var(--shadow-md); }
.model-tag { align-self: flex-start; font-size: 0.72rem; font-weight: 640; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.6rem; }
.model-tag-gold { color: var(--text); background: var(--gold); border-color: var(--gold); }
.model-title { font-size: 1.35rem; margin: 0.35rem 0 0; }
.model-sub { font-size: 0.85rem; color: var(--gold-strong); margin: 0; font-weight: 620; }
.model-desc { color: var(--text-muted); margin: 0.35rem 0 0.7rem; }
.model-includes { margin-bottom: 0.5rem; }
.model-price { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.model-card .btn { margin-top: auto; }

/* ---------- Investment visual ---------- */
.invest-visual { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.invest-list { margin-top: 1.25rem; }
.invest-bars { display: flex; align-items: flex-end; gap: 0.6rem; height: 210px; }
.invest-bars span { flex: 1; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--gold), var(--gold-strong)); transform-origin: bottom; }
.invest-bars span:nth-child(1) { height: 24%; }
.invest-bars span:nth-child(2) { height: 34%; }
.invest-bars span:nth-child(3) { height: 45%; }
.invest-bars span:nth-child(4) { height: 58%; }
.invest-bars span:nth-child(5) { height: 71%; }
.invest-bars span:nth-child(6) { height: 84%; }
.invest-bars span:nth-child(7) { height: 97%; }
.invest-caption { margin: 1rem 0 0; text-align: center; font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text-muted); }

.js .invest-bars span { animation: investGrow 0.7s var(--ease) both; }
.js .invest-bars span:nth-child(1) { animation-delay: 0.05s; }
.js .invest-bars span:nth-child(2) { animation-delay: 0.12s; }
.js .invest-bars span:nth-child(3) { animation-delay: 0.19s; }
.js .invest-bars span:nth-child(4) { animation-delay: 0.26s; }
.js .invest-bars span:nth-child(5) { animation-delay: 0.33s; }
.js .invest-bars span:nth-child(6) { animation-delay: 0.4s; }
.js .invest-bars span:nth-child(7) { animation-delay: 0.47s; }
@keyframes investGrow {
  from { transform: scaleY(0.15); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

@media (min-width: 640px) {
  .model-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .model-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Insights / article ---------- */
.insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.insight-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.insight-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.insight-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--light-2); }
.insight-card-media img { width: 100%; height: 100%; object-fit: cover; }
.insight-card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.insight-card-meta { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.insight-cat { color: var(--gold-strong); font-weight: 620; }
.insight-card-title { font-size: 1.25rem; margin: 0; }
.insight-card-title a:hover { color: var(--gold-strong); }
.insight-card-text { color: var(--text-muted); margin: 0; font-size: 0.95rem; }
.insight-card .link-arrow { margin-top: auto; padding-top: 0.35rem; }

.article-meta { color: var(--text-muted); font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.article-meta a { color: var(--gold); }
.article-hero-image { margin: var(--space-6) 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.article-hero-image img { width: 100%; }
.article-body { max-width: 720px; }
.article-body h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); margin: 2.2rem 0 0.7rem; }
.article-body p { font-size: 1.075rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem; padding-left: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.article-body ul li { padding-left: 1.3rem; position: relative; }
.article-body ul li::before { content: ""; position: absolute; left: 0; top: 0.65rem; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-strong); }
.article-body ol { counter-reset: li; }
.article-body ol li { padding-left: 1.6rem; position: relative; counter-increment: li; }
.article-body ol li::before { content: counter(li) "."; position: absolute; left: 0; color: var(--gold-strong); font-weight: 620; }
.article-body blockquote { border-left: 3px solid var(--gold); padding: 0.4rem 0 0.4rem 1.2rem; margin: 1.5rem 0; font-size: 1.15rem; }
.article-body blockquote p { margin: 0; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
.contact-direct-title, .contact-form-title { font-size: 1.4rem; }
.contact-options { display: flex; flex-direction: column; gap: 1rem; }
.contact-option { display: flex; align-items: center; gap: 1rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.contact-option-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-alt); color: var(--gold-strong); flex: none; }
.contact-option h3 { font-size: 1.05rem; margin: 0 0 0.2rem; }
.contact-option p { margin: 0 0 0.35rem; color: var(--text-muted); font-size: 0.95rem; }
.contact-social { display: flex; flex-wrap: nowrap; gap: 0.5rem; margin-top: 0.4rem; }
.contact-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--ink-soft);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}
.contact-social a:hover { color: var(--gold-strong); border-color: var(--gold-strong); background: rgba(219, 190, 108, 0.12); }
.contact-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; background: var(--surface); }
.contact-form .form-actions { margin-top: 1.25rem; }

/* ---------- Legal ---------- */
.legal-body h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--ink-soft); }
.legal-body ul { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.legal-body ul li { padding-left: 1.2rem; position: relative; }
.legal-body ul li::before { content: ""; position: absolute; left: 0; top: 0.6rem; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-strong); }
.legal-body a { color: var(--gold-strong); text-decoration: underline; }

/* ---------- Errors ---------- */
.error-page { padding: var(--space-8) 0; min-height: 50vh; display: flex; align-items: center; }
.error-code { font-size: clamp(3rem, 2rem + 8vw, 7rem); font-weight: 720; line-height: 1; color: var(--gold); margin: 0 0 0.5rem; letter-spacing: -0.04em; }
.error-title { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); margin-bottom: 0.75rem; }
.error-text { color: var(--text-muted); font-size: 1.05rem; max-width: 52ch; }
.error-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.error-links { color: var(--text-muted); font-size: 0.92rem; }
.error-links a { text-decoration: underline; color: var(--gold-strong); }

/* ---------- Nav pills in a 2-column grid (jump-nav, related links) ---------- */
.jump-nav,
.related-industries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.jump-nav a,
.related-industries a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}

/* ---------- Filter dropdown (shown on mobile, replaces filter pills) ---------- */
.filter-select { display: none; margin-bottom: 2rem; }
.filter-select select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
@media (max-width: 767px) {
  .filter-bar { display: none; }
  .filter-select { display: block; }
}
/* Tighten work/insight cards so two fit comfortably on small screens */
@media (max-width: 599px) {
  .work-grid, .insights-grid { gap: 0.75rem; }
  .work-card-body, .insight-card-body { padding: 1rem; gap: 0.4rem; }
  .work-card-title, .insight-card-title { font-size: 1.05rem; }
  .work-card-text, .insight-card-text { font-size: 0.88rem; }
  .work-card-industry, .insight-card-meta { font-size: 0.72rem; }
}

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  .work-grid, .insights-grid, .pricing-grid, .service-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .case-facts { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .service-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-layout { grid-template-columns: 0.9fr 1.1fr; }
}

@media (min-width: 1024px) {
  .work-grid, .insights-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .sg-pulse, .site-link-pulse { display: none; }
  .sg-live, .sg-bars span, .sg-outputs li { animation: none !important; }
  .sg-bars span { height: 70%; opacity: 0.9; }
  .sg-layer::after { display: none; }
  .ac-live, .ac-activity-dot, .ac-activity li::before { animation: none !important; }
  .ac-bar-track i { width: var(--w, 70%); animation: none; }
  .ac-chart span { transform: scaleY(1); animation: none !important; }
  .automation-console::before,
  .automation-console::after { animation: none !important; }
  .float-badge { animation: none !important; }
  .js .invest-bars span { animation: none !important; }
  .js .connection-grid.is-revealed li,
  .js .flow-step.is-revealed { animation: none !important; }
  .js .process-timeline::after { height: 100% !important; transition: none; }
  .js .before-after .ba-before .ba-list li::after { transform: scaleX(1); transition: none; }
  .js .before-after .ba-after .ba-list li .ba-check { transform: none; opacity: 1; transition: none; }
  .js .process-step:not(.is-revealed)::before { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); transform: none; }
  .js .hero .eyebrow, .js .hero-title, .js .hero-lead, .js .hero-actions, .js .hero-reassurance, .js .hero-visual, .js .hero-assessment,
  .js .page-hero .eyebrow, .js .page-hero-title, .js .page-hero-lead, .js .page-hero .section-lead, .js .page-hero-actions, .js .case-facts,
  .mobile-bar,
  .assessment-step.is-active, .assessment-result.is-visible, .chip.is-active { animation: none !important; }
  .spotlight::before { display: none; }
  .logo-slider { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .logo-slider-track { animation: none !important; }
  .btn:hover, .service-card:hover, .work-card:hover, .insight-card:hover { transform: none; }
}

/* ==========================================================================
   Dark mode component overrides (tokens defined in base.css)
   ========================================================================== */
[data-theme="dark"] body { background: var(--page-bg); color: var(--text); }
[data-theme="dark"] .section { background: var(--page-bg); }
[data-theme="dark"] .hero { background: var(--page-bg); }
[data-theme="dark"] .page-hero {
  background: linear-gradient(180deg, #12161B, var(--page-bg));
  border-bottom-color: var(--line);
}
[data-theme="dark"] .cta-band {
  background: linear-gradient(180deg, #121620, #0F1318);
  border-color: rgba(219, 190, 108, 0.28);
}
[data-theme="dark"] .assessment { background: var(--surface); }
[data-theme="dark"] .assessment-compact { background: linear-gradient(180deg, #171B22, var(--surface)); }
[data-theme="dark"] .assessment-result { background: rgba(219, 190, 108, 0.10); }
[data-theme="dark"] .process-step::before { border-color: var(--page-bg); }
[data-theme="dark"] .filter-btn.is-active { background: var(--gold); color: #14161a; border-color: var(--gold); }
[data-theme="dark"] .service-pills li,
[data-theme="dark"] .tag-cloud li,
[data-theme="dark"] .work-card-tags li,
[data-theme="dark"] .ba-col { background: var(--surface); }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #7d848c; }
[data-theme="dark"] .automation-console { border-color: rgba(255, 255, 255, 0.18); }
/* Client logos are dark artwork — keep them on light chips in dark mode */
[data-theme="dark"] .logo-slide { background: rgba(247, 245, 239, 0.96); border-radius: 14px; }
[data-theme="dark"] .logo-slide img { filter: none; }
[data-theme="dark"] .btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

/* Keep text on gold backgrounds dark in dark mode */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .chip.is-active,
[data-theme="dark"] .sg-layer-mark,
[data-theme="dark"] .ac-brand,
[data-theme="dark"] .model-tag-gold,
[data-theme="dark"] .mobile-bar-primary,
[data-theme="dark"] .option:has(input:checked) .option-box,
[data-theme="dark"] .option:has(input:checked) .option-check { color: #14161a; }
