/* Isolated visual preview. Shared hero files are read-only. */
@property --p2-draw {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.p2 {
  --p2-ink: #0a0a0a;
  --p2-orange: #ff6200;
  --brand-dot-size: 9px;
  position: relative;
  z-index: 4;
  margin: 0;
  padding: 100px 0 88px;
  color: var(--p2-ink);
  background: #fff;
  font-family: "Commissioner", sans-serif;
  scroll-margin-top: 80px;
}

.p2 *, .p2 *::before, .p2 *::after { box-sizing: border-box; }
.p2__wrap { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.p2__intro { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: 64px; align-items: center; }
.p2__title {
  margin: 0;
  font-family: "Geologica", sans-serif;
  font-size: clamp(44px, 3.9vw, 56px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.p2__title span { display: block; }
.p2__title .p2__orange { color: var(--p2-ink); }
.p2__highlight { position: relative; z-index: 0; color: inherit; background: transparent; white-space: nowrap; }
.p2__highlight::before {
  position: absolute;
  z-index: -1;
  right: -.13em;
  bottom: -.04em;
  left: -.13em;
  height: 1.02em;
  content: "";
  background: url("../assets/prototype/accent-brush-orange.svg") center / 100% 100% no-repeat;
  transform: rotate(-1deg);
}
.p2__lead { max-width: 670px; margin: 28px 0 0; font-size: 18px; line-height: 1.55; color: #4a5560; }
.p2__scene { position: relative; align-self: end; width: 100%; max-width: 320px; margin: 0 0 -22px; aspect-ratio: 1 / 1.15; }
.p2__scene::before {
  content: "";
  position: absolute;
  width: 80%;
  aspect-ratio: 1;
  top: 11%;
  left: 11%;
  border-radius: 49% 51% 44% 56% / 52% 43% 57% 48%;
  background: var(--p2-orange);
  transform: rotate(-9deg);
}
.p2__scene img { position: relative; display: block; width: 125%; max-width: none; height: auto; margin-left: -12%; transform: scaleX(-1); }
.p2__scene-line { position: absolute; width: 60%; height: 36px; left: 16%; bottom: -18px; fill: none; stroke: #0a0a0a; stroke-width: 1.5; }

.p2__reasons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 52px; margin-top: 76px; align-items: start; }
.p2__reason { position: relative; min-width: 0; }
.p2__reason:nth-child(2) { margin-top: 54px; }
.p2__reason:nth-child(3) { margin-top: 108px; }
.p2__reason-top { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; }
.p2__number { font: 300 54px/.9 "Geologica", sans-serif; letter-spacing: -.055em; color: var(--p2-orange); }
.p2__rule {
  position: relative;
  flex: 1;
  height: 2px;
  overflow: visible;
}
.p2__rule::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--p2-orange);
  transform: scaleX(1);
  transform-origin: left center;
}
.p2__reason h3 { margin: 0 0 20px; font: 400 28px/1.15 "Geologica", sans-serif; letter-spacing: -.035em; text-wrap: balance; }
.p2__reason p { margin: 0; font-size: 17px; line-height: 1.6; color: #4a5560; }

.p2__conclusion { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 40px; margin-top: 68px; padding-top: 58px; border-top: 1px solid var(--p2-orange); }
.p2__conclusion-arrow {
  width: 108px;
  height: 104px;
  margin-top: 0;
  color: var(--p2-orange);
  fill: none;
  stroke: currentColor;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.p2__arrow-tail {
  stroke-dasharray: 12 8.5;
}
.p2__arrow-stem {
  /* solid segment transitioning directly into arrowhead */
}
.p2__arrow-mask-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: p2-arrow-draw 3.2s cubic-bezier(0.35, 0, 0.25, 1) infinite;
}
.p2__arrow-head {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 85% 50%;
  animation: p2-arrow-head 3.2s ease-out infinite;
}
.p2__arrow-wrap {
  animation: p2-arrow-fade 3.2s ease-in-out infinite;
}
.p2__conclusion p { margin: 0; max-width: 1040px; font: 300 34px/1.28 "Geologica", sans-serif; letter-spacing: -.035em; }
.p2__underline { background: linear-gradient(var(--p2-orange), var(--p2-orange)) left 94% / 100% 3px no-repeat; padding-bottom: 3px; }

/* Desktop only: sequential draw like #services.s3 .s3__tab-marker.
   Draw 0.45s, hold 1.05s, slot 1.5s, cycle 4.5s. Width stays flex:1 (not full tab). */
@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
  .p2__rule {
    --p2-draw: 0;
    opacity: 0;
    animation: p2-rule-cycle 4.5s infinite;
  }
  .p2__rule::before {
    transform: scaleX(var(--p2-draw));
  }
  .p2__rule::after {
    content: "";
    position: absolute;
    left: calc(var(--p2-draw) * 100%);
    top: 50%;
    width: var(--brand-dot-size);
    height: var(--brand-dot-size);
    border-radius: 50%;
    background: var(--p2-orange);
    transform: translate(-50%, -50%);
  }
  .p2__reason:nth-child(1) .p2__rule { animation-delay: 0s; }
  .p2__reason:nth-child(2) .p2__rule { animation-delay: -3s; }
  .p2__reason:nth-child(3) .p2__rule { animation-delay: -1.5s; }
}

/* Compact desktop retains the same three-column composition. */
@media (min-width: 1025px) and (max-width: 1365px) {
  .p2 { padding-top: 80px; }
  .p2__intro { gap: 36px; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); }
  .p2__title { font-size: 48px; }
  .p2__reasons { gap: 32px; margin-top: 68px; }
  .p2__reason h3 { font-size: 26px; }
  .p2__reason p { font-size: 16px; }
  .p2__conclusion p { font-size: 31px; }
}

/* Tablet uses open rows, preserving useful text measure at 601px. */
@media (min-width: 601px) and (max-width: 1024px) {
  .p2 { padding: 64px 0 72px; }
  .p2__wrap { width: calc(100% - 48px); }
  .p2__intro { grid-template-columns: minmax(0, 1fr) 160px; gap: 24px; }
  .p2__title { font-size: 38px; }
  .p2__lead { margin-top: 24px; font-size: 17px; }
  .p2__scene { align-self: center; margin: 0; }
  .p2__scene-line { display: none; }
  .p2__reasons { display: block; margin-top: 52px; }
  .p2__reason, .p2__reason:nth-child(2), .p2__reason:nth-child(3) {
    display: grid;
    grid-template-columns: 56px minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 24px;
    align-items: start;
    margin: 0;
    padding: 32px 0;
    border-top: 1px solid var(--p2-orange);
  }
  .p2__reason-top { margin: 0; }
  .p2__number { font-size: 42px; }
  .p2__rule { display: none; }
  .p2__reason h3 { margin: 0; font-size: 24px; }
  .p2__reason p { font-size: 16px; line-height: 1.55; }
  .p2__conclusion { grid-template-columns: 64px minmax(0, 1fr); gap: 32px; margin-top: 8px; padding-top: 36px; }
  .p2__conclusion-arrow { width: 64px; height: 68px; }
  .p2__conclusion p { font-size: 28px; }
}

@media (max-width: 600px) {
  .p2 { padding: 48px 0 56px; scroll-margin-top: 64px; }
  .p2__wrap { width: calc(100% - 40px); }
  .p2__intro { position: relative; display: block; }
  .p2__title { font-size: clamp(30px, 8vw, 42px); line-height: 1.1; letter-spacing: -.04em; }
  .p2__title span { display: inline; }
  .p2__title .p2__orange { display: block; }
  .p2__lead { margin-top: 24px; font-size: 16px; line-height: 1.55; }
  .p2__scene { display: none; }
  .p2__reasons { display: block; margin-top: 36px; }
  .p2__reason, .p2__reason:nth-child(2), .p2__reason:nth-child(3) {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 18px;
    margin: 0;
    padding: 28px 0 30px;
    border-top: 1px solid var(--p2-orange);
  }
  .p2__reason-top { margin: 0; padding-top: 3px; }
  .p2__number { font-size: 30px; }
  .p2__rule { display: none; }
  .p2__reason h3 { margin: 0; font-size: 23px; line-height: 1.16; text-wrap: pretty; }
  .p2__reason p { grid-column: 2; font-size: 16px; line-height: 1.55; }
  .p2__conclusion { display: block; margin-top: 4px; padding-top: 28px; }
  .p2__conclusion-arrow { display: block; width: 68px; height: 60px; margin: 0 0 10px; transform: rotate(14deg); }
  .p2__conclusion p { font-size: 26px; line-height: 1.3; }
}

@media (max-width: 359px) {
  .p2__wrap { width: calc(100% - 32px); }
  .p2__reason, .p2__reason:nth-child(2), .p2__reason:nth-child(3) { grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
  .p2__reason h3 { font-size: 22px; }
  .p2__reason p { grid-column: 1 / -1; }
  .p2__conclusion p { font-size: 24px; }
}

/* Rule cycle: draw 0–10% (0.45s) → hold to 33.333% (1.05s) → snap idle until 100%. */
@keyframes p2-rule-cycle {
  0% {
    opacity: 1;
    --p2-draw: 0;
    animation-timing-function: cubic-bezier(.2, .75, .3, 1);
  }
  10% {
    opacity: 1;
    --p2-draw: 1;
    animation-timing-function: linear;
  }
  33.333% {
    opacity: 1;
    --p2-draw: 1;
    animation-timing-function: step-start;
  }
  33.34%,
  100% {
    opacity: 0;
    --p2-draw: 0;
  }
}

/* Arrow animation cycle: draw-in (0-0.7s) -> hold (0.7-2.2s) -> fade-out (2.2-2.7s) -> pause (2.7-3.2s) */
@keyframes p2-arrow-draw {
  0% { stroke-dashoffset: 100; }
  22%, 69% { stroke-dashoffset: 0; }
  84%, 100% { stroke-dashoffset: 100; }
}

@keyframes p2-arrow-head {
  0%, 16% { opacity: 0; transform: scale(0.75); }
  22%, 69% { opacity: 1; transform: scale(1); }
  84%, 100% { opacity: 0; transform: scale(0.75); }
}

@keyframes p2-arrow-fade {
  0%, 69% { opacity: 1; }
  84%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .p2__arrow-wrap,
  .p2__arrow-mask-path,
  .p2__arrow-head {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
    transform: none !important;
  }
  .p2__rule,
  .p2__rule::before,
  .p2__rule::after {
    animation: none !important;
  }
  .p2__rule { opacity: 1 !important; }
  .p2__rule::before { transform: scaleX(1) !important; }
  .p2__rule::after { content: none !important; }
}
