/* ============================================================
   pages.css: page-specific styles (shared across pages)
   ============================================================ */

/* ============================================================
   Homepage: Hero
   ============================================================ */
.home-hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: var(--space-24) 0 var(--space-32);
  overflow: hidden;
}
.home-hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  width: 100%;
  position: relative;
  z-index: 2;
}
.home-hero h1 {
  font-size: clamp(2.5rem, 7vw, 6rem);
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-bottom: var(--space-6);
}
.home-hero .hero-subhead {
  font-size: clamp(var(--text-lg), 1.6vw, var(--text-xl));
  color: var(--fg-secondary);
  max-width: 56ch;
  margin-bottom: var(--space-8);
  line-height: var(--lh-normal);
}
.home-hero .hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Hero gradient glow accent */
.home-hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle at center, rgba(246, 213, 56, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Reactive mono character field behind any hero.
   Canvas layer. Dim by default, lights up in accent color around the pointer.
   Works on any section that has position:relative and overflow:hidden.
   See assets/js/hero-field.js */
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  cursor: crosshair;
  /* Soft vignette so the field fades at edges and doesn't crash into text */
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at center, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at center, #000 40%, transparent 100%);
}
/* Inner text in any hero that contains the canvas stays interactive on top.
   Sibling combinator so this works for .home-hero-inner, .service-hero-inner,
   .wm-hero content, and any future hero variant. */
.hero-field ~ * { pointer-events: none; position: relative; z-index: 2; }
.hero-field ~ * a,
.hero-field ~ * button,
.hero-field ~ * .btn,
.hero-field ~ * input,
.hero-field ~ * textarea,
.hero-field ~ * select,
.hero-field ~ * summary,
.hero-field ~ * label { pointer-events: auto; }
/* why-markdown page uses .wm-hero which needs positioning context */
.wm-hero { position: relative; overflow: hidden; }
/* Don't paint the field on touch-only devices (battery + noise). */
@media (hover: none) {
  .hero-field { display: none; }
}

/* ============================================================
   Terminal ticker (bottom-right of hero)
   ============================================================ */
.terminal-ticker {
  position: absolute;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 340px;
  max-width: 40vw;
  height: 1.6em;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-tertiary);
  opacity: 0.65;
  border-left: 2px solid var(--accent-1-dim);
  padding-left: var(--space-3);
  z-index: 2;
  pointer-events: none;
}
.terminal-ticker-track {
  display: flex;
  flex-direction: column;
}
.terminal-ticker-track span {
  display: block;
  line-height: 1.6em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (prefers-reduced-motion: no-preference) {
  .terminal-ticker-track {
    animation: ticker-cycle 12s steps(1, end) infinite;
  }
}
@keyframes ticker-cycle {
  0%, 24%   { transform: translateY(0); }
  25%, 49%  { transform: translateY(-1.6em); }
  50%, 74%  { transform: translateY(-3.2em); }
  75%, 99%  { transform: translateY(-4.8em); }
  100%      { transform: translateY(0); }
}
@media (max-width: 768px) {
  .terminal-ticker { display: none; }
}

/* ============================================================
   Proof strip: 4 columns, dark band
   ============================================================ */
.proof-strip {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-12) 0;
}
.proof-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.proof-item .proof-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-1);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
  display: block;
}
.proof-item p {
  font-size: var(--text-base);
  color: var(--fg-primary);
  line-height: var(--lh-snug);
}
@media (max-width: 768px) {
  .proof-strip-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ============================================================
   Services grid (3x2)
   ============================================================ */
.home-services h2 { margin-bottom: var(--space-3); }
.home-services .section-intro {
  color: var(--fg-secondary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-12);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.services-grid .card { height: 100%; }
.card-featured {
  border-color: var(--accent-1-dim);
  box-shadow: var(--shadow-glow);
  position: relative;
}
.card-featured::after {
  content: "// flagship";
  position: absolute;
  top: var(--space-4);
  right: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-1);
  letter-spacing: 0.1em;
}
.card-featured:hover {
  border-color: var(--accent-1);
  box-shadow: 0 0 32px rgba(246, 213, 56, 0.25);
}
.card-service .card-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-1);
  margin-top: auto;
}
.card-service .card-link:hover { color: var(--fg-primary); }
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
  .card-featured::after { display: none; }
}

/* ============================================================
   Manifesto block
   ============================================================ */
.home-manifesto {
  text-align: center;
}
.home-manifesto h2 {
  margin-bottom: var(--space-8);
}
.home-manifesto p {
  font-size: var(--text-xl);
  color: var(--fg-secondary);
  line-height: var(--lh-normal);
  max-width: 60ch;
  margin: 0 auto;
}
.manifesto-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15em;
  color: var(--fg-primary);
  display: inline;
}

/* ============================================================
   Receipts + Playbooks grids
   ============================================================ */
.home-receipts h2,
.home-playbooks h2 { margin-bottom: var(--space-3); }
.home-receipts .section-intro,
.home-playbooks .section-intro {
  color: var(--fg-secondary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-12);
  max-width: 60ch;
}
.receipts-grid,
.playbooks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}
.receipts-grid .card,
.playbooks-grid .card { height: 100%; }
.card-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-tertiary);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}
.card h3 { margin-bottom: var(--space-3); }
.card p {
  color: var(--fg-secondary);
  font-size: var(--text-base);
  flex: 1;
  margin-bottom: var(--space-4);
}
.card .card-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-1);
  margin-top: auto;
}
.card .card-link:hover { color: var(--fg-primary); }
.section-cta-row { text-align: center; }
@media (max-width: 900px) {
  .receipts-grid,
  .playbooks-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Thesis block
   ============================================================ */
.home-thesis {
  text-align: center;
}
.home-thesis h2 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  margin-bottom: var(--space-8);
  letter-spacing: -0.03em;
}
.home-thesis p {
  font-size: var(--text-lg);
  color: var(--fg-secondary);
  max-width: 58ch;
  margin: 0 auto var(--space-8);
}

/* ============================================================
   CTA band wrapper
   ============================================================ */
.home-cta-band {
  padding: 0 0 var(--space-32);
}
.home-cta-band .container {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ==========================================================================
   Service pages (shared template)
   ========================================================================== */

.service-hero {
  position: relative;
  padding: var(--space-32) 0 var(--space-16);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  min-height: 56vh;
  display: flex;
  align-items: center;
}
@media (max-width: 768px) {
  .service-hero {
    min-height: auto;
    display: block;
    padding-top: var(--space-24);
  }
}
.service-hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  position: relative;
  z-index: 2;
}
.service-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-1);
  text-transform: lowercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-4);
  display: inline-block;
}
.service-hero h1 {
  font-size: clamp(2.25rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
  max-width: 20ch;
  margin-bottom: var(--space-6);
}
.service-hero .subhead {
  font-size: clamp(var(--text-lg), 1.4vw, var(--text-xl));
  color: var(--fg-secondary);
  max-width: 64ch;
  margin-bottom: var(--space-8);
  line-height: var(--lh-normal);
}
.service-hero .cta-row {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  flex-wrap: wrap;
}
.service-hero .cta-row .btn-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* Flagship variant: badge + glow */
.service-hero.flagship {
  background: radial-gradient(ellipse at top right, rgba(246, 213, 56, 0.06), transparent 60%);
}
.service-hero.flagship::before {
  content: "// flagship service";
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-1);
  letter-spacing: 0.1em;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--accent-1-dim);
  border-radius: var(--radius-sm);
  background: rgba(246, 213, 56, 0.04);
}
@media (max-width: 640px) {
  .service-hero.flagship::before {
    position: static;
    display: inline-block;
    margin-bottom: var(--space-6);
  }
}

/* Standard section wrapper */
.service-section {
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--border);
}
.service-section-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.service-section h2 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  letter-spacing: -0.02em;
  line-height: var(--lh-snug);
  max-width: 28ch;
  margin-bottom: var(--space-6);
}
.service-section p {
  color: var(--fg-secondary);
  font-size: var(--text-lg);
  line-height: var(--lh-normal);
  max-width: 64ch;
  margin-bottom: var(--space-4);
}
.service-section ul,
.service-section ol {
  max-width: 68ch;
  margin: var(--space-4) 0 var(--space-4) var(--space-6);
  color: var(--fg-secondary);
  font-size: var(--text-lg);
  line-height: var(--lh-normal);
}
.service-section li {
  margin-bottom: var(--space-3);
}
.service-section li strong {
  color: var(--fg-primary);
  font-weight: 600;
}

/* Stack tag chips */
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
  max-width: 72ch;
}
.stack-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.stack-tag:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
}

/* FAQ */
.service-faq details {
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
  max-width: 72ch;
}
.service-faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}
.service-faq summary {
  cursor: pointer;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--fg-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  transition: color var(--duration-fast) var(--ease-out);
}
.service-faq summary::-webkit-details-marker { display: none; }
.service-faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  color: var(--accent-1);
  line-height: 1;
  transition: transform var(--duration-fast) var(--ease-out);
}
.service-faq details[open] summary { color: var(--accent-1); }
.service-faq details[open] summary::after {
  content: "\2212";
}
.service-faq details > div {
  margin-top: var(--space-4);
  color: var(--fg-secondary);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  max-width: 64ch;
}
.service-faq details > div p { margin-bottom: var(--space-3); }

/* Related playbook card */
.service-related-playbook {
  display: block;
  max-width: 72ch;
  padding: var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-1);
  border-radius: var(--radius-md);
  margin-top: var(--space-6);
  transition: border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.service-related-playbook:hover {
  border-color: var(--accent-1);
  transform: translateY(-2px);
}
.service-related-playbook .playbook-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-1);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  margin-bottom: var(--space-2);
  display: block;
}
.service-related-playbook h3 {
  font-size: var(--text-xl);
  color: var(--fg-primary);
  margin-bottom: var(--space-2);
}
.service-related-playbook .playbook-cta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-1);
}

/* Section CTA band wrapper (reuses cta-band from components.css) */
.service-cta-band-wrap {
  padding: var(--space-16) 0 var(--space-32);
}
.service-cta-band-wrap .container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Services hub grid (what-we-do) */
.hub-why ul {
  max-width: 68ch;
}
.hub-why li {
  color: var(--fg-secondary);
  font-size: var(--text-lg);
  line-height: var(--lh-normal);
}

@media (max-width: 768px) {
  .service-hero { padding: var(--space-16) 0 var(--space-12); }
  .service-section { padding: var(--space-12) 0; }
  .service-hero .cta-row { gap: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  .service-related-playbook,
  .stack-tag,
  .service-faq summary,
  .service-faq summary::after { transition: none; }
  .service-related-playbook:hover { transform: none; }
}
