/* ============================================================
   Container — shared responsive layout constraint
   Provides 1024px max content width with responsive side padding.
   Import this in any component that uses the .container class.
   ============================================================ */

.container {
  position:  relative;
  width:     1024px;
  max-width: calc(100% - 160px); /* 80px × 2 — desktop */
  margin:    0 auto;
}

/* Tablet (≤991px): 60px × 2 = 120px */
@media (max-width: 991px) {
  .container {
    max-width: calc(100% - 120px);
  }
}

/* Landscape mobile (≤767px): 2rem × 2 = 4rem */
@media (max-width: 767px) {
  .container {
    max-width: calc(100% - 4rem);
  }
}



/* ============================================================
   Wide container — 1360px content + 48px side padding
   Used for full-bleed section content blocks (slider, big cards)
   that need to be wider than the standard 1024px text container.
   ============================================================ */

.container-wide {
  width:      100%;
  max-width:  calc(1360px + 96px);   /* 1360px content + 48px × 2 */
  padding:    0 3rem;                /* 48px sides */
  margin:     0 auto;
  box-sizing: border-box;
}

/* Tablet + landscape mobile (≤991px) */
@media (max-width: 991px) {
  .container-wide {
    padding: 0 2rem;
  }

  .container-wide > * {
    margin-left:  -1rem;
    width:        calc(100% + 2rem) !important;
  }
}


/* ============================================================
   Shared homepage section patterns
   Import in any section component that uses the sticky badge rail.

   Provides: .hp-section shell, .hp-rail sticky rail,
   .hp-badge pill, .hp-heading, .hp-body
   ============================================================ */


/* ---- Section shell ----------------------------------------
   Background-color is intentionally omitted — each section
   sets its own via a single-rule override. */

.hp-section {
  position:       relative;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4rem;      /* 64px */
  padding:        8rem 0;   /* 128px top + bottom */
  font-family:    var(--font-family-default);
  width:          100%;
  box-sizing:     border-box;
}

/* Tablet (≤991px) */
@media (max-width: 991px) {
  .hp-section {
    padding: 6rem 0;
    gap:     3rem;
  }
}

/* Mobile (≤767px) */
@media (max-width: 767px) {
  .hp-section {
    padding: 4rem 0;
    gap:     2rem;
  }
}


/* ---- Sticky badge rail ------------------------------------
   Absolutely positioned inside the first .container, pushed
   left via right: 100%.  .container has position: relative so
   the rail is bounded to the container's height — badge stops
   when the container ends.
   Width = gutter between container (1024px) and container-wide
   (1360px): (1360 − 1024) / 2 = 168px.
   Shown only at ≥1488px — when the gutter is a fixed, predictable size. */

.hp-rail {
  display:        none;
  position:       absolute;
  right:          100%;
  top:            0;
  bottom:         0;
  width:          calc((1360px - 1024px) / 2);   /* 168px */
  pointer-events: none;
}

.hp-rail__sticky {
  position:        sticky;
  top:             8rem;
  display:         flex;
  justify-content: flex-end;
  align-items:     flex-start;
  padding-right:   12px;   /* 12px gap from the container's left edge */
}

@media (min-width: 1488px) {
  .hp-rail {
    display:         flex;
    justify-content: flex-start;
    align-items:     flex-start;
  }
}


/* ---- Badge pill -------------------------------------------
   Base pill used in the sticky rail and as the inline badge.
   .hp-badge--inline controls visibility relative to breakpoint. */

.hp-badge {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  height:          26px;
  padding:         0 var(--spacing-3);
  background:      var(--card);
  border-radius:   var(--radius-full);
  font-size:       var(--font-size-xs);
  font-weight:     var(--font-weight-medium);
  line-height:     var(--line-height-xs);
  color:           var(--foreground);
  white-space:     nowrap;
}

/* Inline variant — shown below 1488px, hidden at and above
   (matches the rail breakpoint so there is never a gap where
   neither badge is shown) */
.hp-badge--inline {
  margin-bottom: var(--spacing-6);
}

@media (min-width: 1488px) {
  .hp-badge--inline {
    display: none;
  }
}

@media (max-width: 767px) {
  .hp-badge--inline {
    margin-bottom: 1rem;
  }
}

/* Live indicator dot (DemoSection "Live demo" badge) */
.hp-badge__dot {
  display:          block;
  width:            6px;
  height:           6px;
  border-radius:    var(--radius-full);
  background-color: var(--primary);
  flex-shrink:      0;
}


/* ---- Section heading --------------------------------------
   36px regular weight; <strong> inside uses bold. */

.hp-heading {
  margin:      0;
  font-size:   2.25rem;
  font-weight: var(--font-weight-regular);
  line-height: 2.5rem;
  color:       var(--foreground);
}

.hp-heading strong {
  font-weight: var(--font-weight-bold);
}


/* ---- Section body text ------------------------------------
   20px regular — used in header intro blocks. */

.hp-body {
  margin:      0;
  font-size:   1.25rem;
  font-weight: var(--font-weight-regular);
  line-height: 1.75rem;
  color:       var(--foreground);
}

.hp-body strong {
  font-weight: var(--font-weight-bold);
}

@media (max-width: 767px) {
  .hp-heading {
    font-size:   1.875rem;  /* 30px */
    line-height: 2.25rem;   /* 36px */
  }

  .hp-body {
    font-size:   1.125rem;  /* 18px */
    line-height: 1.75rem;   /* 28px */
  }
}


/* ---- Shared card shell ------------------------------------
   Secondary background + hairline border + 12px radius.
   Use alongside component class for layout-specific rules. */

.card-secondary {
  background:    var(--secondary);
  border:        0.5px solid var(--border);
  border-radius: 12px;
  box-sizing:    border-box;
}


/* ---- 26px number pill -------------------------------------
   Circular badge used for step numbers.
   Color (background) set per-component. */

.num-pill {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           26px;
  height:          26px;
  flex-shrink:     0;
  border-radius:   var(--radius-full);
  font-size:       var(--font-size-xs);
  font-weight:     var(--font-weight-medium);
  line-height:     1;
  color:           var(--foreground);
}


/* ---- Card typography --------------------------------------
   Base/bold title and base/regular muted body.
   Color overrides applied per-component as needed. */

.card-title {
  margin:      0;
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-base);
}

.card-body {
  margin:      0;
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color:       var(--muted-foreground);
}

/* ============================================================
   DifferenceSection — Homepage "The difference / Quality Flywheel" section
   Shared section shell, rail, badge, heading, body → src/section.css
   ============================================================ */

.difference-section { background-color: var(--background); }

@media (max-width: 767px) {
  .difference-section { gap: 4rem; }
}


/* ============================================================
   Section header intro (heading + body block)
   ============================================================ */

.difference-section__intro {
  display:        flex;
  flex-direction: column;
  gap:            36px;
  max-width:      800px;
}


/* ============================================================
   Summary cards row
   ============================================================ */

.difference-section__cards {
  display:     flex;
  align-items: stretch;
  gap:         0.75rem;
}

.difference-section__card {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  align-items:     flex-start;
  justify-content: start;
  gap:             var(--spacing-8);
  min-height:      180px;
  padding:         1.75rem;
}


.difference-section__card-body {
  display:        flex;
  flex-direction: column;
  gap:            var(--spacing-2);
}

.difference-section__card-title {
  color: var(--popover-foreground);
}

.difference-section__card-arrow {
  display:    flex;
  align-items: center;
  align-self:  center;
  color:       var(--muted-foreground);
  flex-shrink: 0;
}


/* ============================================================
   Quality flywheel card — outer shell
   ============================================================ */

.difference-flywheel-card {
  display:               flex;
  grid-template-columns: 2fr 1fr;
  background:            var(--card);
  border-radius:         var(--radius-lg);   /* 24px */
  padding:               0.75rem;  
  width:                 100%;
  box-sizing:            border-box;
  overflow:              hidden;
}


/* ============================================================
   Image area (left 2/3) — flywheel illustration
   ============================================================ */

.difference-flywheel-img-area {
  padding-right:  0.75rem;   /* 12px — Figma pr-3 */
  display:        flex;
  flex-direction: column;
  flex: 1;;
}

.difference-flywheel-img {
  flex:            1;        /* fill full card height on desktop */
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           100%;
  border-radius:   12px;
  overflow:        hidden;
  position:        relative;
  border:          0.5px solid rgba(40, 40, 37, 0.2);

  background-image:    url('https://cdn.prod.website-files.com/5b15ca3d02dd414c89ecc3ed/69c57aa23acbbc27d9c73a14_flywheel-bg.svg');
  background-size:     cover;
  background-position: center;
}



/* ============================================================
   Right column — accordion + info callout
   Figma: justify-content: space-between
   ============================================================ */

.difference-flywheel-right {
  display:         flex;
  flex-direction:  column;
  justify-content: space-between;
  height:          100%;
  box-sizing:      border-box;
  flex: 1;
  max-width: 40%;
}


/* ============================================================
   Accordion area
   Figma: flex-1, items-center (vertically centers the list),
          px-4 (16px) py-8 (32px)
   ============================================================ */

.difference-flywheel-accordions {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  justify-content: center;   /* vertically centre the accordion list */
  padding:         2rem 1rem;
}


/* ============================================================
   "How it works" info callout
   Figma wrapper: pt-8 (32px) px-8 (32px) pb-24 (96px)
   Inner card: p-7 (28px), bg secondary, border, radius-xl
   ============================================================ */

.difference-flywheel-info-wrap {
  padding: 2rem 2rem 6rem;
}

.difference-flywheel-info-card {
  display:        flex;
  flex-direction: column;
  gap:            0.5rem;
  padding:        1.75rem;
  background:     var(--secondary);
  border:         0.5px solid var(--border);
  border-radius:  12px;
}

.difference-flywheel-info-headline {
  margin:      0;
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-base);
  color:       var(--popover-foreground);
}

.difference-flywheel-info-body {
  margin:      0;
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color:       var(--muted-foreground);
}


/* ============================================================
   Tablet (≤991px)
   ============================================================ */

@media (max-width: 991px) {
  .difference-flywheel-img {
    aspect-ratio: unset;
    height:       580px;
  }

  .difference-section__cards {
    flex-direction: column;
    align-items:    stretch;
  }

  .difference-section__card-arrow {
    transform: rotate(90deg);
    align-self: center;
  }

  .difference-flywheel-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    
  }

  .difference-flywheel-img-area {
    padding-right: 0;
  }

  .difference-flywheel-right {
    height: auto;
    max-width: none;
    
  }

  .difference-flywheel-info-wrap {
    padding: 1rem 1.5rem 3rem;
  }
}


/* ============================================================
   Mobile (≤767px)
   ============================================================ */

@media (max-width: 767px) {
  .difference-flywheel-card {
    min-height: auto;
  }

  .difference-flywheel-accordions {
    padding: 28px 0;
  }

  .difference-flywheel-info-wrap {
    padding: 0 1rem 1rem;
  }

  .difference-flywheel-info-card {
    padding: 1.5rem;
  }

  .difference-section__cards {
    margin-left: -1rem;
    width:       calc(100% + 2rem);
  }

  .difference-flywheel-img {
    aspect-ratio: unset;
    height:       340px;
  }
}


/* ============================================================
   RichText — Component Styles
   Self-contained typography for structured content blocks.
   Covers all standard rich text elements.
   Design tokens are defined in src/tokens.css.
   ============================================================ */

.rich-text {
  color:       var(--foreground);
  font-family: var(--font-family-default);
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
}


/* ---- Paragraphs ---- */

.rich-text p {
  margin: 0;
}

.rich-text p + p,
.rich-text * + p {
  margin-top: 1rem;
}


/* ---- Headings ---- */

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
  color:       var(--foreground);
  font-family: var(--font-family-default);
  font-weight: var(--font-weight-bold);
  margin:      0;
}

/* Space between a heading and what follows it */
.rich-text h1 + *,
.rich-text h2 + *,
.rich-text h3 + *,
.rich-text h4 + *,
.rich-text h5 + *,
.rich-text h6 + * {
  margin-top: 0.5rem;
}

/* Space before a heading that has something above it */
.rich-text * + h1,
.rich-text * + h2,
.rich-text * + h3,
.rich-text * + h4,
.rich-text * + h5,
.rich-text * + h6 {
  margin-top: 1.5rem;
}

.rich-text h1 { font-size: var(--font-size-h1); line-height: 1.2;  }
.rich-text h2 { font-size: var(--font-size-h2); line-height: 1.25; }
.rich-text h3 { font-size: var(--font-size-h3); line-height: 1.3;  }
.rich-text h4 { font-size: var(--font-size-h4); line-height: 1.4;  }
.rich-text h5 { font-size: var(--font-size-base); line-height: var(--line-height-base); }
.rich-text h6 { font-size: var(--font-size-sm);   line-height: var(--line-height-sm);  }


/* ---- Lists ---- */

.rich-text ul,
.rich-text ol {
  font-size:    inherit;
  line-height:  inherit;
  margin:       0;
  padding-left: 1.25rem;
}

.rich-text li {
  font-size:   inherit;
  line-height: inherit;
}

.rich-text * + ul,
.rich-text * + ol {
  margin-top: 0.5rem;
}

.rich-text ul { list-style-type: disc;    }
.rich-text ol { list-style-type: decimal; }

.rich-text li + li {
  margin-top: 0.25rem;
}

/* Nested lists */
.rich-text li > ul,
.rich-text li > ol {
  margin-top: 0.25rem;
}


/* ---- Inline emphasis ---- */

.rich-text strong,
.rich-text b {
  font-weight: var(--font-weight-bold);
}

.rich-text em,
.rich-text i {
  font-style: italic;
}


/* ---- Links ---- */

.rich-text a {
  color:           var(--primary);
  font-weight:     var(--font-weight-medium);
  text-decoration: none;
}

.rich-text a:hover {
  text-decoration: underline;
}


/* ---- Blockquote ---- */

.rich-text blockquote {
  border-left: 3px solid var(--border);
  color:       var(--muted-foreground);
  margin:      0;
  padding-left: 1rem;
}

.rich-text * + blockquote {
  margin-top: 1rem;
}


/* ---- Inline code ---- */

.rich-text code {
  background-color: var(--muted);
  border-radius:    0.25rem;
  font-family:      ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  font-size:        0.875em;
  padding:          0.125em 0.375em;
}


/* ---- Code block ---- */

.rich-text pre {
  background-color: var(--muted);
  border-radius:    var(--radius-sm);
  margin:           0;
  overflow-x:       auto;
  padding:          1rem 1.25rem;
}

.rich-text * + pre {
  margin-top: 1rem;
}

/* Reset inline code styles when inside a pre block */
.rich-text pre code {
  background: none;
  font-size:  1em;
  padding:    0;
}


/* ---- Horizontal rule ---- */

.rich-text hr {
  border:     none;
  border-top: 1px solid var(--border);
  margin:     1.5rem 0 0;
}


/* ---- Images ---- */

.rich-text img {
  display:   block;
  height:    auto;
  max-width: 100%;
}

/* ============================================================
   Accordion — Component Styles
   Design tokens are defined in src/tokens.css.

   Figma spec (node 2018:22972):
     Border radius : 12px (0.75rem)
     Trigger padding: 10px 12px 10px 16px (top right bottom left)
     Trigger gap   : 32px between icon / question / price / chevron
     Answer padding : 12px top · 12px right · 24px bottom · 16px left
     Idle bg       : transparent (no background)
     Hover bg      : var(--accent)   — warm off-white (#FAF6F0)
     Open bg       : var(--card)     — white
     Chevron       : 18 × 18px, rotates 180° when open
   ============================================================ */

/* ---- Outer wrapper ---- */
.accordion {
  border-radius: 0.75rem;  /* 12px */
  overflow:      hidden;
  transition:    background-color 150ms ease;
}

.accordion:hover {
  background-color: var(--accent);
}

.accordion[data-open] {
  background-color: var(--card);
}

/* Keep card bg even when hovered while open */
.accordion[data-open]:hover {
  background-color: var(--card);
}

/* Ghost variant — no background changes on hover or open */
.accordion--ghost:hover,
.accordion--ghost[data-open],
.accordion--ghost[data-open]:hover {
  background-color: transparent;
}


/* ---- Trigger button ---- */
.accordion__trigger {
  align-items:  flex-start;
  background:   none;
  border:       none;
  cursor:       pointer;
  display:      flex;
  gap:          0.75rem;         /* 12px */
  padding:      0.625rem 0.75rem 0.625rem 1rem; /* 10px 12px 10px 16px */
  text-align:   left;
  width:        100%;
}

/* ---- Icon slot (16 × 16) ---- */
.accordion__icon {
  align-items:  center;
  color:        var(--foreground);
  display:      flex;
  flex-shrink:  0;
  height:       var(--line-height-base); /* 24px — vertically centers with text */
  width:        1rem;                    /* 16px */
}

.accordion__icon > * {
  display: block;
  height:  1rem;
  width:   1rem;
}

/* ---- Badge slot (optional, between icon and question) ---- */
.accordion__badge {
  align-items: center;
  display:     flex;
  flex-shrink: 0;
}

/* ---- Question text ---- */
.accordion__question {
  color:       var(--foreground);
  flex:        1 0 0;
  font-family: var(--font-family-default);
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-base);
  min-width:   0;
}

/* ---- Price label (optional) ---- */
.accordion__price {
  color:        var(--muted-foreground); /* grey in idle; becomes foreground on hover/open */
  flex-shrink:  0;
  font-family:  var(--font-family-default);
  font-size:    var(--font-size-sm);   /* 14px */
  font-weight:  var(--font-weight-regular);
  line-height:  var(--line-height-sm); /* 20px */
  padding-top:  0.125rem;             /* 2px — nudge to align with bold question baseline */
  text-align:   right;
  white-space:  nowrap;
  transition:   color 150ms ease;
}

/* ---- Chevron ---- */
.accordion__chevron {
  align-items:     center;
  color:           var(--muted-foreground);
  display:         flex;
  flex-shrink:     0;
  height:          1.6875rem; /* 27px — Figma "Button area" height */
  justify-content: center;
}

.accordion__chevron-icon {
  display:    block;
  height:     1.125rem; /* 18px */
  transition: transform 220ms ease;
  width:      1.125rem;
}

/* Price becomes full foreground on hover and when open */
.accordion:hover .accordion__price,
.accordion[data-open] .accordion__price {
  color: var(--foreground);
}

.accordion[data-open] .accordion__chevron-icon {
  transform: rotate(180deg);
}


/* ---- Answer body — CSS grid height animation ---- */
.accordion__body-outer {
  display:            grid;
  grid-template-rows: 0fr;
  transition:         grid-template-rows 220ms ease;
}

.accordion[data-open] .accordion__body-outer {
  grid-template-rows: 1fr;
}

.accordion__body-inner {
  overflow: hidden;
}

/* Padding only — typography is handled by the RichText component.
   Top  : 2px — trigger already has pb:10px, together they form 12px gap (Figma gap-3)
   Right: 24px — matches outer pr:12px + answer pr:12px from Figma
   Bottom: 22px — matches outer pb:10px + answer pb:12px from Figma
   Left : 16px — aligns answer text with question text (Figma outer pl:16px + answer pl:0) */
.accordion__answer {
  padding: 0.125rem 1.5rem 1.375rem 1rem;
  color:   var(--foreground);
}

/* Ghost variant — muted answer text (used in DifferenceSection) */
.accordion--ghost .accordion__answer {
  color: var(--muted-foreground);
}

/* ============================================================
   Badge — pill label with color variants, sizes, and states
   Design tokens from src/tokens.css.
   ============================================================ */

/* ---- Base ---- */

.badge {
  align-items:     center;
  justify-content: center;
  border-radius:   var(--radius-full);
  display:         inline-flex;
  flex-shrink:     0;
  font-family:     var(--font-family-default);
  font-size:       var(--font-size-xs);
  font-weight:     var(--font-weight-medium);
  gap:             var(--spacing-1-5);
  line-height:     1;
  text-decoration: none;    /* reset <a> */
  transition:      opacity 0.15s;
  white-space:     nowrap;
}

/* Interactive reset for button root */
button.badge {
  appearance: none;
  border:     none;
  cursor:     pointer;
}

/* Inactive toggle state */
.badge--inactive {
  opacity: 0.45;
}

/* Hover — only on interactive roots (button / link) */
a.badge:hover,
button.badge:hover {
  opacity: 0.8;
}

/* Focus */
a.badge:focus-visible,
button.badge:focus-visible {
  outline:        1.5px solid var(--info);
  outline-offset: 2px;
}


/* ============================================================
   Shapes
   ============================================================ */

.badge--round   { border-radius: var(--radius-full); }
.badge--rounded { border-radius: var(--radius-sm);   }


/* ============================================================
   Sizes
   ============================================================ */

.badge--sm {
  gap:       var(--spacing-1);
  height:    1.5rem;            /* 24px */
  min-width: 1.5rem;            /* keeps single-char badges circular */
  padding:   0 var(--spacing-2);
}

.badge--md {
  gap:       var(--spacing-1-5);
  height:    1.75rem;           /* 28px */
  min-width: 1.75rem;
  padding:   0 var(--spacing-3);
}

.badge--lg {
  gap:       var(--spacing-2);
  height:    2rem;              /* 32px */
  min-width: 2rem;
  padding:   0 0.9375rem;
}


/* ============================================================
   Variants
   ============================================================ */

.badge--primary {
  background-color: var(--opacity-primary-10);
  color:            var(--primary);
}

.badge--secondary {
  background-color: var(--background);
  color:            var(--foreground);
}

.badge--card {
  background-color: var(--card);
  color:            var(--foreground);
}

.badge--info {
  background-color: var(--opacity-info-10);
  color:            var(--info);
}

.badge--success {
  background-color: var(--opacity-success-10);
  color:            var(--success);
}

.badge--warning {
  background-color: var(--opacity-warning-10);
  color:            var(--warning);
}

.badge--destructive {
  background-color: var(--opacity-destructive-10);
  color:            var(--destructive);
}


/* ============================================================
   Inner elements
   ============================================================ */

/* Label — plain text wrapper */
.badge__label {
  display: contents;
}

/* Left icon */
.badge__icon {
  align-items:     center;
  display:         inline-flex;
  flex-shrink:     0;
  justify-content: center;
}

.badge__icon svg {
  display: block;
  height:  0.875rem;   /* 14px */
  width:   0.875rem;
}

/* Left avatar */
.badge__avatar {
  border-radius: var(--radius-full);
  display:       block;
  flex-shrink:   0;
  height:        0.875rem;   /* 14px */
  object-fit:    cover;
  width:         0.875rem;
}

/* Close button */
.badge__close {
  align-items:     center;
  appearance:      none;
  background:      transparent;
  border:          none;
  color:           inherit;
  cursor:          pointer;
  display:         inline-flex;
  flex-shrink:     0;
  justify-content: center;
  line-height:     1;
  opacity:         0.6;
  padding:         0;
  transition:      opacity 0.15s;
}

.badge__close:hover {
  opacity: 1;
}

.badge__close svg {
  display: block;
  height:  0.625rem;   /* 10px */
  width:   0.625rem;
}

/* ============================================================
   QualityFlywheel — animated ring visual for DifferenceSection

   Layout: 3×3 CSS Grid that fills the full square container.
   Nodes sit in their grid cells; the SVG ring spans everything.

   Grid maths (matches Figma 886px / 3-col):
     Each cell  = 1/3 of total
     Node size  = 54% of cell  (≈ 160px in 295px cell)
     Ring R     = 1/3 of total → ring cardinal points sit at
                  the centre of each outer cell  ✓
   ============================================================ */

/* ---- Square 3×3 grid — fills its container ---- */
.flywheel {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows:    repeat(3, 1fr);
  position:              relative;

  /* Width drives the square; height follows via aspect-ratio.
     Works in both square and tall-parent flex contexts. */
  width:        100%;
  aspect-ratio: 1;
}


/* ---- SVG layer — absolute, fills the whole grid ---- */
.flywheel__svg {
  position: absolute;
  inset:    0;
  width:    100%;
  height:   100%;
  z-index:  0;
}

/* ---- Animated primary arc ---- */
.flywheel__arc {
  transition: stroke-dashoffset 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .flywheel__arc { transition: none; }
}


/* ---- Phase node cells ---- */

.flywheel__node {
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         1;
}

/* Grid placement — one node per outer cardinal cell */
.flywheel__node--top    { grid-column: 2; grid-row: 1; }
.flywheel__node--right  { grid-column: 3; grid-row: 2; }
.flywheel__node--bottom { grid-column: 2; grid-row: 3; }
.flywheel__node--left   { grid-column: 1; grid-row: 2; }

/* The white circle inside each cell */
.flywheel__node-circle {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           54%;     /* ≈ 160px in a 295px cell (Figma) */
  aspect-ratio:    1;
  background:      white;
  border:          0.5px solid rgba(40, 40, 37, 0.2);
  border-radius:   var(--radius-full);
}

.flywheel__node-label {
  font-size:   var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-base);
  color:       var(--muted-foreground);
  transition:  color 300ms ease;
  white-space: nowrap;
}

/* All visited (≤ active) nodes get primary colour */
.flywheel__node--active .flywheel__node-label {
  color: var(--primary);
}


/* ---- Center cell — Quality Flywheel badge ---- */

.flywheel__center {
  grid-column:     2;
  grid-row:        2;
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         1;
}

.flywheel__center-badge {
  display:         flex;
  align-items:     center;
  justify-content: center;
  height:          26px;
  padding:         0 12px;
  background:      rgba(40, 40, 37, 0.1);
  backdrop-filter: blur(20px);
  border-radius:   var(--radius-full);
  white-space:     nowrap;
}

.flywheel__center-label {
  font-size:   var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-xs);
  color:       var(--foreground);
}


/* ---- Tablet (≤991px) ---- */

@media (max-width: 991px) {
  .flywheel {
    max-width: 580px;
    margin:    0 auto;
  }
}


/* ---- Mobile (≤767px) ---- */

@media (max-width: 767px) {
  .flywheel {
    max-width: 340px;
    margin:    0 auto;
  }

  .flywheel__node-circle {
    width: 76%;   /* ≈ 86px in 113px cell — enough for "Analyse" at 12px */
  }

  .flywheel__node-label {
    font-size:   var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-xs);
  }

  .flywheel__center-badge {
    white-space: normal;
    text-align:  center;
    max-width:   100%;
    height:      auto;
    padding:     4px 10px;
  }

  .flywheel__center-label {
    font-size:   var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-xs);
  }
}

