/* ==========================================================================
   PSGroup — main.css
   Design tokens (:root) + base + shared BEM primitives.
   Loaded by every page; page-specific styles live in index.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette
     main:   navy #0d3059 / mint #bdf2eb
     accent: orange #ff5b04 / teal #005c66 */
  --brand-mint: #bdf2eb;

  /* Color roles */
  --color-primary: #0d3059;
  --color-primary-hover: #164272;
  --color-text: #0d3059;
  --color-text-muted: #59708f;
  --color-text-faint: #677281;
  --color-accent: #ff5b04;
  --color-accent-hover: #e04e00;
  /* Orange dark enough to clear 4.5:1 as text on a light background */
  --color-accent-text: #cc4400;
  --color-secondary: #005c66;
  --color-secondary-soft: #dff2f0;
  --color-border: #e3e9f0;
  --color-border-strong: #c9d5e2;
  --color-surface: #fff;
  --color-surface-2: #f1faf7;
  --color-surface-3: #fafcfd;
  --color-ghost: #9ad8cf;
  --color-label-teal: #2f7f88;
  --color-white: #fff;

  /* Panels & gradients */
  --accent-tile: linear-gradient(150deg, #ff7d3a, #ff5b04);
  --teal-panel: linear-gradient(150deg, #0a7a86, #004a52);
  --teal-tile: linear-gradient(150deg, #0a7a86, #005c66);
  --hero-panel: linear-gradient(150deg, #164272, #0b2545);
  --dark-panel: linear-gradient(155deg, #123c68, #091e39);
  --seam: linear-gradient(90deg, #005c66, #ff5b04);

  /* Typography */
  --font-sans: "Museo Sans Cyrl", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Weights — Museo Sans ships 300/500/700/900, so the scale uses those */
  --weight-body: 300;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-black: 900;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 22px;
  --radius-pill: 999px;

  /* Spacing scale */
  --space-1: 8px;
  --space-2: 14px;
  --space-3: 28px;
  --space-4: 48px;
  --space-5: 64px;
  --space-6: 80px;

  /* Layout */
  --container: 1440px;
  --section-x: 80px;
  --section-y: 110px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--weight-body);
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-weight: var(--weight-bold);
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent);
}

/* The reset drops outlines globally — put a keyboard-only ring back */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

img, svg {
  display: block;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes psg-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-40px, 30px, 0) scale(1.12); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes psg-dash {
  to { stroke-dashoffset: -240; }
}

/* --------------------------------------------------------------------------
   Layout shell
   -------------------------------------------------------------------------- */
.page {
  max-width: var(--container);
  margin: 0 auto;
  background: var(--color-surface);
}

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

/* Numbers strip sits a touch tighter than a regular block */
.section--tight {
  padding-top: 96px;
  padding-bottom: 96px;
}

/* About / contact breathe a little wider */
.section--wide {
  padding-top: 120px;
  padding-bottom: 120px;
}

.section--surface-2 {
  background: var(--color-surface-2);
}

.section--dark {
  position: relative;
  overflow: hidden;
  background: var(--dark-panel);
  color: var(--color-white);
}

.section--divide-bottom {
  border-bottom: 1px solid var(--color-border);
}

.section__title {
  font-size: 44px;
  line-height: 1.12;
  text-wrap: balance;
}

/* A title that leads a block on its own, with the block below it */
.section__title--lead {
  max-width: 820px;
  margin-bottom: 56px;
}

.section__title--narrow {
  max-width: 760px;
  margin-bottom: var(--space-4);
}

.section__title--on-dark {
  position: relative;
  color: var(--color-white);
  margin-bottom: var(--space-5);
}

/* Heading left, supporting paragraph right */
.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: 60px;
}

.split--even {
  grid-template-columns: 1fr 1fr;
  margin-bottom: var(--space-5);
}

.split__text {
  padding-top: var(--space-1);
  font-size: 19px;
  line-height: 1.6;
  color: var(--color-text-muted);
  text-wrap: pretty;
}

/* Narrow heading column, wide body column */
.aside-split {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: var(--space-6);
  align-items: start;
}

/* --------------------------------------------------------------------------
   Scroll progress rail
   -------------------------------------------------------------------------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 40;
  background: transparent;
  pointer-events: none;
}

.progress__bar {
  height: 100%;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.1s linear;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 20px var(--section-x);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.header__link {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.header__link:hover {
  color: var(--color-accent);
}

/* Brand logo — sized by height so both lockups line up */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.logo__img {
  height: 34px;
  width: auto;
}

.logo--sm .logo__img {
  height: 27px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease, box-shadow 0.2s ease;
}

.btn__arrow {
  font-size: 18px;
  line-height: 1;
}

.btn--primary {
  padding: 12px 24px;
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  font-size: 15px;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn--accent {
  padding: 18px 34px;
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
  font-size: 16px;
}

.btn--accent:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(255, 91, 4, 0.35);
}

.btn--lg {
  padding: 18px 34px;
  font-size: 16px;
}

.btn--lg:hover {
  transform: translateY(-3px);
}

.btn--sm {
  padding: 12px 24px;
  font-size: 15px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* --------------------------------------------------------------------------
   Labels
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-secondary-soft);
  color: var(--color-secondary);
  font-size: 12px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow--on-dark {
  background: rgba(189, 242, 235, 0.16);
  color: var(--brand-mint);
}

.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-mint);
}

/* Monospace micro-label — used for diagram captions and card footers */
.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

/* --------------------------------------------------------------------------
   Icon tiles & line icons
   -------------------------------------------------------------------------- */
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-xl);
  background: var(--color-secondary-soft);
}

.tile--accent {
  background: var(--accent-tile);
  box-shadow: 0 10px 22px rgba(255, 91, 4, 0.28);
}

.tile--teal {
  background: var(--teal-tile);
  box-shadow: 0 10px 22px rgba(0, 92, 102, 0.3);
}

.tile--navy {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  box-shadow: 0 12px 26px rgba(13, 48, 89, 0.28);
}

.tile--glass {
  background: rgba(189, 242, 235, 0.2);
  box-shadow: 0 10px 22px rgba(13, 48, 89, 0.14);
}

/* Line icons — linear only: no fills, no 3D, per the brand brief */
.icon {
  display: block;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--color-secondary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile--accent .icon,
.tile--teal .icon,
.tile--navy .icon {
  stroke: var(--color-white);
}

/* On the dark panel the line icons pick up the mint, not pure white */
.tile--glass .icon {
  stroke: var(--brand-mint);
}

/* --------------------------------------------------------------------------
   Decorative primitives
   -------------------------------------------------------------------------- */
/* Slowly drifting glow — anchored by whatever block places it */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: psg-drift 20s ease-in-out infinite;
}

.orb--mint {
  background: radial-gradient(circle, rgba(189, 242, 235, 0.22), transparent 66%);
}

.orb--accent {
  background: radial-gradient(circle, rgba(255, 91, 4, 0.24), transparent 68%);
}

.orb--teal {
  background: radial-gradient(circle, rgba(0, 92, 102, 0.14), transparent 70%);
}

/* --------------------------------------------------------------------------
   Scroll reveal — JS flips [data-reveal] to is-revealed
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .orb,
  .hero__rail {
    animation: none;
  }
}

/* ==========================================================================
   Responsive — tablet (<=1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --section-x: 48px;
    --section-y: 80px;
  }

  .section--tight,
  .section--wide {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .section__title {
    font-size: 34px;
  }

  .section__title--lead {
    margin-bottom: var(--space-4);
  }

  .split,
  .split--even,
  .aside-split {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .split,
  .split--even {
    margin-bottom: var(--space-4);
  }

  .split__text {
    padding-top: 0;
    font-size: 17px;
  }
}

/* ==========================================================================
   Responsive — mobile (<=640px)
   ========================================================================== */
@media (max-width: 640px) {
  :root {
    --section-x: 20px;
    --section-y: 56px;
  }

  .section--tight,
  .section--wide {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .section__title {
    font-size: 27px;
  }

  .section__title--lead,
  .section__title--narrow {
    margin-bottom: var(--space-3);
  }

  .header {
    padding: 14px var(--section-x);
  }

  .header__nav {
    gap: var(--space-2);
  }

  .header__link {
    font-size: 14px;
  }

  .logo__img {
    height: 28px;
  }

  .btn--sm {
    padding: 10px 18px;
    font-size: 14px;
  }

  .btn--accent,
  .btn--lg {
    padding: 16px 26px;
    font-size: 15px;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.08em;
  }
}
