/* ─── Power Grid Consultants — custom styles ──────────────────────────── */

:root {
  --pgc-font-sans: 'Inter', 'Noto Sans SC', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pgc-font-display: var(--pgc-font-sans);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
  letter-spacing: 0 !important;
}

/* Smooth scroll, respecting user preference */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--pgc-font-sans);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--pgc-font-sans);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:where(h1, h2, h3, h4, h5, h6, p, a, button, label, li, span, input, select, textarea) {
  overflow-wrap: anywhere;
}

:where(button, a, input, select, textarea) {
  max-width: 100%;
}

/* Skip-link — WCAG 2.2 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: #004d82;
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 0.5rem 0.5rem;
}
.skip-link:focus {
  left: 1rem;
  top: 0.5rem;
  outline: 3px solid #22d3ee;
  outline-offset: 2px;
}

/* Focus states — keyboard navigation */
:focus-visible {
  outline: 2px solid #0088e6;
  outline-offset: 2px;
  border-radius: 0.25rem;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0088e6;
  outline-offset: 2px;
}

/* Header scroll elevation */
#site-header.scrolled {
  box-shadow: 0 4px 20px -4px rgba(0, 77, 130, 0.12);
  background: rgba(255, 255, 255, 0.95);
}

/* Legal prose typography */
.legal-prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #002f50;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.legal-prose h2:first-child { margin-top: 0; }
.legal-prose p {
  color: #1f2937;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.legal-prose ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: #1f2937;
}
.legal-prose li { margin-bottom: 0.4rem; line-height: 1.6; }
.legal-prose a { color: #006ab4; text-decoration: underline; }
.legal-prose a:hover { color: #004d82; }

/* Disclosure (details/summary) caret suppression */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Scrollbar styling — desktop */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: #e6f4ff; }
  ::-webkit-scrollbar-thumb {
    background: #80c5ff;
    border-radius: 5px;
    border: 2px solid #e6f4ff;
  }
  ::-webkit-scrollbar-thumb:hover { background: #006ab4; }
}

/* Form error state */
.form-error { border-color: #dc2626 !important; }
.form-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

/* Conditional adaptive form fields */
.persona-fields { display: none; }
.persona-fields.show { display: grid; }

/* Drag-and-drop zone */
.drop-zone {
  border: 2px dashed #b3dcff;
  background: #f8fcff;
  transition: all 0.2s ease;
}
.drop-zone.drag-over {
  border-color: #006ab4;
  background: #e6f4ff;
}

/* High-contrast preference */
@media (prefers-contrast: more) {
  body { color: #000; }
  a { text-decoration: underline; }
  button, .btn { border: 2px solid currentColor; }
}

/* Print */
@media print {
  header, footer, #cookie-banner, .no-print { display: none !important; }
  body { color: #000; background: #fff; }
  a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  main { padding-top: 0 !important; }
  section { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
}

/* Chinese typography tweaks */
html[lang^="zh"] body {
  font-family: 'Noto Sans SC', 'Inter', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.75;
}

/* Reduce cumulative layout shift on images */
img { max-width: 100%; height: auto; }

/* Anchor offset for in-page fragments */
[id]:target { scroll-margin-top: 6rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM HOMEPAGE — Scroll-driven animations
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Loader ── */
#pgc-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #060d1a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.25rem;
}
#pgc-loader.pgc-loader-out {
  opacity: 0; transition: opacity 0.55s ease;
}
.pgc-loader-brand {
  font-size: 0.85rem; font-weight: 700;
  color: #ffffff;
  text-transform: uppercase; opacity: 0.9;
}
.pgc-loader-bar-wrap {
  width: 180px; height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
}
#pgc-loader-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #0088e6, #22d3ee);
  border-radius: 2px;
}
#pgc-loader-percent {
  font-size: 0.7rem; color: rgba(255,255,255,0.35);
  font-family: var(--pgc-font-sans);
}

/* ── Hero standalone ── */
.pgc-hero-standalone {
  position: fixed; inset: 0; z-index: 10;
  background: #060d1a;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  padding: 0 8vw 4rem;
  pointer-events: none;
}
.pgc-section-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  background: rgba(34,211,238,0.10);
  border: 1px solid rgba(34,211,238,0.28);
  border-radius: 999px;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase;
  color: #22d3ee; margin-bottom: 2rem;
}
.pgc-hero-heading {
  font-family: var(--pgc-font-display);
  font-size: 4rem;
  font-weight: 800; line-height: 1.1;
  color: #ffffff;
  max-width: 11.5em; margin-bottom: 1.2rem;
}
.pgc-word { display: inline-block; }
.pgc-hero-tagline {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.58);
  max-width: 56ch; line-height: 1.72;
  margin-bottom: 2rem;
}
.pgc-hero-ctas {
  display: flex; gap: 0.7rem; flex-wrap: wrap;
  pointer-events: auto;
}
.pgc-cta-primary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.8rem 1.6rem;
  background: #ffffff; color: #004d82;
  font-weight: 700; font-size: 0.875rem;
  border-radius: 0.55rem; text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}
.pgc-cta-primary:hover { background: #e6f4ff; transform: translateY(-1px); }
.pgc-cta-secondary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.8rem 1.6rem;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff; font-weight: 600; font-size: 0.875rem;
  border-radius: 0.55rem; text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background 0.18s;
}
.pgc-cta-secondary:hover { background: rgba(255,255,255,0.16); }
.pgc-scroll-indicator {
  position: absolute; bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 0.35rem; color: rgba(255,255,255,0.28);
  font-size: 0.62rem; text-transform: uppercase;
  pointer-events: none;
}
.pgc-scroll-indicator i { animation: pgc-bounce 2s ease-in-out infinite; }
@keyframes pgc-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ── Canvas wrap ── */
.pgc-canvas-wrap {
  position: fixed; inset: 0; z-index: 5;
}
#pgc-canvas { display: block; }

/* ── Dark overlay ── */
#pgc-dark-overlay {
  position: fixed; inset: 0; z-index: 6;
  background: #060d1a;
  opacity: 0; pointer-events: none;
}

/* ── Marquee ── */
.pgc-marquee-wrap {
  position: fixed; left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  z-index: 7; overflow: hidden;
  opacity: 0; pointer-events: none;
  white-space: nowrap;
}
.pgc-marquee-text {
  display: inline-block;
  font-family: var(--pgc-font-display);
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255,255,255,0.032);
  white-space: nowrap; will-change: transform;
}

/* ── Scroll container ── */
#pgc-scroll-container {
  position: relative; height: 1050vh; z-index: 8;
}

/* ── Scroll sections ── */
.pgc-scroll-section {
  position: fixed; inset: 0;
  display: flex; align-items: center;
  opacity: 0; pointer-events: none;
  padding: 0 6vw;
  will-change: opacity;
  visibility: hidden;
  transition: opacity 0.08s linear, visibility 0s linear 0.08s;
}
.pgc-scroll-section.align-left  { padding-right: 62vw; }
.pgc-scroll-section.align-right { padding-left: 62vw; padding-right: 7vw; }

.pgc-scroll-section .section-inner {
  width: 100%;
  max-width: 29rem;
  display: flex;
  flex-direction: column;
  row-gap: 0.75rem;
}

.section-label {
  display: block;
  font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase;
  color: #22d3ee; margin-bottom: 0;
}
.section-heading {
  font-family: var(--pgc-font-display);
  font-size: 1.9rem;
  font-weight: 800; line-height: 1.22;
  color: #ffffff; margin-bottom: 0;
}
.section-body {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7; max-width: 52ch;
  margin-bottom: 0.35rem;
}
.pgc-service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.35rem; height: 2.35rem;
  background: rgba(0,136,230,0.18);
  border: 1px solid rgba(0,136,230,0.28);
  border-radius: 0.65rem;
  color: #22d3ee; font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

/* ── Stats section ── */
.pgc-section-stats {
  align-items: center; justify-content: center;
  padding: 0 8vw !important;
}
.pgc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem; width: 100%;
  text-align: center;
}
.stat-value-wrap { display: flex; align-items: baseline; justify-content: center; gap: 0; }
.stat-number {
  font-family: var(--pgc-font-display);
  font-size: 3rem;
  font-weight: 800; line-height: 1;
  color: #ffffff; display: block;
}
.stat-suffix {
  font-size: 1.7rem;
  font-weight: 800; color: #22d3ee; line-height: 1;
}
.stat-label {
  display: block; font-size: 0.6rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  margin: 0.6rem auto 0;
  max-width: 18ch;
  line-height: 1.45;
}

/* ── Why us grid ── */
.pgc-why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem; margin-top: 0.15rem;
}
.pgc-why-item {
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  transition: background 0.2s;
}
.pgc-why-item:hover { background: rgba(255,255,255,0.07); }
.pgc-why-icon {
  display: block;
  font-size: 0.88rem; color: #22d3ee;
  margin-bottom: 0.45rem;
}
.pgc-why-title {
  font-family: var(--pgc-font-display);
  font-size: 0.72rem; font-weight: 700;
  color: #ffffff; margin-bottom: 0.35rem;
  line-height: 1.3;
}
.pgc-why-desc {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

/* ── Case study mini cards ── */
.pgc-cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.62rem; margin-top: 0.15rem;
  width: 100%;
}
.pgc-case-mini {
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
}
.pgc-case-tag {
  display: inline-block;
  font-size: 0.55rem; font-weight: 700;
  text-transform: uppercase;
  color: #22d3ee; padding: 0.2rem 0.55rem;
  background: rgba(34,211,238,0.10);
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: 999px; margin-bottom: 0.65rem;
}
.pgc-case-title {
  font-family: var(--pgc-font-display);
  font-size: 0.7rem; font-weight: 700;
  color: #ffffff; line-height: 1.35;
  margin-bottom: 0.5rem;
}
.pgc-case-desc {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}

/* ── Partner logo block ── */
.pgc-partner-logo {
  display: inline-flex; align-items: center;
  padding: 0.95rem 1.05rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem; margin-bottom: 0.25rem;
}

/* ── Header dark mode (on hero) ── */
#site-header.pgc-header-dark {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
#site-header.pgc-header-dark a,
#site-header.pgc-header-dark button { color: rgba(255,255,255,0.82) !important; }
#site-header.pgc-header-dark a:hover,
#site-header.pgc-header-dark button:hover { color: #ffffff !important; }
#site-header.pgc-header-dark .border-pgc-200 { border-color: rgba(255,255,255,0.2) !important; }
#site-header.pgc-header-dark .text-pgc-900 { color: #ffffff !important; }
#site-header.pgc-header-dark .text-pgc-800,
#site-header.pgc-header-dark .text-pgc-600 { color: rgba(255,255,255,0.75) !important; }

/* ── Mobile ── */
@media (min-width: 1536px) {
  .pgc-hero-heading { font-size: 4.6rem; }
  .pgc-marquee-text { font-size: 5.25rem; }
  .section-heading { font-size: 2.25rem; }
  .stat-number { font-size: 3.45rem; }
  .stat-suffix { font-size: 1.95rem; }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .pgc-hero-heading { font-size: 3.35rem; }
  .pgc-marquee-text { font-size: 3.6rem; }
  .section-heading { font-size: 1.7rem; }
  .section-body { font-size: 0.74rem; }
  .stat-number { font-size: 2.55rem; }
  .stat-suffix { font-size: 1.45rem; }
  .pgc-scroll-section.align-left { padding-right: 60vw; }
  .pgc-scroll-section.align-right { padding-left: 60vw; }
}

@media (max-width: 1279px) {
  .pgc-hero-standalone { padding: 0 6vw 3rem; }
  .pgc-scroll-section.align-left,
  .pgc-scroll-section.align-right {
    padding-left: 5vw !important;
    padding-right: 5vw !important;
    align-items: flex-end;
    padding-bottom: 12vh;
  }
  .section-body { max-width: 100%; }
  .pgc-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  #pgc-scroll-container { height: 850vh; }
  .pgc-section-stats { padding: 0 5vw !important; }
  .pgc-why-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .pgc-cases-grid { grid-template-columns: 1fr; gap: 0.8rem; }
}

@media (max-width: 640px) {
  :where(a, button, input, select, textarea) {
    min-height: 44px;
  }

  :where(h1) {
    font-size: 2.15rem;
    line-height: 1.14;
  }

  :where(h2) {
    font-size: 1.75rem;
    line-height: 1.18;
  }

  :where(p, li) {
    line-height: 1.68;
  }
}

@media (max-width: 480px) {
  :where(.grid) {
    grid-template-columns: 1fr !important;
  }

  :where(.px-8) {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  :where(.py-24) {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }
}

/* ── Responsive : masquer le premium desktop sur mobile ── */
@media (max-width: 1279px) {
  #pgc-loader,
  .pgc-hero-standalone,
  #pgc-canvas-wrap,
  #pgc-dark-overlay,
  #pgc-marquee,
  #pgc-scroll-container { display: none !important; }
}
