/* Shared editorial layout for about, services, portfolio and contacts pages. */

#page-content {
  scroll-margin-top: calc(var(--floating-header-clearance, 108px) + 12px);
}

.page-story-section {
  --page-accent: #1f7fe5;
  --page-accent-rgb: 31, 127, 229;
  --page-surface: #f4f6f8;
  --page-panel: rgba(255, 255, 255, 0.9);
  --page-panel-strong: #ffffff;
  --page-ink: #2e333b;
  --page-muted: #68717d;
  --page-line: rgba(48, 56, 68, 0.1);
  position: relative;
  isolation: isolate;
  overflow: clip;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 246, 248, 0.96) 34%, #f4f6f8 100%);
  color: var(--page-ink);
}

.page-story-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 12%, rgba(var(--page-accent-rgb), 0.14), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(17, 19, 21, 0.07), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
}

.page-story-screen {
  position: relative;
  z-index: 1;
  gap: clamp(34px, 4vw, 58px);
  width: min(92%, 1240px);
  max-width: 1240px;
  padding-top: max(
    clamp(72px, 8vw, 118px),
    calc(var(--floating-header-clearance, 108px) + 44px)
  );
  padding-bottom: clamp(56px, 6vw, 86px);
}

.page-story-hero {
  display: grid;
  gap: clamp(18px, 2.2vw, 28px);
}

.page-story-eyebrow {
  display: none;
}

.page-story-mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}

.page-story-copy {
  display: grid;
  gap: clamp(18px, 2vw, 24px);
  min-width: 0;
}

.page-story-title {
  margin: 0;
  max-width: 14.5ch;
  color: var(--page-ink);
  font-size: clamp(2.48rem, 4vw, 4.35rem);
  line-height: 0.96;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.page-story-intro {
  margin: 0;
  max-width: 58ch;
  color: rgba(46, 51, 59, 0.82);
  font-size: clamp(1rem, 1.08vw, 1.16rem);
  line-height: 1.64;
}

.page-story-aside {
  position: relative;
  display: grid;
  gap: 16px;
  align-content: end;
  min-height: 240px;
  padding: clamp(24px, 2.4vw, 32px);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(18, 22, 28, 0.96), rgba(13, 16, 20, 0.98)),
    radial-gradient(circle at 100% 0%, rgba(var(--page-accent-rgb), 0.26), transparent 44%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(18, 22, 28, 0.18);
  overflow: hidden;
}

.page-story-visual picture,
.about-founders-media picture,
.page-chapter-avatar picture,
.page-point-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.page-story-aside::before {
  content: "";
  position: absolute;
  right: -70px;
  top: -82px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--page-accent-rgb), 0.42), transparent 68%);
  pointer-events: none;
}

.page-story-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent);
  pointer-events: none;
}

.page-story-aside-label,
.page-story-aside-text {
  position: relative;
  z-index: 1;
}

.page-story-aside-label {
  font-family: var(--font-ui-accent);
  font-size: 0.74rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(180, 220, 255, 0.94);
}

.page-story-aside-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.98rem, 1.08vw, 1.12rem);
  line-height: 1.6;
}

.page-story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-story-tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(var(--page-accent-rgb), 0.18);
  background: rgba(255, 255, 255, 0.74);
  color: rgba(48, 56, 68, 0.74);
  font-family: var(--font-ui-accent);
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-story-chapters {
  display: grid;
  gap: clamp(18px, 2vw, 26px);
}

.page-chapter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.38fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  padding: clamp(24px, 2.6vw, 34px);
  border-radius: 24px;
  background: var(--page-panel);
  border: 1px solid var(--page-line);
  box-shadow: 0 18px 42px rgba(36, 44, 54, 0.055);
  overflow: hidden;
}

.page-chapter::before {
  display: none;
}

.page-chapter-head {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.page-chapter-index {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(var(--page-accent-rgb), 0.18);
  background: rgba(var(--page-accent-rgb), 0.08);
  color: rgb(var(--page-accent-rgb));
  font-family: var(--font-ui-accent);
  font-size: 0.9rem;
  line-height: 1;
  letter-spacing: 0.1em;
}

.page-chapter-copy {
  display: grid;
  gap: 12px;
}

.page-chapter-title {
  margin: 0;
  color: var(--page-ink);
  font-size: clamp(1.48rem, 2vw, 2.08rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.page-chapter-intro {
  margin: 0;
  max-width: 36ch;
  color: var(--page-muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.page-points {
  display: grid;
  gap: 0;
  counter-reset: page-point;
  min-width: 0;
}

.page-point {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 18px;
  align-content: start;
  padding: 18px 0;
  border-top: 1px solid rgba(48, 56, 68, 0.1);
}

.page-point:first-child {
  padding-top: 0;
  border-top: none;
}

.page-point:last-child {
  padding-bottom: 0;
}

.page-point::before {
  counter-increment: page-point;
  content: counter(page-point, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--page-accent-rgb), 0.18);
  background: rgba(var(--page-accent-rgb), 0.08);
  color: rgb(var(--page-accent-rgb));
  font-family: var(--font-ui-accent);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.1em;
}

.page-point-title {
  grid-column: 2;
  margin: 0;
  color: var(--page-ink);
  font-size: clamp(1rem, 1.18vw, 1.16rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-point-text,
.page-point-link {
  grid-column: 2;
  margin: 0;
  color: var(--page-muted);
  font-size: 0.96rem;
  line-height: 1.56;
}

.page-point-link {
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.page-point-link:hover {
  color: rgb(var(--page-accent-rgb));
  opacity: 0.86;
}

.page-story-cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(26px, 3vw, 38px);
  border-radius: 26px;
  background:
    radial-gradient(circle at 92% 0%, rgba(var(--page-accent-rgb), 0.28), transparent 36%),
    linear-gradient(135deg, #12161c 0%, #0e1116 100%);
  color: #ffffff;
  box-shadow: 0 22px 54px rgba(18, 22, 28, 0.2);
  overflow: hidden;
}

.page-story-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  pointer-events: none;
}

.page-story-cta-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-width: 42rem;
}

.page-story-cta-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.66rem, 2.2vw, 2.42rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.page-story-cta-text {
  margin: 0;
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.98rem;
  line-height: 1.58;
}

.page-story-cta-button {
  position: relative;
  z-index: 1;
  justify-self: end;
  min-width: 210px;
  max-width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1180px) {
  .page-story-mast {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .page-story-aside {
    min-height: 0;
  }

  .page-chapter {
    grid-template-columns: 1fr;
  }

  .page-chapter-intro {
    max-width: 58ch;
  }

  .page-story-cta {
    grid-template-columns: 1fr;
  }

  .page-story-cta-button {
    justify-self: start;
  }
}

@media (max-width: 768px) {
  .page-story-section {
    overflow: hidden;
  }

  .page-story-screen {
    width: min(100% - 28px, 620px);
    gap: 30px;
    padding-top: max(
      92px,
      calc(var(--floating-header-clearance, 108px) + 28px)
    );
    padding-bottom: 48px;
  }

  .page-story-hero {
    gap: 16px;
  }

  .page-story-mast {
    gap: 18px;
  }

  .page-story-copy {
    gap: 14px;
  }

  .page-story-title {
    max-width: 13ch;
    font-size: clamp(2.02rem, 9.2vw, 2.72rem);
    line-height: 0.98;
    letter-spacing: -0.034em;
  }

  .page-story-intro {
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .page-story-aside {
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
  }

  .page-story-aside-text {
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .page-story-tags {
    gap: 8px;
  }

  .page-story-tag {
    min-height: 31px;
    padding: 0 11px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .page-story-chapters {
    gap: 16px;
  }

  .page-chapter {
    gap: 18px;
    padding: 20px 16px;
    border-radius: 20px;
  }

  .page-chapter-head {
    gap: 12px;
  }

  .page-chapter-index {
    width: 52px;
    height: 32px;
    font-size: 0.78rem;
  }

  .page-chapter-title {
    font-size: clamp(1.38rem, 6.2vw, 1.86rem);
  }

  .page-chapter-intro {
    max-width: 100%;
    font-size: 0.92rem;
    line-height: 1.48;
  }

  .page-point {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 0;
  }

  .page-point::before {
    grid-column: 1;
    grid-row: auto;
    width: fit-content;
    min-width: 40px;
    height: 24px;
    font-size: 0.68rem;
  }

  .page-point-title,
  .page-point-text,
  .page-point-link {
    grid-column: 1;
  }

  .page-point-title {
    font-size: 1.04rem;
  }

  .page-point-text,
  .page-point-link {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .page-story-cta {
    gap: 18px;
    padding: 22px 16px;
    border-radius: 20px;
  }

  .page-story-cta-title {
    font-size: clamp(1.48rem, 6.4vw, 1.92rem);
  }

  .page-story-cta-text {
    font-size: 0.93rem;
    line-height: 1.48;
  }

  .page-story-cta-button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
  }
}
