/* ============================================================
   FOOTER COMPONENT — footer.css
   Tier-1 SaaS footer: editorial, immersive, dark.
   Variables pinned on .footer for full immunity to
   individual page overrides.
   ============================================================ */

/* ── Design tokens (isolated from each page's :root) ── */
.footer {
  --f-bg: #16120D;
  --f-body-bg: #16120D;
  --f-border: rgba(255, 255, 255, 0.06);
  --f-text:          rgba(255, 255, 255, 0.88);
  --f-muted:         rgba(255, 255, 255, 0.7);    /* 0.38 gave 3.4:1 */
  --f-dim:           rgba(255, 255, 255, 0.62);   /* 0.22 gave 2:1 */
  --f-accent:        #FF5A1F;
  --f-accent-glow:   rgba(255, 90, 31, 0.18);
  --f-hover:         #ffffff;
  --f-max-w:         1280px;
  --f-font:          'Nohemi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  font-family: var(--f-font);
  background: var(--f-bg);
  position: relative;
  overflow: hidden;
  --focus-ring: var(--primary-on-dark);
}

/* ── Atmospheric grain texture ── */
.footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── All children above the grain ── */
.footer > * { position: relative; z-index: 1; }


/* ================================================================
   PRE-FOOTER CTA — the memorable moment
   ================================================================ */

.footer-cta {
  border-top: 1px solid var(--f-border);
  border-bottom: 1px solid var(--f-border);
  position: relative;
  overflow: hidden;
}

/* Blue glow centred in the CTA section */
.footer-cta::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, 100%);
  height: 400px;
  background: radial-gradient(ellipse at top center,
    rgba(255, 90, 31, 0.13) 0%,
    transparent 65%);
  pointer-events: none;
}

.footer-cta-inner {
  max-width: var(--f-max-w);
  margin: 0 auto;
  padding: 88px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

/* Eyebrow pill */
.footer-cta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-label);
  font-weight: 550;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--primary-on-dark);   /* #FF5A1F is decorative only: 4.5:1 needs the on-dark tint */
  background: rgba(255, 90, 31, 0.1);
  border: 1px solid rgba(255, 90, 31, 0.22);
  border-radius: 99px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 22px;
}

.footer-cta-eyebrow::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--f-accent);
  box-shadow: 0 0 6px rgba(255, 90, 31, 0.8);
  flex-shrink: 0;
}

/* Monumental headline */
.footer-cta-headline {
  font-size: clamp(38px, 4.5vw, 68px);
  font-weight: 450;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--f-hover);
  margin: 0;
}

/* Right column */
.footer-cta-right {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-cta-sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--f-muted);
  margin: 0;
  max-width: 400px;
}

.footer-cta-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Primary button */
.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--primary-solid);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  font-family: var(--f-font);
  text-decoration: none;
  border-radius: 99px;
  box-shadow: 0 0 32px rgba(255, 90, 31, 0.28);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
}

@media (hover: hover) and (pointer: fine) {
  .footer-cta-btn:hover {
    background: var(--primary-solid-hover);
    box-shadow: 0 0 52px rgba(255, 90, 31, 0.42);
    transform: translateY(-1px);
  }
}

.footer-cta-btn svg {
  transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .footer-cta-btn:hover svg {
    transform: translateX(3px);
  }
}

/* Secondary link */
.footer-cta-link {
  font-size: 14px;
  gap: 6px;
  font-weight: 500;
  color: var(--f-muted);
  text-decoration: none;
  transition: color 0.18s ease;
  letter-spacing: 0.01em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-cta-link:hover { color: var(--f-hover); }


/* ================================================================
   MAIN FOOTER BODY
   Desktop: brand on the left, four link groups on the right.
   ≤1100px: brand becomes a row above the groups.
   ≤720px: groups fold into an accordion.
   ================================================================ */

.footer-body {
  background: var(--f-body-bg);
  padding: 88px 0 72px;
}

.footer-inner {
  max-width: var(--f-max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 64px clamp(48px, 5vw, 72px);
  align-items: start;
}

/* ── Brand ── */
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 6px;
}

.footer-logo-svg {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.94;
  transition: opacity 0.2s ease;
}
.footer-logo-link:hover .footer-logo-svg { opacity: 1; }

.footer-tagline {
  max-width: 30ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--f-muted);
  text-wrap: balance;
}

.footer-platforms {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-meta);
  color: var(--f-muted);
}
.footer-platforms svg { flex-shrink: 0; color: var(--primary-on-dark); }

/* Social: rounded squares, one quiet row */
.footer-social {
  display: flex;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--f-muted);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .footer-social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 169, 138, 0.4);
    color: #fff;
    transform: translateY(-1px);
  }
}
.footer-social-link:active { transform: translateY(0); }

/* ── Link groups ── */
/* Five groups, in the nav's order: Software · Packs · Hosting · Resources · Support.
   Columns size to their longest link (no wrapped labels) and share the rest. */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: space-between;
  gap: 24px 32px;
}

/* Sentence-case headings, brighter than the links under them */
.footer-col-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: var(--fw-strong);
  letter-spacing: 0;
  line-height: 44px;
  color: var(--text-on-dark);
}

.footer-col-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Rows touch (44px each), so the target floor costs no extra gap */
.footer-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--f-muted);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}
.footer-link:hover { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); }
.footer-ext { flex-shrink: 0; opacity: 0.7; }
.footer-nav .footer-link { white-space: nowrap; }

/* Status next to a link ("Soon") — read as part of the link text */
.footer-tag {
  margin-left: 3px;
  padding: 1px 7px;
  border-radius: var(--radius-pill, 99px);
  background: rgba(255, 255, 255, 0.08);
  font-size: var(--fs-label, 12px);
  font-weight: var(--fw-bold, 600);
  letter-spacing: var(--tr-caps, 0.08em);
  text-transform: uppercase;
  font-feature-settings: 'case' 1;
  color: var(--text-muted-on-dark, rgba(242, 240, 237, 0.7));
}

/* The page you are on: brighter, with a small accent dot */
.footer-link[aria-current="page"] { color: #fff; }
.footer-link[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--primary);
}

/* Heading toggles exist only for the phone accordion */
.footer-col-toggle { display: none; }


/* ================================================================
   BOTTOM BAR
   ================================================================ */

.footer-bottom-inner {
  /* Rule spans the content width, not the padded box */
  width: min(100% - 48px, var(--f-max-w) - 48px);
  margin: 0 auto;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "copy legal top";
  align-items: center;
  gap: 8px 32px;
}

.footer-copy {
  grid-area: copy;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin: 0;
  font-size: var(--fs-meta);
  color: var(--f-dim);
}

.footer-heritage { display: inline-flex; align-items: center; gap: 6px; }
.footer-heritage strong { color: rgba(255, 255, 255, 0.86); font-weight: 550; }

.footer-legal {
  grid-area: legal;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-size: var(--fs-meta);
  color: var(--f-muted);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.footer-legal-link:hover,
.footer-legal-link[aria-current="page"] { color: #fff; text-decoration: underline; }

.footer-top {
  grid-area: top;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--f-text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.footer-top:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }
.footer-top svg { transition: transform 0.2s ease; }
@media (hover: hover) and (pointer: fine) { .footer-top:hover svg { transform: translateY(-2px); } }


/* ================================================================
   WORDMARK — the real logo, large and quiet, as a sign-off.
   Drawn with the logo SVG as a mask, so it stays the brand's own
   letterforms. A mouse pointer lights it up (footer.js).
   ================================================================ */

.footer-mark {
  --mx: 50%;
  --my: 50%;
  max-width: var(--f-max-w);
  margin: 0 auto;
  padding: 8px 24px 0;
  overflow: hidden;
}

.footer-mark-logo {
  aspect-ratio: 280.61 / 56.69;
  width: 100%;
  margin-bottom: -2.2%;          /* the baseline sits on the footer's edge */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.015) 90%);
  -webkit-mask: url('/assets-coffeecup-website/coffeecup-text-logo.svg') center / contain no-repeat;
          mask: url('/assets-coffeecup-website/coffeecup-text-logo.svg') center / contain no-repeat;
}
.footer-mark.is-lit .footer-mark-logo {
  background:
    radial-gradient(circle 240px at var(--mx) var(--my), rgba(255, 169, 138, 0.42), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.015) 90%);
}

/* Ember glow under the wordmark */
.footer-mark { position: relative; }
.footer-mark::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -40%;
  width: min(900px, 90%);
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 90, 31, 0.14), transparent 70%);
  pointer-events: none;
}


/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
  .footer-cta-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .footer-cta-sub { max-width: none; }
}

/* Brand becomes a row: logo and tagline left, channels right —
   from here down the five groups need the full width */
@media (max-width: 1280px) {
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .footer-brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo social"
      "tagline social"
      "platforms social";
    column-gap: 32px;
    row-gap: 12px;
  }
  .footer-logo-link { grid-area: logo; }
  .footer-tagline { grid-area: tagline; max-width: 46ch; }
  .footer-platforms { grid-area: platforms; }
  .footer-social { grid-area: social; align-self: end; margin: 0; }

  /* Bottom bar: legal and the button on one line, copyright under it */
  .footer-bottom-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "legal top"
      "copy  copy";
  }
  .footer-legal { justify-self: start; }
  .footer-copy { padding-bottom: 8px; }
}

/* Tablets: three groups per row before the phone accordion */
@media (min-width: 721px) and (max-width: 960px) {
  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
}

@media (max-width: 768px) {
  .footer-body { padding: 56px 0 48px; }
  .footer-cta-inner { padding-top: 52px; padding-bottom: 52px; }
}

@media (max-width: 480px) {
  .footer-cta-headline { font-size: 34px; }
  .footer-cta-actions { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ── Phones: brand stacks, groups become an accordion ── */
@media (max-width: 720px) {
  .footer-inner { gap: 40px; }
  .footer-brand {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "logo" "tagline" "platforms" "social";
  }
  .footer-social { align-self: start; margin-top: 4px; }

  .footer-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border-top: 1px solid var(--f-border-strong, rgba(255, 255, 255, 0.09));
  }
  .footer-col { border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
  .footer-col-title { margin: 0; }
  .footer-link[aria-current="page"]::before { left: auto; right: -14px; }

  /* Accordion (only once footer.js has run) */
  .footer-acc .footer-col-label { display: none; }
  .footer-acc .footer-col-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 16px;
    font-weight: var(--fw-strong);
    color: var(--text-on-dark);
    cursor: pointer;
    touch-action: manipulation;
  }
  .footer-col-chev { flex-shrink: 0; color: var(--f-muted); transition: transform 0.3s var(--ease-out); }
  .footer-col.is-open .footer-col-chev { transform: rotate(180deg); color: var(--primary-on-dark); }

  /* Folded lists: out of the focus order and the accessibility tree */
  .footer-acc .footer-col-panel {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.35s var(--ease-out), visibility 0s linear 0.35s;
  }
  .footer-acc .footer-col.is-open .footer-col-panel {
    grid-template-rows: 1fr;
    visibility: visible;
    transition-delay: 0s;
  }
  .footer-acc .footer-col-list { overflow: hidden; min-height: 0; }
  .footer-acc .footer-col.is-open .footer-col-list { padding-bottom: 12px; }
  .footer-link { display: flex; width: 100%; font-size: 15px; }

  /* Without JS the headings stay as labels and every list is shown */
  .footer:not(.footer-acc) .footer-col { padding: 12px 0; }

  /* Bottom bar: legal links, copyright, then a full-width button */
  .footer-bottom-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "legal" "copy" "top";
    padding-top: 12px;
    padding-bottom: 20px;
  }
  .footer-legal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .footer-copy { flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 0 12px; }
  .footer-top { width: 100%; }
  .footer-mark { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .footer-link, .footer-legal-link, .footer-social-link, .footer-top, .footer-top svg,
  .footer-col-chev, .footer-acc .footer-col-panel { transition: none; }
  @media (hover: hover) and (pointer: fine) { .footer-social-link:hover { transform: none; } }
}
