/* Shared foundations and page exceptions. Layout utilities stay in the HTML.
   Keep the component layer below Tailwind utilities. */
@layer theme, base, components, utilities;

/* ==========================================================================
   Shared styles: base, navigation, rings and links
   ========================================================================== */
@layer components {
  /* Base */
  html,
  body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
  }

  :focus-visible {
    outline: 3px solid #fff;
    outline-offset: 5px;
  }

  /* Header glow follows the pill and calculator button in the reference. */
  .header-pill {
    box-shadow:
      0 0 8px rgb(255 255 255 / 14%),
      0 6px 20px rgb(0 0 0 / 40%);
  }

  .calculator-link {
    box-shadow: 0 0 12px rgb(255 255 255 / 45%);
  }

  .calculator-link:focus-visible {
    outline-color: #75003e;
  }

  /* Navigation underlines appear only on hover or keyboard focus. */
  .nav-text-link {
    text-decoration-line: none;
    text-decoration-color: #75003e;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
  }

  .nav-text-link:hover,
  .nav-text-link:focus-visible {
    text-decoration-line: underline;
  }

  /* Subtle vertical shading in the services consultation card. */
  .nav-consultation-card {
    background-image:
      repeating-linear-gradient(
        90deg,
        transparent 0 62px,
        rgb(255 255 255 / 1.2%) 62px 124px
      ),
      linear-gradient(120deg, #151515, #090909);
  }

  /* What we do: fine line rings and burgundy underlines. */
  .what-rings {
    width: 540px;
    height: 540px;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
  }

  .what-rings::before,
  .what-rings::after {
    position: absolute;
    inset: 32px;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
    content: "";
  }

  .what-rings::after {
    inset: 66px;
  }

  .what-rings-top {
    top: -50px;
    right: -130px;
  }

  .what-rings-bottom {
    bottom: -50px;
    left: -140px;
  }

  .what-link {
    text-decoration: underline;
    text-decoration-color: #660033;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
  }

  .what-link:hover {
    color: #660033;
  }

  .what-link:focus-visible {
    outline-color: #660033;
  }

  @media (min-width: 1280px) {
    .what-rings-top {
      right: -158px;
    }
  }
}

/* ==========================================================================
   Homepage styles
   ========================================================================== */
@layer components {
  /* Hero artwork: darken the image without reducing the text contrast. */
  .hero-shade {
    background: linear-gradient(
      180deg,
      rgb(0 0 0 / 12%) 0%,
      rgb(0 0 0 / 20%) 50%,
      rgb(0 0 0 / 42%) 78%,
      rgb(0 0 0 / 96%) 100%
    );
  }

  /* Cropped companion cards continue the statistics beyond both edges. */
  .hero-stat {
    position: relative;
  }

  .hero-stat::before {
    position: absolute;
    top: -1px;
    right: calc(100% + 10px);
    bottom: -1px;
    width: 140px;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 8px;
    background: rgb(255 255 255 / 20%);
    content: "";
  }

  [aria-label="Our experience"] .hero-stat::before {
    right: auto;
    left: calc(100% + 10px);
  }

  /* Find your path: transparent reference artwork sits on a white section. */
  .path-section-rings {
    bottom: 0;
    left: -224px;
    width: 540px;
    height: 540px;
    border: 1px solid #eeeeee;
    border-radius: 50%;
  }

  .path-section-rings::before,
  .path-section-rings::after {
    position: absolute;
    inset: 32px;
    border: 1px solid #eeeeee;
    border-radius: 50%;
    content: "";
  }

  .path-section-rings::after {
    inset: 66px;
  }

  .path-card {
    box-shadow: 0 6px 24px rgb(0 0 0 / 4%);
  }

  .path-card a:focus-visible {
    outline-color: #75003e;
  }

  .path-rings {
    bottom: -51px;
    left: -171px;
    width: 406px;
    height: 406px;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    box-shadow:
      0 0 0 32px #fafafa,
      0 0 0 33px #e8e8e8,
      0 0 0 65px #fafafa,
      0 0 0 66px #e8e8e8;
  }

  @media (min-width: 768px) {
    .path-section-rings {
      display: none;
    }

    .path-label {
      writing-mode: vertical-rl;
      transform: rotate(180deg);
      white-space: nowrap;
      margin-bottom: 8px;
    }
  }

  @media (min-width: 1280px) {
    .path-section-rings {
      display: block;
      top: 0;
      right: -158px;
      bottom: auto;
      left: auto;
    }
  }

  /* About: a quiet brand pattern behind the copy and staggered photos. */
  .about-section {
    background-image: var(--nexona-about-pattern-svg);
    background-repeat: repeat;
    background-size: 196px 196px;
  }

  /* These circles share a stacking context with both service sections. */
  .difference-rings-top {
    top: -100px;
    right: -300px;
  }

  .difference-rings-bottom {
    bottom: -180px;
    left: -200px;
  }

  @media (min-width: 768px) {
    .difference-rings-top {
      top: -80px;
      right: -130px;
    }

    .difference-rings-bottom {
      bottom: -180px;
      left: -140px;
    }
  }

  @media (min-width: 1280px) {
    .difference-rings-top {
      top: -180px;
      right: -158px;
    }
  }

  /* Insights: reveal the third article only on tablet and mobile. */
  .insight-extra {
    display: none;
  }

  #insights-grid[data-expanded="true"] .insight-extra {
    display: block;
  }

  #insights :focus-visible {
    outline-color: #660033;
  }

  @media (min-width: 1280px) {
    .insight-extra {
      display: block;
    }
  }

  /* FAQ: subtle square artwork, tabs and native exclusive accordions. */
  .faq-pattern {
    background-image: var(--nexona-faq-pattern-svg);
    background-size: 320px 320px;
    mask-image: linear-gradient(#000 0%, #000 45%, transparent 85%);
  }

  .faq-tabs {
    scrollbar-width: none;
  }

  .faq-tabs::-webkit-scrollbar {
    display: none;
  }

  .faq-tab {
    background: #ede9ec;
    color: #929292;
  }

  .faq-tab[aria-selected="true"] {
    background: #660033;
    color: #fff;
  }

  .faq-section [hidden] {
    display: none !important;
  }

  .faq-section :focus-visible {
    outline-color: #660033;
  }

  /* Process: one uninterrupted white rail behind all four step numbers. */
  .process-steps::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 90px;
    border-radius: 24px 24px 0 0;
    background: #fff;
    content: "";
  }

  /* Commitment: soft white cards over a continuous loop pattern. */
  .commitment-pattern {
    background-image: var(--nexona-commitment-pattern-svg);
    background-repeat: repeat;
    background-size: 196px 196px;
  }

  .commitment-card {
    border-bottom: 1px solid #a14a76;
    box-shadow: 0 4px 24px rgb(0 0 0 / 4%);
  }

  /* Partnerships: six cards on mobile, all twelve on larger screens. */
  .partner-card {
    order: var(--partner-order);
  }

  .partner-extra {
    display: none;
  }

  .partnership-grid[data-expanded="true"] .partner-extra {
    display: block;
  }

  .partnership-map {
    background: var(--nexona-partnership-outline-svg) center top / 1280px
      1400px no-repeat;
  }

  /* Client experiences: static offset rows, with softly faded outer cards. */
  .client-mobile-map {
    background: var(--nexona-partnership-outline-svg) center top / 900px
      1000px no-repeat;
  }

  .testimonial-window {
    mask-image: linear-gradient(
      to right,
      transparent,
      #000 6%,
      #000 94%,
      transparent
    );
  }

  .testimonial-track {
    width: max-content;
    margin-left: -382px;
  }

  .testimonial-track-second {
    margin-left: -24px;
  }

  @media (min-width: 768px) {
    .testimonial-window {
      mask-image: linear-gradient(
        to right,
        transparent,
        #000 12%,
        #000 88%,
        transparent
      );
    }

    .testimonial-track {
      margin-left: calc(50% - 802px);
    }

    .testimonial-track-second {
      margin-left: calc(50% - 888px);
    }
  }

  @media (min-width: 768px) {
    .partner-card {
      display: block;
      order: var(--partner-desktop-order);
    }
  }

  @media (min-width: 768px) {
    .process-steps::before {
      width: 110px;
    }
  }

  @media (min-width: 768px) {
    .about-photo-column::before {
      position: absolute;
      top: -273px;
      left: 0;
      width: 100%;
      height: 320px;
      border-radius: 18px;
      background: #7a0745;
      content: "";
    }
  }
}

/* ==========================================================================
   Homepage animations
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  html:has(.home-page.motion-ready) {
    scroll-behavior: smooth;
  }

  .home-page.motion-ready [data-reveal] {
    transition:
      opacity var(--reveal-duration, 800ms) cubic-bezier(0.22, 1, 0.36, 1),
      translate var(--reveal-duration, 800ms) cubic-bezier(0.22, 1, 0.36, 1),
      scale var(--reveal-duration, 800ms) cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }

  .home-page.motion-ready [data-motion-state="pending"] {
    opacity: 0;
    translate: 0 36px;
  }

  .home-page.motion-ready [data-motion-state="pending"][data-reveal="left"] {
    translate: -42px 0;
  }

  .home-page.motion-ready [data-motion-state="pending"][data-reveal="right"] {
    translate: 42px 0;
  }

  .home-page.motion-ready [data-motion-state="pending"][data-reveal="down"] {
    translate: 0 -20px;
  }

  .home-page.motion-ready [data-motion-state="pending"][data-reveal="fade"] {
    translate: none;
  }

  .home-page.motion-ready [data-motion-state="pending"][data-reveal="soft"] {
    translate: 0 30px;
    scale: 0.98;
  }

  .home-page.motion-ready [data-motion-state="revealed"] {
    opacity: 1;
    translate: none;
    scale: 1;
  }

  .home-page.motion-ready [data-reveal]:focus-within {
    opacity: 1;
    translate: none;
    scale: 1;
    transition: none;
  }

  /* Touch layouts use shorter entrances and less movement. */
  @media (max-width: 767px) {
    .home-page.motion-ready [data-reveal] {
      transition-duration: 600ms;
      transition-delay: min(var(--reveal-delay, 0ms), 180ms);
    }

    .home-page.motion-ready [data-motion-state="pending"] {
      translate: 0 24px;
    }

    .home-page.motion-ready [data-motion-state="pending"][data-reveal="left"],
    .home-page.motion-ready [data-motion-state="pending"][data-reveal="right"] {
      translate: 0 24px;
    }
  }
}

.home-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: #030303;
  animation: home-intro-exit 650ms 350ms ease-in-out forwards;
}

.home-intro img {
  width: clamp(170px, 18vw, 250px);
  height: auto;
  filter: brightness(0) saturate(100%) invert(10%) sepia(73%) saturate(3736%)
    hue-rotate(308deg) brightness(80%) contrast(113%);
  animation: home-intro-logo 750ms ease both;
}

@keyframes home-intro-logo {
  0% {
    opacity: 0;
    scale: 0.96;
  }
  25%,
  65% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1.03;
  }
}

@keyframes home-intro-exit {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-intro {
    display: none;
  }

  .home-page.motion-ready [data-reveal] {
    opacity: 1;
    translate: none;
    scale: 1;
    transition: none;
  }
}

@media print {
  .home-intro {
    display: none;
  }

  .home-page.motion-ready [data-reveal] {
    opacity: 1;
    translate: none;
    scale: 1;
    transition: none;
  }
}

/* ==========================================================================
   Service styles: free zone carousel and jurisdiction cards
   ========================================================================== */
@layer components {
  /* Free zone process: native horizontal scrolling with compact controls. */
  .setup-carousel {
    scrollbar-width: none;
  }

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

  [data-setup-carousel] :focus-visible {
    outline-color: #660033;
  }

  .jurisdiction-card {
    box-shadow: 0 3px 14px rgb(0 0 0 / 4%);
  }
}

/* ==========================================================================
   About us styles
   ========================================================================== */
@layer components {
  /* About value cards: a darker curved cap behind each white icon. */
  .about-value-card::before {
    position: absolute;
    top: -300px;
    left: -20%;
    z-index: -1;
    width: 140%;
    height: 410px;
    border-radius: 50%;
    background: rgb(0 0 0 / 14%);
    content: "";
  }
}

/* ==========================================================================
   Insights page styles
   ========================================================================== */
/* Article cards use Tailwind classes in insight.html and the shared styles above. */

/* ==========================================================================
   Insight detail page styles
   ========================================================================== */
/* Article and related-card layouts use Tailwind classes in insight-detail.html. */

/* ==========================================================================
   Contact page styles
   ========================================================================== */
/* Contact details and form layouts use Tailwind classes in contact-us.html. */

/* ==========================================================================
   Shared footer styles
   ========================================================================== */
@layer components {
  /* Reusable footer artwork; all footer layout stays in the HTML. */
  .footer-cta-art {
    background: var(--nexona-footer-pattern-svg) left center / auto 100%
      no-repeat;
  }

  @media (max-width: 767px) {
    .footer-cta-art {
      background-position: left -210px top;
      background-size: 900px auto;
      mask-image: linear-gradient(to right, transparent 15%, #000 65%);
      opacity: 0.8;
    }
  }
}

/* ==========================================================================
   Cost calculator modal styles
   ========================================================================== */
.cost-calculator {
  position: fixed;
  inset: 0 0 auto;
  width: min(924px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - clamp(24px, 12.6vh, 121px) - 24px);
  margin: clamp(24px, 12.6vh, 121px) auto 24px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #000;
}

.cost-calculator::backdrop {
  background: rgb(0 0 0 / 60%);
}

.cost-calculator-scroll {
  max-height: inherit;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.cost-calculator [hidden] {
  display: none !important;
}

.cost-calculator :focus-visible {
  outline: 2px solid #660033;
  outline-offset: 3px;
}

.cost-calculator [data-calculator-title]:focus {
  outline: none;
}

.cost-calculator-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233b4147' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
}

.cost-calculator-pattern {
  background: var(--nexona-cost-calculator-pattern-svg) left top / 100% 100%
    no-repeat;
}

@media (max-width: 767px) {
  .cost-calculator {
    max-height: calc(100dvh - clamp(24px, 11.4vh, 98px) - 16px);
    margin-top: clamp(24px, 11.4vh, 98px);
  }

  .cost-calculator[data-step="2"] .cost-calculator-close {
    color: #fff;
  }

  .cost-calculator[data-step="2"] .cost-calculator-close:focus-visible {
    outline-color: #fff;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cost-calculator[open] {
    animation: calculator-enter 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes calculator-enter {
    from {
      opacity: 0;
      translate: 0 10px;
    }
    to {
      opacity: 1;
      translate: none;
    }
  }
}
