/* ==========================================================
   MedSiLa v2 — distinct palette from v1 (navy/teal).
   v2 palette: deep indigo + warm coral on a soft cream base.
   ========================================================== */
:root {
  --v2-ink:        #0F1115; /* near-black — headings, the one dark section */
  --v2-ink-soft:   #4A4D55;
  --v2-accent:     #FF6B57; /* coral — everyday accent: icons, links, hover, borders */
  --v2-accent-soft:#FFD9D1;
  --v2-power:      #D7263D; /* bold red — reserved ONLY for primary CTA buttons */
  --v2-bg:         #FFFFFF; /* crisp white page background */
  --v2-surface:    #FFFFFF;
  --v2-border:     #E5E5EA;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body.v2-body {
  margin: 0;
  background: var(--v2-bg);
  color: var(--v2-ink);
  font-family: var(--font-body);
  line-height: 1.55;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--v2-ink); margin: 0 0 16px; }

.v2-banner {
  background: var(--v2-ink);
  color: var(--v2-accent-soft);
  text-align: center;
  font-size: 13px;
  padding: 6px 12px;
  letter-spacing: .03em;
}

/* ---- Header ---- */
.v2-header { background: var(--v2-surface); border-bottom: 1px solid var(--v2-border); position: sticky; top: 0; z-index: 50; }
.v2-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.v2-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.v2-brand-name { font-family: var(--font-display); font-weight: 600; color: var(--v2-ink); font-size: 20px; }
.v2-nav { display: flex; align-items: center; gap: 28px; }
.v2-nav a { color: var(--v2-ink-soft); text-decoration: none; font-weight: 500; font-size: 15px; }
.v2-nav a[aria-current="page"], .v2-nav a:hover { color: var(--v2-accent); }
.v2-nav-toggle { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; padding: 12px; margin: -12px; }
.v2-nav-toggle span { width: 24px; height: 2px; background: var(--v2-ink); display: block; }

.v2-btn { display: inline-block; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.v2-btn-primary { background: var(--v2-power); color: #fff; }
.v2-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(215,38,61,.35); }

/* ---- Hero with animated 2D blob shapes ---- */
.v2-hero { position: relative; overflow: hidden; padding: 90px 0 70px; }
.v2-hero-zone { position: relative; overflow: hidden; }
.v2-hero-zone > section.v2-section { position: relative; z-index: 1; }
.v2-hero-network { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; pointer-events: none; z-index: 0; }
.v2-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.v2-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--v2-accent); font-weight: 600; letter-spacing: .08em; font-size: 13px; text-transform: uppercase; margin-bottom: 14px; }
.v2-hero h1 { font-size: 46px; line-height: 1.12; }
.v2-hero p.lede { font-size: 18px; color: var(--v2-ink-soft); max-width: 46ch; }

.v2-art { position: relative; height: 340px; }
.v2-blob {
  position: absolute;
  border-radius: 42% 58% 65% 35% / 45% 45% 55% 55%;
  opacity: .85;
  animation: v2-float 7s ease-in-out infinite;
}
.v2-blob.b1 { width: 220px; height: 220px; background: var(--v2-accent-soft); top: 10px; left: 40px; animation-delay: 0s; }
.v2-blob.b2 { width: 150px; height: 150px; background: var(--v2-accent); opacity: .18; top: 80px; right: 20px; animation-delay: 1.2s; }
.v2-blob.b3 { width: 110px; height: 110px; background: var(--v2-ink); opacity: .08; bottom: 10px; left: 110px; animation-delay: 2.1s; }
.v2-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--v2-accent); animation: v2-pulse 2.4s ease-in-out infinite; }
.v2-dot.d1 { top: 40px; right: 100px; }
.v2-dot.d2 { bottom: 60px; left: 60px; animation-delay: .8s; }
.v2-dot.d3 { top: 160px; left: 200px; animation-delay: 1.6s; }

@keyframes v2-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(6deg); }
}
@keyframes v2-pulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50%      { transform: scale(1.5); opacity: .3; }
}
@media (prefers-reduced-motion: reduce) {
  .v2-blob, .v2-dot { animation: none; }
}

/* ---- Labeled hero pipeline diagram (Capture -> Contextualize -> Reason -> Decide) ---- */
.v2-hero-pipeline { position: relative; height: 380px; }
.v2-hero-pipeline-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.v2-hero-pill {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--v2-surface); border: 1px solid var(--v2-border);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--v2-ink);
  box-shadow: 0 6px 18px rgba(27,31,59,.08); white-space: nowrap;
}
.v2-hero-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--v2-accent); display: inline-block; }
.v2-hero-pipeline .v2-blob.b2 { top: 40%; left: 55%; opacity: .35; }

/* ---- Extra icon-animation keyframes, used by v2/includes/illustrations-v2.php ---- */
@keyframes v2-spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes v2-twist { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-0.35); } }
@keyframes v2-draw { to { stroke-dashoffset: 0; } }
@keyframes v2-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.v2-icon-anim { width: 100%; max-width: 340px; margin: 0 auto; }
.v2-icon-anim .spin-slow { animation: v2-spin-slow 14s linear infinite; transform-origin: center; }
.v2-icon-anim .twist { animation: v2-twist 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.v2-icon-anim .draw-line { stroke-dasharray: 400; stroke-dashoffset: 400; animation: v2-draw 2.2s ease forwards; }
.v2-icon-anim .bob { animation: v2-bob 3.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .v2-icon-anim .spin-slow, .v2-icon-anim .bob, .v2-icon-anim .twist { animation: none; }
  .v2-icon-anim .draw-line { stroke-dashoffset: 0; animation: none; }
}

/* ---- Layout components (grids, cards, pipeline, checklist) ---- */
.v2-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.v2-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.v2-card { background: var(--v2-surface); border: 1px solid var(--v2-border); border-radius: 16px; padding: 24px; }
.v2-card h3 { font-size: 17px; margin-bottom: 8px; }
.v2-eyebrow-block { display: block; margin-bottom: 8px; }

.v2-check-list { list-style: none; margin: 0; padding: 0; }
.v2-check-list li { padding: 12px 0 12px 30px; border-bottom: 1px solid var(--v2-border); position: relative; color: var(--v2-ink-soft); }
.v2-check-list li::before { content: '✓'; position: absolute; left: 0; top: 12px; color: var(--v2-accent); font-weight: 700; }
.v2-check-list li:last-child { border-bottom: 0; }

.v2-pipeline-connector { position: relative; height: 4px; border-radius: 4px; background: var(--v2-border); margin: 20px 0 32px; overflow: hidden; }
.v2-pipeline-connector::after {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--v2-accent), transparent);
  animation: v2-flow 2.6s linear infinite;
}
@keyframes v2-flow { 0% { left: -40%; } 100% { left: 100%; } }

.v2-pipeline { display: grid; grid-template-columns: 1fr 36px 1fr 36px 1fr 36px 1fr; grid-template-rows: auto 0 auto; align-items: stretch; }
.v2-pipeline-step {
  background: var(--v2-surface); border: 1px solid var(--v2-border); border-top: 3px solid var(--v2-accent);
  border-radius: 16px; padding: 22px; position: relative;
  box-shadow: 0 4px 14px rgba(27,31,59,.05); transition: transform .2s ease, box-shadow .2s ease;
}
.v2-pipeline-step.is-down { grid-row: 3; }
.v2-pipeline-step.is-up { grid-row: 1; }
.v2-pipeline-step:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(27,31,59,.12); }
.v2-pipeline-step:hover .v2-step-icon { transform: scale(1.08); }
.v2-pipeline-arrow { grid-row: 2; align-self: center; justify-self: center; display: flex; align-items: center; justify-content: center; color: var(--v2-accent); animation: v2-arrow-pulse 1.8s ease-in-out infinite; }
.v2-pipeline-arrow svg { width: 20px; height: 20px; }
@keyframes v2-arrow-pulse { 0%,100% { opacity: .4; transform: translateX(0); } 50% { opacity: 1; transform: translateX(3px); } }
.v2-pipeline-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.v2-step-icon { width: 44px; height: 44px; flex: 0 0 auto; transition: transform .2s ease; }
.v2-pipeline-num { width: 22px; height: 22px; border-radius: 50%; background: var(--v2-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex: 0 0 auto; }
.v2-pipeline-step h3 { font-size: 16px; margin: 0 0 6px; position: relative; display: inline-block; transition: color .3s ease; }
.v2-pipeline-step h3::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--v2-accent); transition: width .35s ease; }
.v2-pipeline-step:hover h3 { color: var(--v2-accent); }
.v2-pipeline-step:hover h3::after { width: 100%; }
.v2-pipeline-step p { margin: 0; font-size: 14px; color: var(--v2-ink-soft); }

/* per-icon continuous animations */
.step-anim-drop { animation: v2-step-drop 2.4s ease-in-out infinite; }
@keyframes v2-step-drop { 0%, 15% { transform: translateY(0); opacity: 1; } 45% { transform: translateY(10px); opacity: 0; } 50% { transform: translateY(-6px); opacity: 0; } 70%,100% { transform: translateY(0); opacity: 1; } }
.step-anim-pulse { animation: v2-step-pulse 2.8s ease-in-out infinite; transform-origin: 38px 22px; }
@keyframes v2-step-pulse { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.step-anim-spin { animation: v2-step-spin 7s linear infinite; }
@keyframes v2-step-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.step-anim-ring { animation: v2-step-ring 2.2s ease-out infinite; transform-origin: 30px 30px; }
@keyframes v2-step-ring { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@media (max-width: 860px) {
  .v2-pipeline { grid-template-columns: 1fr; }
  .v2-pipeline-arrow { display: none; }
  .v2-pipeline-step, .v2-pipeline-step.is-down, .v2-pipeline-step.is-up { grid-row: auto; grid-column: 1; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .v2-pipeline-connector::after, .v2-pipeline-arrow, .step-anim-drop, .step-anim-pulse, .step-anim-spin, .step-anim-ring { animation: none; }
}

.v2-section-dark { background: var(--v2-ink); color: #fff; }
.v2-section-dark h2, .v2-section-dark .v2-eyebrow { color: #fff; }
.v2-section-dark .v2-check-list li { color: rgba(255,255,255,.82); border-bottom-color: rgba(255,255,255,.15); }

@media (max-width: 860px) {
  .v2-grid-2, .v2-grid-3 { grid-template-columns: 1fr; }
}

/* ---- Generic content sections ---- */
.v2-section { padding: 64px 0; }
.v2-section.alt { background: var(--v2-surface); border-top: 1px solid var(--v2-border); border-bottom: 1px solid var(--v2-border); }
.v2-section-with-art { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.v2-section-with-art.reverse { direction: rtl; }
.v2-section-with-art.reverse > * { direction: ltr; }

/* ---- FAQ accordion (used by section_type = 'faq') ---- */
.v2-faq-item { border-bottom: 1px solid var(--v2-border); }
.v2-faq-q { width: 100%; text-align: left; background: none; border: 0; padding: 18px 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--v2-ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.v2-faq-a { max-height: 0; overflow: hidden; color: var(--v2-ink-soft); transition: max-height .25s ease; }
.v2-faq-item.open .v2-faq-a { max-height: 300px; padding-bottom: 18px; }

/* ---- Timeline (used by section_type = 'timeline') ---- */
.v2-timeline { position: relative; padding-left: 28px; border-left: 2px solid var(--v2-accent-soft); }
.v2-timeline-item { position: relative; margin-bottom: 28px; }
.v2-timeline-item::before { content: ''; position: absolute; left: -34px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--v2-accent); }
.v2-timeline-date { font-weight: 600; color: var(--v2-accent); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }

/* ---- Reveal-on-scroll ---- */
/* Fail-safe scroll reveal: content is visible by default. Only once JS
   confirms it's running (adding .js-reveal-ready to <html>) do elements
   start hidden and wait to be revealed - so if JS is slow, blocked, or
   the observer never fires, the page still shows its content instead of
   staying blank. */
.reveal-v2 { opacity: 1; transform: none; }
.js-reveal-ready .reveal-v2 { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.js-reveal-ready .reveal-v2.in-view { opacity: 1; transform: none; }

.v2-footer { padding: 28px 0; text-align: center; color: var(--v2-ink-soft); font-size: 13px; }

/* ---- Full footer: dark band with wave texture, same content as before ---- */
.v2-footer-full { position: relative; background: var(--v2-surface); border-top: 1px solid var(--v2-border); margin-top: 40px; overflow: hidden; color: var(--v2-ink-soft); }
.v2-footer-network { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; pointer-events: none; }
.v2-footer-top { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 72px 0 32px; }
.v2-footer-brand .v2-brand-name { margin-left: 8px; color: var(--v2-ink); }
.v2-footer-brand .muted, .v2-footer-brand p { color: var(--v2-ink-soft); }
.v2-footer-col h4 { font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--v2-power); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.v2-footer-col h4::after { content: ''; flex: 1; height: 1px; background: var(--v2-power); opacity: .35; }
.v2-footer-col a, .v2-footer-col span { display: block; color: var(--v2-ink-soft); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.v2-footer-col a:hover { color: var(--v2-accent); }
.v2-footer-nav-item { display: flex !important; align-items: center; gap: 10px; margin-bottom: 32px; }
.v2-footer-col a.v2-footer-nav-item .v2-footer-nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: 0 0 auto; margin-bottom: 0; color: var(--v2-power); }
.v2-footer-col a.v2-footer-nav-item span { margin-bottom: 0; display: inline; line-height: 1.3; }
.v2-footer-nav-icon svg { display: block; }
.v2-footer-nav-item:hover .v2-footer-nav-icon { color: var(--v2-accent); }
.v2-footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.v2-footer-contact-item svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: var(--v2-power); }
.v2-footer-contact-item a, .v2-footer-contact-item span { margin-bottom: 0; }
.v2-footer-social { display: flex; gap: 12px; margin-top: 16px; }
.v2-footer-icon { width: 16px; height: 16px; color: var(--v2-ink-soft); }
.v2-footer-social a:hover .v2-footer-icon { color: var(--v2-accent); }
.v2-footer-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px 0; border-top: 1px solid var(--v2-border); font-size: 13px; color: var(--v2-ink-soft); }
.v2-footer-legal { display: flex; gap: 20px; }
.v2-footer-legal a { color: var(--v2-ink-soft); text-decoration: none; }
.v2-footer-legal a:hover { color: var(--v2-accent); }
@media (max-width: 860px) {
  .v2-footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .v2-hero-grid, .v2-section-with-art { grid-template-columns: 1fr; }
  .v2-nav-toggle { display: flex; }
  .v2-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--v2-surface); flex-direction: column; padding: 16px 24px; display: none; border-bottom: 1px solid var(--v2-border); }
  .v2-nav.open { display: flex; }
  .v2-nav a { padding: 10px 0; }
}

/* ==========================================================
   Responsive tuning — layout/spacing/sizing only. No color,
   icon, image, or copy changes here; same design, just fitted
   to smaller viewports so nothing crowds, overlaps or overflows.
   ========================================================== */

/* Tablet (roughly iPad portrait and small laptops) */
@media (max-width: 1024px) {
  .v2-hero { padding: 64px 0 52px; }
  .v2-hero h1 { font-size: 38px; }
  .v2-art, .v2-hero-pipeline { height: 300px; }
}

@media (max-width: 860px) {
  /* Stacked hero loses its side illustration's reserved height, so
     the fixed 340px/380px art box was leaving a tall empty gap above
     the real content once everything went single-column. */
  .v2-art, .v2-hero-pipeline { height: 260px; margin-bottom: 8px; }
  .v2-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .v2-pipeline-head { flex-wrap: wrap; }
}

/* Phone */
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .v2-section { padding: 44px 0; }
  .v2-hero { padding: 44px 0 36px; }
  .v2-hero h1 { font-size: 30px; }
  .v2-hero p.lede { font-size: 16px; }
  .v2-art, .v2-hero-pipeline { height: 220px; }
  .v2-grid-3 { grid-template-columns: 1fr; }
  .v2-nav { padding: 16px 18px; }
  .v2-header-inner { padding: 12px 0; }
  .v2-footer-top { padding: 48px 0 24px; gap: 32px; }
  .v2-footer-bottom { flex-direction: column; align-items: flex-start; }
  .v2-hero-pill { font-size: 13px; padding: 7px 14px; }
  .v2-pipeline-step { padding: 18px; }
}
