/* ─── Power Grid Consultants — custom styles ──────────────────────────── */

/* Smooth scroll, respecting user preference */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

@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 {
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 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', sans-serif;
  letter-spacing: 0.01em;
  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; letter-spacing: 0.18em;
  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: monospace; letter-spacing: 0.05em;
}

/* ── 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;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #22d3ee; margin-bottom: 2rem;
}
.pgc-hero-heading {
  font-family: 'Syne', 'DM Sans', sans-serif;
  font-size: clamp(3.2rem, 10vw, 12rem);
  font-weight: 800; line-height: 1.0;
  color: #ffffff;
  max-width: 14em; margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}
.pgc-word { display: inline-block; }
.pgc-hero-tagline {
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  color: rgba(255,255,255,0.58);
  max-width: 46ch; line-height: 1.65;
  margin-bottom: 2.25rem;
}
.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; letter-spacing: 0.14em; 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: 'Syne', 'DM Sans', sans-serif;
  font-size: clamp(5rem, 14vw, 18rem);
  font-weight: 800; letter-spacing: -0.03em;
  color: rgba(255,255,255,0.045);
  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;
}
.pgc-scroll-section.align-left  { padding-right: 55vw; }
.pgc-scroll-section.align-right { padding-left: 55vw; padding-right: 6vw; }

.pgc-scroll-section .section-inner { width: 100%; }

.section-label {
  display: block;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #22d3ee; margin-bottom: 0.9rem;
}
.section-heading {
  font-family: 'Syne', 'DM Sans', sans-serif;
  font-size: clamp(2rem, 4.5vw, 4.5rem);
  font-weight: 800; line-height: 1.08;
  color: #ffffff; margin-bottom: 1.1rem;
  letter-spacing: -0.02em;
}
.section-body {
  font-size: clamp(0.875rem, 1.15vw, 1rem);
  color: rgba(255,255,255,0.6);
  line-height: 1.68; max-width: 38ch;
  margin-bottom: 1.5rem;
}
.pgc-service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem;
  background: rgba(0,136,230,0.18);
  border: 1px solid rgba(0,136,230,0.28);
  border-radius: 0.65rem;
  color: #22d3ee; font-size: 1rem;
  margin-bottom: 1.1rem;
}

/* ── 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: 2.5rem; width: 100%;
  text-align: center;
}
.stat-value-wrap { display: flex; align-items: baseline; justify-content: center; gap: 0; }
.stat-number {
  font-family: 'Syne', 'DM Sans', sans-serif;
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 800; line-height: 1;
  color: #ffffff; display: block;
}
.stat-suffix {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 800; color: #22d3ee; line-height: 1;
}
.stat-label {
  display: block; font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 0.6rem;
}

/* ── Why us grid ── */
.pgc-why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem; margin-top: 1.5rem;
}
.pgc-why-item {
  padding: 1.1rem 1.2rem;
  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: 1rem; color: #22d3ee;
  margin-bottom: 0.6rem;
}
.pgc-why-title {
  font-family: 'Syne', 'DM Sans', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  color: #ffffff; margin-bottom: 0.35rem;
  line-height: 1.3;
}
.pgc-why-desc {
  font-size: 0.75rem;
  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.85rem; margin-top: 1.5rem;
  width: 100%;
}
.pgc-case-mini {
  padding: 1.1rem 1.15rem;
  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.6rem; font-weight: 700;
  letter-spacing: 0.1em; 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: 'Syne', 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 700;
  color: #ffffff; line-height: 1.35;
  margin-bottom: 0.5rem;
}
.pgc-case-desc {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}

/* ── Partner logo block ── */
.pgc-partner-logo {
  display: inline-flex; align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem; margin-bottom: 1.5rem;
}

/* ── 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 (max-width: 768px) {
  .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; }
}
