/* ============================================================
   HamTech Automation — 2026 redesign layer
   Extends the existing --ce-* tokens (cutting-edge.css) into a
   single dark/amber system across the whole page: nav, hero,
   services accordion, projects brochure, mobile nav, type.
   Loads after every other stylesheet — this is the source of
   truth for the current visual system.
   ============================================================ */

/* ---------- Type ---------- */
:root {
    --ce-display: 'Space Grotesk', 'SB Body', -apple-system, BlinkMacSystemFont, sans-serif;
    --ce-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

    /* extend the existing cutting-edge token set with surfaces + text */
    --ce-surface: #17171a;
    --ce-surface-raised: #1e1e22;
    --ce-text: #eeeae4;
    --ce-text-muted: #9c968f;
    --ce-hairline: rgba(255, 122, 47, 0.16);
}

/* ============================================================
   GLOBAL — one dark surface, no more black/white striping
   ============================================================ */
html { scroll-behavior: smooth; }

body {
    background-color: var(--ce-board) !important;
    color: var(--ce-text) !important;
}

.page-section {
    background-color: var(--ce-board) !important;
    border-top: 1px solid var(--ce-hairline);
}
.page-section:first-of-type { border-top: 0; }

/* alternate every other section into the slightly-raised surface for depth,
   without going back to stark white/black stripes */
.page-section.bg-primary,
.page-section#techstack,
.page-section#certifications {
    background-color: var(--ce-surface) !important;
}

.page-section .lead,
.page-section p { color: var(--ce-text); }
.page-section .text-muted { color: var(--ce-text-muted) !important; }

h1, h2, h3, h4, h5, h6,
.masthead-heading, .page-section-heading, .navbar-brand,
.cb-label, .modal-title {
    font-family: var(--ce-display);
    letter-spacing: 0.01em;
}

.page-section-heading,
.text-primary { color: var(--ce-amber) !important; }

.divider-custom .divider-custom-line {
    background-color: var(--ce-orange) !important;
    max-width: 3.5rem;
    height: 2px;
    border-radius: 0;
}
.divider-custom .divider-custom-icon { color: var(--ce-amber) !important; }

a { color: var(--ce-amber); }
a:hover { color: var(--ce-orange); }

.btn-hero-primary,
.btn-outline-dark {
    font-family: var(--ce-mono);
    letter-spacing: 0.06em;
    border-radius: 6px;
}
.btn-hero-primary {
    background: linear-gradient(135deg, var(--ce-orange), var(--ce-ember));
    border: none;
    color: #100701;
    font-weight: 700;
}
.btn-hero-primary:hover { filter: brightness(1.12); color: #100701; }
.btn-outline-dark {
    border: 1px solid rgba(255, 122, 47, 0.5);
    color: var(--ce-text);
    background: transparent;
}
.btn-outline-dark:hover {
    border-color: var(--ce-amber);
    color: var(--ce-amber);
    background: rgba(255, 122, 47, 0.08);
}

.glass {
    background: linear-gradient(160deg, var(--ce-surface-raised), var(--ce-surface));
    border: 1px solid var(--ce-hairline);
    border-radius: 10px;
}

:focus-visible {
    outline: 2px solid var(--ce-amber);
    outline-offset: 3px;
}

/* ============================================================
   NAV — reordered, glassy, and a real mobile overlay
   ============================================================ */
#mainNav {
    background: rgba(10, 10, 11, 0.72) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ce-hairline);
    transition: background 0.25s ease;
}
#mainNav.navbar-scrolled { background: rgba(8, 8, 9, 0.92) !important; }

#mainNav .nav-link {
    font-family: var(--ce-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    color: var(--ce-text) !important;
    position: relative;
}
#mainNav .nav-link:hover,
#mainNav .nav-link.active { color: var(--ce-amber) !important; }
#mainNav .nav-link.nav-trade-pillar {
    border: 1px solid rgba(255, 122, 47, 0.45);
    border-radius: 6px;
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
}
/* unscoped variant so trade/*.html can reuse the same pill treatment
   without also pulling in #mainNav's .nav-link color/font overrides */
.nav-trade-pillar {
    border: 1px solid rgba(255, 122, 47, 0.45);
    border-radius: 6px;
    padding-left: 0.8rem !important;
    padding-right: 0.8rem !important;
}
/* trade/*.html's plain <a> has no padding of its own (unlike main site's
   .nav-link, which already gets 16px vertical from Bootstrap's py-3) —
   give it some here, scoped so it can't leak onto the main site's pill
   and shrink it shorter than its siblings. */
header.site .nav-trade-pillar {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

/* Desktop dropdowns (Services / Trade Services) — pure CSS reveal so
   keyboard tabbing works: focusing the trigger makes :focus-within true
   on the <li>, which is what un-hides (and un-hides-from-focus) the panel. */
.nav-item-has-dropdown { position: relative; }
.nav-item-has-dropdown > .nav-link::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.4em;
    margin-bottom: 1px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--ce-text-muted);
}
.nav-dropdown {
    /* flush against the trigger (no margin gap) so the cursor never
       crosses dead space where neither element is :hover-active —
       an 8px gap here was exactly what made the dropdown flaky */
    position: absolute;
    top: 100%;
    left: 50%;
    min-width: 250px;
    background: var(--ce-board);
    border: 1px solid var(--ce-hairline);
    border-radius: 8px;
    box-shadow: 0 24px 44px -18px rgba(0, 0, 0, 0.65);
    padding: 0.5rem 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 0);
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 20;
}
.nav-item-has-dropdown:hover .nav-dropdown,
.nav-item-has-dropdown:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.nav-dropdown a {
    display: block;
    padding: 0.6rem 1.2rem;
    font-family: var(--ce-mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: var(--ce-text-muted) !important;
    text-transform: none;
    white-space: nowrap;
}
.nav-dropdown a:hover,
.nav-dropdown a:focus-visible { color: var(--ce-amber) !important; background: rgba(255, 122, 47, 0.08); }
.nav-dropdown a[aria-current="page"] { color: var(--ce-amber) !important; }

/* hamburger — square, technical, not the default bootstrap icon */
.nav-toggle-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(255, 122, 47, 0.4);
    border-radius: 6px;
    cursor: pointer;
}
.nav-toggle-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ce-amber);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    background:
        radial-gradient(80% 60% at 50% 0%, rgba(255, 122, 47, 0.08), transparent 60%),
        var(--ce-board);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.mobile-nav-overlay a {
    font-family: var(--ce-display);
    font-size: 1.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ce-text);
    text-decoration: none;
}
.mobile-nav-overlay a:hover,
.mobile-nav-overlay a:focus-visible { color: var(--ce-amber); }
.mobile-nav-overlay .mno-meta {
    margin-top: 1rem;
    font-family: var(--ce-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--ce-text-muted);
    text-transform: uppercase;
}
body.mobile-nav-open { overflow: hidden; }

/* Mobile nested groups (Services / Trade Services) inside the overlay */
.mobile-nav-overlay .mno-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.mno-group-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--ce-display);
    font-size: 1.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ce-text);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.mno-group-toggle:hover,
.mno-group-toggle:focus-visible,
.mno-group-toggle[aria-expanded="true"] { color: var(--ce-amber); }
.mno-chevron {
    display: inline-block;
    width: 0;
    height: 0;
    margin-bottom: 2px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--ce-text-muted);
    transition: transform 0.25s ease;
}
.mno-group-toggle:hover .mno-chevron,
.mno-group-toggle[aria-expanded="true"] .mno-chevron { border-top-color: var(--ce-amber); }
.mno-group-toggle[aria-expanded="true"] .mno-chevron { transform: rotate(180deg); }
.mno-sublist {
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: max-height 0.3s ease, margin-top 0.3s ease;
}
.mno-sublist.open { max-height: 320px; margin-top: 0.9rem; }
.mno-sublist a {
    font-family: var(--ce-mono);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--ce-text-muted);
}
.mno-sublist a:hover,
.mno-sublist a:focus-visible { color: var(--ce-amber); }
.mno-sublist a[aria-current="page"] { color: var(--ce-amber); }

@media (min-width: 992px) {
    .nav-toggle-btn, .mobile-nav-overlay { display: none !important; }
}
@media (max-width: 991.98px) {
    #mainNav .navbar-collapse { display: none !important; }
    /* trade/*.html's own header nav uses .nav-links, not Bootstrap's collapse */
    header.site .nav-links { display: none !important; }
}

/* ============================================================
   HERO — circuit backdrop + 3D/fallback gear, no lava
   ============================================================ */
.hero-board { display: none !important; } /* lava artwork retired */

.masthead {
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(255, 122, 47, 0.10), transparent 60%),
        var(--ce-board) !important;
}

/* PCB substrate grid, replaces the photographic backdrop */
.hero-pcb-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(var(--ce-hairline) 1px, transparent 1px),
        linear-gradient(90deg, var(--ce-hairline) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(75% 75% at 50% 42%, #000 30%, transparent 78%);
    mask-image: radial-gradient(75% 75% at 50% 42%, #000 30%, transparent 78%);
}

.hero-gear-mount {
    position: relative;
    width: min(64vw, 380px);
    height: min(64vw, 380px);
    margin: 0 auto 1.5rem;
    z-index: 2;
}
.hero-gear-mount canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}
/* static fallback: mobile / reduced-motion / no-WebGL — shown by default,
   hidden by JS only once the 3D scene confirms it booted */
.hero-gear-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: min(30vw, 180px);
    color: var(--ce-amber);
    filter: drop-shadow(0 0 26px rgba(255, 122, 47, 0.45));
    animation: ce-gear-spin 16s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .hero-gear-fallback { animation: none; }
}
@keyframes ce-gear-spin { to { transform: rotate(360deg); } }
.hero-gear-mount.gear-3d-active .hero-gear-fallback { display: none; }

.masthead-heading { font-family: var(--ce-display); font-weight: 700; }
.masthead-subheading .typing-text { font-family: var(--ce-mono); }

/* ============================================================
   ABOUT — capability flags
   ============================================================ */
.about-flags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 1.6rem 0 0.4rem;
}
.about-flag {
    font-family: var(--ce-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 14px;
    border: 1px solid rgba(255, 122, 47, 0.4);
    border-radius: 999px;
    color: var(--ce-amber);
    background: rgba(255, 122, 47, 0.06);
}

/* ============================================================
   SERVICES — circuit-board nodes that expand in place
   ============================================================ */
/* enhancements.css left #services on a light grey gradient with
   near-black heading text from an earlier pass — override both
   the background-image (background-color alone doesn't touch it)
   and the heading color at matching #id specificity so this file's
   later load order wins the tie. */
#services {
    background: var(--ce-board) !important;
}
#services .page-section-heading {
    color: var(--ce-amber) !important;
}

.circuit-board { height: auto; min-height: 620px; padding-bottom: 10px; }
.cb-node { cursor: pointer; }
.cb-node[aria-expanded="true"] {
    border-color: var(--ce-amber);
    box-shadow: 0 0 26px rgba(255, 122, 47, 0.5), inset 0 0 16px rgba(255, 77, 0, 0.12);
}

.cb-panels { position: relative; z-index: 5; margin-top: 1.4rem; }
.cb-panel {
    display: none;
    background: linear-gradient(160deg, var(--ce-surface-raised), var(--ce-surface));
    border: 1px solid rgba(255, 122, 47, 0.4);
    border-radius: 12px;
    padding: 2rem 2.2rem;
    box-shadow: 0 0 40px -14px rgba(255, 122, 47, 0.35);
}
.cb-panel.open { display: block; animation: ce-panel-in 0.3s ease; }
@keyframes ce-panel-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cb-panel h5 {
    color: var(--ce-amber);
    font-family: var(--ce-display);
    margin-bottom: 0.9rem;
}
.cb-panel ul { padding-left: 1.1rem; margin-bottom: 0; }
.cb-panel li { margin-bottom: 0.55rem; color: var(--ce-text); }
.cb-panel li strong { color: var(--ce-text); }
.cb-panel-close {
    float: right;
    background: none;
    border: 1px solid rgba(255, 122, 47, 0.4);
    color: var(--ce-text-muted);
    border-radius: 6px;
    font-family: var(--ce-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    cursor: pointer;
}
.cb-panel-close:hover { color: var(--ce-amber); border-color: var(--ce-amber); }

@media (max-width: 767.98px) {
    .cb-panel { padding: 1.5rem 1.4rem; }
}

/* ============================================================
   PROJECTS / BROCHURE — a gallery, not a list
   ============================================================ */
.brochure-group-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--ce-mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ce-text-muted);
    text-align: center;
    margin: 2.4rem 0 1.4rem;
}
.brochure-group-label:first-of-type { margin-top: 0; }
.brochure-group-label::before,
.brochure-group-label::after {
    content: "";
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ce-hairline));
}
.brochure-group-label::after { transform: scaleX(-1); }

#projects .row { perspective: 1400px; }

.brochure-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ce-surface-raised), var(--ce-surface));
    border: 1px solid var(--ce-hairline);
    border-radius: 10px;
    padding: 1.6rem 1.6rem 1.4rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--brand-accent, var(--ce-orange));
    /* includes opacity so this rule can safely replace .fade-in's own
       transition shorthand (same specificity, later source — cascade
       picks one full declaration, not a merge of both) */
    transition: opacity 0.6s ease,
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    will-change: transform;
}
/* entrance: tilt in from a slight 3D angle, settle flat — higher
   specificity than plain .fade-in/.fade-in.visible so it overrides
   their translateY-only transform for cards specifically. */
#projects .brochure-card.fade-in {
    transform-origin: bottom center;
    transform: translateY(30px) rotateX(-10deg) rotateY(5deg);
}
#projects .brochure-card.fade-in.visible {
    transform: translateY(0) rotateX(0) rotateY(0);
}
/* one-time highlight sweep across the top accent border on arrival */
.brochure-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
    opacity: 0;
    pointer-events: none;
}
#projects .brochure-card.fade-in.visible::after {
    animation: ce-card-sweep 1.1s ease-out 0.2s 1;
}
@keyframes ce-card-sweep {
    0%   { left: -35%; opacity: 0; }
    12%  { opacity: 0.9; }
    100% { left: 100%; opacity: 0; }
}
/* faint idle pulse once settled, paused on hover so the (stronger)
   hover glow takes over cleanly instead of fighting the animation */
#projects .brochure-card.fade-in.visible {
    animation: ce-card-idle-pulse 6s ease-in-out 1s infinite;
}
.brochure-card:hover,
.brochure-card:focus-within { animation-play-state: paused; }
@keyframes ce-card-idle-pulse {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 10px 26px -16px color-mix(in srgb, var(--brand-accent, var(--ce-orange)) 45%, transparent); }
}
.brochure-card h6 {
    font-family: var(--ce-display);
    font-size: 1.05rem;
    color: var(--ce-text);
    margin-bottom: 0.2rem;
    transition: color 0.3s ease;
}
.brochure-card h6 i { transition: color 0.3s ease, transform 0.3s ease; }
.brochure-card .brochure-role {
    font-family: var(--ce-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-accent, var(--ce-amber));
    margin-bottom: 0.7rem;
}
.brochure-card p { font-size: 0.92rem; color: var(--ce-text-muted); flex: 1; }
.brochure-card a {
    font-family: var(--ce-mono);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    width: fit-content;
}
.brochure-card a i { transition: transform 0.25s ease; }

/* hover: lift + glow in the card's own brand colour + icon/link come alive.
   transition-delay reset to 0 here so the entrance stagger below never
   makes hover feel laggy on later cards in a row. */
.brochure-card:hover,
.brochure-card:focus-within {
    transition-delay: 0s !important;
    /* -6px lift, shared across Projects/AI/Trade cards for a consistent
       hover feel site-wide; the scale nudge stays Projects-only as its
       one distinguishing touch. */
    transform: translateY(-6px) scale(1.015);
    border-color: var(--brand-accent, var(--ce-amber));
    box-shadow: 0 22px 44px -18px rgba(255, 122, 47, 0.45);
}
.brochure-card:hover,
.brochure-card:focus-within {
    box-shadow: 0 22px 44px -18px color-mix(in srgb, var(--brand-accent, var(--ce-orange)) 55%, transparent);
}
.brochure-card:hover h6,
.brochure-card:focus-within h6 { color: var(--brand-accent, var(--ce-amber)); }
.brochure-card:hover h6 i,
.brochure-card:focus-within h6 i { transform: scale(1.12) rotate(-4deg); }
.brochure-card:hover a i,
.brochure-card:focus-within a i { transform: translateX(3px); }

/* staggered reveal: each card in a gallery row wakes up a beat after the last */
#projects .row > div:nth-child(1) .brochure-card { transition-delay: 0s; }
#projects .row > div:nth-child(2) .brochure-card { transition-delay: 0.08s; }
#projects .row > div:nth-child(3) .brochure-card { transition-delay: 0.16s; }
#projects .row > div:nth-child(4) .brochure-card { transition-delay: 0.24s; }
#projects .row > div:nth-child(5) .brochure-card { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
    .brochure-card { transition: border-color 0.2s ease; animation: none !important; }
    .brochure-card:hover, .brochure-card:focus-within { transform: none; }
    .brochure-card::after { display: none; }
    #projects .brochure-card.fade-in,
    #projects .brochure-card.fade-in.visible { transform: none; }
}

.hosted-strip {
    max-width: 1000px;
    margin: 2.4rem auto 0;
    padding: 1.2rem 1.6rem;
    border: 1px dashed rgba(255, 122, 47, 0.3);
    border-radius: 10px;
    text-align: center;
    font-family: var(--ce-mono);
    font-size: 0.78rem;
    color: var(--ce-text-muted);
    line-height: 2.1;
}
.hosted-strip a { color: var(--ce-text-muted); margin: 0 0.5em; }
.hosted-strip a:hover { color: var(--ce-amber); }

/* ============================================================
   EXPERIENCE — condensed at bottom
   ============================================================ */
#experience .timeline-item { border-left: 2px solid rgba(255, 122, 47, 0.3); padding-left: 1.4rem; margin-bottom: 2rem; }
#experience .timeline-item:last-child { margin-bottom: 0; }

/* ============================================================
   AI & AUTOMATION — icon-led motion, distinct from the Projects
   gallery's whole-card tilt. Themed around "processing/active
   indicator" rather than a product-shot reveal.
   ============================================================ */
.ai-card {
    position: relative;
    overflow: hidden;
    /* includes opacity + transform so this doesn't silently replace
       .fade-in's own entrance transition (same specificity, later
       source — cascade picks one full declaration, not a merge) */
    transition: opacity 0.6s ease,
                transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
.ai-card:hover,
.ai-card:focus-within {
    transform: translateY(-6px);
}
.ai-icon {
    display: inline-block;
    position: relative;
    transform: scale(0.4) rotate(-15deg);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
/* enhancements.js adds .visible to every .fade-in element (including
   .ai-card) once it scrolls into view — reused here, no new JS needed. */
.ai-card.visible .ai-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    animation: ai-icon-breathe 3.2s ease-in-out 0.6s infinite;
}
@keyframes ai-icon-breathe {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 179, 71, 0)); }
    50%      { filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.65)); }
}

/* hover: a thin scan-line sweeps once, and the icon fires a pulse ring —
   both are plain :hover-triggered keyframes, so they replay cleanly on
   every hover-enter without any JS. */
.ai-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -5%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 179, 71, 0.9), transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}
.ai-card:hover::before,
.ai-card:focus-within::before {
    animation: ai-scan-sweep 0.9s ease-out;
}
@keyframes ai-scan-sweep {
    0%   { top: -5%; opacity: 0; }
    15%  { opacity: 0.9; }
    100% { top: 105%; opacity: 0; }
}
.ai-icon::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 179, 71, 0.8);
    opacity: 0;
    pointer-events: none;
}
.ai-card:hover .ai-icon::after,
.ai-card:focus-within .ai-icon::after {
    animation: ai-ring-burst 0.6s ease-out;
}
@keyframes ai-ring-burst {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.8); opacity: 0; }
}
.ai-card:hover,
.ai-card:focus-within {
    border-color: rgba(255, 179, 71, 0.5);
    box-shadow: 0 14px 32px -18px rgba(255, 122, 47, 0.4);
}

@media (prefers-reduced-motion: reduce) {
    .ai-icon { animation: none !important; transition: opacity 0.3s ease; transform: none; opacity: 1; }
    .ai-card::before, .ai-icon::after { animation: none !important; display: none; }
    .ai-card:hover, .ai-card:focus-within { transform: none; }
}
