/* ============================================================
   Moffat Studio — shared site styles (style.css)
   Reusable components used across the marketing pages:
   loader, header/nav, mega-menu, footer, CTA banner, reveal,
   framed project cards, and the shared design tokens.

   Page-specific styles stay in each page's own <style> block
   (and cascade OVER these, so per-page overrides keep working).
   Requires fonts: Plus Jakarta Sans (heading) + Poppins (body),
   and Tailwind for utility classes used in the markup.
   ============================================================ */

:root {
  /* royal blue */
  --royal-pastel-top: #5a78ec;
  --royal-pastel-bottom: #2b46c4;
  --soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Resets ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* Reserve the scrollbar gutter permanently so showing/hiding the loader
   (which toggles overflow via Lenis) never shifts the page width. */
html { scrollbar-gutter: stable; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
}

/* ---------- Loader overlay ---------- */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw; /* cover the full window, incl. the reserved gutter */
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* royal-pastel-blue wash */
  background: radial-gradient(circle at 50% 45%, var(--royal-pastel-top) 0%, var(--royal-pastel-bottom) 100%);
  /* curtain-up reveal */
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.83, 0, 0.17, 1);
}
/* state added by JS once the page has loaded: curtain slides up */
#loader.is-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}
.loader__mark {
  position: relative;
  width: clamp(44px, 8vw, 64px);
  animation:
    mark-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both,
    mark-breathe 2.8s ease-in-out 0.9s infinite;
  filter: drop-shadow(0 12px 26px rgba(34, 52, 130, 0.32));
}
.loader__mark img,
.loader__logo {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
@keyframes mark-in {
  0%   { opacity: 0; transform: translateY(18px) scale(0.82); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes mark-breathe {
  0%, 100% { transform: translateY(0)    scale(1); }
  50%      { transform: translateY(-6px) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .loader__mark { animation: mark-in 0.4s ease both; }
  #loader { transition: opacity 0.4s ease; }
  #loader.is-hidden { transform: none; opacity: 0; }
}

/* ---------- Header dark state (while a mega-menu is open) ---------- */
header { transition: background-color 0.35s ease; }
header.is-dark { background-color: #0a0a0a; }
header.is-dark .nav-desktop { color: #ffffff; }
header.is-dark .nav-desktop a:hover,
header.is-dark .mega-trigger:hover { color: #7d9bff; }
header.is-dark .mega-trigger.is-open { color: #7d9bff; }
/* logo crossfade: show the white M while the header is dark */
.logo-light { opacity: 0; transition: opacity 0.35s ease; }
.logo-dark { transition: opacity 0.35s ease; }
header.is-dark .logo-light { opacity: 1; }
header.is-dark .logo-dark { opacity: 0; }

/* ---------- Dark mega-menu (unrolls DOWN from the header) ---------- */
.mega {
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  visibility: hidden;
  transition: clip-path 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, visibility 0s linear 0.4s;
  pointer-events: none;
}
.mega.is-open {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  visibility: visible;
  transition: clip-path 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  pointer-events: auto;
}
.mega-trigger.is-open .mega-caret { transform: rotate(180deg); }
.mega-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.35rem, 1.9vw, 1.9rem);
  font-weight: 500;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.92);
  transition: color 0.25s ease, padding-left 0.25s ease;
}
.mega-item:hover {
  color: #7d9bff;
  padding-left: 0.5rem;
}
.mega-arrow {
  width: 2.5rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.mega-item:hover .mega-arrow { transform: translateX(8px); }
/* "View all" link — white highlight sweep on hover (like the footer email) */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35em 0.6em;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(#fff, #fff) left center / 0% 100% no-repeat;
  transition: background-size 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}
.view-all:hover { background-size: 100% 100%; color: #0a0a0a; }

/* ---------- Footer logo: static white, redraws itself on hover ---------- */
.footer-logo svg { display: block; overflow: visible; }
.footer-logo .fm-pc {
  fill: #ffffff;
  fill-opacity: 1;
  stroke: #ffffff;
  stroke-width: 22;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.footer-logo:hover .fm-pc {
  animation: fm-draw 0.35s cubic-bezier(0.65, 0, 0.35, 1) both,
             fm-fill 0.3s ease both;
}
.footer-logo:hover .fm-pc:nth-child(1) { animation-delay: 0s, 0.35s; }
.footer-logo:hover .fm-pc:nth-child(2) { animation-delay: 0.08s, 0.43s; }
.footer-logo:hover .fm-pc:nth-child(3) { animation-delay: 0.16s, 0.51s; }
.footer-logo:hover .fm-pc:nth-child(4) { animation-delay: 0.24s, 0.59s; }
@keyframes fm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fm-fill { from { fill-opacity: 0; } to { fill-opacity: 1; } }

/* ---------- Footer email: highlight sweep on hover ---------- */
.email-hl {
  display: inline-block;
  padding: 0.2em 0.4em;
  margin-left: -0.4em; /* keep text flush with the column edge */
  border-radius: 3px;
  background: linear-gradient(#0a0a0a, #0a0a0a) left center / 0% 100% no-repeat;
  transition: background-size 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}
.email-hl:hover { background-size: 100% 100%; color: #fff; }

/* ---------- Sticky CTA banner that docks into the footer ---------- */
.cta-banner {
  position: fixed;          /* floats at the viewport bottom while scrolling */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  opacity: 0;               /* hidden until scrolled past 200px */
  pointer-events: none;
  box-shadow: 0 -8px 30px rgba(43, 70, 196, 0.25);
  transition: opacity 0.3s ease;
}
.cta-banner.is-visible { opacity: 1; pointer-events: auto; }
.cta-banner.is-docked {
  position: absolute;       /* attaches to the footer's top, scrolls with it */
  top: 0;
  bottom: auto;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) { .cta-banner { transition: none; } }

/* ---------- Header logo: static black, redraws itself on hover ---------- */
.header-logo svg { display: block; overflow: visible; }
.header-logo .hm-pc {
  fill: #0a0a0a;
  fill-opacity: 1;
  stroke: #0a0a0a;
  stroke-width: 22;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.header-logo:hover .hm-pc {
  animation: fm-draw 0.35s cubic-bezier(0.65, 0, 0.35, 1) both,
             fm-fill 0.3s ease both;
}
.header-logo:hover .hm-pc:nth-child(1) { animation-delay: 0s, 0.35s; }
.header-logo:hover .hm-pc:nth-child(2) { animation-delay: 0.08s, 0.43s; }
.header-logo:hover .hm-pc:nth-child(3) { animation-delay: 0.16s, 0.51s; }
.header-logo:hover .hm-pc:nth-child(4) { animation-delay: 0.24s, 0.59s; }

@media (prefers-reduced-motion: reduce) {
  .mega, .mega-item, .mega-arrow,
  header, .logo-light, .logo-dark { transition: none; }
  .footer-logo:hover .fm-pc,
  .header-logo:hover .hm-pc { animation: none; }
  .email-hl { transition: none; }
}

/* ---------- Scroll-in reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s var(--soft), transform 0.6s var(--soft);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* ---------- Framed project cards (Our Work gallery + homepage Selected work) ---------- */
.work-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: clamp(1.5rem, 4vw, 3.25rem);
  border-radius: 6px;
  overflow: hidden;
}
/* subtle inner sheen so flat gradients read as a surface */
.work-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.16), transparent 60%);
  pointer-events: none;
}
/* Titans Gym self-drawing logo tile (decorative, single column):
   dark base, faint gym-hero photo layer, logo animation on top */
.work-frame--tglogo { background: #0a0a0a; position: relative; }
.work-frame--tglogo::after { display: none; }
.tglogo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.16;
}
.work-frame--tglogo #tgLogoCell {
  position: relative;
  z-index: 1;
}

/* Anderson Projects self-drawing logo tile:
   dark base, faint penthouse-interior photo layer, logo animation on top */
.work-frame--aplogo { background: #171717; position: relative; }
.work-frame--aplogo::after { display: none; }
.aplogo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.16;
}
.work-frame--aplogo #apLogoCell {
  position: relative;
  z-index: 1;
}

/* Marlo's Barbers self-drawing logo tile:
   brand-navy base, faint shopfront photo layer, logo animation on top */
.work-frame--mllogo { background: #003061; position: relative; }
.work-frame--mllogo::after { display: none; }
.mllogo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.14;
}
.work-frame--mllogo #mlLogoCell {
  position: relative;
  z-index: 1;
}
.browser {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32rem;
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.28);
  transform: translateY(0);
  transition: transform 0.55s var(--soft), box-shadow 0.55s var(--soft);
}
.group:hover .browser {
  transform: translateY(-10px);
  box-shadow: 0 34px 64px rgba(15, 23, 42, 0.38);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #f4f4f5;
  border-bottom: 1px solid #e5e7eb;
}
.browser-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #d4d4d8; }
.browser-url {
  margin-left: 10px;
  flex: 1;
  max-width: 70%;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.browser-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .browser { transition: none; }
}

/* ============================================================
   Services showcase — horizontal accordion (one panel open)
   ============================================================ */
.svc-hac {
  display: flex;
  gap: 6px;
  height: clamp(440px, 60vh, 600px);
}
.svc-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  background: #0a0a0a;
  outline: none;
  transition: flex-grow .65s cubic-bezier(.22, 1, .36, 1);
}
.svc-panel::before {                      /* gradient / image layer */
  content: "";
  position: absolute; inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  filter: brightness(.82) saturate(1);
  transform: scale(1.03);
  transition: filter .65s ease, transform .65s ease;
}
.svc-panel::after {                       /* readability gradient */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,5,10,.88) 0%, rgba(5,5,10,.38) 34%, rgba(5,5,10,.05) 100%);
}
.svc-panel:focus-visible { box-shadow: inset 0 0 0 2px #4169e1; }
.svc-panel.is-active { flex-grow: 6; }
.svc-panel.is-active::before { filter: brightness(1) saturate(1.05); transform: scale(1); }

/* collapsed vertical label */
.svc-label {
  position: absolute; z-index: 2;
  left: 50%; bottom: 1.9rem;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600; font-size: 1.05rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: #fff; white-space: nowrap;
  transition: opacity .3s ease;
}
.svc-panel.is-active .svc-label { opacity: 0; pointer-events: none; }

/* expanded body — FIXED width so the text never re-wraps while the
   panel is animating open (that per-frame reflow was the "glitch") */
.svc-body {
  position: absolute; z-index: 2;
  left: 0; bottom: 0;
  width: min(90vw, 30rem);
  padding: 2rem clamp(1.5rem, 3vw, 2.75rem) 2.4rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  /* fade OUT fast (before the collapsing panel clips the text) */
  transition: opacity .22s ease, transform .22s ease;
  will-change: opacity, transform;
}
/* fade IN a touch later, once the panel has started opening */
.svc-panel.is-active .svc-body {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .45s ease .2s, transform .5s ease .2s;
}
.svc-num {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: .8rem;
  letter-spacing: .22em; color: #7d9bff;
  margin-bottom: .8rem;
}
.svc-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500; line-height: 1.08;
  letter-spacing: -0.01em; color: #fff;
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  margin-bottom: .9rem;
}
.svc-text {
  font-family: 'Poppins', sans-serif;
  color: rgba(255,255,255,.8);
  font-size: .95rem; line-height: 1.65;
  max-width: 36rem; margin-bottom: 1.6rem;
}
.svc-cta {
  display: inline-flex; align-items: center; gap: .55rem;
  background: #4169e1; color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600; font-size: .78rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .9rem 1.6rem; border-radius: 3px;
  transition: background .25s ease, transform .25s ease;
}
.svc-cta:hover { background: #5a78e8; transform: translateX(3px); }

@media (max-width: 1023px) {
  .svc-hac { flex-direction: column; height: auto; gap: 5px; }
  .svc-panel { flex: none; height: 74px; transition: height .55s cubic-bezier(.22, 1, .36, 1); }
  .svc-panel.is-active { height: 420px; }
  .svc-label {
    writing-mode: horizontal-tb;
    left: 1.6rem; bottom: auto; top: 50%;
    transform: translateY(-50%);
  }
  .svc-body { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .svc-panel, .svc-panel::before, .svc-body { transition: none; }
}

/* Per-panel showcase backgrounds (URLs resolve relative to this CSS file) */
.svc-bg-anderson::before    { background-image: linear-gradient(150deg, #17235c 0%, #4169e1 100%); }  /* Web Design — royal blue */
.svc-bg-fastlane::before     { background-image: linear-gradient(150deg, #241663 0%, #6d4ae1 100%); }  /* Web Development — indigo */
.svc-bg-schlegel::before     { background-image: linear-gradient(150deg, #08324e 0%, #1fa6d8 100%); }  /* UI & UX — cyan */
.svc-bg-titans::before       { background-image: linear-gradient(150deg, #4a1240 0%, #c0407a 100%); }  /* Branding — magenta */
.svc-bg-os-home::before      { background-image: linear-gradient(150deg, #093a3a 0%, #15a693 100%); }  /* Web Apps — teal */
.svc-bg-os-pipe::before      { background-image: linear-gradient(150deg, #2c1652 0%, #7a3ad0 100%); }  /* Custom Software — violet */
.svc-bg-os-activity::before  { background-image: linear-gradient(150deg, #123f24 0%, #2f9e5a 100%); }  /* Automations — green */
.svc-bg-totaltax::before     { background-image: linear-gradient(150deg, #4a3410 0%, #d08a2f 100%); }  /* SEO — amber */
.svc-bg-ruskells::before     { background-image: linear-gradient(150deg, #0e2c4e 0%, #2f6fb0 100%); }  /* Hosting & Care — steel blue */

/* ============================================================
   Index: skill radar + retainer icon animations
   ============================================================ */
/* subtle float on the whole radar so it feels alive */
.radar-svg { width: 100%; height: auto; display: block; }
.radar-us { fill: rgba(65, 105, 225, 0.88); }
.radar-them { fill: #f2f2f2; stroke: #dcdcdc; stroke-width: 1; }
.radar-ring { fill: none; stroke: #9a9a9a; stroke-width: 1.2; }
.radar-spoke { stroke: #9a9a9a; stroke-width: 1.2; }
.radar-node { fill: #ffffff; stroke: #3d3d3d; stroke-width: 1.6; }
.radar-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  fill: #171717;
}

/* ---- Retainer icons: thin royal line-art, gently animated ---- */
.ret-ico { width: 100%; max-width: 250px; height: auto; color: #4169e1; overflow: visible; }
.ret-ico circle { fill: none; stroke: currentColor; stroke-width: 2; }
.ret-ico .ri-dash { stroke-dasharray: 5 8; stroke-linecap: round; }

/* Size: squares growing out of each other, small -> large (up and right) */
.ret-ico rect { fill: none; stroke: currentColor; stroke-width: 2; }
.ri-grow {
  transform-box: fill-box;
  transform-origin: left bottom;
  animation: ri-grow 5.2s cubic-bezier(0.22, 1, 0.36, 1) infinite backwards;
}
@keyframes ri-grow {
  0%        { transform: scale(0);    opacity: 0; }
  7%        { transform: scale(1.06); opacity: 1; }
  11%       { transform: scale(1); }
  80%       { transform: scale(1);    opacity: 1; }
  88%, 100% { transform: scale(0.97); opacity: 0; }
}

/* System: satellite orbiting on a dashed path */
.ri-orbit { animation: ri-spin 10s linear infinite; }
@keyframes ri-spin { to { transform: rotate(360deg); } }

/* Scope: dot grid ripple (diagonal, like the nine-dot loader) */
.ri-dot { animation: ri-dot 2.8s ease-in-out infinite; }
@keyframes ri-dot { 0%, 100% { opacity: 0.3; } 45%, 60% { opacity: 1; } }

/* Scale: inner circle swelling toward the dashed bound */
.ri-pulse { transform-box: fill-box; transform-origin: center; animation: ri-pulse 3.6s ease-in-out infinite; }
@keyframes ri-pulse { 0%, 100% { transform: scale(0.92); } 50% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  .ri-grow, .ri-orbit, .ri-dot, .ri-pulse { animation: none; }
}

/* ============================================================
   Global: paragraph text +5% (overrides Tailwind size utilities
   on <p>; element+class specificity beats the bare utility, and
   the responsive lg/md rules are ordered last so they still win)
   ============================================================ */
p.text-xs        { font-size: 0.7875rem; }   /* .75  * 1.05 */
p.text-\[11px\]  { font-size: 11.55px; }
p.text-\[13px\]  { font-size: 13.65px; }
p.text-\[14px\]  { font-size: 14.7px; }
p.text-sm        { font-size: 0.91875rem; }  /* .875 * 1.05 */
p.text-\[15px\]  { font-size: 15.75px; }
p.text-base      { font-size: 1.05rem; }     /* 1    * 1.05 */
p.text-lg        { font-size: 1.18125rem; }  /* 1.125* 1.05 */
p.text-xl        { font-size: 1.3125rem; }   /* 1.25 * 1.05 */
@media (min-width: 768px) {
  p.md\:text-lg  { font-size: 1.18125rem; }
  p.md\:text-xl  { font-size: 1.3125rem; }
}
@media (min-width: 1024px) {
  p.lg\:text-lg  { font-size: 1.18125rem; }
}
