/* Final readability and profile layout refinements. */

.hero h1,
.section-heading h2,
.case-copy h2,
.about-copy h2,
.contact-copy h2 {
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.about-layout {
  align-items: start;
}

.about-aside {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portrait-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: #101811;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .18);
}

.portrait-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.about-aside > .about-identity {
  display: block;
  margin: 2px 0 0;
  color: var(--green);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.about-aside > .about-identity::after {
  content: "Specjalista od systemów biznesowych";
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: .9rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: .015em;
  line-height: 1.45;
  text-transform: none;
}

.about-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin-top: 4px;
}

.about-contact .contact-reveal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.about-contact .contact-reveal summary {
  list-style: none;
}

.about-contact .contact-reveal summary::-webkit-details-marker {
  display: none;
}

.about-contact .contact-reveal-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  user-select: none;
}

.about-contact .contact-hide {
  display: none;
}

.about-contact .contact-reveal[open] .contact-show {
  display: none;
}

.about-contact .contact-reveal[open] .contact-hide {
  display: inline;
}

.about-contact .contact-reveal-value {
  display: inline-block;
  padding-inline: 4px;
}

/* Full-width process flow directly below the hero. */
.hero-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.hero-copy {
  max-width: 1080px;
}

.hero-flow-section {
  position: relative;
  padding: 0 0 38px;
  overflow: hidden;
}

.hero-flow-section::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 360px;
  left: 50%;
  top: -90px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(52, 149, 83, .10), transparent 68%);
  pointer-events: none;
}

.hero-flow-container {
  position: relative;
  z-index: 1;
}

.hero-flow-section .hero-visual {
  width: 100%;
  max-width: none;
}

.hero-flow-section .visual-shell {
  border-radius: 24px;
}

.hero-flow-section .flow-board {
  --flow-gap: clamp(58px, 7vw, 96px);
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  column-gap: var(--flow-gap);
  row-gap: 24px;
  align-items: center;
  padding: 42px 44px 30px;
}

.hero-flow-section .flow-node {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  min-height: 154px;
  padding: 20px 20px 18px;
  border-radius: 16px;
}

.hero-flow-section .flow-node strong {
  margin-top: 20px;
  font-size: 1rem;
  line-height: 1.25;
}

.hero-flow-section .flow-node small {
  margin-top: 6px;
  font-size: .72rem;
  line-height: 1.5;
}

.hero-flow-section .node-a {
  grid-column: 1;
  grid-row: 1;
}

.hero-flow-section .node-b {
  grid-column: 2;
  grid-row: 1;
}

.hero-flow-section .node-c {
  grid-column: 3;
  grid-row: 1;
}

.hero-flow-section .node-a::after,
.hero-flow-section .node-b::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 100%;
  width: var(--flow-gap);
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(98,217,139,.16), rgba(98,217,139,.75), rgba(98,217,139,.16));
  background-size: 220% 100%;
  animation: hero-flow-line 3.2s linear infinite;
}

.hero-flow-section .node-a::before,
.hero-flow-section .node-b::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 100%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(98,217,139,.85);
  transform: translate(-50%, -50%);
  animation: hero-flow-pulse 3.2s linear infinite;
}

.hero-flow-section .node-b::before,
.hero-flow-section .node-b::after {
  animation-delay: 1.05s;
}

.hero-flow-section .flow-lines {
  display: none;
}

.hero-flow-section .flow-metric {
  position: static;
  min-width: 0;
  padding: 11px 13px;
}

.hero-flow-section .metric-a {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.hero-flow-section .metric-b {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

@keyframes hero-flow-line {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

@keyframes hero-flow-pulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(0);
  }
  8% { opacity: 1; }
  88% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(var(--flow-gap));
  }
}

@media (max-width: 900px) {
  .hero-flow-section .flow-board {
    --flow-gap: 28px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: var(--flow-gap);
    padding: 28px 24px;
  }

  .hero-flow-section .node-a,
  .hero-flow-section .node-b,
  .hero-flow-section .node-c {
    grid-column: 1;
    grid-row: auto;
  }

  .hero-flow-section .node-a::after,
  .hero-flow-section .node-b::after {
    top: 100%;
    left: 50%;
    width: 2px;
    height: var(--flow-gap);
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(98,217,139,.16), rgba(98,217,139,.75), rgba(98,217,139,.16));
    background-size: 100% 220%;
    animation-name: hero-flow-line-vertical;
  }

  .hero-flow-section .node-a::before,
  .hero-flow-section .node-b::before {
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-name: hero-flow-pulse-vertical;
  }

  .hero-flow-section .flow-metric {
    display: none !important;
  }
}

@keyframes hero-flow-line-vertical {
  from { background-position: 0 100%; }
  to { background-position: 0 -120%; }
}

@keyframes hero-flow-pulse-vertical {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(0);
  }
  8% { opacity: 1; }
  88% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(var(--flow-gap));
  }
}

@media (max-width: 720px) {
  .hero h1,
  .section-heading h2,
  .case-copy h2,
  .about-copy h2,
  .contact-copy h2 {
    line-height: 1.16;
    letter-spacing: -0.035em;
  }

  .hero-flow-section {
    padding: 0 0 28px;
  }

  .hero-flow-section .visual-shell {
    border-radius: 20px;
  }

  .hero-flow-section .flow-board {
    padding: 18px;
  }

  .hero-flow-section .flow-node {
    min-height: 0;
    padding: 15px;
  }

  .hero-flow-section .flow-node strong {
    margin-top: 9px;
    font-size: .9rem;
  }

  .hero-flow-section .flow-node small {
    font-size: .68rem;
  }

  .about-layout {
    gap: 28px;
  }

  .about-aside {
    align-items: center;
  }

  .portrait-card {
    width: min(78vw, 320px);
    max-width: 100%;
    margin-inline: auto;
    border-radius: 20px;
  }

  .about-aside > .about-identity {
    width: 100%;
    margin-top: 2px;
    text-align: center;
  }

  .about-aside > .about-identity::after {
    font-size: .86rem;
  }

  .about-contact {
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .about-contact .contact-reveal {
    align-items: center;
  }

  .about-contact .contact-reveal-button {
    min-width: 150px;
    justify-content: center;
  }

  .about-contact .contact-reveal-value {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flow-section .node-a::after,
  .hero-flow-section .node-b::after,
  .hero-flow-section .node-a::before,
  .hero-flow-section .node-b::before {
    animation: none !important;
  }
}
