/* Autera optical edges. Load LAST, after every component stylesheet.
   Most borders rest neutral; brand and primary actions get small ambient glints.
   JS draws the brighter local pointer light independently.
   Border lighting uses its own overlay and never consumes a component pseudo. */
@media screen {
  :root {
    --prism-edge: none;
    --prism-edge-soft: none;
    --prism-rim: inset 0 1px 0 #ffffff17;
    --autera-edge-rest: #c3cfde38;
    --autera-edge-selected: #dbe4ed9c;
  }

  /* Deliberately match even late !important component edge declarations.
     Width/style/radius remain inherited, including one-sided separators. */
  :root:root:root body * { border-color: var(--autera-edge-rest) !important; }
  :root:root:root body :is([aria-pressed="true"], [aria-selected="true"], [aria-current="date"]),
  :root:root:root body :is(input, textarea, select):focus {
    border-color: var(--autera-edge-selected) !important;
  }
  :root:root:root body :is(:disabled, [aria-disabled="true"]) {
    border-color: #c3cfde16 !important;
  }
  :root:root:root body .booking-days button:disabled { border-color: transparent !important; }

  /* Remove existing spectrum rims without touching FAQ symbols, date dots,
     timeline counters, icon pseudo-elements, or reveal/compare masks. */
  :root:root:root body :is(.btn, .dock-cta, .round-link, .site-header, .sig-panel, .closing-band, .autera-portrait, .sig-design-lab)::before,
  :root:root:root body :is(.premium-offer, .sig-design-face)::after {
    content: none !important;
  }
  :root:root:root body .premium-offer::before {
    opacity: 0 !important;
    background: none !important;
  }
  /* Generic glass tiles also inherited opposing cyan/lilac inset shadows.
     Leave their translucent material intact while neutralizing those fixed rims. */
  :root:root:root body :is(.glass, .glass-heavy):not(.site-header):not(.conversion-dock) {
    box-shadow: 0 3px 6px #0006, 0 18px 40px -14px #0008, inset 0 1px 0 #ffffff1a !important;
  }
  :root:root:root body .glass::after {
    background: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
  }
  /* Navigation reads as typography: one fine line, filled on hover.
     Current-page state remains visible without showing a colored rectangle. */
  :root:root:root body .site-nav > a:not(.btn)::after {
    height: 2px !important;
    background: linear-gradient(90deg, #ffcb8f, #ff7868 25%, #b5a3ff 51%, #83d6e7 77%, #a3ddc5) !important;
    box-shadow: 0 1px 8px #a89dee24 !important;
    transform-origin: left center !important;
    transition: transform .42s cubic-bezier(.22, .72, .22, 1), opacity .28s ease !important;
  }
  :root:root:root body .site-nav > a[aria-current="page"]:not(:hover)::after { opacity: .6 !important; }
  :root:root:root body .site-nav > a:hover::after { opacity: 1 !important; }
  @media (hover: none), (pointer: coarse) {
    :root:root:root body .site-nav > a:not(.btn):not([aria-current="page"])::after {
      transform: scaleX(0) !important;
    }
  }
  :root:root:root body :is(.text-link, .side-index a, .project-index a, .breadcrumb a, .motion-toggle, .footer-links a):hover {
    text-decoration-line: none !important;
  }
  :root:root:root body .project-index a { text-decoration-line: none !important; }
  :root:root:root body .motion-toggle,
  :root:root:root body .motion-toggle:hover {
    background: transparent !important;
    box-shadow: none !important;
  }
  :root:root:root body .sig-rule,
  :root:root:root body .sig-process-copy::after,
  :root:root:root body .booking-progress::after,
  :root:root:root body.story-home .brand-promise-line > span::after {
    background: #d2deea70 !important;
    box-shadow: none !important;
  }
  :root:root:root body .sig-roadmap article::before,
  :root:root:root body .sig-float-note:last-of-type::before {
    background: #c5d1df50 !important;
    box-shadow: none !important;
  }
  :root:root:root body .faq-item summary::after,
  :root:root:root body :is(.process-number, .timeline-rail) {
    text-shadow: none !important;
  }

  /* Keep glass depth and pearl calls to action; retire the permanent rainbow
     backgrounds that were also being used to paint border-box edges. */
  :root:root:root body :is(.premium-offer, .package, .service-outcome, .audit-card, .contact-form,
    .company-metric, .services-project-image, .offer-product-view, .phone-stage, .system-stage,
    .search-stage, .contact-band, .free-call-strip, .direct-build) {
    background: linear-gradient(145deg, #ffffff08, transparent 52%), #12171e !important;
    box-shadow: 0 3px 7px #0006, 0 25px 45px -19px #000b, inset 0 1px 0 #ffffff14 !important;
  }
  :root:root:root body :is(.service-modules, .session-agenda-shell, .work-compare-stage, .sys-flow) {
    background: linear-gradient(150deg, #1a2028, #10151b 65%) !important;
    box-shadow: 0 24px 44px -20px #000a, inset 0 1px 0 #ffffff12 !important;
  }
  :root:root:root body :is(.site-header, .site-header.scrolled, .conversion-dock, .mobile-call-dock) {
    background: linear-gradient(150deg, #ffffff0b, transparent 50%), #10151deb !important;
    box-shadow: 0 6px 18px #0006, 0 20px 44px #0006, inset 0 1px 0 #ffffff14 !important;
  }
  :root:root:root body :is(.btn-primary, .btn-ink, .dock-cta),
  :root:root:root body :is(.btn-primary, .btn-ink, .dock-cta):hover {
    background: linear-gradient(160deg, #ffffffa1, transparent 51%), linear-gradient(#efeee9, #d1d4d9) !important;
    color: #101319 !important;
    border-color: #edf0f3aa !important;
    box-shadow: 0 3px 7px #0007, 0 9px 21px -8px #000b, inset 0 1px 0 #ffffff70 !important;
  }
  :root:root:root body :is(.btn-secondary, .round-link, .availability-day),
  :root:root:root body :is(.btn-secondary, .round-link, .availability-day):hover {
    background: linear-gradient(135deg, #ffffff0c, transparent 50%), #151b23 !important;
    color: #eef0f4 !important;
    box-shadow: 0 3px 7px #0007, 0 9px 21px -8px #000b, inset 0 1px 0 #ffffff14 !important;
  }
  :root:root:root body button:not(.btn):not(.menu-backdrop):not(:disabled),
  :root:root:root body .service-modules__links a {
    background-image: linear-gradient(155deg, #242b35, #171e27) !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 3px 7px #0005, inset 0 1px 0 #ffffff12 !important;
  }
  :root:root:root body button:is([aria-pressed="true"], [aria-selected="true"]):not(.btn):not(:disabled) {
    background-image: linear-gradient(155deg, #364151, #242d3a) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px #0006, inset 0 1px 0 #ffffff26 !important;
  }
  /* Runtime appointment links and the navigation backdrop also inherit
     older control shadows; keep both free of colored full frames. */
  :root:root:root body .menu-backdrop { box-shadow: none !important; }
  :root:root:root body .offer-row.sig-recommended {
    outline-color: var(--autera-edge-selected) !important;
    box-shadow: 0 0 30px #d7e0ea08 !important;
  }
  :root:root:root body .booking-days button[aria-pressed="true"]:not(:disabled) {
    background-image: linear-gradient(#e8ecf0, #ced7df) !important;
    color: #141820 !important;
    box-shadow: 0 2px 8px #0006, inset 0 1px 0 #ffffff80 !important;
  }
  :root:root:root body :is(.sig-panel, .booking-shell, .screenshot-dialog, .browser-frame, .trio-shot,
    .project-trio, .closing-band, .availability-card, .work-compare-note, .sig-float-note,
    .sys-flow-tool, .sys-flow-founder, .sig-design-face, .founder-paths__project) {
    box-shadow: 0 4px 9px #0006, 0 24px 48px -18px #000b, inset 0 1px 0 #ffffff16 !important;
  }
  :root:root:root body .work-compare-note {
    background: linear-gradient(145deg, #ffffff09, transparent 52%), #20242d !important;
  }
  :root:root:root body .availability-preview summary,
  :root:root:root body .faq-item:hover,
  :root:root:root body .faq-item[open] {
    background: linear-gradient(145deg, #ffffff07, transparent 60%), #17202a !important;
    box-shadow: inset 0 1px 0 #ffffff0c !important;
  }
  @media (max-width: 820px) {
    :root:root:root body .site-nav {
      background: #10161efa !important;
      box-shadow: 0 24px 40px #0009, inset 0 1px 0 #ffffff12 !important;
    }
  }

  :root:root:root body :is(.dock-cta, .project-trio, .signature-device-frame) {
    outline: 1px solid var(--autera-edge-rest);
    outline-offset: -1px;
  }
  :root:root:root body .signature-device-frame {
    transform: none !important;
    background: linear-gradient(125deg, #737d8a, #252c35 20%, #10151d 76%, #75818a) !important;
    box-shadow: 0 18px 28px #0008, inset 0 1px 0 #ffffff19 !important;
  }
  /* Keep dialog overlays aligned to the viewport as the native top layer opens. */
  :root:root:root body .screenshot-dialog[open] { animation: none !important; }

  /* Border light tracks the pointer without moving the surface itself. */
  :root:root:root body .premium-offer[data-tilt] { transform: none !important; }
  :root:root:root body :is(.btn, .round-link, .browser-frame, .trio-shot, .service-modules__module) {
    transition-property: box-shadow, background-color, color, border-color, opacity !important;
  }
  :root:root:root body :is(.custom-cursor, .cursor-dot, .cursor-ring, [data-custom-cursor]) {
    display: none !important;
  }
  :root:root:root body :is(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 2px solid #dce7f2 !important;
    outline-offset: 4px !important;
  }

  /* The shared overlay is positioned with measured border geometry, including
     native inputs/selects. It never changes box size or catches pointer input. */
  .autera-prism-layer {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483000 !important;
    pointer-events: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    contain: strict;
    overflow: hidden;
  }
  .autera-prism-border {
    position: absolute !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    border: 0 !important;
    margin: 0 !important;
    /* JS places this small light on the nearest actual rounded edge.
       Detection uses the larger invisible cursor radius; visual footprint
       stays bounded, so illuminating all native sides cannot create a frame. */
    background: radial-gradient(var(--prism-radius, 110px) circle at var(--prism-x, -1000px) var(--prism-y, -1000px),
      #fff0d5 0%, #ffca8e 13%, #ff8172 30%, #b6a3ff 48%, #87d8e7d9 66%, #a4dfc58c 82%, transparent 100%) !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: var(--prism-opacity, .92);
    box-shadow: none !important;
    /* A measured ancestor clipping polygon may be supplied by JavaScript.
       An inline clip-path remains authoritative over this optional fallback. */
    clip-path: var(--prism-clip, none);
  }
  /* Measured lines live outside component DOM, leaving existing icons and
     pseudo-elements intact. Geometry stays on the outer span; only its fill
     grows, so a rotated screenshot never distorts the animation. */
  .autera-prism-underline {
    position: absolute !important;
    box-sizing: border-box !important;
    height: 2px !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    pointer-events: none !important;
    opacity: var(--prism-opacity, .95);
    overflow: visible !important;
    -webkit-mask: none !important;
    mask: none !important;
  }
  .autera-prism-underline-fill {
    position: absolute !important;
    inset: 0 !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 999px !important;
    pointer-events: none !important;
    background: linear-gradient(90deg, #ffcb8f, #ff7868 25%, #b5a3ff 51%, #83d6e7 77%, #a3ddc5) !important;
    box-shadow: 0 1px 8px #a89dee24 !important;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .42s cubic-bezier(.22, .72, .22, 1);
  }
  .autera-prism-underline.is-active > .autera-prism-underline-fill { transform: scaleX(1); }
  .autera-prism-underline[hidden], .autera-prism-border[hidden], .autera-prism-layer[hidden] { display: none !important; }
  @media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce), (forced-colors: active) {
    .autera-prism-layer, .autera-prism-local { display: none !important; }
  }
  html.motion-off .autera-prism-layer, html.motion-off .autera-prism-local { display: none !important; }
}

/* Activation uses one quiet prism underline. A completed tap/click starts it;
   the JavaScript gesture gate keeps scrolling from creating touch feedback. */
@media screen {
  .autera-prism-press-layer {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483001 !important;
    pointer-events: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    contain: strict;
    overflow: hidden;
  }
  .autera-prism-press-border {
    position: absolute !important;
    box-sizing: border-box !important;
    height: 2px !important;
    pointer-events: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: none !important;
    -webkit-mask: none !important;
    mask: none !important;
    opacity: .98;
    box-shadow: none !important;
    overflow: hidden;
    contain: paint;
  }
  .autera-prism-press-color {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    pointer-events: none !important;
    border: 0 !important;
    background: linear-gradient(90deg, #ffcb8f, #ff7868 25%, #b5a3ff 51%, #83d6e7 77%, #a3ddc5) !important;
    transform-origin: left center;
  }
  .autera-prism-press-border.is-still > .autera-prism-press-color {
    transform: none !important;
  }
  @media (forced-colors: active) {
    .autera-prism-press-layer { display: none !important; }
  }
}

/* Selective ambient light: short line glints establish the brand and calls
   to action without tracing a perimeter. Each placement follows its role. */
@media screen {
  :root:root:root body :is(
    .site-header,
    .site-nav > .btn-primary,
    .hero-top .actions > .btn-primary,
    .page-hero .actions > .btn-primary,
    .intake-form [data-intake-submit],
    .contact-band .btn-ink,
    .closing-band .actions > .btn-primary,
    .closing-band .actions > .btn-ink,
    .conversion-dock .dock-cta,
    .mobile-call-dock .btn-primary
  )::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: auto !important;
    left: var(--ambient-prism-left, 22%) !important;
    top: var(--ambient-prism-top, 0px) !important;
    width: var(--ambient-prism-width, 42%) !important;
    height: 2px !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 0 !important;
    pointer-events: none !important;
    z-index: 1;
    background: linear-gradient(90deg, transparent, #ffd19b 13%, #ed8b7d 32%, #b4a2ef 52%, #85cfe4 73%, #a0ddc899 86%, transparent) !important;
    background-size: 100% 100% !important;
    background-position: 0 0 !important;
    background-repeat: no-repeat !important;
    -webkit-mask: none !important;
    mask: none !important;
    opacity: var(--ambient-prism-opacity, .78) !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    box-shadow: 0 1px 8px #ac9ce61a !important;
    filter: none !important;
  }

  /* Header glint sits beside the wordmark, distinct from the nav underline. */
  :root:root:root body .site-header {
    --ambient-prism-left: clamp(100px, 11%, 155px);
    --ambient-prism-top: 0px;
    --ambient-prism-width: 96px;
    --ambient-prism-opacity: .72;
  }
  :root:root:root body .site-nav > .btn-primary {
    --ambient-prism-left: 53%;
    --ambient-prism-top: calc(100% - 2px);
    --ambient-prism-width: 34%;
    --ambient-prism-opacity: .70;
  }
  :root:root:root body .hero-top .actions > .btn-primary,
  :root:root:root body .page-hero .actions > .btn-primary {
    --ambient-prism-left: 12%;
    --ambient-prism-top: 0px;
    --ambient-prism-width: 39%;
    --ambient-prism-opacity: .86;
  }
  :root:root:root body .intake-form [data-intake-submit] {
    --ambient-prism-left: 54%;
    --ambient-prism-top: 0px;
    --ambient-prism-width: 32%;
    --ambient-prism-opacity: .84;
  }
  :root:root:root body .contact-band .btn-ink {
    --ambient-prism-left: 18%;
    --ambient-prism-top: calc(100% - 2px);
    --ambient-prism-width: 35%;
    --ambient-prism-opacity: .82;
  }
  :root:root:root body .closing-band .actions > .btn-primary,
  :root:root:root body .closing-band .actions > .btn-ink {
    --ambient-prism-left: 48%;
    --ambient-prism-top: 0px;
    --ambient-prism-width: 38%;
    --ambient-prism-opacity: .82;
  }
  :root:root:root body .conversion-dock .dock-cta {
    --ambient-prism-left: 41%;
    --ambient-prism-top: calc(100% - 2px);
    --ambient-prism-width: 42%;
    --ambient-prism-opacity: .52;
  }
  :root:root:root body .mobile-call-dock .btn-primary {
    --ambient-prism-left: 17%;
    --ambient-prism-top: 0px;
    --ambient-prism-width: 34%;
    --ambient-prism-opacity: .64;
  }

  /* Pearl material stays readable; the accents above provide the color. */
  :root:root:root body :is(
    .site-nav > .btn-primary,
    .hero-top .actions > .btn-primary,
    .page-hero .actions > .btn-primary,
    .intake-form [data-intake-submit],
    .contact-band .btn-ink,
    .closing-band .actions > .btn-primary,
    .closing-band .actions > .btn-ink,
    .conversion-dock .dock-cta,
    .mobile-call-dock .btn-primary
  ) {
    background: linear-gradient(160deg, #ffffffa1, transparent 51%), linear-gradient(#efeee9, #d1d4d9) !important;
  }

  :root:root:root body .site-footer .brand { position: relative; width: fit-content; }
  :root:root:root body .site-footer .brand::after {
    content: "";
    position: absolute;
    right: 8%;
    bottom: -8px;
    width: 86px;
    height: 2px;
    border: 0;
    border-radius: 999px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, #edb5849c 19%, #ab9aeeb3 48%, #83cbdc8c 76%, transparent);
    box-shadow: 0 1px 9px #ac9ce626;
  }

  @media (prefers-reduced-motion: reduce) {
    :root:root:root body .site-nav > a:not(.btn)::after,
    .autera-prism-underline-fill { transition: none !important; }
    :root:root:root body :is(.text-link, .side-index a, .project-index a, .breadcrumb a, .motion-toggle, .footer-links a):hover {
      text-decoration-line: underline !important;
      text-underline-offset: .3em;
    }
  }
  /* Pausing motion removes measured hover overlays, so text keeps a static
     native underline as its interaction cue. */
  :root:root:root.motion-off body :is(.text-link, .side-index a, .project-index a, .breadcrumb a, .motion-toggle, .footer-links a):hover {
    text-decoration-line: underline !important;
    text-underline-offset: .3em;
  }
  :root:root:root.motion-off body .site-nav > a:not(.btn)::after,
  html.motion-off .autera-prism-underline-fill { transition: none !important; }
  @media (forced-colors: active) {
    :root:root:root body :is(
      .site-header,
      .site-nav > .btn-primary,
      .hero-top .actions > .btn-primary,
      .page-hero .actions > .btn-primary,
      .intake-form [data-intake-submit],
      .contact-band .btn-ink,
      .closing-band .actions > .btn-primary,
      .closing-band .actions > .btn-ink,
      .conversion-dock .dock-cta,
      .mobile-call-dock .btn-primary
    )::before,
    :root:root:root body .site-footer .brand::after { content: none !important; }
    :root:root:root body .site-nav > a:not(.btn)::after { background: currentColor !important; }
  }
}
