/* ========================================
   CSS VARIABLES
   ======================================== */

:root {
  --body-colour: hsl(40, 40%, 92%);
  --container-colour: hsl(40, 30%, 88%);
  --border-colour: hsl(40, 20%, 75%);
  --accent-colour: hsl(25, 100%, 60%);
  --accent-colour-hover: hsl(25, 100%, 50%);
  --text-colour: hsl(0, 0%, 20%);
  --shadow: hsla(210, 9%, 62%, 0.12) 0px 4px 12px;
  --section-gap: clamp(0.75rem, 2vw, 1rem);
  --corner-radius: 0.5em;
  --content-width: 1200px;
  /* Uncomment --ui-border-colour to enable subtle borders on article, form, and widget elements */
  /* --ui-border-colour: var(--border-colour); */
  --black: hsl(0, 0%, 0%);
  --white: hsl(0, 0%, 100%);
  --border-colour-light: hsl(0, 0%, 75%);
  --transition-settings: 0.4s ease;
  --font-weight-regular: 400;
  --breakpoint: 810px;

  /* Font size variables */
  --font-size-top: clamp(2rem, 4vw, 3rem);
  --font-size-mid: clamp(1rem, 2vw + 0.5rem, 1.25rem);
  --font-size-low: clamp(0.95rem, 1.5vw + 0.3rem, 1.1rem);

  /* Animation timing variables */
  --anim-base-delay: 0.3s;
  --anim-duration: 1.4s;
  --anim-hero-stagger-1: 0.7s;
  --anim-hero-stagger-2: 1.4s;
  --anim-content-delay: 2s;

  --font-weight-light: 300;
  --font-weight-bold: 700;
  --button-text-colour: hsl(0, 0%, 100%);
  --success-text: hsl(140, 45%, 28%);
  --success-bg: hsl(140, 40%, 92%);
  --error-text: hsl(0, 50%, 35%);
  --error-bg: hsl(0, 50%, 94%);
  --corner-radius-circle: 50%;
  --letter-spacing-wide: 0.06em;
  --z-card-overlay: 1;
  --z-floating: 999;
  --z-nav: 1000;
  --z-above-nav: 1001;

}

/* ========================================
   DARK MODE - currently disabled, see main.js initDarkMode()
   ======================================== */

[data-theme="dark"] {
  --body-colour: hsl(30, 10%, 12%);
  --container-colour: hsl(30, 8%, 15%);
  --border-colour: hsl(30, 8%, 28%);
  --text-colour: hsl(30, 15%, 83%);
  --white: hsl(30, 8%, 20%);
  --shadow: none;
  /* --accent-colour intentionally unchanged (orange works well on dark) */
  --success-text: hsl(140, 50%, 70%);
  --success-bg: hsl(140, 20%, 18%);
  --error-text: hsl(0, 60%, 70%);
  --error-bg: hsl(0, 20%, 18%);
}

[data-theme="dark"] body {
  background: var(--body-colour);
}

[data-theme="dark"] .image-container {
  background-color: hsl(30, 8%, 14%);
}

[data-theme="dark"] .google-reviews-card-bar-track {
  background: hsl(30, 8%, 28%);
}

[data-theme="dark"] .faq-arrow {
  color: var(--text-colour);
}


/* ========================================
   RESET & GLOBAL STYLES
   ======================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height, 0px);
}

body {
  font-family: "Inter", sans-serif;
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
  font-weight: var(--font-weight-light);
  background: var(--white);
  color: var(--text-colour);
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}



body::-webkit-scrollbar {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-settings);
}

a:hover {
  opacity: 0.6;
}

a:has(.button):hover,
a.button:hover {
  opacity: 1;
}

a:visited,
a:active {
  color: inherit;
}

/* Underline links that appear inline within text content */
p a, li a {
  text-decoration: underline;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1 {
  font-size: var(--font-size-top);
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
}

h2 {
  font-size: var(--font-size-top);
  font-weight: var(--font-weight-regular);
}

.highlight {
  color: var(--accent-colour);
}

p {
  font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
}

/* ========================================
   BUTTONS
   ======================================== */

.button {
  padding: 15px 30px;
  border: 2px solid var(--accent-colour);
  background-color: var(--accent-colour);
  color: var(--button-text-colour);
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  border-radius: var(--corner-radius);
  transition: all var(--transition-settings);
  outline: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.button:hover {
  background: var(--accent-colour-hover);
  border-color: var(--accent-colour-hover);
}

/* No shadow on buttons nested inside other elements */
google-reviews-card .button,
.carousel-card .button {
  box-shadow: none;
}

/* Keep button text white even on visited links (a:visited has higher specificity than .button) */
a.button:visited,
a.button:active {
  color: var(--button-text-colour);
}

.button-arrow {
  margin-left: 0.5em;
  vertical-align: middle;
}

/* ========================================
   IMAGES
   ======================================== */

.image-container {
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--corner-radius);
  background-color: var(--text-colour);
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ========================================
   LAYOUT & CONTAINERS
   ======================================== */

.section {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 2);
  padding: calc(var(--section-gap) * 2);
  justify-content: center;
  align-items: center;
}

/* More breathing room between main content sections */
main > .section {
  padding-block-start: calc(var(--section-gap) * 2);
  padding-block-end: clamp(3rem, 6vw, 5rem);
}


.page-header.section {
  min-height: 10vh;
  padding-block-start: clamp(3rem, 6vw, 5rem);
  padding-block-end: calc(var(--section-gap) * 1);
}

.page-header.section h1 {
  text-align: center;
}

.section-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
  background-color: var(--body-colour);
  flex: 1;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-container::-webkit-scrollbar {
  display: none;
}

.section-title {
  width: 100%;
  height: fit-content;
}

.section-title h2 {
  padding-bottom: calc(var(--section-gap) * 1);
  text-align: center;
}

.section-title.sticky {
  position: sticky;
  top: calc(var(--section-gap) * 7);
  align-self: start;
}

.section-content {
  max-width: var(--content-width);
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: calc(var(--section-gap) * 2);
}

body.initial-load.home-page .section-content:not(.hero .section-content) {
  animation: appear var(--anim-duration) ease-out calc(var(--anim-base-delay) + var(--anim-content-delay)) backwards;
}

.two-column {
  width: 100%;
  display: grid;
  gap: calc(var(--section-gap) * 2);
  grid-template-columns: 1fr;
}

@media (min-width: 810px) {
  .two-column {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes slideUp {
  from {
    clip-path: inset(0 0 0 0);
  }
  to {
    clip-path: inset(0 0 100% 0);
  }
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========================================
   NAVIGATION
   ======================================== */

nav-bar {
  display: block;
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background-color: var(--body-colour);
}

.announcement-banner {
  position: relative;
  z-index: var(--z-above-nav);
  background-color: var(--accent-colour);
  color: var(--button-text-colour);
  text-align: center;
  padding: calc(var(--section-gap) * 1);
}

.announcement-banner p {
  margin: 0;
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-regular);
}

.nav-bar {
  background-color: var(--body-colour);
}

.nav-content {
  padding: calc(var(--section-gap) * 2);
  height: calc(var(--section-gap) * 5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-content.initial-load {
  animation: slideInFromTop 0.6s ease-out var(--anim-base-delay) backwards;
}

.nav-menu {
  display: flex;
  gap: calc(var(--section-gap)*2);
  align-items: left;
}

.nav-links {
  display: flex;
  gap: calc(var(--section-gap)*2);
}

.nav-links a {
  color: var(--text-colour);
  text-decoration: none;
  font-size: clamp(0.95rem, 1.5vw, 1rem);
  transition: opacity var(--transition-settings);
}

.nav-links a:hover {
  opacity: 0.6;
}

.nav-logo img {
  height: 2rem;
  display: block;
}

.burger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: var(--z-above-nav);
  position: relative;
  width: 24px;
  height: 18px;
}

.burger-menu span {
  width: 24px;
  height: 2px;
  background-color: var(--text-colour);
  transition: all var(--transition-settings);
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(45deg);
  position: absolute;
  top: 8px;
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg);
  position: absolute;
  top: 8px;
}

@media (max-width: 810px) {
  .burger-menu {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: calc(var(--section-gap) * 8);
    left: 0;
    right: 0;
    background-color: var(--body-colour);
    flex-direction: column;
    padding: calc(var(--section-gap) * 2);
    padding-bottom: calc(var(--section-gap) * 3);
    gap: calc(var(--section-gap) * 3);
    display: none;
    clip-path: inset(0 0 0 0);
    animation: slideDown 0.3s ease-out;
  }

  .nav-menu.closing {
    display: flex;
    animation: slideUp 0.3s ease-in forwards;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    gap: calc(var(--section-gap) * 3);
  }
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero.section {
  min-height: 70vh;
}

.hero .section-content {
  align-items: flex-start;
}

.hero-grid {
  align-items: center;
  gap: calc(var(--section-gap) * 4);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 2);
  align-items: flex-start;
}

.hero-centered {
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: var(--font-weight-regular);
  color: var(--accent-colour);
  background-color: color-mix(in srgb, var(--accent-colour) 12%, transparent);
  border: 1px solid var(--accent-colour);
  border-radius: 9999px;
  padding: 0.35em 0.85em;
  letter-spacing: var(--letter-spacing-wide);
  margin: 0;
}

.hero-description {
  font-size: var(--font-size-mid);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
}

.hero-centered {
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-cta-footnote {
  font-size: 0.75rem;
  color: var(--border-colour-light);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--corner-radius);
}

@media (max-width: 810px) {
  .hero-image img {
    max-width: 500px;
  }
}

body.initial-load .hero-eyebrow {
  animation: appear var(--anim-duration) ease-out calc(var(--anim-base-delay) + 0.4s) backwards;
}

body.initial-load .hero-title {
  animation: appear var(--anim-duration) ease-out calc(var(--anim-base-delay) + var(--anim-hero-stagger-1)) backwards;
}

body.initial-load .hero-description {
  animation: appear var(--anim-duration) ease-out calc(var(--anim-base-delay) + var(--anim-hero-stagger-1)) backwards;
}

body.initial-load .hero.section .button {
  animation: appear var(--anim-duration) ease-out calc(var(--anim-base-delay) + var(--anim-hero-stagger-2)) backwards;
}

body.initial-load .hero-cta-footnote {
  animation: appear var(--anim-duration) ease-out calc(var(--anim-base-delay) + var(--anim-hero-stagger-2)) backwards;
}

body.initial-load .hero-image img {
  animation: appear var(--anim-duration) ease-out var(--anim-base-delay) backwards;
}

@media (max-width: 810px) {
  .hero-grid {
    display: flex;
    flex-direction: column-reverse;
  }
}

/* ========================================
   TESTIMONIALS SECTION
   ======================================== */

.testimonials .section-content {
  position: relative;
}

/* Google Reviews Carousel Card */
google-reviews-card {
  align-items: center;
  width: 400px;
}

@media (max-width: 810px) {
  google-reviews-card {
    width: min(320px, 90vw);
  }
}

.google-reviews-card-logo {
  width: 2rem;
  height: 2rem;
}

.google-reviews-card-score-row {
  display: flex;
  align-items: baseline;
  gap: 0.1em;
}

.google-reviews-card-score {
  font-size: var(--font-size-top);
  font-weight: var(--font-weight-regular);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.google-reviews-card-denom {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
}

.google-reviews-card-stars {
  position: relative;
  display: inline-flex;
  line-height: 0;
}

.google-reviews-card-stars-bg {
  display: flex;
  gap: 0.2em;
}

.google-reviews-card-stars-fg {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 0.2em;
  overflow: hidden;
  white-space: nowrap;
}

.google-reviews-card-star {
  fill: var(--accent-colour);
  width: 1.4em;
  height: 1.4em;
  flex-shrink: 0;
}

.google-reviews-card-stars-bg .google-reviews-card-star {
  fill: var(--border-colour);
}

.google-reviews-card-count {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
}

.google-reviews-card-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  width: 100%;
}

.google-reviews-card-bar-row {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.google-reviews-card-bar-label {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  min-width: 0.75em;
  text-align: right;
  line-height: 1;
}

.google-reviews-card-bar-star {
  fill: var(--accent-colour);
  width: 0.75em;
  height: 0.75em;
  flex-shrink: 0;
}

.google-reviews-card-bar-track {
  flex: 1;
  height: 8px;
  background: var(--body-colour);
  border-radius: var(--corner-radius);
  overflow: hidden;
}

.google-reviews-card-bar-fill {
  height: 100%;
  background: var(--accent-colour);
  border-radius: var(--corner-radius);
}

.google-reviews-card-bar-count {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  min-width: 1.25em;
  text-align: right;
  line-height: 1;
}

.google-reviews-card-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: auto;
  width: 100%;
}

.testimonial-carousel {
  display: flex;
  width: 100vw;
  margin-left: calc(-1 * max(
    calc(var(--section-gap) * 2),
    calc((100vw - var(--content-width)) / 2)
  ));
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  border-radius: 0;
  scroll-snap-type: x mandatory;
  scroll-padding-left: max(
    calc(var(--section-gap) * 2),
    calc((100vw - var(--content-width)) / 2)
  );
  scroll-padding-right: max(
    calc(var(--section-gap) * 2),
    calc((100vw - var(--content-width)) / 2)
  );
  /* Allow card shadows to extend vertically without clipping */
  padding-block: 1rem;
  margin-block: -1rem;
}

.testimonial-carousel::-webkit-scrollbar {
  display: none;
}

.testimonial-group {
  display: flex;
  align-items: stretch;
  gap: calc(var(--section-gap) * 2);
  padding-left: max(
    calc(var(--section-gap) * 2),
    calc((100vw - var(--content-width)) / 2)
  );
}

/* Last card snaps by its end edge so its right side aligns with the content-width boundary. */
.testimonial-group > :last-child {
  scroll-snap-align: end;
}

/* Trailing spacer so the end-align snap equals maxScroll exactly.
   Flex gap is already counted in scrollWidth, so ::after only needs to fill the remainder:
     gap + ::after min-width = scroll-padding-right
     ::after min-width = max(0, scroll-padding-right − gap)
                       = max(0, (100vw − content-width)/2 − section-gap×2)
   On mobile this resolves to 0 (gap alone covers scrollPR); on wider viewports it fills the gap. */
.testimonial-group::after {
  content: '';
  display: block;
  min-width: max(1px, calc((100vw - var(--content-width)) / 2 - var(--section-gap) * 2));
  flex-shrink: 0;
}

.carousel-card {
  background-color: var(--white);
  padding: calc(var(--section-gap) * 2);
  border-radius: var(--corner-radius);
  /* Match card-grid column width: (content-width - 2 × card-gap) / 3, where card-gap = section-gap × 2 */
  min-width: clamp(280px, 40vw, calc((var(--content-width) - var(--section-gap) * 4) / 3));
  max-width: calc((var(--content-width) - var(--section-gap) * 4) / 3);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1);
  scroll-snap-align: start;
  box-shadow: var(--shadow);
}

@media (max-width: 810px) {
  .carousel-card {
    min-width: min(280px, 90vw);
    max-width: min(320px, 90vw);
  }

}

.carousel-card-featured {
  font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
}

.carousel-card-body {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
}

.carousel-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  gap: calc(var(--section-gap) * 1);
}

.carousel-card-attribution {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-regular);
  color: var(--accent-colour);
}

.carousel-card-year {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  color: var(--text-colour);
  white-space: nowrap;
}

/* Carousel Pagination */
.carousel-pagination {
  display: flex;
  gap: calc(var(--section-gap) * 1);
  justify-content: center;
  margin-top: calc(var(--section-gap) * 2);
}

.carousel-btn {
  background-color: var(--white);
  border: none;
  color: var(--accent-colour);
  width: 48px;
  height: 48px;
  border-radius: var(--corner-radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition-settings);
  padding: 0;
  outline: none;
  box-shadow: var(--shadow);
}

.carousel-btn:hover {
  opacity: 0.6;
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-btn.disabled:hover {
  opacity: 0.3;
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
}

/* ========================================
   HOW I CAN HELP SECTION
   ======================================== */


/* ========================================
   CARD GRID
   ======================================== */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--section-gap) * 2);
  width: 100%;
}

@media (min-width: 810px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border-radius: var(--corner-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-item-link {
  position: absolute;
  inset: 0;
  border-radius: var(--corner-radius);
  z-index: var(--z-card-overlay);
}

card-item:has(.card-item-link) {
  transition: opacity var(--transition-settings);
}

card-item:has(.card-item-link):hover {
  opacity: 0.6;
}

.card-item .image-container {
  border-radius: 0;
  /* Reserve space matching the 3:2 images so lazy loading doesn't shift the layout */
  aspect-ratio: 3 / 2;
}

.card-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-colour);
  color: white;
  padding: calc(var(--section-gap) * 2.5);
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1.5);
  padding: calc(var(--section-gap) * 2);
}

.card-heading {
  font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem);
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
}

.card-text p {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.6;
}



/* ========================================
   FAQs SECTION
   ======================================== */

.faqs .section-content {
  max-width: calc(var(--content-width) * 0.75);
}

.faq-list {
  display: grid;
  gap: 0;
  width: 100%;
  border-top: 1px solid var(--border-colour);
}

.faq-item {
  border-bottom: 1px solid var(--border-colour);
}

.faq-question {
  width: 100%;
  padding: var(--section-gap) 0;
  background-color: transparent;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
  font-size: var(--font-size-mid);
  font-weight: var(--font-weight-regular);
  color: var(--text-colour);
  transition: all var(--transition-settings);
}

.faq-arrow {
  flex-shrink: 0;
  margin-left: calc(var(--section-gap) * 2);
  transition: transform var(--transition-settings);
  color: var(--accent-colour);
}

.faq-arrow.rotated {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
  padding: 0;
}

.faq-answer.open {
  max-height: 1000px;
  opacity: 1;
  padding: 0 0 var(--section-gap) 0;
}

.faq-answer p {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.6;
}

/* ========================================
   CONTACT/GET IN TOUCH SECTION
   ======================================== */

.contact .section-content {
  max-width: calc(var(--content-width) * 0.75);
}

.contact .section-content > p {
  font-size: var(--font-size-mid);
  font-weight: var(--font-weight-light);
  line-height: 1.6;
}

/* Contact Form */

.contact-form {
  background-color: var(--white);
  border-radius: var(--corner-radius);
  padding: calc(var(--section-gap) * 2);
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 2);
  box-shadow: var(--shadow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 0.5);
}

.form-label {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-regular);
  color: var(--text-colour);
}

.form-required {
  color: var(--accent-colour);
  margin-left: 0.15em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: calc(var(--section-gap) * 0.85) calc(var(--section-gap) * 1);
  background-color: var(--body-colour);
  border: 1.5px solid var(--ui-border-colour, transparent);
  border-radius: var(--corner-radius);
  font-family: inherit;
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  color: var(--text-colour);
  outline: none;
  transition: border-color var(--transition-settings);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent-colour);
}

.form-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.5;
}

.form-group:has(.channel-dropdown) {
  gap: calc(var(--section-gap) * 1);
}

.channel-dropdown {
  background-color: var(--body-colour);
  border-radius: var(--corner-radius);
  border: 1px solid var(--ui-border-colour, transparent);
  overflow: hidden;
}

.channel-dropdown-trigger {
  width: 100%;
  padding: var(--section-gap);
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  color: var(--text-colour);
  outline: none;
}

.channel-dropdown-value {
  flex: 1;
}

.channel-dropdown .faq-arrow {
  color: var(--text-colour);
  margin-left: calc(var(--section-gap) * 2);
}

.channel-dropdown-options {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.channel-dropdown-options.open {
  max-height: 400px;
  opacity: 1;
}

.channel-dropdown-option {
  padding: calc(var(--section-gap) * 0.75) var(--section-gap);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  color: var(--text-colour);
  outline: none;
  transition: background-color var(--transition-settings);
}

.channel-dropdown-option:hover {
  background-color: var(--container-colour);
}

.channel-dropdown-option.selected {
  color: var(--accent-colour);
  font-weight: var(--font-weight-regular);
}

#other-field {
  transition: opacity var(--transition-settings);
}

#other-field[hidden] {
  display: none;
}

.form-message {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
  border-radius: var(--corner-radius);
  padding: 0;
  display: none;
}

.form-message--success {
  display: block;
  color: var(--success-text);
  background-color: var(--success-bg);
  padding: calc(var(--section-gap) * 1);
}

.form-message--error {
  display: block;
  color: var(--error-text);
  background-color: var(--error-bg);
  padding: calc(var(--section-gap) * 1);
}


.form-submit-btn {
  width: 100%;
  padding: calc(var(--section-gap) * 1.25) calc(var(--section-gap) * 2);
  font-size: var(--font-size-low);
  margin-top: calc(var(--section-gap) * 0.5);
}

.form-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   FOOTER
   ======================================== */

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-footnote {
  font-size: 0.75rem;
  color: var(--border-colour-light);
  margin: 0;
}

/* ========================================
   FOOTER
   ======================================== */

.footer.section {
  background-color: var(--body-colour);
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: calc(var(--section-gap) * 4);
  flex-wrap: wrap;
}

.footer {
  margin-top: auto;
}

/* ========================================
   FLOATING CONTACT BUTTON
   ======================================== */

.floating-contact-button {
  position: fixed;
  bottom: calc(var(--section-gap) * 2);
  left: 50%;
  transform: translate(-50%, 150%);
  opacity: 0;
  z-index: var(--z-floating);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  pointer-events: none;
}

.floating-contact-button.visible {
  transform: translateX(-50%);
  opacity: 1;
  pointer-events: auto;
}

.floating-contact-button .button {
  margin: 0;
  box-shadow: var(--shadow);
}

/* ========================================
   ARTICLE LAYOUT (sidebar + body)
   ======================================== */

.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--section-gap) * 2);
  width: 100%;
  max-width: var(--content-width);
  
}

@media (min-width: 810px) {
  .article-layout {
    grid-template-columns: 260px 1fr;
    height: var(--article-body-height, 600px);
    align-items: stretch;
  }
}

.article-sidebar {
  display: flex;
  flex-direction: column;
}

@media (min-width: 810px) {
  .article-sidebar {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .article-sidebar::-webkit-scrollbar {
    display: none;
  }
}


.article-nav {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 0.75);
}

.article-nav--nested {
  padding-left: 0;
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  margin-top: calc(var(--section-gap) * 0.75);
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
}

.article-nav--nested.article-nav--collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.article-nav--nested .article-nav-link {
  font-size: var(--font-size-low);
}

.toc-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--section-gap) * 0.75) calc(var(--section-gap) * 1);
  border-radius: var(--corner-radius);
}

.toc-group-header .article-nav-link {
  padding: 0;
  border-radius: 0;
}

.toc-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-left: calc(var(--section-gap) * 1);
  cursor: pointer;
  color: var(--text-colour);
  opacity: 0.45;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: opacity var(--transition-settings);
}

.toc-toggle:hover {
  opacity: 1;
}

.toc-toggle svg {
  transform: rotate(-90deg);
  transition: transform var(--transition-settings);
  color: var(--accent-colour);
}

.toc-toggle[aria-expanded="true"] svg {
  transform: rotate(0deg);
}

.article-nav-link {
  font-size: var(--font-size-mid);
  color: var(--text-colour);
  text-decoration: none;
  transition: color var(--transition-settings), background-color var(--transition-settings);
  display: block;
  line-height: 1.4;
  padding: calc(var(--section-gap) * 0.75) calc(var(--section-gap) * 1);
  border-radius: var(--corner-radius);
}



.article-nav-link.is-active {
  color: var(--text-colour);
  background-color: var(--white);
  border: 1px solid var(--ui-border-colour, transparent);
}

/* For H2 group headers, pill covers the whole row including the chevron */
.toc-group-header:has(.article-nav-link.is-active) {
  background-color: var(--white);
  border-radius: var(--corner-radius);
  border: 1px solid var(--ui-border-colour, transparent);
}

.toc-group-header .article-nav-link.is-active {
  background-color: transparent;
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 2);
  min-width: 0;
  border-radius: var(--corner-radius);
}

@media (min-width: 810px) {
  .article-body {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    /* Inline padding + negative margin lets shadows extend beyond the scroll boundary */
    padding: 0.5rem 1rem 60vh;
    margin: -0.5rem -1rem;
    width: calc(100% + 2rem);
  }

  .article-body::-webkit-scrollbar {
    display: none;
  }
}

.article-body section {
  background-color: var(--white);
  border-radius: var(--corner-radius);
  border: 1px solid var(--ui-border-colour, transparent);
  padding: calc(var(--section-gap) * 2);
  box-shadow: var(--shadow);
}

.article-body section:has(h2) {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1.5);
}

.article-body h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: var(--font-weight-regular);
}

.article-body h3 {
  font-size: var(--font-size-mid);
  font-weight: var(--font-weight-regular);
  margin-bottom: calc(var(--section-gap) * 1);
}

.article-body p {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.6;
  margin-bottom: calc(var(--section-gap) * 1);
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body ul {
  list-style: none;
  padding-left: 0;
}

.article-body li {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.6;
  margin-bottom: calc(var(--section-gap) * 0.75);
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
}

.article-body li::before {
  content: '•';
  flex-shrink: 0;
  margin-top: 0.05em;
}

.article-body li:last-child {
  margin-bottom: 0;
}

/* ========================================
   METRONOME WIDGET
   ======================================== */

.metronome-widget {
  background-color: var(--white);
  border-radius: var(--corner-radius);
  border: 1px solid var(--ui-border-colour, transparent);
  padding: calc(var(--section-gap) * 2);
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 2);
  width: min(340px, 92vw);
  align-self: center;
  box-shadow: var(--shadow);
}

.tempo-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1);
}

.metronome-top-row {
  display: flex;
  align-items: center;
  gap: calc(var(--section-gap) * 2);
}

.metronome-bpm-display {
  flex: 1;
  text-align: center;
  min-width: 0;
}

#bpmOut {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: var(--font-weight-regular);
  color: var(--text-colour);
  text-align: center;
  width: 100%;
  padding: 0;
  cursor: pointer;
  transition: border-color var(--transition-settings);
}

#bpmOut:focus {
  cursor: text;
  border-bottom-color: var(--accent-colour);
}

.metronome-widget input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 6px;
  background: var(--body-colour);
  border-radius: var(--corner-radius);
  outline: none;
  border: none;
  cursor: pointer;
}

.metronome-widget input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: var(--corner-radius-circle);
  background: var(--accent-colour);
  cursor: pointer;
  transition: background-color var(--transition-settings);
}

.metronome-widget input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--accent-colour-hover);
}

.metronome-widget input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--body-colour);
  border-radius: var(--corner-radius);
}

.metronome-widget input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: var(--corner-radius-circle);
  background: var(--accent-colour);
  border: none;
  cursor: pointer;
}

.metronome-widget input[type="range"]:focus,
.metronome-widget input[type="range"]:focus-visible {
  outline: none;
}

.bpm-slider-row {
  display: flex;
  align-items: center;
  gap: calc(var(--section-gap) * 1);
}

.bpm-step-btn {
  position: relative;
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--accent-colour);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  outline: none;
  user-select: none;
  touch-action: manipulation;
  transition: color var(--transition-settings);
}

/* Expand touch target to 44×44px without affecting layout */
.bpm-step-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
}

.bpm-step-btn:hover {
  color: var(--accent-colour-hover);
}

.beats-group,
.subdivisions-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1);
}

.beats-label-row {
  display: flex;
  align-items: center;
  gap: calc(var(--section-gap) * 1);
}

.section-label {
  flex: 1;
  text-align: center;
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  color: var(--text-colour);
  letter-spacing: var(--letter-spacing-wide);
}

.metronome-play-btn {
  --btn-size: clamp(2rem, 4vw, 3rem);
  width: var(--btn-size);
  height: var(--btn-size);
  border-radius: var(--corner-radius-circle);
  border: none;
  background-color: var(--accent-colour);
  color: var(--button-text-colour);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-settings);
  padding: 0;
  outline: none;
  touch-action: manipulation;
}

.metronome-play-btn:hover {
  background-color: var(--accent-colour-hover);
}

.metronome-play-icon,
.metronome-pause-icon {
  width: calc(var(--btn-size) * 0.55);
  height: calc(var(--btn-size) * 0.55);
}

.metronome-play-btn[aria-pressed="false"] .metronome-pause-icon {
  display: none;
}

.metronome-play-btn[aria-pressed="true"] .metronome-play-icon {
  display: none;
}

/* ========================================
   METRO BAR
   ======================================== */

.metro-bar {
  position: relative;
  width: 100%;
  height: 44px;
  background: var(--body-colour);
  border-radius: var(--corner-radius);
}

.metro-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 100%;
  background: var(--accent-colour);
  border-radius: var(--corner-radius);
  transform: translateX(0);
}

/* ========================================
   BEAT INDICATOR
   ======================================== */

.beat-metro-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1);
}

.beat-indicator {
  display: flex;
  gap: calc(var(--section-gap) * 1);
  height: 44px;
}

.beat-cell {
  flex: 1;
  background: var(--body-colour);
  border-radius: var(--corner-radius);
  cursor: pointer;
}

@keyframes beat-flash {
  0%   { background: var(--accent-colour); }
  100% { background: var(--body-colour); }
}

.beat-cell.active {
  animation: beat-flash 0.6s ease-out forwards;
}

.beat-cell.disabled {
  opacity: 0.3;
  cursor: pointer;
}

/* ========================================
   SUBDIVISION BUTTONS
   ======================================== */

.subdivision-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--section-gap) * 1);
}

.subdivision-btn {
  aspect-ratio: 1;
  overflow: hidden; /* prevent content from breaking the square */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  background: var(--body-colour);
  border: none;
  border-radius: var(--corner-radius);
  cursor: pointer;
  font-family: inherit;
  color: var(--text-colour);
  min-width: 0;
  touch-action: manipulation;
  transition: background-color 0.15s, color 0.15s;
}

.subdivision-btn:hover {
  background: var(--container-colour);
}

.subdivision-btn.active {
  background: var(--accent-colour);
  color: var(--button-text-colour);
}

.subdivision-btn.active:hover {
  background: var(--accent-colour-hover);
}

.subdiv-icon {
  width: 50%;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.tap-tempo-btn {
  --btn-size: clamp(2rem, 4vw, 3rem);
  width: var(--btn-size);
  height: var(--btn-size);
  border-radius: var(--corner-radius-circle);
  border: none;
  background-color: var(--accent-colour);
  color: var(--button-text-colour);
  font-family: inherit;
  font-size: calc(var(--btn-size) * 0.22);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-settings);
  padding: 0;
  outline: none;
  touch-action: manipulation;
}

.tap-tempo-btn:hover {
  background-color: var(--accent-colour-hover);
}

/* ========================================
   PRACTICE GROUP
   ======================================== */

.practice-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 1);
}

.practice-row {
  display: flex;
  align-items: center;
  gap: calc(var(--section-gap) * 1);
}

.practice-row-label {
  flex: 1;
  text-align: center;
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  color: var(--text-colour);
  letter-spacing: var(--letter-spacing-wide);
}
/* ========================================
   ICON GRID
   ======================================== */

.icon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--section-gap) * 2);
  width: 100%;
}

@media (min-width: 810px) {
  .icon-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--section-gap) * 2);
  }
}

.icon-card {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 0.4);
  background-color: var(--white);
  border-radius: var(--corner-radius);
  box-shadow: var(--shadow);
  padding: calc(var(--section-gap) * 2);
}

.icon-card h3 {
  font-size: var(--font-size-mid);
  font-weight: var(--font-weight-regular);
  margin: 0;
}

.icon-card p {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
  margin: 0;
}

.icon-box {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: calc(var(--section-gap) * 0.5);
}

.icon-box svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--text-colour);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Icon grid: no container box, orange icons, left-aligned */
.icon-grid .icon-box {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  box-shadow: none;
  align-self: flex-start;
  justify-content: flex-start;
}

.icon-grid .icon-box svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--accent-colour);
}

/* Feature list: restore white background box on icons */
.feature-text .icon-box {
  background-color: var(--white);
  border-radius: var(--corner-radius);
  box-shadow: var(--shadow);
}

/* ========================================
   FEATURE LIST (3-column grid)
   ======================================== */

.feature-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--section-gap) * 2);
  width: 100%;
}

@media (min-width: 810px) {
  .feature-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--section-gap) * 2);
  align-items: start;
}

.feature-image {
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) * 0.4);
}

.feature-text h3 {
  font-size: var(--font-size-mid);
  font-weight: var(--font-weight-regular);
  margin: 0;
}

.feature-text p {
  font-size: var(--font-size-low);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
  margin: 0;
}

.how-i-can-help .section-content {
  max-width: var(--content-width);
}
