/* =========================================================
   Social Map Space — "Social Pulse" Design System
   ========================================================= */

/* === Variables === */
:root {
  --primary:      #FF6B6B;
  --primary-dk:   #E85252;
  --secondary:    #4ECDC4;
  --secondary-dk: #3AB5AD;
  --accent:       #FFE66D;
  --accent-dk:    #F5D800;
  --bg:           #F7F9F9;
  --surface:      #FFFFFF;
  --text:         #1A1A52;
  --text-mid:     #2E2E7A;
  --text-soft:    #6060A0;
  --dark:         #0F0F38;
  --border:       rgba(26,26,82,0.12);
  --radius:       10px;
  --radius-lg:    20px;
  --radius-pill:  50px;
  --shadow:       0 4px 24px rgba(47,47,162,0.09);
  --shadow-lg:    0 10px 40px rgba(47,47,162,0.15);
  --transition:   0.22s ease;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
h1, h2, h3 { line-height: 1.25; }

/* === Utility === */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.text-content {
  max-width: 780px;
  margin: 0 auto;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* === Typography helpers === */
.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(255,107,107,0.10);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.section-eyebrow--teal {
  color: var(--secondary-dk);
  background: rgba(78,205,196,0.12);
}
.section-eyebrow--accent {
  color: #B89600;
  background: rgba(255,230,109,0.25);
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes pulse-ring {
  0%   { width: 12px; height: 12px; opacity: 0.8; }
  100% { width: 60px; height: 60px; opacity: 0; }
}
@keyframes float-node {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
  50%       { transform: translate(-50%, -50%) translateY(-8px); }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.header-logo img {
  height: 40px;
  width: auto;
}

/* Desktop nav */
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--primary);
  color: #FFF;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #FFF;
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.mobile-nav a {
  display: block;
  width: 100%;
  padding: 13px 24px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  transition: background var(--transition);
}
.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(255,107,107,0.10);
  color: var(--primary);
}
.mobile-nav.is-open { display: flex; }

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 200;
  transition: width 0.1s linear;
}

/* =========================================================
   Hero — Coral with network nodes
   ========================================================= */
.site-hero {
  position: relative;
  background:
    radial-gradient(rgba(255,255,255,0.14) 2px, transparent 2px),
    linear-gradient(135deg, var(--dark) 0%, var(--secondary-dk) 100%);
  background-size: 38px 38px, auto;
  overflow: hidden;
  padding: 90px 0 80px;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}
.hero-text { color: #FFF; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: #FFF;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  max-width: none;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 2.5px solid #FFF;
  color: #FFF;
  background: transparent;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.hero-cta:hover {
  background: #FFF;
  color: var(--dark);
}
.hero-cta svg { transition: transform var(--transition); }
.hero-cta:hover svg { transform: translateX(4px); }

/* Network visualization */
.hero-network {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.net-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.net-node {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.net-node::before,
.net-node::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  animation: pulse-ring 2.8s ease-out infinite;
}
/* Node positions */
.node-1 { top: 15%; left: 57%; animation: float-node 5s ease-in-out infinite; }
.node-2 { top: 30%; left: 74%; animation: float-node 6s ease-in-out infinite 1s; }
.node-3 { top: 20%; left: 88%; animation: float-node 5.5s ease-in-out infinite 0.5s; }
.node-4 { top: 52%; left: 64%; animation: float-node 4.5s ease-in-out infinite 1.5s; }
.node-5 { top: 42%; left: 92%; animation: float-node 7s ease-in-out infinite 2s; }
.node-6 { top: 64%; left: 80%; animation: float-node 5.5s ease-in-out infinite 0.8s; }
/* Pulse delays */
.node-1::before { animation-delay: 0s; }    .node-1::after { animation-delay: 1.4s; }
.node-2::before { animation-delay: 0.4s; }  .node-2::after { animation-delay: 1.8s; }
.node-3::before { animation-delay: 0.8s; }  .node-3::after { animation-delay: 2.2s; }
.node-4::before { animation-delay: 1.2s; }  .node-4::after { animation-delay: 2.6s; }
.node-5::before { animation-delay: 1.6s; }  .node-5::after { animation-delay: 0.2s; }
.node-6::before { animation-delay: 2.0s; }  .node-6::after { animation-delay: 0.6s; }

/* =========================================================
   Intro Section
   ========================================================= */
.intro-section {
  padding: 90px 0;
  background: var(--surface);
}
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}
.intro-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.intro-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.intro-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.intro-text p { color: var(--text-mid); margin-bottom: 12px; }

/* =========================================================
   Social Mapping Section (teal)
   ========================================================= */
.mapping-section {
  padding: 90px 0;
  background: var(--secondary);
  position: relative;
  overflow: hidden;
}
.mapping-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.15) 2px, transparent 2px);
  background-size: 32px 32px;
  pointer-events: none;
}
.mapping-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}
.mapping-text { color: #FFF; }
.mapping-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: #FFF;
}
.mapping-text p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
}
.mapping-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.mapping-img img { width: 100%; }

/* =========================================================
   Slider Section
   ========================================================= */
.slider-section {
  padding: 90px 0;
  background: var(--bg);
}
.slider-header {
  text-align: center;
  margin-bottom: 48px;
}
.slider-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.slider-header p { color: var(--text-mid); }

.carousel-wrapper {
  --slides-visible: 3;
  --slide-gap: 16px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.carousel-track {
  display: flex;
  gap: var(--slide-gap);
  transition: transform 0.45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 calc(
    (100% - var(--slide-gap) * (var(--slides-visible) - 1))
    / var(--slides-visible)
  );
}
.carousel-slide img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.carousel-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
}
.carousel-dots { display: flex; gap: 8px; }
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border: none;
}
.carousel-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* =========================================================
   FAQ / Accordion Section
   ========================================================= */
.faq-section {
  padding: 90px 0;
  background: #FFFBEC;
}
.faq-header {
  text-align: center;
  margin-bottom: 48px;
}
.faq-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}
.accordion-item {
  border-bottom: 1px solid rgba(47,47,162,0.12);
}
.accordion-item summary {
  list-style: none;
  padding: 20px 48px 20px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  position: relative;
  transition: color var(--transition);
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.accordion-item[open] summary::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
  background-color: var(--text);
  transform: translateY(-50%) rotate(0deg);
}
.accordion-item summary:hover { color: var(--primary); }
.accordion-body {
  padding: 0 0 20px;
  color: var(--text-mid);
  line-height: 1.75;
}

/* =========================================================
   Articles listing page
   ========================================================= */
.articles-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--secondary-dk) 100%);
  padding: 70px 0 60px;
  text-align: center;
}
.articles-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #FFF;
  letter-spacing: -0.02em;
}
.articles-hero p {
  color: rgba(255,255,255,0.7);
  margin-top: 12px;
  font-size: 1.05rem;
}

.articles-main {
  padding: 72px 0 96px;
}

/* Mosaic grid */
.articles-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 28px;
}
.article-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}
.article-card--featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.article-card-img {
  overflow: hidden;
}
.article-card--featured .article-card-img {
  height: 100%;
  min-height: 260px;
}
.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .article-card-img img { transform: scale(1.04); }
.article-card-img.card-img-std { height: 200px; }
.article-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.article-card-body h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 10px;
  flex: 1;
}
.article-card--featured .article-card-body h2 {
  font-size: 1.35rem;
}
.article-excerpt {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  transition: gap var(--transition);
}
/* Stretched link — вся площина картки клікабельна */
.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}
.article-card:hover .card-link { gap: 10px; }

/* =========================================================
   Article page
   ========================================================= */
.article-page {
  padding: 60px 0 96px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 36px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }
.article-header { margin-bottom: 36px; }
.article-header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 12px;
}
.text-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}
.text-content p {
  color: var(--text-mid);
  margin-bottom: 16px;
  line-height: 1.8;
}
.text-content img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 28px 0;
  box-shadow: var(--shadow);
}

/* =========================================================
   Third page (social-challenges)
   ========================================================= */
.page-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--secondary-dk) 100%);
  padding: 70px 0 60px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  color: #FFF;
  letter-spacing: -0.02em;
}
.page-hero p {
  color: rgba(255,255,255,0.72);
  margin-top: 12px;
  font-size: 1.05rem;
}
.page-main {
  padding: 64px 0 96px;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.footer-logo img {
  height: 36px;
  width: auto;
  filter: invert(1);
  opacity: 0.9;
}
.footer-copy {
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  justify-self: center;
}
.footer-nav {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.footer-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  transition: background var(--transition), color var(--transition);
}
.footer-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: #FFF;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .hero-inner { gap: 32px; }
}

@media (max-width: 860px) {
  .site-hero { padding: 64px 0 56px; }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  /* hide network nodes on mobile—hero stays nice */
  .hero-network { opacity: 0.25; }

  .hero-cta { margin: 0 auto; }

  .intro-grid { grid-template-columns: 1fr; gap: 36px; }
  .mapping-grid { grid-template-columns: 1fr; gap: 36px; }
  .carousel-wrapper { --slides-visible: 2; }

  .articles-mosaic { grid-template-columns: 1fr 1fr; }
  .article-card--featured {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }
  .article-card--featured .article-card-img { min-height: 220px; height: 220px; }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "logo nav"
      "copy copy";
  }
  .footer-logo { grid-area: logo; }
  .footer-nav  { grid-area: nav; }
  .footer-copy { grid-area: copy; padding-top: 12px; }
}

@media (max-width: 700px) {
  .articles-mosaic { grid-template-columns: 1fr; }
  .article-card--featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .wrapper { padding: 0 16px; }

  .nav-toggle { display: flex; }
  .main-nav   { display: none; }

  .site-hero { padding: 52px 0 48px; }
  .intro-section,
  .mapping-section,
  .slider-section,
  .faq-section { padding: 56px 0; }

  .carousel-wrapper { --slides-visible: 1; --slide-gap: 0px; }
  .carousel-track { gap: 0; }
  .carousel-slide img { height: 260px; border-radius: 0; }

  .articles-main { padding: 40px 0 72px; }

  .footer-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "nav"
      "copy";
    justify-items: center;
    text-align: center;
  }
  .footer-nav {
    justify-content: center;
    flex-wrap: wrap;
  }
  .footer-copy { padding-top: 8px; }
}

@media (max-width: 420px) {
  .hero-inner { gap: 24px; }
  .hero-text h1 { font-size: 1.9rem; }
}
