/* peel.css: the peel-off paper ([data-peel], see peel.js), shared by every page that uses it */
/* ===== Peel-off paper over a section's text ([data-peel], see peel.js) ===== */
.bd-peel { position: relative; max-width: 760px; margin: 0 auto; padding: 40px 44px; }
.bd-peel > .split-copy { max-width: none !important; margin: 0 !important; }
.bd-peel-cover {
  position: absolute; inset: 0; z-index: 3; border: 0; padding: 0; margin: 0;
  background: none; font: inherit; color: inherit; text-align: center;
  cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.bd-peel-cover:active { cursor: grabbing; }
.bd-peel-cover:focus-visible { outline: none; }
.bd-peel-cover:focus-visible .bd-peel-paper { box-shadow: 0 0 0 3px var(--mkt-accent, #0f5fa6), 0 22px 44px -22px rgba(15, 40, 80, 0.4); }
.bd-peel-paper {
  position: absolute; inset: 0; border-radius: 4px; display: grid; place-items: center;
  background-color: #f5f0e6;
  background-image:
    linear-gradient(135deg, rgba(40, 30, 10, 0.22) var(--fold, 0px), rgba(40, 30, 10, 0.06) calc(var(--fold, 0px) + 18px), rgba(40, 30, 10, 0) calc(var(--fold, 0px) + 70px)),
    radial-gradient(rgba(60, 45, 20, 0.045) 1px, transparent 1.2px),
    linear-gradient(180deg, #f8f4eb, #f1ebdf);
  background-size: auto, 5px 5px, auto;
  box-shadow: 0 22px 44px -22px rgba(15, 40, 80, 0.4), 0 1px 2px rgba(15, 40, 80, 0.08);
}
.bd-peel-flap { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; pointer-events: none; filter: drop-shadow(3px 4px 6px rgba(20, 30, 50, 0.28)); }
.bd-peel-back {
  position: absolute; inset: 0; border-radius: 4px;
  background-image: linear-gradient(135deg, #efe8da 0px, #e9e1d1 calc(var(--fold, 0px) - 60px), #d9cfbc calc(var(--fold, 0px) - 8px), #cbbfa9 var(--fold, 0px));
}
.bd-peel-label { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 28px; max-width: 520px; pointer-events: none; user-select: none; }
.bd-peel-label small { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8b7f68; }
.bd-peel-label b { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.25; color: #2c2a25; text-wrap: balance; }
.bd-peel-label em { font-style: normal; font-size: 0.85rem; font-weight: 600; color: var(--mkt-accent, #0f5fa6); display: inline-flex; align-items: center; gap: 6px; }
.bd-peel-arrow { display: inline-block; font-size: 1rem; }
@media (prefers-reduced-motion: no-preference) {
  .bd-peel.is-covered .bd-peel-arrow { animation: bdNudge 2.2s ease-in-out infinite; }
}
@keyframes bdNudge { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-4px, -4px); } }
.bd-peel.is-open > .split-copy { animation: bdReveal .5s ease both; }
@keyframes bdReveal { from { opacity: .4; } to { opacity: 1; } }
@media (max-width: 640px) {
  .bd-peel { padding: 32px 22px; }
  .bd-peel-label { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) { .bd-peel.is-open > .split-copy { animation: none; } }

/* ===== Dark mode (html[data-theme="dark"]): the peel is slate card stock, never brown, cream or white. =====
   Read as PAPER: a textured front, a fold shadow, a back that is LIGHTER than the front (the curled sheet catches light),
   a physical contact shadow, a thin lit edge. Tokens below; per pillar only --peel-em (label accent) and the tinted edge change.
   bdNudge, bdReveal and the --fold JS are untouched. This block replaces every dark peel rule in home.css, ai-development.css,
   bx-sections.css and marketing.css (their owners delete them). */
:root[data-theme="dark"]{
  --peel-top:#2a354a;   /* 32.9% 0.040 263 front, top */
  --peel-bot:#202a3d;   /* 28.5% 0.038 263 front, bottom */
  --peel-dot:rgba(190,210,255,.05);
  --peel-fold:1,2,11;   /* rgb of the fold shadow = --dk-deep family */
  --peel-b0:#4b5b77; --peel-b1:#41506c; --peel-b2:#37455f; --peel-b3:#2e3b52;   /* back: far from the fold -> at the fold */
  --peel-edge-base:#495874;
  --peel-small:#b2bbcb; --peel-heading:#e7ebf3;
  --peel-em:#8cb4fe;    /* Engineering + home strip + ai-development: 5.9 / 6.9 on the paper */
}
:root[data-theme="dark"] .bx-peel{ --peel-em:#b09bee; }                                  /* Business Experiences: 5.1 / 6.0 */
:root[data-theme="dark"] body.pillar-infra{ --peel-em:#b2dc69; }                         /* Infrastructure: 7.8 / 9.1 */
:root[data-theme="dark"] body.pillar-marketing{                                          /* Marketing: hue 240 paper */
  --peel-em:#71c1e0; --peel-top:#1e384a; --peel-bot:#142d3d; --peel-dot:rgba(190,225,255,.05); --peel-fold:0,3,11;
  --peel-b0:#3d5f77; --peel-b1:#33546b; --peel-b2:#28495f; --peel-b3:#203e52; --peel-edge-base:#3b5c74;
  --peel-small:#aebfca; --peel-heading:#e4edf2;
}
:root[data-theme="dark"] .home-facts{ --peel-edge-c:#f39d5e; --peel-edge-pct:40%; }       /* the only warm thing on the home strip is its 1px edge */

/* specificity: #the-problem .bd-peel-paper (1,1,0) and .home-facts .bd-peel-paper (0,2,0) in the light CSS; an ID inside :is() is deliberate and safe here (the paper has no state classes) -> (1,3,0) */
:root[data-theme="dark"] :is(.bd-peel,#the-problem,.home-facts,.bx-peel) .bd-peel-paper{
  background-color:var(--peel-bot);
  background-image:
    linear-gradient(135deg, rgba(var(--peel-fold),.55) var(--fold,0px), rgba(var(--peel-fold),.16) calc(var(--fold,0px) + 18px), rgba(var(--peel-fold),0) calc(var(--fold,0px) + 70px)),
    radial-gradient(var(--peel-dot) 1px, transparent 1.2px),
    linear-gradient(180deg, var(--peel-top), var(--peel-bot));
  background-size:auto, 5px 5px, auto;
  /* peel.js clips the paper (clip-path for the fold), which cuts off any OUTER shadow, so the lit edge is an inset ring
     and the contact shadow lives on the unclipped cover as a drop-shadow (orchestrator fix R2). Mixed in sRGB: oklch took
     the short hue path through magenta and turned the home strip's warm edge mauve. */
  box-shadow:inset 0 0 0 1px var(--peel-edge-base), inset 0 2px 0 rgba(190,210,255,.10);   /* fallback without color-mix */
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--peel-edge-c,var(--peel-em)) var(--peel-edge-pct,38%), var(--peel-edge-base)), inset 0 2px 0 rgba(190,210,255,.10);
}
:root[data-theme="dark"] .bd-peel.is-covered .bd-peel-cover{ filter:drop-shadow(0 10px 12px rgba(1,2,11,.6)); }   /* contact shadow: a listed exception */
:root[data-theme="dark"] :is(.bd-peel,#the-problem,.home-facts,.bx-peel) .bd-peel-back{
  background-image:linear-gradient(135deg, var(--peel-b0) 0px, var(--peel-b1) calc(var(--fold,0px) - 60px), var(--peel-b2) calc(var(--fold,0px) - 8px), var(--peel-b3) var(--fold,0px));
  box-shadow:inset 0 0 0 1px rgba(190,210,255,.10);
}
:root[data-theme="dark"] .bd-peel-flap{ filter:drop-shadow(3px 4px 5px rgba(1,2,11,.55)); }   /* the lifted flap really casts a shadow: a listed exception */
:root[data-theme="dark"] :is(.bd-peel,#the-problem,.home-facts,.bx-peel) .bd-peel-label small{ color:var(--peel-small); }
:root[data-theme="dark"] :is(.bd-peel,#the-problem,.home-facts,.bx-peel) .bd-peel-label b{ color:var(--peel-heading); }
:root[data-theme="dark"] :is(.bd-peel,#the-problem,.home-facts,.bx-peel) .bd-peel-label em,
:root[data-theme="dark"] :is(.bd-peel,#the-problem,.home-facts,.bx-peel) .bd-peel-arrow{ color:var(--peel-em); }
:root[data-theme="dark"] .bd-peel-cover:focus-visible .bd-peel-paper{ box-shadow:inset 0 0 0 3px #97bffe; }   /* inset: an outer ring is clipped away */
/* ai-development blueprint paper: the same slate plus a faint grid as the first two layers, after the generic rule.
   Every pillar page also uses section#the-problem, so the grid skips the Marketing and Infrastructure pillars (R2). */
:root[data-theme="dark"] body:not(.pillar-marketing):not(.pillar-infra) #the-problem .bd-peel .bd-peel-paper{
  background-image:
    repeating-linear-gradient(0deg, rgba(129,170,247,.07) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(129,170,247,.07) 0 1px, transparent 1px 24px),
    linear-gradient(135deg, rgba(var(--peel-fold),.55) var(--fold,0px), rgba(var(--peel-fold),.16) calc(var(--fold,0px) + 18px), rgba(var(--peel-fold),0) calc(var(--fold,0px) + 70px)),
    radial-gradient(var(--peel-dot) 1px, transparent 1.2px),
    linear-gradient(180deg, var(--peel-top), var(--peel-bot));
  background-size:auto, auto, auto, 5px 5px, auto;
}
