/* Citgentic homepage: ONE SECTION PER SCREEN (desktop, >= 1024 x 640, html.cg-fit)
   Each chapter fills exactly one browser screen: the padding clears the nav,
   type scales with screen height, and tall content sits beside its heading.
   Off on phones, tablets and short screens (normal flow there). */

@media (min-width: 1024px) and (min-height: 640px) {

  /* ---- shell ---- */
  .cg-fit body > section[data-chapter]:not(.hero),
  .cg-fit .pin-spacer > section[data-chapter] {
    box-sizing: border-box;
    min-height: 100svh;
    padding-top: clamp(80px, 11vh, 112px);
    padding-bottom: clamp(24px, 4vh, 56px);
    display: flex; flex-direction: column; justify-content: center;
  }
  .cg-fit section[data-chapter] > .container { width: 100%; }

  /* ---- compact two-column heading: eyebrow and heading left, Ask Clara and text right ---- */
  .cg-fit .cg-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "eye ask" "h2 p";
    column-gap: clamp(24px, 4vw, 64px); row-gap: clamp(8px, 1.4vh, 16px);
    align-items: end; text-align: left;
    max-width: none !important; margin: 0 0 clamp(16px, 3vh, 32px) !important;
  }
  .cg-fit .cg-head > .label-small { grid-area: eye; margin: 0; justify-self: start; }
  .cg-fit .cg-head + * { margin-top: 0 !important; }
  .cg-fit .cg-head > h2 { grid-area: h2; margin: 0 !important; font-size: clamp(30px, 5.4vh, 50px); line-height: 1.08; }
  .cg-fit .cg-head > .cg-ask { grid-area: ask; margin: 0; justify-content: flex-start; }
  .cg-fit .cg-head > p { grid-area: p; margin: 0 !important; max-width: none !important; font-size: clamp(15px, 2.1vh, 18px); line-height: 1.5; }

  /* ---- 1. Hero: exactly one screen, type scales with height ---- */
  .cg-fit .hero { min-height: 100svh; height: 100svh; padding-top: clamp(80px, 12vh, 120px); box-sizing: border-box; }
  .cg-fit .hero .h1 { font-size: clamp(46px, 8.6vh, 82px); }
  .cg-fit .hero .body-large { font-size: clamp(15px, 2.3vh, 19px); }
  .cg-fit .hero-buttons { margin-top: clamp(20px, 3.6vh, 40px); margin-bottom: clamp(12px, 2vh, 24px); }
  /* the orb area is 600px tall: centre it in the space under the nav so no floating card is cut off */
  .cg-fit .hero-visual { top: calc(50% - 300px + 80px); }

  /* ---- 2. The miss: the whole section is pinned on one screen ---- */
  .cg-fit .missed-call-section .grid-2 { align-items: center; }
  .cg-fit .missed-call-section h2.h1 { font-size: clamp(34px, 6.2vh, 60px); line-height: 1.05; margin-bottom: clamp(8px, 1.6vh, 16px) !important; }
  .cg-fit .missed-call-section .body-large { font-size: clamp(15px, 2.1vh, 18px); margin-bottom: clamp(12px, 2.4vh, 24px) !important; }
  .cg-fit .missed-call-section .missed-features { margin-top: 0; padding-bottom: 0; }
  .cg-fit .missed-call-section .missed-feature { padding: clamp(8px, 1.5vh, 16px) 0; }
  .cg-fit .missed-call-section .missed-feature + .missed-feature { margin-top: 0; }
  .cg-fit .missed-call-section .missed-feature > * { opacity: 0.35; transition: opacity 0.4s ease-out; }
  .cg-fit .missed-call-section .missed-feature.is-active > * { opacity: 1; }
  .cg-fit .missed-call-section .callcard-stage { align-items: center; }
  .cg-fit .missed-call-section .callcard-viz { flex: 0 0 auto; height: clamp(64px, 11vh, 96px); }
  .cg-fit .missed-call-section .cg-ask { margin: 0 0 clamp(8px, 1.6vh, 16px); }

  /* ---- 3. Hear it: demo box capped to the space left ---- */
  .cg-fit .demo-interface { height: clamp(340px, 63vh, 580px); }
  .cg-fit .demo-call, .cg-fit .demo-outcome { height: 100%; box-sizing: border-box; overflow: hidden; }
  .cg-fit .demo-transcript { max-height: calc(100% - 64px); overflow: hidden; }
  .cg-fit .demo-outcome { padding: clamp(16px, 3vh, 32px); align-self: stretch; display: flex; flex-direction: column; }
  .cg-fit .demo-outcome .outcome-header { margin-bottom: clamp(8px, 1.6vh, 16px); }
  .cg-fit .demo-outcome .outcome-row { margin-bottom: clamp(6px, 1.4vh, 16px); }
  .cg-fit .demo-outcome .replay-btn { margin-top: auto; align-self: flex-start; }

  /* ---- 4. Handle: bento as 4 columns x 2 rows ---- */
  .cg-fit .bento-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(160px, 30vh, 244px); gap: clamp(10px, 1.6vh, 16px); margin-top: 0; }
  .cg-fit .bento-item { padding: clamp(14px, 2.4vh, 24px); min-height: 0; }
  .cg-fit .bento-hero, .cg-fit .bento-banner { grid-column: span 2; }
  .cg-fit .bento-banner { flex-direction: column; align-items: flex-start; gap: clamp(8px, 1.4vh, 12px); }
  .cg-fit .bento-banner .bento-body { max-width: none; }
  .cg-fit .bento-banner .bento-body h3 { margin-top: 8px; }
  .cg-fit .bento-flow { width: 100%; }
  .cg-fit .bento-item h3 { font-size: clamp(16px, 2.4vh, 20px); }
  .cg-fit .bento-item p { font-size: 14px; line-height: 1.45; }
  .cg-fit .bento-icon { width: 36px; height: 36px; }
  .cg-fit .bento-wave { height: clamp(24px, 4vh, 40px); }

  /* ---- 5. Who it is for: compact 3 x 2 tiles ---- */
  .cg-fit .industry-grid { gap: clamp(10px, 1.6vh, 16px); }
  .cg-fit .industry-card { padding: clamp(14px, 2.4vh, 24px); }
  .cg-fit .industry-icon { width: 40px; height: 40px; margin-bottom: clamp(8px, 1.4vh, 12px); }
  .cg-fit .industry-card p { font-size: 14px; line-height: 1.45; margin-bottom: 8px; }

  /* ---- 6. Setup: steps left, visual card right, all on one pinned screen ---- */
  .cg-fit .process-layout { align-items: center; gap: clamp(24px, 4vw, 64px); }
  .cg-fit .process-step { padding-top: clamp(6px, 1.2vh, 12px) !important; padding-bottom: clamp(6px, 1.2vh, 12px) !important; margin: 0 !important; min-height: 0 !important; }
  .cg-fit .process-step h3 { font-size: clamp(17px, 2.6vh, 22px); margin: 2px 0 4px; }
  .cg-fit .process-step p { font-size: 14px; line-height: 1.45; margin: 0; }
  /* the extra button under the steps is dropped here: Book a Call is in the nav and at the end */
  .cg-fit .process-path > .reveal:last-child { display: none; }
  .cg-fit .process-visual-wrap { position: relative !important; top: auto !important; height: auto !important; }
  .cg-fit .process-layout { margin-top: 0; }
  .cg-fit .process-visual-card { min-height: clamp(300px, 56vh, 452px); padding: clamp(18px, 3vh, 32px); }
  .cg-fit .pv-rows { gap: clamp(6px, 1vh, 10px); }
  .cg-fit .pv-row { padding: clamp(8px, 1.4vh, 13px) 16px; }

  /* ---- 7. We run it: the managed card left, the 4 points right ---- */
  .cg-fit .managed-section .container {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "head head" "diagram points"; column-gap: clamp(24px, 4vw, 64px); align-items: center;
  }
  .cg-fit .managed-section .cg-head { grid-area: head; }
  .cg-fit .managed-diagram { grid-area: diagram; margin: 0 !important; }
  .cg-fit .managed-stage { height: auto !important; min-height: 0 !important; }
  .cg-fit .managed-orbit { display: none; }
  .cg-fit .managed-core { position: relative !important; inset: auto !important; transform: none !important; margin: 0 auto; }
  .cg-fit .managed-points { grid-area: points; grid-template-columns: minmax(0, 1fr) !important; gap: clamp(8px, 1.4vh, 16px); margin: 0 !important; }
  .cg-fit .managed-point { padding: clamp(8px, 1.4vh, 16px) clamp(12px, 1.8vh, 18px); }
  .cg-fit .managed-point p { font-size: 14px; line-height: 1.45; }
  /* this heading is three lines long, so it runs a size smaller */
  .cg-fit .managed-section .cg-head > h2 { font-size: clamp(28px, 4.8vh, 46px); }

  /* ---- 8. Built on: logo band + infrastructure grid ---- */
  .cg-fit .tech-rail-band { padding: 0; border: 0; margin: 0 0 clamp(12px, 2.4vh, 24px); background: transparent; }
  .cg-fit .tech-rail-band .ticker-track.left { margin-bottom: 0; }
  .cg-fit .tech-rail-band .tech-tile { background: var(--c-white); }
  .cg-fit .tech-rail-band > .label-small { display: none; }
  .cg-fit .tech-rail-band .ticker-track + .ticker-track { display: none; }
  .cg-fit .tech-rail-band .tech-tile { height: clamp(44px, 7vh, 64px); }
  .cg-fit .network-map {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vh, 16px);
    height: auto !important; min-height: 0 !important; aspect-ratio: auto !important;
  }
  .cg-fit .network-map > svg, .cg-fit .network-center { display: none !important; }
  .cg-fit .network-node {
    position: relative !important; inset: auto !important; transform: none !important;
    width: auto !important; opacity: 1 !important; padding: clamp(12px, 2vh, 20px);
  }
  .cg-fit .network-node p { font-size: 14px; line-height: 1.45; }

  /* ---- 9. See every call: dashboard capped to the space left ---- */
  .cg-fit .dash-card { height: clamp(320px, 56vh, 500px); display: flex; flex-direction: column; }
  .cg-fit .dash-panels { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  /* no grey scrollbars inside the call record (it still scrolls with the wheel) */
  .cg-fit .dash-panels, .cg-fit .dash-panels * { scrollbar-width: none; }
  .cg-fit .dash-panels ::-webkit-scrollbar, .cg-fit .dash-panels::-webkit-scrollbar { display: none; }
  .cg-fit .dashboard-section .cg-head > h2 { font-size: clamp(28px, 4.8vh, 46px); }

  /* ---- 10. Questions ---- */
  .cg-fit .faq-head { margin-bottom: clamp(16px, 3vh, 32px) !important; }
  .cg-fit .faq-head .h2 { font-size: clamp(30px, 5.4vh, 50px); }

  /* ---- 11. Book ---- */
  .cg-fit .cta-title { font-size: clamp(38px, 7.4vh, 76px); line-height: 1.05; }
  .cg-fit .cta-content .body-large { font-size: clamp(15px, 2.2vh, 18px); }
  /* the sphere becomes a glowing arc under the content instead of rising behind the button */
  .cg-fit body > section.cta-section { padding-bottom: clamp(120px, 20vh, 200px); }
  .cg-fit .cta-sphere-wrap { width: 560px; height: 560px; bottom: -460px; }
}

/* ---- Bigger Clara orb (all motion layouts) ---- */
.cg-motion .clara-orb { width: 224px; height: 224px; }
.cg-motion .cg-clara-gl { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
@media (max-width: 1199px) {
  .cg-motion .clara-orb { width: 190px; height: 190px; }
  .cg-motion .cg-clara-gl { width: 256px; height: 256px; margin: -128px 0 0 -128px; }
}

/* ---- Short laptop screens (640 to 760 px tall): a slightly more compact tier ---- */
@media (min-width: 1024px) and (min-height: 640px) and (max-height: 760px) {
  /* Setup reads like an accordion: only the current step shows its sentence */
  .cg-fit .process-step:not(.current) p { display: none; }
  /* infrastructure cards drop their icons */
  .cg-fit .network-node .nn-icon { display: none; }
  /* the FAQ intro line goes; the question list says the same thing */
  .cg-fit .faq-head .body-large { display: none; }
  .cg-fit .faq-head .h2 { margin-bottom: 0; }
}

/* ---- Caption card buttons: icon + label on desktop ---- */
.cg-say-btn { display: inline-flex; align-items: center; gap: 4px; }
.cg-say-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.cg-say-btn.is-muted .cg-say-waves { opacity: 0; }

/* ---- Phones and tablets: the caption card becomes a slim bar above the bottom pill ---- */
@media (max-width: 1199px) {
  .cg-say {
    left: 16px; right: 16px; bottom: 72px; width: auto;
    align-items: center; gap: 8px;
    padding: 8px 8px 8px 12px; border-radius: 14px;
    max-height: 64px; overflow: hidden;
  }
  .cg-say.is-expanded { max-height: 50vh; overflow-y: auto; }
  .cg-say-orb { width: 16px; height: 16px; margin-top: 0; box-shadow: 0 0 8px rgba(255, 208, 44, 0.55); }
  .cg-say-name { display: none; }
  .cg-say-text {
    font-size: 14px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  /* live captions: a two-line window that scrolls along with the words being spoken */
  .cg-motion .cg-say-text { display: block; -webkit-line-clamp: unset; position: relative; max-height: 2.8em; scroll-behavior: smooth; }
  .cg-say.is-expanded .cg-say-text { display: block; -webkit-line-clamp: unset; max-height: none; }
  .cg-say-ctrl { flex-direction: row; gap: 4px; }
  .cg-say-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 10px; }
  .cg-say-btn svg { width: 20px; height: 20px; }
  .cg-say-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- Phone tidy-ups found by the audit ---- */
@media (max-width: 1199px) {
  /* the dashboard tab row scrolls sideways instead of running off the screen */
  .cg-motion #dashTabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cg-motion #dashTabs::-webkit-scrollbar { display: none; }
  .cg-motion #dashTabs .dash-tab { flex: 0 0 auto; }
}
/* FAQ page dots: same small dot, but a finger-sized tap area around it */
.cg-motion .faq-dot { position: relative; }
.cg-motion .faq-dot::after { content: ''; position: absolute; inset: -10px; }
@media (max-width: 1199px) { .cg-motion .faq-dot { margin: 0 6px; } }
@media (max-width: 1023px) {
  /* tighter gap between each heading block and the content under it */
  .cg-motion .cg-head + * { margin-top: 32px !important; }
}
