/* ==========================================================================
   IBPLD UI Polish — design system cleanup (loaded last)
   Fixes: CTA contrast, containers, rhythm, sticky header, section polish
   ========================================================================== */

:root {
  --page-gutter: 1.25rem;
  --container-max: 88rem; /* ~1408px */
  --section-y: clamp(4.5rem, 8vw, 7.5rem);
  --section-y-sm: clamp(3rem, 6vw, 5.5rem);
  --mast-h: 4.25rem; /* ~68px mobile */
  --scroll-pad: calc(var(--mast-h) + 1.25rem);

  --paper: #F7F6F2;
  --ink: #161719;
  --graphite: #17191D;
  --soft: #64696F;
  --wine: #4C0911;
  --champagne: #C8B69A;
  --steel: #74808A;
}

@media (min-width: 768px) {
  :root {
    --page-gutter: 2rem;
    --mast-h: 5rem; /* 80px */
  }
}

@media (min-width: 1024px) {
  :root {
    --page-gutter: clamp(2.5rem, 6vw, 6rem);
    --mast-h: 5.25rem; /* 84px */
  }
}

@media (min-width: 1440px) {
  :root {
    --page-gutter: clamp(3rem, 8vw, 9.375rem);
  }
}

/* Sync legacy tokens */
:root {
  --proto-gutter: var(--page-gutter);
  --proto-max: var(--container-max);
  --proto-mast-h: var(--mast-h);
  --proto-bg: #F5F3EE;
}

/* --------------------------------------------------------------------------
   Global link/button conflict fix
   Former .proto-body a { color: inherit } hid CTA labels (specificity beat
   component colors). Do not reintroduce a global color on anchors.
   -------------------------------------------------------------------------- */

.proto-body a:where(:not([class])) {
  color: inherit;
}

/* --------------------------------------------------------------------------
   Official buttons
   -------------------------------------------------------------------------- */

.button-primary,
.button-secondary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.8rem 1.3rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none !important;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background-color 220ms var(--proto-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    color 220ms var(--proto-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 220ms var(--proto-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.button-primary {
  background: var(--wine);
  color: #F7F6F2 !important;
  border: 1px solid var(--wine);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #76323B;
  border-color: #76323B;
  color: #F7F6F2 !important;
}

.button-secondary {
  background: #F7F6F2;
  color: var(--ink) !important;
  border: 1px solid rgba(22, 23, 25, 0.18);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--ink);
  color: var(--ink) !important;
}

.button-ghost {
  background: transparent;
  border: 0;
  padding-inline: 0;
  color: var(--ink) !important;
  min-height: 44px;
}

.button-ghost::after {
  content: "→";
  margin-left: 0.35rem;
  transition: transform 220ms var(--proto-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.button-ghost:hover::after,
.button-ghost:focus-visible::after {
  transform: translateX(3px);
}

.button-ghost--light {
  color: #F7F6F2 !important;
}

.button-primary--on-dark {
  background: #F7F6F2;
  border-color: #F7F6F2;
  color: var(--graphite) !important;
}

.button-primary--on-dark:hover,
.button-primary--on-dark:focus-visible {
  background: var(--champagne);
  border-color: var(--champagne);
  color: var(--graphite) !important;
}

/* Legacy CTA skins — defer to official button variants */
.button-primary.immersion__cta,
.button-primary.intelx__cta,
.button-primary.trainx__cta {
  background: var(--wine);
  border: 1px solid var(--wine);
  color: #F7F6F2 !important;
}

.button-primary--on-dark.cpldif__cta,
.button-primary--on-dark.finalx__cta,
.finalx a.button-primary--on-dark {
  background: #F7F6F2;
  border-color: #F7F6F2;
  color: var(--graphite) !important;
}

.button-ghost.immersion__textlink { color: var(--ink) !important; }
.button-ghost.intelx__textlink { color: var(--wine) !important; }
.button-ghost.cpldif__textlink,
.button-ghost.finalx__textlink { color: rgba(247, 246, 242, 0.92) !important; }

.academia__incompany-link { color: var(--wine) !important; }

/* Suppress duplicate arrow from legacy textlinks when using .button-ghost */
.button-ghost.immersion__textlink::after,
.button-ghost.intelx__textlink::after,
.button-ghost.cpldif__textlink::after,
.button-ghost.finalx__textlink::after,
.button-ghost.academia__incompany-link::after {
  content: "→";
  margin-left: 0.35rem;
}

/* --------------------------------------------------------------------------
   Sticky header + scroll offset
   -------------------------------------------------------------------------- */

/* Mast sticky polish superseded by ibpld-stabilize.css (position: relative). */

section[id],
main [id] {
  scroll-margin-top: var(--scroll-pad);
}

/* --------------------------------------------------------------------------
   Shared shells
   -------------------------------------------------------------------------- */

.market__shell,
.cpldif__shell,
.academia__shell,
.intelx__shell,
.proofx__shell,
.journeyx__shell,
.solonx__pubs-shell,
.sitefoot__shell,
.immersion__stage {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.market,
.academia,
.intelx,
.proofx {
  padding-block: var(--section-y);
}

.cpldif {
  padding-block: var(--section-y);
}

/* --------------------------------------------------------------------------
   Hero polish
   -------------------------------------------------------------------------- */

.immersion {
  min-height: auto;
  padding-bottom: 2rem;
}

.immersion__stage {
  min-height: auto;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.immersion__copy {
  position: relative;
  z-index: 2;
  max-width: 36rem;
}

.immersion__title {
  font-size: clamp(2.75rem, 11vw, 3.5rem);
  max-width: 12ch;
}

.immersion__line--b {
  padding-left: 0.85rem;
  margin-top: 0.08em;
}

.immersion__media-region--video {
  margin-top: 2rem;
}

.immersion__coord {
  display: none;
}

/* Soften awaiting media — less technical chrome */
.inst-video.is-prepared .inst-video__label {
  opacity: 0.55;
  letter-spacing: 0.1em;
}

.inst-video.is-prepared .inst-video__evidence,
.inst-video.is-prepared .inst-video__role,
.inst-video.is-prepared .inst-video__duration {
  display: none;
}

.inst-video.is-prepared .inst-video__speaker {
  font-size: 0.875rem;
  opacity: 0.85;
}

.inst-video.is-prepared .inst-video__veil {
  background: linear-gradient(
    180deg,
    rgba(23, 25, 29, 0.04) 0%,
    rgba(23, 25, 29, 0.12) 50%,
    rgba(23, 25, 29, 0.42) 100%
  );
}

.inst-video__await-tone {
  background:
    linear-gradient(165deg, rgba(22, 23, 25, 0.05) 0%, rgba(200, 182, 154, 0.14) 100%);
}

/* Hero absolute / vh composition superseded by ibpld-stabilize.css */

@media (min-width: 768px) {
  .immersion__actions {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Portfolio
   -------------------------------------------------------------------------- */

.market__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1.25rem;
  margin-top: 2.5rem;
}

.market__item {
  min-height: 6.25rem;
  place-items: start;
  justify-items: start;
  align-content: start;
  text-align: left;
  padding: 0.5rem 0.25rem;
  gap: 0.65rem;
}

.market__logo {
  max-height: 2.25rem;
  max-width: 8.5rem;
}

.market__org-name {
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--soft);
  max-width: 12rem;
}

@media (min-width: 768px) {
  .market__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.75rem;
  }
}

@media (min-width: 1024px) {
  .market__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   CPLD-IF
   -------------------------------------------------------------------------- */

.cpldif__title {
  font-size: clamp(1.85rem, 3.8vw, 2.85rem);
  line-height: 1.18;
  max-width: 18ch;
}

@media (min-width: 1024px) and (max-width: 1366px) {
  .cpldif__title {
    font-size: clamp(2rem, 3.2vw, 2.65rem);
  }
}

.cpldif__steps {
  margin-top: 3.75rem;
  gap: 1.5rem 1.25rem;
}

.cpldif__step-title {
  letter-spacing: -0.02em;
}

.cpldif__step-text {
  line-height: 1.5;
  color: rgba(247, 246, 242, 0.72);
}

.cpldif__mosaic {
  gap: 1.25rem 1.35rem;
}

.cpldif__mosaic-item {
  min-height: 0;
  background: transparent;
  border: 0;
  padding: 0;
  place-items: center;
  justify-items: center;
  align-content: start;
  text-align: center;
  box-shadow: none;
}

.cpldif__mosaic-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(247, 246, 242, 0.88);
}

@media (min-width: 1024px) {
  .cpldif__mosaic-item {
    min-height: 0;
  }
}

/* --------------------------------------------------------------------------
   Academia paths
   -------------------------------------------------------------------------- */

.academia {
  padding-block: var(--section-y-sm) var(--section-y);
}

.academia__title {
  font-size: clamp(1.75rem, 3.8vw, 2.65rem);
  line-height: 1.15;
  max-width: 22ch;
}

.academia__paths {
  margin-top: 2rem;
}

.academia__path {
  padding: 1.1rem 0;
  align-items: start;
}

.academia__path-name {
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
}

.academia__path-desc {
  margin-top: 0.45rem;
  line-height: 1.55;
}

@media (min-width: 1024px) {
  .academia__paths {
    align-items: start;
  }

  .academia__path {
    padding: 1.2rem 1rem 1.2rem 0;
    height: auto;
  }
}

/* --------------------------------------------------------------------------
   Training Explorer
   -------------------------------------------------------------------------- */

.trainx {
  margin-top: 2.75rem;
  padding-top: 2rem;
}

.trainx__stage {
  max-width: 48rem; /* ~768px textual block */
  min-width: 0;
}

.trainx__name {
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  max-width: 22ch;
  line-height: 1.15;
}

.trainx__desc {
  max-width: 40rem;
}

.trainx__meta {
  max-width: 38rem;
  gap: 1rem;
  width: 100%;
}

.trainx__audience {
  max-width: 40rem;
}

.trainx__cta {
  margin-top: 1.35rem;
}

@media (min-width: 1024px) {
  .trainx__layout {
    display: grid;
    grid-template-columns: minmax(11rem, 32%) minmax(0, 68%);
    gap: 1.75rem 2.25rem;
    align-items: start;
  }

  .trainx__stage {
    max-width: 46rem;
  }

  .trainx__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 38rem;
  }
}

@media (min-width: 1024px) and (max-width: 1366px) {
  .trainx__layout {
    grid-template-columns: minmax(10rem, 30%) minmax(0, 70%);
    gap: 1.5rem 1.75rem;
  }

  .trainx__name {
    font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  }
}

/* --------------------------------------------------------------------------
   Consultoria process + areas
   -------------------------------------------------------------------------- */

.intelx__title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.intelx__process {
  overflow: visible;
  width: 100%;
  max-width: 100%;
}

.intelx__step {
  min-width: 0;
}

.intelx__step-title {
  overflow-wrap: anywhere;
  hyphens: auto;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .intelx__process {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem 1.25rem;
    transform: none !important;
  }

  .intelx__step {
    transform: none !important;
  }

  .intelx__step:nth-child(3) .intelx__step-thread,
  .intelx__step:nth-child(6) .intelx__step-thread {
    display: none;
  }
}

@media (min-width: 1200px) {
  .intelx__process {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem 0.85rem;
    transform: none !important;
  }

  .intelx__step {
    transform: none !important;
    min-width: 0;
  }

  .intelx__step-title {
    font-size: 0.875rem;
  }

  .intelx__step-text {
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .intelx__step-thread {
    right: -0.65rem;
  }
}

@media (min-width: 1024px) {
  .intelx__areas-layout {
    grid-template-columns: 16.25rem minmax(0, 43.75rem);
    gap: 2.25rem 3rem;
    justify-content: start;
  }

  .intelx__area-stage {
    max-width: 43.75rem;
  }

  .intelx__area-name {
    font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  }

  .intelx__area-summary {
    max-width: 40rem;
  }
}

/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */

.proofx {
  padding-block: var(--section-y-sm);
}

.proofx__title {
  font-size: clamp(1.65rem, 3.5vw, 2.4rem);
}

.proofx__voices {
  margin-top: 2rem;
}

.proofx__voice {
  max-width: 56rem; /* 900px */
}

.proofx__voice::before {
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  margin-bottom: 0.15rem;
}

.proofx__voice blockquote p {
  font-size: clamp(1.35rem, 2.6vw, 2.35rem); /* ~24–38px / up to ~48 */
  line-height: 1.3;
}

.proofx__nav {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Journeys — critical contrast on dark half
   -------------------------------------------------------------------------- */

.journeyx__shell {
  padding-top: var(--section-y-sm);
}

.journeyx__path {
  min-height: auto;
  padding: 2.25rem 1.5rem 2.5rem;
}

.journeyx__path--org,
.journeyx__path--org:hover,
.journeyx__path--org:focus-visible {
  color: #F7F6F2 !important;
  background: var(--graphite);
}

.journeyx__path--org .journeyx__path-kicker {
  color: var(--champagne) !important;
}

.journeyx__path--org .journeyx__path-title {
  color: #F7F6F2 !important;
}

.journeyx__path--org .journeyx__path-text {
  color: rgba(247, 246, 242, 0.72) !important;
  opacity: 1;
}

.journeyx__path--org .journeyx__path-list li {
  color: rgba(247, 246, 242, 0.92) !important;
}

.journeyx__path--org .journeyx__path-cta {
  color: #F7F6F2 !important;
}

.journeyx__path--org .journeyx__path-list li::before {
  border-color: var(--champagne);
  background: radial-gradient(circle, #F7F6F2 0 1.5px, transparent 1.7px);
}

.journeyx__path--pro {
  color: var(--ink) !important;
}

.journeyx__path--pro .journeyx__path-title {
  color: var(--ink) !important;
}

.journeyx__path--pro .journeyx__path-text {
  opacity: 1;
  color: rgba(22, 23, 25, 0.72) !important;
}

.journeyx__path--pro .journeyx__path-cta {
  color: var(--wine) !important;
}

@media (min-width: 1024px) {
  .journeyx__path {
    min-height: 0;
    padding: 2.75rem 2.25rem;
  }

  .journeyx__split {
    width: 100%;
    margin-inline: 0;
  }
}

/* --------------------------------------------------------------------------
   Final CTA
   -------------------------------------------------------------------------- */

.finalx {
  min-height: 0;
}

.finalx__veil {
  background: linear-gradient(
    105deg,
    rgba(18, 19, 22, 0.82) 0%,
    rgba(18, 19, 22, 0.62) 42%,
    rgba(18, 19, 22, 0.35) 100%
  );
}

.finalx__content {
  padding: 4.5rem var(--page-gutter) 3.5rem;
  max-width: var(--container-max);
}

.finalx__title {
  max-width: 16ch;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.finalx__sub {
  max-width: 34rem;
}

.finalx a.finalx__cta {
  background: #F7F6F2;
  color: var(--graphite) !important;
}

.finalx a.finalx__textlink {
  color: rgba(247, 246, 242, 0.92) !important;
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.sitefoot__shell {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.sitefoot__logo img {
  width: 10.5rem;
  height: auto;
  filter: none;
  opacity: 1;
  object-fit: contain;
}

.sitefoot__grid {
  gap: 1.5rem 1.25rem;
}

.sitefoot__col a {
  min-height: 32px;
  line-height: 1.5;
  font-size: 0.875rem;
  transition: color 180ms var(--proto-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.sitefoot__col a:hover {
  color: var(--champagne);
}

.sitefoot__base-inner {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

@media (max-width: 767px) {
  .sitefoot__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .sitefoot__shell {
    gap: 2rem 2.5rem;
  }

  .sitefoot__grid {
    gap: 1.15rem 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   Risk transition height
   -------------------------------------------------------------------------- */

.risk-transit {
  min-height: auto;
  padding-block: var(--section-y-sm);
}

.risk-transit__title {
  font-size: clamp(1.65rem, 3.8vw, 2.35rem);
}

/* --------------------------------------------------------------------------
   Overflow safety (targeted, not body-hidden)
   -------------------------------------------------------------------------- */

.immersion,
.intelx,
.cpldif,
.journeyx,
.proofx,
.market,
.academia {
  overflow-x: clip;
}

.intelx__process,
.trainx__nav,
.market__grid {
  max-width: 100%;
}

/* debug-layout — enable temporarily with <body class="debug-layout"> */
.debug-layout .market__shell,
.debug-layout .cpldif__shell,
.debug-layout .academia__shell,
.debug-layout .intelx__shell,
.debug-layout .proofx__shell,
.debug-layout .immersion__stage,
.debug-layout .finalx__content {
  outline: 1px dashed rgba(76, 9, 17, 0.35);
}
