/* File: theme/css/humanspark-layout.css
 * Purpose: Structural layout classes - hero, grid, section, content width.
 * Project: HumanSpark | Date: 2026-03-20
 *
 * Overview: Provides .hs-hero, .hs-section, .hs-grid, and width
 * constraint classes. Uses Open Props tokens for spacing and
 * responsive behaviour. All layout is CSS Grid or Flexbox.
 * Includes hi-tech visual effects: mesh gradient on heroes,
 * geometric grid on dark sections, diagonal clip-paths.
 */

/* --- Body background --- */
body {
  background: var(--hs-navy);
}

main {
  background: var(--hs-navy);
}

/* --- Content width constraints --- */
.hs-contain {
  max-width: var(--hs-content-width);
  margin-inline: auto;
  padding-inline: var(--size-fluid-3);
}

.hs-contain--wide {
  max-width: var(--hs-wide-width);
  margin-inline: auto;
  padding-inline: var(--size-fluid-3);
}

/* --- Hero section --- */
.hs-hero {
  background: linear-gradient(180deg, #000620 0%, var(--hs-navy) 40%, var(--hs-navy) 80%, #00082A 100%);
  color: var(--hs-white);
  padding-block: clamp(5rem, 12vw, 10rem);
  padding-inline: var(--size-fluid-3);
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: none;
}

/* Geometric mesh gradient overlay - hi-tech depth */
.hs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(238, 186, 0, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 70%, rgba(238, 186, 0, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 35%, rgba(16, 58, 101, 0.9) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 20%, rgba(238, 186, 0, 0.12) 0%, transparent 30%),
    radial-gradient(ellipse at 10% 80%, rgba(0, 131, 132, 0.1) 0%, transparent 35%),
    radial-gradient(ellipse at 90% 80%, rgba(16, 58, 101, 0.5) 0%, transparent 35%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 131, 132, 0.15) 0%, transparent 45%);
  pointer-events: none;
}

/* Fine geometric dot grid - tech texture */
.hs-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hs-dot-pattern);
  background-size: 20px 20px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
}

.hs-hero > * {
  position: relative;
  z-index: 1;
}

.hs-hero h1,
.hs-hero h2 {
  color: var(--hs-white);
  max-width: 850px;
  margin-inline: auto;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  line-height: 1.12;
  margin-bottom: var(--size-3);
  letter-spacing: -0.03em;
}

.hs-hero p {
  color: rgba(210, 218, 230, 0.95);
  max-width: 620px;
  margin-inline: auto;
  font-size: var(--font-size-2);
  line-height: 1.7;
  margin-bottom: var(--size-2);
}

/* Gradient accent line under hero heading */
.hs-hero h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--hs-gradient-line);
  margin-top: var(--size-4);
  margin-inline: auto;
  border-radius: var(--radius-round);
  box-shadow: 0 0 15px rgba(238, 186, 0, 0.3);
}

.hs-hero .hs-btn {
  margin-top: var(--size-5);
  padding: var(--size-3) var(--size-fluid-4);
  font-size: var(--font-size-2);
  box-shadow: var(--hs-glow-accent), 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}

.hs-hero .hs-btn:hover {
  box-shadow: var(--hs-glow-accent-strong), 0 6px 20px rgba(0, 0, 0, 0.3);
}

.hs-hero--split {
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-fluid-4);
  align-items: center;
  max-width: var(--hs-wide-width);
  margin-inline: auto;
}

@media (max-width: 768px) {
  .hs-hero--split {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hs-hero {
    padding-block: clamp(3rem, 8vw, 5rem);
  }

  .hs-tagline {
    font-size: var(--font-size-0);
    letter-spacing: var(--font-letterspacing-3);
  }
}

/* --- Sections --- */
.hs-section {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  padding-inline: clamp(2.5rem, 6vw, 5rem);
  background: var(--hs-white);
  max-width: var(--hs-wide-width);
  margin-inline: auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

/* White sections get rounded corners when adjacent to dark sections */
.hs-hero + .hs-section:not(.hs-section--dark),
.hs-section--dark + .hs-section:not(.hs-section--dark) {
  border-radius: var(--radius-3) var(--radius-3) 0 0;
  position: relative;
  z-index: 2;
  margin-top: -0.5rem;
}

/* White section before a dark section */
.hs-section:not(.hs-section--dark) + .hs-section--dark {
  /* The previous white section needs bottom rounding - handled by :has */
}

/* White section followed by dark gets rounded bottom */
.hs-section:not(.hs-section--dark):has(+ .hs-section--dark) {
  border-radius: 0 0 var(--radius-3) var(--radius-3);
}

/* White section between two dark sections - round all corners */
.hs-section--dark + .hs-section:not(.hs-section--dark):has(+ .hs-section--dark) {
  border-radius: var(--radius-3);
}

/* Also handle hero → dark transitions */
.hs-hero + .hs-section:not(.hs-section--dark):has(+ .hs-section--dark) {
  border-radius: var(--radius-3);
}

/* Centered heading style for sections */
.hs-section h2 {
  text-align: center;
  margin-bottom: var(--size-fluid-4);
  color: var(--hs-navy);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hs-section--dark h2 {
  color: var(--hs-white);
}

/* Gradient accent line below section headings */
.hs-section h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--hs-gradient-line);
  margin-top: var(--size-3);
  margin-inline: auto;
  border-radius: var(--radius-round);
}

/* Tagline centered in sections */
.hs-section .hs-tagline {
  text-align: center;
}

.hs-section--dark {
  background: var(--hs-navy);
  color: var(--hs-white);
  position: relative;
  max-width: none;
  box-shadow: none;
  padding-block: clamp(3rem, 6vw, 5rem);
}

/* Geometric grid on dark sections */
.hs-section--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, var(--hs-grid-line) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(90deg, var(--hs-grid-line) 0 1px, transparent 1px 100%);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Mesh gradient on dark sections for depth */
.hs-section--dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hs-mesh-gradient);
  pointer-events: none;
}

.hs-section--dark > * {
  position: relative;
  z-index: 1;
}

.hs-section--dark h2,
.hs-section--dark h3 {
  color: var(--hs-white);
}

.hs-section--dark {
  text-align: center;
}

.hs-section--dark p {
  color: rgba(200, 210, 225, 0.9);
  max-width: 600px;
  margin-inline: auto;
  font-size: var(--font-size-2);
  line-height: 1.7;
}

/* Diagonal clip-path transition between sections */
.hs-section--angled {
  clip-path: polygon(0 3vw, 100% 0, 100% calc(100% - 3vw), 0 100%);
  padding-block: calc(clamp(3rem, 6vw, 5rem) + 3vw);
  margin-block: -3vw;
}

/* Services section - first white section below hero */
.hs-section--services {
  background: var(--hs-white);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}

.hs-section--services .hs-tagline {
  text-align: center;
}

.hs-section--services .hs-grid {
  margin-top: var(--size-fluid-4);
}

.hs-section--grey {
  background: var(--hs-grey);
}

/* Warm CTA section - last white section before footer */
.hs-section--cta-warm {
  background: var(--hs-white);
  text-align: center;
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 7rem);
  border-bottom-left-radius: var(--radius-3);
  border-bottom-right-radius: var(--radius-3);
  margin-bottom: var(--size-fluid-4);
}

.hs-section--cta-warm h2 {
  color: var(--hs-navy);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.hs-section--cta-warm h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--hs-gradient-line);
  margin-top: var(--size-3);
  margin-inline: auto;
  border-radius: var(--radius-round);
}

.hs-section--cta-warm p {
  color: var(--hs-text);
  max-width: 600px;
  margin-inline: auto;
  font-size: var(--font-size-2);
  line-height: 1.7;
}

/* Testimonial section - extra padding for breathing room */
.hs-section--testimonial {
  padding-block: clamp(4.5rem, 9vw, 7rem);
  background: var(--hs-white);
}

.hs-section--navy-light {
  background: var(--hs-navy-light);
  color: var(--hs-white);
  position: relative;
}

.hs-section--navy-light::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hs-dot-pattern);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.5;
}

.hs-section--navy-light > * {
  position: relative;
  z-index: 1;
}

.hs-section--navy-light h2,
.hs-section--navy-light h3 {
  color: var(--hs-white);
}

/* --- Grid --- */
.hs-grid {
  display: grid;
  gap: var(--size-fluid-4);
  max-width: var(--hs-wide-width);
  margin-inline: auto;
}

.hs-grid--2col {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.hs-grid--3col {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.hs-grid--4col {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

/* --- Stack (single column, spaced) --- */
.hs-stack {
  display: flex;
  flex-direction: column;
  gap: var(--size-fluid-3);
  max-width: var(--hs-content-width);
  margin-inline: auto;
}

/* --- Tagline (small uppercase text above headings) --- */
.hs-tagline {
  font-size: var(--font-size-1);
  font-weight: var(--hs-weight-heading);
  text-transform: uppercase;
  letter-spacing: var(--font-letterspacing-4);
  color: var(--hs-accent);
  margin-bottom: var(--size-3);
  text-shadow: 0 0 20px rgba(238, 186, 0, 0.2);
}

/* Hero tagline with gradient text */
.hs-hero .hs-tagline {
  background: var(--hs-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  font-size: var(--font-size-1);
  margin-bottom: var(--size-4);
}
