/* ============================================================
   STUCCI THEME — UPGRADE LAYER v1.1 (2026-10-17)
   Load AFTER style.css. Transform/opacity only. Every motion
   rule is inside prefers-reduced-motion: no-preference and keyed
   off html.js so nothing can strand content invisible.
   ============================================================ */

:root {
  --ease-out-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-lift: 0 2px 4px rgba(11, 15, 20, 0.04), 0 16px 40px -16px rgba(11, 15, 20, 0.16);
  --shadow-lift-copper: 0 2px 4px rgba(168, 90, 46, 0.08), 0 18px 44px -16px rgba(168, 90, 46, 0.28);
}

/* ── 1. FIX: capability grid first-card span bug ─────────────
   .svc-included > div:first-child was spanning 2 cols × 2 rows
   with no featured content (web-development, about, mobile-app).
   Equal cells, icon slot, hover depth. */
@media (min-width: 768px) {
  .svc-included > div:first-child { grid-column: auto; }
}
@media (min-width: 1024px) {
  .svc-included > div:first-child { grid-row: auto; }
}
.svc-included > div:first-child {
  border: 1px solid var(--stucci-border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: none;
  padding: 1.75rem;
  display: block;
}
.svc-included > div:first-child h3 { font-size: inherit; }
@media (min-width: 1024px) { .svc-included > div:first-child h3 { font-size: inherit; } }
.svc-included > div:first-child:hover { box-shadow: var(--shadow-lift); }
.svc-included > div {
  position: relative;
  padding: 1.75rem 1.75rem 1.75rem 1.75rem;
  background: #fff;
  border: 1px solid var(--stucci-border);
  border-radius: var(--radius-sm);
  transition: transform .3s var(--ease-out-quint), box-shadow .3s var(--ease-out-quint), border-color .3s var(--ease-out-quint);
}
.svc-included > div::before {
  /* icon slot: a bronze hairline bracket, no asset required */
  content: "";
  display: block;
  width: 28px; height: 28px;
  margin-bottom: 1rem;
  border: 1.5px solid var(--stucci-accent);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 2px;
  transition: transform .4s var(--ease-out-quint);
}
.svc-included > div:hover::before { transform: rotate(90deg); }

/* ── 2. Card hover depth (cards were inert) ──────────────────── */
@media (hover: hover) {
  .svc-included > div:hover,
  .post-card:hover,
  .portfolio-card:hover,
  .discipline-cell:hover,
  .svc-why > div:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: rgba(168, 90, 46, 0.4);
  }
  .discipline-cell:hover .discipline-cell__stat .icon,
  .post-card:hover .icon,
  .btn-solid:hover .icon { transform: translateX(4px); }
  .discipline-cell__stat .icon, .btn-solid .icon { transition: transform .3s var(--ease-out-quint); }
}
.discipline-cell { position: relative; z-index: 0; }
.discipline-cell:hover { z-index: 1; background: #fff; }

/* ── 3. Portfolio / article image reveal ─────────────────────── */
.portfolio-card img, .post-card img {
  transition: transform .7s var(--ease-out-quint);
  will-change: transform;
}
@media (hover: hover) {
  .portfolio-card:hover img, .post-card:hover img { transform: scale(1.04); }
}
.portfolio-card > a:first-child, .portfolio-card figure { position: relative; overflow: hidden; }
.portfolio-card > a:first-child::after, .portfolio-card figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,15,20,.55) 0%, rgba(11,15,20,0) 45%);
  opacity: 0; transition: opacity .4s var(--ease-out-quint); pointer-events: none;
}
.portfolio-card:hover > a:first-child::after, .portfolio-card:hover figure::after { opacity: 1; }

/* ── 4. Primary button: copper lift + magnetic hook ──────────── */
.btn-solid {
  position: relative;
  transition: background-color .2s ease, transform .35s var(--ease-out-soft), box-shadow .35s var(--ease-out-soft);
  will-change: transform;
}
@media (hover: hover) {
  .btn-solid:hover { box-shadow: var(--shadow-lift-copper); }
  .btn-solid.is-magnetic { transition: background-color .2s ease, transform .12s linear, box-shadow .35s var(--ease-out-soft); }
}
.btn-solid:active { transform: translateY(1px) scale(.99); }

/* ── 5. FAQ accordion: animated height, rotating chevron ─────── */
.svc-faq details { transition: border-color .25s ease, box-shadow .25s ease; }
.svc-faq details[open] { border-color: rgba(168, 90, 46, 0.5); box-shadow: var(--shadow-sm); }
.svc-faq summary svg, .svc-faq summary .icon { transition: transform .35s var(--ease-out-quint); flex: none; }
.svc-faq details[open] summary svg, .svc-faq details[open] summary .icon { transform: rotate(180deg); }
.svc-faq details > :not(summary) { animation: faqBody .38s var(--ease-out-quint) both; }
@keyframes faqBody { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── 6. Header glass ─────────────────────────────────────────── */
.site-header { -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.site-header.is-scrolled { background: rgba(255,255,255,.86); }

/* ── 7. Mobile hero: get the CTA above the fold ──────────────── */
@media (max-width: 767.98px) {
  .home-hero__copy .positioning {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .home-hero__copy .positioning.is-expanded { -webkit-line-clamp: unset; display: block; }
  .hero-readmore {
    background: none; border: 0; padding: 0; margin: -.5rem 0 1rem;
    font: 600 .8125rem/1 var(--font-body); color: var(--stucci-accent);
    letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
  }
  .mobile-nav { background: rgba(255,255,255,.97); }
}

/* ── 8. Blueprint grid drift (uses existing --scroll-progress) ─ */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-plane__marks {
    transform: translate3d(0, calc(var(--scroll-progress, 0) * -40px), 0);
    will-change: transform;
  }
  html.js .cta-band { position: relative; overflow: hidden; }
  html.js .cta-band::before {
    content: ""; position: absolute; inset: -20%;
    background:
      linear-gradient(115deg, transparent 40%, rgba(255,255,255,.07) 50%, transparent 60%),
      repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 48px);
    transform: translate3d(calc(var(--scroll-progress, 0) * 60px), 0, 0);
    pointer-events: none;
  }
  html.js .cta-band__inner { position: relative; }
}

/* ── 9. Hero entrance sequence (home + service heroes) ───────── */
@media (prefers-reduced-motion: no-preference) {
  html.js .home-hero__copy > *,
  html.js .svc-hero__grid > div:first-child > * {
    opacity: 0;
    transform: translateY(16px);
    animation: heroIn .7s var(--ease-out-quint) forwards;
  }
  html.js .home-hero__copy > :nth-child(1), html.js .svc-hero__grid > div:first-child > :nth-child(1) { animation-delay: .05s; }
  html.js .home-hero__copy > :nth-child(2), html.js .svc-hero__grid > div:first-child > :nth-child(2) { animation-delay: .15s; }
  html.js .home-hero__copy > :nth-child(3), html.js .svc-hero__grid > div:first-child > :nth-child(3) { animation-delay: .27s; }
  html.js .home-hero__copy > :nth-child(4), html.js .svc-hero__grid > div:first-child > :nth-child(4) { animation-delay: .39s; }
  html.js .home-hero__copy > :nth-child(5), html.js .svc-hero__grid > div:first-child > :nth-child(5) { animation-delay: .49s; }
  html.js .home-hero__copy > :nth-child(n+6), html.js .svc-hero__grid > div:first-child > :nth-child(n+6) { animation-delay: .58s; }
  html.js .svc-stats { opacity: 0; transform: translateY(20px) scale(.98); animation: heroIn .8s var(--ease-out-quint) .45s forwards; }
  html.js .svc-stats > div { transition: transform .3s var(--ease-out-quint), box-shadow .3s var(--ease-out-quint); }
  html.js .svc-stats > div:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  @keyframes heroIn { to { opacity: 1; transform: none; } }
}

/* ── 10. Process line that draws itself ──────────────────────── */
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  html.js .process-grid { position: relative; }
  html.js .process-rule {
    display: block; position: absolute; left: 0; right: 0; top: 1.25rem; height: 1px;
    background: var(--stucci-accent);
    transform-origin: left center; transform: scaleX(0);
    transition: transform 1.4s var(--ease-out-quint);
  }
  html.js .process-rule.is-visible { transform: scaleX(1); }
  html.js .process-step__num,
  html.js .svc-process .step-num > span {
    transition: background-color .4s ease, color .4s ease, transform .5s var(--ease-out-soft);
  }
  html.js .process-step.is-visible .process-step__num { animation: nodePulse .9s var(--ease-out-soft) .6s both; }
  @keyframes nodePulse { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

  /* service-page 4-step: hairline behind the numbers, drawn on reveal */
  html.js .svc-process { position: relative; }
  html.js .svc-process::before {
    content: ""; position: absolute; left: 8%; right: 8%; top: 1.4rem; height: 1px;
    background: var(--stucci-accent); opacity: .55;
    transform-origin: left; transform: scaleX(0);
    transition: transform 1.4s var(--ease-out-quint) .1s;
  }
  html.js .svc-process.is-drawn::before { transform: scaleX(1); }
  html.js .svc-process .step-num { position: relative; background: var(--stucci-base); z-index: 1; }
}

/* ── 11. Count-up hairline (pairs with main.js count-up) ─────── */
.trust-mark b, .svc-stats b { position: relative; display: inline-block; }
.trust-mark b::after, .svc-stats b::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--stucci-accent); transform-origin: left; transform: scaleX(0);
  transition: transform 1.1s var(--ease-out-quint);
}
.trust-mark b.count-up::after, .svc-stats b.count-up::after { transform: scaleX(1); }

/* ── 12. View Transitions (same-origin nav crossfade) ────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 160ms ease-out both vtOut; }
  ::view-transition-new(root) { animation: 220ms ease-in both vtIn; }
  @keyframes vtOut { to { opacity: 0; } }
  @keyframes vtIn { from { opacity: 0; } }
  .site-header { view-transition-name: site-header; }
}

/* ── 13. Services index: portfolio strip ─────────────────────── */
.work-strip { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .25rem .25rem 1rem; scrollbar-width: thin; }
.work-strip > a { flex: 0 0 min(320px, 80vw); scroll-snap-align: start; border: 1px solid var(--stucci-border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; transition: transform .3s var(--ease-out-quint), box-shadow .3s var(--ease-out-quint); }
.work-strip > a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.work-strip img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.work-strip span { display: block; padding: .75rem 1rem; font: 600 .8125rem/1.3 var(--font-display); color: var(--stucci-text); }

/* ── 14. Homepage hero: layered device composition ───────────── */
.hero-stage {
  position: relative; width: 100%; max-width: 680px; aspect-ratio: 16 / 12;
  margin-inline: auto; perspective: 1400px;
}
.hero-stage figure { margin: 0; position: absolute; }
.hero-stage__screen { overflow: hidden; background: #0B0F14; }
.hero-stage__screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }

.hero-stage__laptop {
  left: 0; right: 7%; top: 4%;
  transform: rotateY(-7deg) rotateX(3deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 30px 50px rgba(11, 15, 20, 0.28)) drop-shadow(0 8px 16px rgba(168, 90, 46, 0.12));
}
.hero-stage__bezel {
  padding: 2.2% 2.2% 2.6%; background: linear-gradient(160deg, #2B3340, #141A23);
  border-radius: 14px 14px 4px 4px; border: 1px solid rgba(255,255,255,0.08);
}
.hero-stage__bezel .hero-stage__screen { aspect-ratio: 1568 / 726; border-radius: 6px; }
.hero-stage__base {
  height: 12px; margin: 0 -3%; border-radius: 0 0 10px 10px;
  background: linear-gradient(#3A4452, #1A2230); border-top: 1px solid rgba(255,255,255,0.14);
}
.hero-stage__base::after {
  content: ""; position: absolute; left: 40%; right: 40%; top: 100%; height: 4px;
  background: #0E131A; border-radius: 0 0 6px 6px; opacity: .8;
}

.hero-stage__phone {
  right: 2%; bottom: 2%; width: 24%;
  border-radius: 26px; padding: 2.8%; background: linear-gradient(160deg, #2B3340, #0E131A);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 40px 60px -20px rgba(11, 15, 20, 0.45), 0 12px 24px -10px rgba(168, 90, 46, 0.25);
  transform: rotate(-3deg);
}
.hero-stage__phone .hero-stage__screen { aspect-ratio: 9 / 19.5; border-radius: 18px; }
.hero-stage__phone::before {
  content: ""; position: absolute; left: 50%; top: 4.5%; width: 30%; height: 3%;
  background: #0E131A; border-radius: 99px; transform: translateX(-50%); z-index: 2;
}

.hero-stage__card {
  left: -3%; bottom: 8%; width: 19%; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 28px 44px -16px rgba(11, 15, 20, 0.45);
  transform: rotate(4deg);
}
.hero-stage__card img { display: block; width: 100%; height: 100%; object-fit: cover; }

.hero-stage__chip {
  position: absolute; left: 6%; top: -2%;
  background: #FFFFFF; border: 1px solid var(--stucci-border);
  padding: .75rem 1rem; display: flex; flex-direction: column; gap: .1rem;
  box-shadow: var(--shadow-lg);
}
.hero-stage__chip b { font: 700 1.5rem/1.1 var(--font-display); color: var(--stucci-accent); }
.hero-stage__chip span { font: 600 .75rem/1.2 var(--font-body); color: var(--stucci-text); }
.hero-stage__chip i { font: 400 .6875rem/1.2 var(--font-body); font-style: normal; color: var(--stucci-steel); }

.hero-stage__tag {
  position: absolute; right: 30%; top: 100%; margin-top: .5rem;
  font: 600 .6875rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--stucci-steel);
}

/* hide the old text card where the stage shows */
@media (min-width: 768px) {
  .home-hero__media .hero-system { display: none; }
}
@media (max-width: 767.98px) {
  .hero-stage { display: none; }
}

/* depth: layers drift at different rates on scroll, settle on load */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-stage__laptop { transform: rotateY(-7deg) rotateX(3deg) translate3d(0, calc(var(--scroll-progress, 0) * -30px), 0); }
  html.js .hero-stage__phone  { transform: rotate(-3deg) translate3d(0, calc(var(--scroll-progress, 0) * -70px), 0); }
  html.js .hero-stage__card   { transform: rotate(4deg)  translate3d(0, calc(var(--scroll-progress, 0) * -50px), 0); }
  html.js .hero-stage__chip   { transform: translate3d(0, calc(var(--scroll-progress, 0) * -90px), 0); }
  html.js .hero-stage > * { animation: stageIn .9s var(--ease-out-quint) both; }
  html.js .hero-stage__laptop { animation-delay: .25s; }
  html.js .hero-stage__phone  { animation-delay: .45s; }
  html.js .hero-stage__card   { animation-delay: .55s; }
  html.js .hero-stage__chip   { animation-delay: .7s; }
  html.js .hero-stage__tag    { animation-delay: .8s; }
  @keyframes stageIn { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
}

/* ── 15. Settled state: forced by JS timer after 1.6s (see js §0) ──── */
html.hero-settled .home-hero__copy > *,
html.hero-settled .svc-hero__grid > div:first-child > *,
html.hero-settled .svc-stats { animation: none !important; opacity: 1 !important; transform: none !important; }
html.hero-settled .hero-stage > * { animation: none !important; opacity: 1 !important; translate: 0 0 !important; }

/* ── 16. Service hero visual (right column) ─────────────────────────── */
.svc-hero__grid.has-visual { align-items: start; grid-template-rows: auto auto; row-gap: 1.25rem; }
.svc-hero__grid.has-visual > :first-child { grid-row: 1 / span 2; align-self: center; }
.svc-hero__grid.has-visual > .svc-visual { grid-column: 2; grid-row: 1; margin: 0; }
.svc-hero__grid.has-visual > .svc-stats { grid-column: 2; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.svc-hero__grid.has-visual > .svc-stats > div { padding: .875rem .75rem; }
.svc-hero__grid.has-visual > .svc-stats b { font-size: clamp(.95rem, 1.1vw, 1.2rem); line-height: 1.15; overflow-wrap: anywhere; }
.svc-hero__grid.has-visual > .svc-stats span { font-size: .75rem; }
.svc-hero__grid.has-visual--solo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.svc-hero__grid.has-visual--solo > .svc-visual { grid-row: 1 / span 2; align-self: center; }
.svc-visual img {
  display: block; width: 100%; height: auto; border-radius: 22px;
  box-shadow: 0 2px 4px rgba(11,15,20,.06), 0 40px 80px -36px rgba(11,15,20,.55), 0 18px 40px -24px rgba(168,90,46,.35);
}
@media (prefers-reduced-motion: no-preference) {
  html.js .svc-visual img { animation: stageIn .9s var(--ease-out-quint, cubic-bezier(.22,1,.36,1)) .2s both;
    transform: translate3d(0, calc(var(--scroll-progress, 0) * -24px), 0); }
}
@media (max-width: 767.98px) {
  .svc-hero__grid.has-visual, .svc-hero__grid.has-visual--solo { grid-template-columns: minmax(0, 1fr); }
  .svc-hero__grid.has-visual > :first-child, .svc-hero__grid.has-visual > .svc-visual,
  .svc-hero__grid.has-visual > .svc-stats, .svc-hero__grid.has-visual--solo > .svc-visual { grid-column: 1; grid-row: auto; }
  .svc-hero__grid.has-visual > .svc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-visual img { border-radius: 16px; }
}

/* ── 17. Article table of contents ──────────────────────────────────── */
.article-toc { max-width: 768px; margin: 2rem auto 2.5rem; width: calc(100% - 2rem); border: 1px solid var(--stucci-border, #E2E6EA); border-radius: 14px; background: var(--stucci-surface, #F7F8FA); }
.article-toc summary {
  list-style: none; cursor: pointer; padding: 1rem 1.25rem;
  font: 700 .75rem/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--stucci-accent, #A85A2E);
  display: flex; justify-content: space-between; align-items: center;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s ease; }
.article-toc details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.article-toc ol { margin: 0; padding: 0 1.25rem 1.125rem 2.75rem; display: grid; gap: .5rem; counter-reset: toc; }
.article-toc li { font: 500 .975rem/1.4 var(--font-body); color: var(--stucci-text, #111827); }
.article-toc li::marker { color: var(--stucci-accent, #A85A2E); font-weight: 700; }
.article-toc a { color: inherit; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .3s ease, color .2s ease; }
.article-toc a:hover { color: var(--stucci-accent, #A85A2E); background-size: 100% 1px; }
.entry-content h2[id] { scroll-margin-top: 6rem; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── 18. Service stats: number above label (theme ran them inline) ─── */
.svc-stats > div { display: flex; flex-direction: column; justify-content: center; gap: .3rem; }
.svc-stats > div > b, .svc-stats > div > span { display: block; }
.svc-stats > div > b { min-width: 0 !important; }


/* ── 17. Hero visuals: index, contact, booking and band heroes ─────── */
.svc-hero__grid.hero-split {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; gap: clamp(2rem, 4vw, 4.5rem);
}
.hero-split > div:first-child { text-align: left; }
.hero-split .eyebrow--center { text-align: left; justify-content: flex-start; }
.hero-split .eyebrow--center::before { margin-inline: 0; }
.hero-split .positioning, .hero-split .lead { margin-left: 0 !important; margin-right: 0 !important; }
.hero-split .svc-visual { margin: 0; grid-column: 2; grid-row: 1; }
.page-hero.has-hero-visual .hero-plane__marks { display: none; }
.page-hero.has-hero-visual .page-hero__title { max-width: 14ch; }
@media (max-width: 767.98px) {
  .svc-hero__grid.hero-split { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .hero-split .svc-visual { grid-column: 1; grid-row: auto; max-width: 560px; }
  .page-hero.has-hero-visual .page-hero__title { max-width: none; }
}

/* ── 18. Homepage hero on phones: show the layered stage, not the text card */
@media (max-width: 767.98px) {
  .hero-stage { display: block; max-width: 460px; margin: 1.75rem auto 2.5rem; }
  .home-hero__media .hero-system { display: none; }
}


/* ── 19. Homepage articles: side cards keep their image (no empty gap) ── */
.post-grid--feature > .post-card:not(:first-child) .post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.post-grid--feature > .post-card:not(:first-child) .post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
