/* Universal mobile niceties */
html, body { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
* { overflow-wrap: anywhere; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
a, button { min-height: 44px; }

/* Slightly shorter header */
:root { --header-h: 64px; }

/* Header/nav: allow wrapping so buttons don’t collide */
.nav {
  flex-wrap: wrap;
  row-gap: 10px;
}

/* Make the CBC audio link full-width under the brand/buttons when narrow */
.audio-header {
  flex: 1 1 100%;
  order: 3;               /* push below */
  min-width: 0;
}
.audio-header button { width: 100%; }

/* Brand and buttons appear first */
.brand { order: 1; }
.nav a.btn { order: 2; }

/* Container padding a bit closer to edges */
.wrap { padding: 40px 16px; }

/* Hero becomes single column; center text and image */
.hero-inner {
  grid-template-columns: 1fr !important;
  gap: 24px !important;
  text-align: center;
}
.cta { justify-content: center; }

/* Product image: ensure it’s not oversized */
.glass img {
  width: 100%;
  height: auto;
  border-radius: 16px;
}

/* Grids collapse to single column for easy reading */
.grid,
.steps,
.split {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 16px;
}

/* Feature cards breathe a bit more vertically */
.card { padding: 18px; }

/* Safety for notched phones */
body { padding-top: calc(var(--header-h) + env(safe-area-inset-top)); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}
/* ===== Compact header on mobile ===== */

/* 1) Set a smaller header height and match body offset */
:root { --header-h: 52px; }               /* was 64–72px */
body { padding-top: calc(var(--header-h) + env(safe-area-inset-top)); }

/* 2) Tighten the nav row */
.nav{
  padding: 8px 12px;                      /* was 14px 20px */
  gap: 8px;                               /* was 20px */
  align-items: center;
}

/* 3) Smaller brand lockup */
.logo{
  width: 28px; height: 28px;              /* was 36x36 */
  border-radius: 8px;
}
.brand{ gap: 8px; font-weight: 800; font-size: 14px; }

/* 4) Buttons: smaller text + padding */
.nav a.btn{
  padding: 6px 10px;                      /* was 10px 14px */
  font-size: 14px;
  line-height: 1.1;
  border-radius: 10px;
}

/* 5) Audio banner: move below and make it single-line clipped */
.audio-header{
  flex: 1 1 100%;
  order: 3;
  min-width: 0;
  margin-top: 4px;
}
.audio-header button{
  width: 100%;
  padding: 6px 8px;                       /* tighter */
  font-size: 14px;
}

/* 6) Reduce overall top padding in the hero so content shows sooner */
.wrap{ padding-top: 28px; }                /* was 40–60px depending on your rules */

/* 7) If the header still feels tall on very small phones, go 'extra-compact' */
@media (max-width: 360px){
  :root { --header-h: 46px; }
  .nav{ padding: 6px 10px; gap: 6px; }
  .logo{ width: 24px; height: 24px; }
  .brand{ font-size: 13px; }
  .nav a.btn{ padding: 5px 8px; font-size: 13px; }
  .audio-header{ display: none; }         /* hide the CBC strip on ultra-small screens */
}
/* Put only the right-side buttons in a scrollable lane if they wrap too much */
.nav{
  overflow-x: auto;                        /* lets the row scroll horizontally if needed */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar{ display: none; }
/* Hide the "How it works" button on phones */
@media (max-width: 767px){
  .nav a.btn.ghost[href="#details"] {
    display: none !important;
  }
}
/* Feature cards: icon + heading inline on phones */
@media (max-width: 767px){
  #features .grid .card{
    display: grid;
    grid-template-columns: auto 1fr;   /* icon | heading */
    align-items: center;
    column-gap: 10px;
  }
  #features .grid .card .icon{
    margin: 0;                         /* kill desktop bottom margin */
    width: 36px; height: 36px;         /* a touch smaller on mobile */
    border-radius: 10px;
    flex-shrink: 0;
    display: grid; place-items: center;
  }
  #features .grid .card h3{
    margin: 0;                         /* keep heading on same row */
  }
  #features .grid .card p{
    grid-column: 1 / -1;               /* span full width under header row */
    margin-top: 6px;
  }
}
/* Hide the Gallery CTA button on phones */
@media (max-width: 767px){
  .cta a.btn.ghost[href="#gallery"] {
    display: none !important;
  }
}
/* Steps: number + label inline, lighter on phones */
@media (max-width: 767px){
  .steps .step{
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .steps .step .num,
  .steps .step strong{
    display: inline-block;
    vertical-align: middle;
    margin: 0;
  }
  .steps .step .num{
    margin-right: 6px;
    font-size: 14px;       /* smaller */
    font-weight: 600;      /* less bold */
    color: var(--accent);
  }
  .steps .step strong{
    font-size: 15px;       /* slightly smaller than base */
    font-weight: 600;      /* not full bold */
  }
  .steps .step p{
    margin: 0;
  }
}

/* Section headers in .glass boxes: scale down for phones */
@media (max-width: 767px){
  .glass h2{
    font-size: 20px;       /* was ~32px */
    line-height: 1.2;
    margin-bottom: 8px;
  }
}
/* Global <h2> scale-down on phones */
@media (max-width: 767px){
  h2 {
    font-size: 20px;    /* friendlier size for small screens */
    line-height: 1.25;
    margin-bottom: 8px;
  }
}
/* Center buttons on phones */
@media (max-width: 767px){
  .btn {
    display: inline-flex;      /* keep their inline-flex styling */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  /* If buttons sit in a row (like .cta), center the whole row */
  .cta {
    justify-content: center;
  }
}
/* Stack and center buttons in glass info boxes on phones */
@media (max-width: 767px){
  .glass > div[style*="display:flex"] {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    gap: 12px !important;
  }

  .glass > div[style*="display:flex"] .btn {
    margin: 0 auto;   /* center horizontally */
  }
}
/* Hide Instagram icon in header on phones, keep footer */
@media (max-width: 767px){
  .nav .social-link {
    display: none !important;
  }
}