/* ============================================================
   CONTACT + FOOTER — scoped stylesheet
   Shared infrastructure (design tokens, .wrap, section.section,
   .reveal/.in-view) already lives in base.css. The duplicate
   [data-theme="dark"] block, *{box-sizing}, html/body/body rules,
   and .wrap/section.section/.reveal were stripped from the original
   delivery — all matched base.css already except --teal.

   --teal here (#2dd4bf dark) is the "majority" value shared by
   Capabilities/Experience/Projects, not Philosophy's (#0e7490/
   #22d3ee) that base.css uses globally — same three-way situation
   as those sections. Scoped below to #contact.cf-section, .cf-top-btn,
   and footer.footer TOGETHER, since the back-to-top button and the
   footer are DOM siblings of #contact, not descendants — a scope on
   #contact alone wouldn't reach them, and all three actually use
   --teal (the CTA ring's conic-gradient trim, contact-bar/footer-link
   hover states, and the back-to-top button's focus ring).
============================================================= */
[data-theme="dark"] #contact.cf-section,
[data-theme="dark"] .cf-top-btn,
[data-theme="dark"] footer.footer{
  --teal:#2dd4bf;
  --teal-soft:rgba(45,212,191,0.14);
}

/* ============================================================
   CONTACT SECTION — namespaced "cf-" to avoid clashing with the
   rest of the page's classes when dropped in
   ============================================================ */

#contact.cf-section{
  position:relative;
  overflow:hidden;
  background:var(--bg);
  isolation:isolate;
  text-align:center;
}

/* Ambient stage light — three soft blurred orbs breathing behind the content */
.cf-atmosphere{
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
}
.cf-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(70px);
  will-change:transform, opacity;
}
.cf-orb--amber{
  width:52vw; height:52vw; max-width:620px; max-height:620px;
  left:50%; top:-8%;
  transform:translateX(-50%);
  background:radial-gradient(circle, var(--amber-soft), transparent 70%);
  animation:cfOrbPulse 16s ease-in-out infinite;
}
.cf-orb--purple{
  width:44vw; height:44vw; max-width:520px; max-height:520px;
  left:8%; bottom:-12%;
  background:radial-gradient(circle, var(--purple-soft), transparent 70%);
  animation:cfOrbPulse 20s ease-in-out infinite -6s;
}
.cf-orb--blue{
  width:38vw; height:38vw; max-width:460px; max-height:460px;
  right:6%; bottom:0%;
  background:radial-gradient(circle, var(--blue-soft), transparent 70%);
  animation:cfOrbPulse 24s ease-in-out infinite -12s;
}
@keyframes cfOrbPulse{
  0%,100%{ opacity:.55; transform:scale(1) translateX(var(--ox,0)); }
  50%{ opacity:1; transform:scale(1.12) translateX(var(--ox,0)); }
}
.cf-orb--amber{ --ox:-50%; }

/* Fine film grain, laid over everything at very low opacity */
.cf-grain{
  position:absolute; inset:0; z-index:1;
  pointer-events:none;
  opacity:.05;
  mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Vignette to keep focus in the center */
.cf-vignette{
  position:absolute; inset:0; z-index:1; pointer-events:none;
  background:radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.55) 100%);
}

.cf-content{ position:relative; z-index:2; }

/* Oversized ghost title card — a cinematic title-card treatment for the word "Contact",
   instead of a small tracked eyebrow label */
.cf-title-card{
  position:relative;
  height:0;
  margin-bottom:-.35em;
  pointer-events:none;
  user-select:none;
}
.cf-title-card span{
  position:absolute;
  left:50%; top:0;
  transform:translate(-50%,-58%);
  white-space:nowrap;
  font-family:'Space Grotesk', sans-serif;
  font-weight:700;
  font-size:clamp(4.5rem, 21vw, 11rem);
  letter-spacing:0.01em;
  line-height:1;
  background:linear-gradient(180deg, rgba(245,245,247,0.10), rgba(245,245,247,0.015) 65%, transparent 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.cf-heading{
  font-family:'Space Grotesk', sans-serif;
  font-weight:700;
  font-size:clamp(2.3rem, 7.6vw, 4.3rem);
  line-height:1.08;
  letter-spacing:-0.015em;
  color:var(--text-hi);
  margin:0 0 22px;
}

.cf-sub{
  font-family:'Inter', sans-serif;
  font-weight:700;
  font-size:clamp(1.1rem, 2.8vw, 1.32rem);
  line-height:1.6;
  color:var(--text-mid);
  max-width:460px;
  margin:0 auto 44px;
}

/* Staggered reveal for the pieces inside .cf-content — driven by the ancestor's
   .reveal/.in-view state, so it plugs into the site's existing scroll observer */
.cf-item{
  opacity:0;
  transform:translateY(22px);
  transition:opacity .8s cubic-bezier(.16,1,.3,1) var(--d,0s),
             transform .8s cubic-bezier(.16,1,.3,1) var(--d,0s);
}
.cf-content.in-view .cf-item{ opacity:1; transform:translateY(0); }
.cf-content.in-view .cf-item--cta{
  transition:opacity .7s cubic-bezier(.34,1.56,.64,1) var(--d,0s),
             transform .7s cubic-bezier(.34,1.56,.64,1) var(--d,0s);
}
.cf-content.in-view .cf-title-card span{
  animation:cfGhostIn 1.4s cubic-bezier(.16,1,.3,1) both;
}
@keyframes cfGhostIn{
  from{ opacity:0; transform:translate(-50%,-48%); }
  to{ opacity:1; transform:translate(-50%,-58%); }
}

/* CTA — glossy sticky "Book a call" pill with a static mixed-color trim.
   Structure: .cf-cta-ring (holds the static color trim) > .cf-cta (the glass pill itself,
   split into two layers so the trim ring can sit outside the box while the glossy
   reflection stays clipped inside it — the two effects need different overflow rules). */
.cf-cta-wrap{
  position:sticky;
  bottom:22px;
  z-index:6;
  margin-bottom:46px;
  display:flex;
  justify-content:center;
}
.cf-cta-ring{
  position:relative;
  display:inline-block;
  border-radius:999px;
  padding:1.5px;
  background:conic-gradient(from 160deg, var(--amber), var(--purple), var(--blue), var(--teal));
  box-shadow:0 20px 55px rgba(0,0,0,.5);
}
.cf-cta{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:14px;
  padding:26px 52px;
  border-radius:999px;
  overflow:hidden;
  background:var(--bg);
  color:var(--text-hi);
  font-family:'Inter', sans-serif;
  font-weight:700;
  font-size:1.18rem;
  letter-spacing:0.04em;
  text-transform:uppercase;
  text-decoration:none;
  transition:transform .3s cubic-bezier(.16,1,.3,1);
}
/* the glass "reflection" — a small, purely-white highlight sitting toward the top-left */
.cf-cta::after{
  content:"";
  position:absolute;
  top:-16%; left:-8%;
  width:36%; height:44%;
  background:radial-gradient(ellipse at center, rgba(255,255,255,.55), rgba(255,255,255,0) 72%);
  filter:blur(3px);
  pointer-events:none;
}
.cf-cta:active{ transform:scale(.96); }
.cf-cta:hover, .cf-cta:focus-visible{ box-shadow:0 0 44px var(--amber-soft); }
.cf-cta svg{ width:37px; height:37px; flex-shrink:0; }

/* Contact bars — email + phone, each its own small bordered pill */
.cf-bars{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:14px;
  margin-bottom:34px;
}
.cf-bar{
  display:inline-flex;
  align-items:center;
  gap:14px;
  padding:16px 26px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--text-mid);
  font-family:'Inter', sans-serif;
  font-weight:900;
  font-size:1.55rem;
  letter-spacing:0.01em;
  text-decoration:none;
  transition:color .3s ease, background .3s ease;
}
.cf-bar svg, .cf-bar img{ width:24px; height:24px; flex-shrink:0; display:block; color:var(--text-lo); opacity:.85; transition:color .3s ease, opacity .3s ease; }
.cf-bar:hover, .cf-bar:focus-visible{ color:var(--text-hi); background:rgba(255,255,255,0.07); }
.cf-bar:hover svg, .cf-bar:focus-visible svg{ color:var(--teal); }
.cf-bar:hover img, .cf-bar:focus-visible img{ opacity:1; }

/* Minimal rule between the contact bars and the social row */
.cf-divider{
  width:120px;
  height:1px;
  margin:0 auto 34px;
  background:var(--card-border);
}

.cf-socials{
  display:flex;
  justify-content:center;
  gap:34px;
  flex-wrap:wrap;
}
.cf-socials a{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:12px 20px;
  border-radius:999px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  font-family:'Inter', sans-serif;
  font-weight:700;
  font-size:1.2rem;
  letter-spacing:0.01em;
  color:var(--text-mid);
  text-decoration:none;
  transition:color .3s ease, background .3s ease;
}
.cf-socials svg, .cf-socials img{ width:26px; height:26px; flex-shrink:0; display:block; opacity:.85; transition:opacity .3s ease; }
.cf-socials a:hover img, .cf-socials a:focus-visible img{ opacity:1; }
.cf-socials a:hover, .cf-socials a:focus-visible{ color:var(--text-hi); background:rgba(255,255,255,0.07); }

/* ============================================================
   FLOATING "BACK TO TOP" BUTTON
   Fixed to the viewport, hidden by default — JS below reveals it only
   while #contact is in view, and hides it again once the visitor
   scrolls back up past it. Sits above-right of the sticky CTA so the
   two never overlap.
   ============================================================ */
.cf-top-btn{
  position:fixed;
  right:18px;
  bottom:132px;
  z-index:50;
  width:54px;
  height:54px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-hi);
  text-decoration:none;
  opacity:0;
  transform:translateY(14px) scale(.9);
  pointer-events:none;
  transition:opacity .45s cubic-bezier(.16,1,.3,1), transform .45s cubic-bezier(.16,1,.3,1);
}
.cf-top-btn.is-visible{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
/* Tucks lower once the footer is reached — the resting offset above is
   tuned to clear the sticky CTA inside #contact, which would otherwise
   land the button right on the footer's right-aligned Call/WhatsApp links. */
.cf-top-btn.is-in-footer{ bottom:14px; }
/* the glass surface is a separate layer behind the icon so the SVG liquid-distortion
   filter warps only the glass, never the icon glyph riding on top of it */
.cf-top-btn-glass{
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:
    linear-gradient(155deg, rgba(255,255,255,.24), rgba(255,255,255,.04) 45%, transparent 72%),
    rgba(255,255,255,0.06);
  backdrop-filter:blur(16px) saturate(160%);
  -webkit-backdrop-filter:blur(16px) saturate(160%);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 14px 36px rgba(0,0,0,.55), inset 0 1px 1px rgba(255,255,255,.3);
  filter:url(#cfLiquidGlass);
  transition:transform .25s cubic-bezier(.16,1,.3,1);
}
.cf-top-btn:active .cf-top-btn-glass{ transform:scale(.92); }
.cf-top-btn:focus-visible .cf-top-btn-glass{ box-shadow:0 14px 36px rgba(0,0,0,.55), 0 0 0 3px var(--teal-soft); }
.cf-top-btn-icon{ position:relative; width:22px; height:22px; z-index:1; }

@media (max-width:640px){
  .cf-top-btn{ right:10px; bottom:90px; width:48px; height:48px; }
  .cf-top-btn-icon{ width:19px; height:19px; }
  /* On phones the copyright line wraps to 2 lines, which reaches into the
     14px-tucked spot used on wider screens — so here the button sits just
     above the whole footer instead, in the contact section's clear tail
     space, rather than fighting for room inside a footer this narrow. */
  .cf-top-btn.is-in-footer{ bottom:190px; }
}

/* ============================================================
   FOOTER — a quiet close after the CTA's big moment. Laid out as a
   grid so it stays short: on phones, the tagline and the two contact
   links share one row (tagline left, contacts right), with the
   copyright line below; from tablet up, all three pieces fit on a
   single compact row since there's enough width for it.
   ============================================================ */
footer.footer{
  position:relative;
  z-index:1;
  padding:40px 0 34px;
  background:var(--bg);
  border-top:1px solid var(--card-border);
}

.cf-footer-inner{
  display:grid;
  grid-template-columns:1fr auto;
  grid-template-areas:
    "tagline  contacts"
    "copyright copyright";
  align-items:start;
  column-gap:18px;
  row-gap:22px;
}

.cf-footer-tagline{
  grid-area:tagline;
  text-align:left;
  font-family:'Space Grotesk', sans-serif;
  font-weight:500;
  font-size:clamp(1rem, 2.6vw, 1.2rem);
  line-height:1.5;
  color:var(--text-mid);
  letter-spacing:0.005em;
  margin:0;
}

.cf-footer-contact{
  grid-area:contacts;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
}
.cf-footer-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--text-mid);
  font-family:'Inter', sans-serif;
  font-weight:600;
  font-size:.85rem;
  letter-spacing:0.02em;
  text-decoration:none;
  white-space:nowrap;
  transition:color .3s ease;
}
.cf-footer-link svg{ width:15px; height:15px; flex-shrink:0; color:var(--text-lo); transition:color .3s ease; }
.cf-footer-link:hover, .cf-footer-link:focus-visible{ color:var(--text-hi); }
.cf-footer-link:hover svg, .cf-footer-link:focus-visible svg{ color:var(--teal); }

.cf-footer-copyright{
  grid-area:copyright;
  text-align:center;
  margin:0;
  font-size:12px;
  letter-spacing:0.01em;
  color:var(--text-lo);
}

/* True desktop widths: everything fits on one compact row — tagline left,
   copyright centered between, contacts right. Tablet keeps the phone's
   2-row layout below since a tablet-width row is too tight to fit a
   full sentence of copyright text between the other two without
   squeezing them — auto/1fr/auto lets tagline and contacts keep their
   natural width and gives the copyright line whatever's left over. */
@media (min-width:1024px){
  .cf-footer-inner{
    grid-template-columns:auto 1fr auto;
    grid-template-areas:"tagline copyright contacts";
    align-items:center;
    column-gap:32px;
  }
  .cf-footer-copyright{ justify-self:center; }
  .cf-footer-contact{ flex-direction:row; align-items:center; justify-self:end; gap:26px; }
}

@media (prefers-reduced-motion: reduce){
  .cf-orb, .cf-content.in-view .cf-title-card span{ animation:none !important; }
  .reveal, .cf-item, .cf-content.in-view .cf-item--cta{ transition:none !important; }
  .cf-cta-wrap{ position:relative; bottom:auto; }
  .cf-top-btn{ transition:opacity .3s ease; transform:none !important; }
}

@media (max-width:640px){
  /* The ghost "CONTACT" title scales with viewport width (21vw) — fine on
     wide screens, but on phones that meant it clipped hard off both edges
     rather than reading as an intentional bleed. Contained here instead. */
  .cf-title-card span{ font-size:clamp(2.8rem, 15vw, 6rem); }

  .cf-socials{ gap:10px; }
  .cf-socials a{ font-size:.85rem; font-weight:600; padding:9px 14px; }
  .cf-socials svg, .cf-socials img{ width:16px; height:16px; }
  .cf-cta{ padding:22px 38px; font-size:1.02rem; }
  .cf-cta svg{ width:26px; height:26px; }
  .cf-bar{ padding:12px 16px; font-size:1.05rem; font-weight:700; gap:10px; }
  .cf-bar svg, .cf-bar img{ width:19px; height:19px; }
}
