/* ==============================================================
   AI FUTURE HUB ULTIMATE
   Additive visual system loaded after the preserved legacy styles.
   ============================================================== */

:root {
    --afh-bg: #edf5ff;
    --afh-bg-elevated: #f7faff;
    --afh-ink: #10172a;
    --afh-muted: #5b6881;
    --afh-deep: #060817;
    --afh-deep-2: #0b1330;
    --afh-surface: rgba(255, 255, 255, .88);
    --afh-surface-strong: #ffffff;
    --afh-surface-dark: rgba(10, 18, 42, .88);
    --afh-primary: #6c43e8;
    --afh-primary-strong: #4e2bb8;
    --afh-cyan: #08b9d9;
    --afh-cyan-bright: #57e7ff;
    --afh-violet: #b470ff;
    --afh-pink: #ed5bff;
    --afh-success: #20c997;
    --afh-danger: #f0546f;
    --afh-border: rgba(87, 104, 151, .18);
    --afh-border-bright: rgba(87, 231, 255, .34);
    --afh-grid: rgba(66, 88, 143, .075);
    --afh-gradient: linear-gradient(118deg, #6c43e8 0%, #3488f2 50%, #08b9d9 100%);
    --afh-gradient-hot: linear-gradient(118deg, #8b5cf6 0%, #5e72f2 46%, #14c8de 100%);
    --afh-radius-sm: 10px;
    --afh-radius-md: 16px;
    --afh-radius-lg: 24px;
    --afh-radius-xl: 34px;
    --afh-shadow-sm: 0 8px 26px rgba(23, 34, 75, .09);
    --afh-shadow-md: 0 18px 48px rgba(23, 34, 75, .14);
    --afh-shadow-glow: 0 18px 52px rgba(77, 73, 210, .2);
    --afh-container: 1180px;
    --afh-fast: 160ms;
    --afh-normal: 300ms;
    --afh-slow: 420ms;
    --afh-ease: cubic-bezier(.22, 1, .36, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
    background: var(--afh-bg);
    color: var(--afh-ink);
    font-family: Inter, Aptos, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.dark-mode {
    --afh-bg: #050816;
    --afh-bg-elevated: #0a1024;
    --afh-ink: #eef5ff;
    --afh-muted: #aab8d2;
    --afh-surface: rgba(11, 19, 43, .9);
    --afh-surface-strong: #0c1530;
    --afh-border: rgba(144, 168, 225, .17);
    --afh-grid: rgba(92, 145, 225, .08);
    --afh-shadow-sm: 0 10px 30px rgba(0, 0, 0, .24);
    --afh-shadow-md: 0 22px 56px rgba(0, 0, 0, .34);
    --afh-shadow-glow: 0 20px 58px rgba(38, 94, 214, .21);
    background: var(--afh-bg);
    color: var(--afh-ink);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: -3;
    background-image:
        linear-gradient(var(--afh-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--afh-grid) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 82%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 82%);
}

body::after {
    z-index: -4;
    background:
        radial-gradient(circle at 12% 12%, rgba(108, 67, 232, .16), transparent 27%),
        radial-gradient(circle at 88% 24%, rgba(8, 185, 217, .13), transparent 25%),
        radial-gradient(circle at 50% 78%, rgba(76, 82, 214, .09), transparent 34%),
        var(--afh-bg);
}

::selection {
    background: rgba(88, 217, 255, .34);
    color: inherit;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid rgba(26, 196, 225, .48);
    outline-offset: 3px;
}

a,
button,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
}

.particles {
    z-index: -2;
    opacity: .48;
}

.particles span {
    width: 4px;
    height: 4px;
    background: rgba(80, 207, 255, .52);
    box-shadow: 0 0 12px rgba(104, 79, 238, .58);
    animation-duration: 16s !important;
}

.cursor-glow {
    z-index: -1;
    width: 320px;
    height: 320px;
    opacity: .55;
    background: radial-gradient(circle, rgba(73, 129, 238, .16), transparent 68%);
    transition: opacity var(--afh-normal) ease;
}

/* Brand header */

.site-header {
    position: relative;
    overflow: hidden;
    padding: 28px 24px 26px;
    border-bottom: 1px solid rgba(93, 220, 255, .18);
    background:
        radial-gradient(circle at 20% -30%, rgba(147, 96, 255, .45), transparent 38%),
        radial-gradient(circle at 84% 140%, rgba(0, 210, 232, .3), transparent 38%),
        linear-gradient(128deg, #070a19 0%, #12143a 52%, #07162f 100%);
    box-shadow: 0 16px 42px rgba(4, 8, 28, .2);
    color: #fff;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .34;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(86, 224, 255, .1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(86, 224, 255, .1) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(circle at center, #000, transparent 76%);
    mask-image: radial-gradient(circle at center, #000, transparent 76%);
}

.logo-area {
    position: relative;
    z-index: 1;
    width: min(100%, var(--afh-container));
    margin: 0 auto;
    gap: 18px;
}

.site-logo {
    width: 76px;
    height: 76px;
    border: 1px solid rgba(134, 235, 255, .72);
    box-shadow:
        0 0 0 6px rgba(70, 119, 225, .13),
        0 0 30px rgba(46, 199, 240, .25);
    animation: afhLogoFloat 5s var(--afh-ease) infinite;
}

.site-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -.045em;
    text-shadow: 0 8px 28px rgba(0, 0, 0, .24);
}

.tagline {
    margin: 8px 0 0;
    color: #b9c9e8;
    font-size: .95rem;
    letter-spacing: .025em;
}

@keyframes afhLogoFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.025); }
}

/* Navigation */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    min-height: 68px;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(111, 163, 230, .19);
    background: rgba(6, 9, 24, .91);
    box-shadow: 0 14px 34px rgba(4, 7, 24, .16);
    backdrop-filter: blur(16px) saturate(135%);
}

.navbar.is-scrolled {
    background: rgba(5, 8, 22, .97);
    box-shadow: 0 16px 38px rgba(3, 6, 20, .27);
}

.navbar a {
    position: relative;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #c9d5ee;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition:
        color var(--afh-fast) ease,
        background var(--afh-fast) ease,
        border-color var(--afh-fast) ease,
        transform var(--afh-fast) ease;
}

.navbar a:hover {
    transform: translateY(-1px);
    border-color: rgba(100, 207, 255, .18);
    background: rgba(103, 112, 237, .13);
    color: #fff;
}

.navbar a.active,
.navbar a[aria-current="page"] {
    border-color: rgba(96, 220, 255, .26);
    background: linear-gradient(118deg, rgba(119, 75, 232, .36), rgba(15, 184, 218, .22));
    box-shadow: inset 0 0 18px rgba(79, 171, 255, .11);
    color: #fff;
}

.global-ai-link {
    border-color: rgba(96, 220, 255, .34) !important;
    background: linear-gradient(118deg, rgba(126, 70, 232, .2), rgba(12, 197, 219, .13)) !important;
    color: #e8fbff !important;
}

.global-ai-link::after {
    content: "SOON";
    margin-left: 7px;
    padding: 2px 6px;
    border: 1px solid rgba(117, 231, 255, .32);
    border-radius: 999px;
    background: rgba(29, 208, 226, .12);
    color: #7ceaff;
    font-size: .57rem;
    font-weight: 850;
    letter-spacing: .12em;
    vertical-align: 2px;
}

html[data-global-ai-ready="true"] .global-ai-link::after {
    content: "LIVE";
    border-color: rgba(90, 237, 191, .42);
    background: rgba(32, 201, 151, .14);
    color: #7ef1c5;
}

.sidebar {
    z-index: 1400;
    width: 0;
    max-width: min(340px, 88vw);
    padding-top: 76px;
    border-right: 1px solid rgba(96, 220, 255, .18);
    background:
        radial-gradient(circle at 10% 0%, rgba(111, 71, 225, .35), transparent 34%),
        #070b1d;
    box-shadow: 22px 0 55px rgba(2, 5, 18, .42);
}

.sidebar a {
    margin: 4px 14px;
    padding: 12px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #cdd9f1;
    font-weight: 650;
    transition: var(--afh-fast) ease;
}

.sidebar a:hover,
.sidebar a.active {
    border-color: rgba(101, 216, 255, .19);
    background: rgba(92, 102, 221, .15);
    color: #fff;
    transform: translateX(3px);
}

.sidebar .closebtn {
    top: 10px;
    right: 14px;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 2rem;
}

.menu-btn,
.theme-btn,
#topBtn {
    display: grid;
    place-items: center;
    border: 1px solid rgba(100, 220, 255, .28);
    background: rgba(8, 14, 34, .9);
    color: #edfaff;
    box-shadow: 0 10px 28px rgba(3, 8, 24, .22);
    backdrop-filter: blur(12px);
}

.menu-btn {
    top: 16px;
    left: 16px;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 14px;
    font-size: 1.15rem;
}

.theme-btn {
    z-index: 1100;
    top: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.15rem;
}

.menu-btn:hover,
.theme-btn:hover,
#topBtn:hover {
    border-color: rgba(104, 231, 255, .62);
    background: #101a3b;
    color: #fff;
    transform: translateY(-2px);
}

#topBtn {
    right: 22px;
    bottom: 22px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 1.15rem;
}

/* Loader */

.page-loader {
    background:
        radial-gradient(circle at center, rgba(105, 71, 229, .3), transparent 30%),
        #050817;
    transition: opacity .55s ease, visibility .55s ease;
}

.robot {
    filter: drop-shadow(0 0 18px rgba(80, 221, 255, .38));
    animation: robotMove 1.8s var(--afh-ease) infinite alternate;
}

.loader-content h2 {
    margin-bottom: 4px;
    font-size: clamp(1.7rem, 5vw, 2.45rem);
    letter-spacing: -.04em;
}

.loader-content p {
    color: #adbfde;
}

/* Shared page structure */

.page-container,
.tools-page,
.favorites-section,
.gallery-section,
.news-section,
.tutorial-section,
.stats,
.card-container {
    width: min(100%, var(--afh-container));
    margin-left: auto;
    margin-right: auto;
}

.page-container,
.tools-page,
.favorites-section {
    padding: clamp(42px, 6vw, 78px) clamp(18px, 4vw, 30px);
}

.gallery-section,
.news-section,
.tutorial-section,
.stats {
    padding: clamp(48px, 7vw, 86px) clamp(18px, 4vw, 28px);
}

.page-container > h1,
.tools-page > h1,
.tools-page > h2,
.favorites-section > h2 {
    margin: 0 0 14px;
    color: var(--afh-ink);
    font-size: clamp(2rem, 5vw, 3.65rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

.page-container > h1::after,
.tools-page > h1::after,
.tools-page > h2::after,
.favorites-section > h2::after {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin: 18px 0 0;
    border-radius: 999px;
    background: var(--afh-gradient);
    box-shadow: 0 0 18px rgba(42, 190, 230, .28);
}

.tools-page > h1::after,
.tools-page > h2::after,
.favorites-section > h2::after {
    margin-left: auto;
    margin-right: auto;
}

.page-banner {
    position: relative;
    overflow: hidden;
    margin: 0 0 clamp(34px, 5vw, 58px);
    padding: clamp(38px, 6vw, 68px) clamp(22px, 5vw, 48px);
    border: 1px solid rgba(97, 215, 255, .23);
    border-radius: var(--afh-radius-xl);
    background:
        radial-gradient(circle at 16% 12%, rgba(142, 85, 240, .38), transparent 34%),
        radial-gradient(circle at 90% 110%, rgba(21, 202, 221, .27), transparent 34%),
        linear-gradient(125deg, #090d24, #121744 52%, #081a34);
    box-shadow: 0 26px 70px rgba(9, 20, 56, .2);
    color: #fff;
    text-align: center;
}

.page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .27;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(103, 216, 255, .12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 216, 255, .12) 1px, transparent 1px);
    background-size: 38px 38px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

.page-banner > * {
    position: relative;
    z-index: 1;
}

.page-banner h1,
.page-banner h2 {
    margin: 0 0 12px;
    color: #f5fbff;
    font-size: clamp(2rem, 5vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

.page-banner p {
    max-width: 760px;
    margin: 0 auto;
    color: #b8cae6;
    font-size: clamp(1rem, 2vw, 1.16rem);
}

.about-section {
    margin: 24px 0;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius-lg);
    background: var(--afh-surface);
    box-shadow: var(--afh-shadow-sm);
}

.about-section h2,
.gallery-section h2,
.news-section h2,
.tutorial-section h2,
.stats h2,
.cms-tools-section h2 {
    margin: 0 0 22px;
    color: var(--afh-ink);
    font-size: clamp(1.75rem, 4vw, 2.55rem);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.about-section p,
.page-container > p,
.page-container section p {
    color: var(--afh-muted);
}

.about-section font {
    color: inherit !important;
}

/* Home hero — original large banner concept retained */

.hero {
    position: relative;
    width: 100%;
    min-height: min(780px, calc(100svh - 120px));
    padding: clamp(64px, 8vw, 108px) clamp(20px, 6vw, 72px) clamp(68px, 8vw, 104px);
    border: 0;
    border-bottom: 1px solid rgba(99, 222, 255, .24);
    border-radius: 0 0 54px 54px;
    background:
        linear-gradient(180deg, rgba(5, 8, 23, .18), rgba(5, 8, 23, .84)),
        radial-gradient(circle at 18% 22%, rgba(132, 82, 238, .42), transparent 31%),
        radial-gradient(circle at 84% 38%, rgba(13, 196, 220, .28), transparent 31%),
        linear-gradient(132deg, #080b20, #111542 52%, #071b34);
    background-size: auto;
    color: #fff;
    animation: none;
    box-shadow: 0 30px 80px rgba(7, 17, 52, .22);
}

.hero::before {
    content: "AI FUTURE HUB  •  INTELLIGENCE NETWORK  •  ONLINE";
    position: relative;
    z-index: 2;
    display: inline-flex;
    margin-bottom: 20px;
    padding: 7px 13px;
    border: 1px solid rgba(100, 224, 255, .27);
    border-radius: 999px;
    background: rgba(37, 91, 153, .14);
    color: #86e9f8;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .34;
    background-image:
        linear-gradient(rgba(99, 218, 255, .11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 218, 255, .11) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 73%);
    mask-image: radial-gradient(ellipse at center, #000, transparent 73%);
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h2 {
    max-width: 920px;
    margin: 0 auto;
    font-size: clamp(2.55rem, 7vw, 5.7rem);
    font-weight: 880;
    line-height: .98;
    letter-spacing: -.064em;
    text-wrap: balance;
    text-shadow: 0 14px 46px rgba(0, 0, 0, .34);
}

.hero img {
    width: min(920px, 88%);
    max-height: 420px;
    margin: clamp(28px, 5vw, 46px) auto;
    border: 1px solid rgba(113, 226, 255, .31);
    border-radius: 28px;
    object-fit: cover;
    box-shadow:
        0 28px 80px rgba(0, 0, 0, .42),
        0 0 0 8px rgba(66, 116, 217, .08);
    filter: saturate(.92) contrast(1.04);
}

.hero p {
    max-width: 760px;
    color: #c4d3eb;
    font-size: clamp(1rem, 2vw, 1.24rem);
}

.hero-btn,
.tool-btn,
.tutorial-card button,
.cms-read-button,
.newsletter-box button,
.send-btn,
.reset-btn,
.favorite-btn {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 780;
    line-height: 1.2;
    transition:
        transform var(--afh-fast) var(--afh-ease),
        box-shadow var(--afh-fast) ease,
        background var(--afh-fast) ease,
        border-color var(--afh-fast) ease;
}

.hero-btn,
.tool-btn,
.tutorial-card button,
.send-btn,
.newsletter-box button {
    background: var(--afh-gradient);
    color: #fff;
    box-shadow: 0 12px 26px rgba(73, 80, 213, .23);
}

.hero-btn {
    padding: 14px 28px;
}

.hero-btn:hover,
.tool-btn:hover,
.tutorial-card button:hover,
.send-btn:hover,
.newsletter-box button:hover {
    transform: translateY(-3px) scale(1.01);
    background: var(--afh-gradient-hot);
    color: #fff;
    box-shadow: 0 16px 34px rgba(54, 119, 225, .3);
}

.home-intro {
    width: min(100% - 36px, 820px);
    margin: 38px auto 16px;
    color: var(--afh-muted);
    font-size: 1.08rem;
    text-align: center;
}

body[data-page="home"] > hr {
    width: min(100% - 36px, var(--afh-container));
    margin: 36px auto 0;
    border: 0;
    border-top: 1px solid var(--afh-border);
}

body[data-page="home"] > center {
    width: min(calc(100% - 36px), var(--afh-container));
    margin: 34px auto;
}

body[data-page="home"] > center h2,
body[data-page="tools"] > h2 {
    color: var(--afh-ink);
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    letter-spacing: -.035em;
}

body[data-page="favorites"] > header:not(.site-header) {
    width: min(calc(100% - 36px), var(--afh-container));
    margin: clamp(42px, 6vw, 72px) auto 0;
    padding: clamp(32px, 5vw, 54px);
    border: 1px solid rgba(99, 220, 255, .24);
    border-radius: var(--afh-radius-xl);
    background:
        radial-gradient(circle at 12% 0%, rgba(132, 78, 232, .34), transparent 34%),
        linear-gradient(128deg, #090c23, #10183f 58%, #071a31);
    box-shadow: 0 24px 64px rgba(9, 19, 55, .2);
    color: #fff;
    text-align: center;
}

body[data-page="favorites"] > header:not(.site-header) h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.65rem);
    letter-spacing: -.045em;
}

table {
    width: min(calc(100% - 36px), 920px) !important;
    margin: 36px auto !important;
    overflow: hidden;
    border: 1px solid var(--afh-border) !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--afh-radius-lg);
    background: var(--afh-surface-strong) !important;
    color: var(--afh-ink);
    box-shadow: var(--afh-shadow-sm);
}

table th,
table td {
    padding: 14px 16px;
    border: 0;
    border-right: 1px solid var(--afh-border);
    border-bottom: 1px solid var(--afh-border);
    background: transparent !important;
    text-align: left;
}

table tr {
    background: transparent !important;
}

table tbody tr:nth-child(even) {
    background: rgba(77, 110, 178, .045) !important;
}

table th:last-child,
table td:last-child {
    border-right: 0;
}

table tr:last-child td {
    border-bottom: 0;
}

table th {
    background: linear-gradient(118deg, #151b49, #0c3d61) !important;
    color: #fff;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Global AI honest standby entry */

.global-ai-entry {
    position: relative;
    overflow: hidden;
    width: min(calc(100% - 36px), var(--afh-container));
    margin: clamp(50px, 7vw, 86px) auto;
    padding: clamp(30px, 5vw, 54px);
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr);
    align-items: center;
    gap: clamp(26px, 5vw, 64px);
    border: 1px solid rgba(98, 224, 255, .28);
    border-radius: var(--afh-radius-xl);
    background:
        radial-gradient(circle at 10% 0%, rgba(145, 82, 242, .34), transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(12, 198, 220, .24), transparent 34%),
        linear-gradient(132deg, #080b21, #111841 55%, #07192f);
    box-shadow: 0 26px 72px rgba(8, 18, 54, .24);
    color: #fff;
}

.global-ai-entry::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .26;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(99, 218, 255, .11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 218, 255, .11) 1px, transparent 1px);
    background-size: 36px 36px;
}

.global-ai-entry > * {
    position: relative;
    z-index: 1;
}

.global-ai-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: #78e6f8;
    font-size: .73rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.global-ai-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5eeaff;
    box-shadow: 0 0 16px rgba(80, 229, 255, .75);
}

.global-ai-entry h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: -.052em;
}

.global-ai-entry p {
    max-width: 680px;
    margin: 0;
    color: #b8cae6;
}

.global-ai-console {
    padding: 22px;
    border: 1px solid rgba(105, 226, 255, .22);
    border-radius: 22px;
    background: rgba(5, 11, 28, .68);
    box-shadow: inset 0 0 30px rgba(62, 93, 199, .1);
}

.global-ai-console-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(146, 179, 224, .12);
    color: #9eb0cd;
    font-size: .8rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.global-ai-console-row:last-child {
    border-bottom: 0;
}

.global-ai-console-row strong {
    color: #74e4f5;
    font-size: .74rem;
}

.global-ai-launch {
    width: 100%;
    min-height: 52px;
    margin-top: 16px;
    border: 1px solid rgba(107, 229, 255, .34);
    border-radius: 14px;
    background: linear-gradient(118deg, rgba(117, 73, 232, .24), rgba(11, 193, 218, .18));
    color: #f4fdff;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition:
        transform 220ms var(--afh-ease),
        border-color 220ms ease,
        box-shadow 260ms var(--afh-ease),
        background-color 220ms ease;
}

.global-ai-launch:hover {
    transform: translateY(-2px);
    border-color: rgba(107, 229, 255, .64);
    box-shadow: 0 12px 28px rgba(26, 172, 221, .15);
}

.global-ai-status {
    min-height: 1.4em;
    margin: 12px 0 0 !important;
    color: #8fa3c2 !important;
    font-size: .78rem;
    text-align: center;
}

/* Cards and discovery surfaces */

.card-container,
.gallery-container,
.news-container,
.tutorial-container,
.tool-container,
.feature-grid,
.stats-container {
    gap: clamp(18px, 3vw, 28px);
}

.card-container,
.news-container,
.tutorial-container,
.tool-container,
.stats-container {
    align-items: stretch;
}

.card,
.gallery-item,
.news-card,
.tool-card,
.tutorial-card,
.feature-card,
.stat-box,
.featured-card,
.timeline-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius-lg);
    background: var(--afh-surface);
    color: var(--afh-ink);
    box-shadow: var(--afh-shadow-sm);
    animation: none;
    transform: none;
    transition:
        transform 380ms var(--afh-ease),
        border-color 300ms ease,
        box-shadow 360ms var(--afh-ease);
}

.card::before,
.gallery-item::before,
.news-card::before,
.tool-card::before,
.tutorial-card::before,
.feature-card::before,
.stat-box::before,
.featured-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 2;
    width: 100%;
    height: 2px;
    background: var(--afh-gradient);
    opacity: .5;
    pointer-events: none;
}

.news-card::after,
.tool-card::after {
    display: none;
}

.card:hover,
.gallery-item:hover,
.news-card:hover,
.tool-card:hover,
.tutorial-card:hover,
.feature-card:hover,
.stat-box:hover,
.featured-card:hover {
    transform: translateY(-10px);
    border-color: var(--afh-border-bright);
    box-shadow: var(--afh-shadow-glow);
}

.card,
.news-card,
.tool-card,
.tutorial-card {
    width: min(100%, 340px);
}

.card {
    padding: 0;
}

.card img,
.gallery-item img,
.news-card > img,
.tool-card > img,
.tutorial-card img,
.feature-card img,
.featured-card img {
    transition: transform 460ms var(--afh-ease), filter 460ms ease;
}

.card:hover img,
.gallery-item:hover img,
.news-card:hover > img,
.tool-card:hover > img,
.tutorial-card:hover img,
.feature-card:hover img,
.featured-card:hover img {
    transform: scale(1.065);
    filter: saturate(1.05);
}

/* Home AI Gallery: preserve the old/live interaction without affecting other cards. */
@media (hover: hover) and (pointer: fine) {
    #gallery .gallery-item {
        animation: none;
        transform-style: preserve-3d;
        perspective: 1000px;
        transition:
            transform .3s ease,
            border-color 300ms ease,
            box-shadow .3s ease;
    }

    #gallery .gallery-item:hover {
        transform: translateY(-10px);
        box-shadow: 0 25px 50px rgba(75, 0, 130, .35);
    }

    #gallery .gallery-item img {
        transition: transform .5s ease, filter .5s ease;
    }

    #gallery .gallery-item:hover img {
        transform: scale(1.1);
    }
}

.card-content,
.news-card,
.tool-card,
.tutorial-card,
.feature-card {
    padding: clamp(22px, 3vw, 28px);
}

.card-content h3,
.gallery-item h3,
.news-card h3,
.tool-card h2,
.tutorial-card h3,
.feature-card h3 {
    color: var(--afh-ink);
    line-height: 1.24;
    letter-spacing: -.025em;
}

.card-content p,
.news-card p,
.tool-card p,
.tutorial-card p,
.feature-card p,
.cms-tool-meta,
.cms-meta {
    color: var(--afh-muted);
}

.tool-card {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.tool-card h2 {
    margin: 24px 0 8px;
    font-size: 1.42rem;
}

.tool-card p {
    flex: 1;
}

.tool-card .tool-btn,
.tool-card .favorite-btn {
    margin-top: 14px;
}

.badge,
.news-card > span,
.news-badge,
.tags span,
.ai-tag {
    border: 1px solid rgba(83, 206, 239, .22);
    border-radius: 999px;
    background: rgba(79, 150, 229, .12);
    color: var(--afh-primary);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.badge {
    top: 18px;
    right: 18px;
    padding: 5px 11px;
    color: #fff;
}

.badge.fd { background: #3267f7; }
.badge.ud { background: #159f6d; }
.badge.paid { background: #db405f; }

.rating {
    color: #ffb02e;
    letter-spacing: .08em;
}

.favorite-btn {
    padding: 10px 18px;
    border-color: rgba(240, 84, 111, .23);
    background: rgba(240, 84, 111, .1);
    color: #d33b5a;
}

.favorite-btn:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(240, 84, 111, .42);
    background: rgba(240, 84, 111, .16);
}

body.dark-mode .favorite-btn {
    color: #ff97aa;
}

.search-container {
    position: relative;
    width: min(100% - 36px, 720px);
    margin: 8px auto 48px;
}

.search-container input {
    width: 100%;
    max-width: none;
    min-height: 58px;
    padding: 15px 22px;
    border: 1px solid var(--afh-border);
    border-radius: 18px;
    background: var(--afh-surface-strong);
    color: var(--afh-ink);
    box-shadow: var(--afh-shadow-sm);
    font: inherit;
}

.search-container input:focus {
    transform: none;
    border-color: rgba(31, 190, 222, .58);
    box-shadow: 0 0 0 4px rgba(31, 190, 222, .1), var(--afh-shadow-sm);
}

#noResults,
.cms-section-status,
#cmsToolsStatus,
#favoriteList > h3 {
    width: min(100%, 760px);
    margin: 18px auto;
    padding: 16px 18px;
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius-md);
    background: var(--afh-surface);
    color: var(--afh-muted);
    text-align: center;
}

.cms-section-status[data-state="unavailable"] {
    border-color: rgba(240, 84, 111, .2);
    background: rgba(240, 84, 111, .065);
}

.cms-tools-section {
    margin-top: 32px;
    padding-top: clamp(54px, 7vw, 82px);
    border-top: 1px solid var(--afh-border);
}

.cms-tools-section > p,
.cms-tool-meta,
.cms-meta {
    color: var(--afh-muted);
}

.cms-tool-image {
    width: 94px;
    height: 94px;
    border: 1px solid var(--afh-border);
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(25, 46, 103, .12);
}

/* Newsroom */

.news-section {
    text-align: center;
}

.news-card {
    padding: 26px;
    text-align: left;
}

.news-card > span,
.news-badge {
    display: inline-flex;
    padding: 5px 11px;
}

.news-card h3 {
    margin-top: 18px;
}

.news-card a,
.cms-read-button {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--afh-primary);
    cursor: pointer;
    text-decoration: none;
}

.news-card a:hover,
.cms-read-button:hover {
    transform: translateX(3px);
    background: none;
    color: var(--afh-cyan);
    box-shadow: none;
}

.featured-card {
    display: grid;
    grid-template-columns: minmax(250px, .9fr) minmax(0, 1.1fr);
    gap: 0;
    width: min(100%, 1040px);
    margin: 0 auto;
}

.featured-image,
.featured-img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
}

.featured-content {
    padding: clamp(28px, 5vw, 48px);
    align-self: center;
    text-align: left;
}

.featured-content h3 {
    margin: 14px 0;
    color: var(--afh-ink);
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.featured-content p,
.news-meta {
    color: var(--afh-muted);
}

.news-ticker {
    overflow: hidden;
    padding: 13px 18px;
    border: 1px solid var(--afh-border);
    border-radius: 14px;
    background: var(--afh-surface);
    color: var(--afh-muted);
    box-shadow: var(--afh-shadow-sm);
}

.timeline {
    position: relative;
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.timeline-item {
    padding: 22px 24px;
}

.year {
    color: var(--afh-primary);
    font-weight: 850;
}

.newsletter-box {
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(93, 218, 255, .24);
    border-radius: var(--afh-radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(119, 76, 230, .25), transparent 32%),
        linear-gradient(130deg, #0a0f2b, #0c1c39);
    color: #fff;
    box-shadow: 0 24px 60px rgba(9, 21, 57, .2);
}

.newsletter-box h2,
.newsletter-box p {
    color: #fff;
}

.newsletter-box input {
    width: min(100%, 480px);
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid rgba(137, 197, 239, .25);
    border-radius: 13px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.newsletter-box button {
    min-height: 48px;
    padding: 11px 20px;
    border: 0;
}

.cms-news-dialog {
    width: min(calc(100% - 32px), 760px);
    max-height: 86vh;
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid var(--afh-border-bright);
    border-radius: var(--afh-radius-lg);
    background: var(--afh-bg-elevated);
    color: var(--afh-ink);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
}

.cms-news-dialog::backdrop {
    background: rgba(3, 6, 19, .72);
    backdrop-filter: blur(6px);
}

.cms-dialog-close {
    display: grid;
    place-items: center;
    border: 1px solid var(--afh-border);
    background: var(--afh-surface-strong);
    color: var(--afh-ink);
}

/* Stats and informational content */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    width: min(100%, 980px);
    margin: 0 auto;
}

.stat-box {
    width: auto;
    min-width: 0;
    padding: 28px 20px;
}

.stat-box h1 {
    margin: 0;
    color: var(--afh-primary);
    font-size: clamp(2.2rem, 5vw, 3.25rem);
    line-height: 1;
    letter-spacing: -.045em;
}

.stat-box p {
    margin: 10px 0 0;
    color: var(--afh-muted);
    font-size: .95rem;
}

.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.feature-card {
    padding: 25px;
    text-align: left;
}

details {
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius-md);
    background: var(--afh-bg-elevated);
}

summary {
    padding: 16px 18px;
    color: var(--afh-ink);
    cursor: pointer;
    font-weight: 760;
}

details p {
    margin: 0;
    padding: 0 18px 18px;
}

.page-container > section {
    margin: 18px 0;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius-lg);
    background: var(--afh-surface);
    box-shadow: var(--afh-shadow-sm);
}

.page-container > section h2 {
    margin-top: 0;
    color: var(--afh-ink);
    line-height: 1.25;
    letter-spacing: -.025em;
}

.page-container li,
.about-section li {
    margin: 8px 0;
    color: var(--afh-muted);
}

/* Favorites */

#favoriteList {
    align-items: stretch;
}

#favoriteList .tool-card {
    overflow: hidden;
    justify-content: center;
}

#favoriteList .tool-btn,
#favoriteList .tool-btn:hover,
#favoriteList .tool-btn:focus,
#favoriteList .tool-btn:active {
    transform: none;
}

#favoriteList .tool-btn:hover {
    box-shadow: 0 12px 26px rgba(53, 115, 224, .25);
}

/* Contact */

.contact-section {
    min-height: 70vh;
    padding: clamp(54px, 8vw, 96px) 20px;
    background:
        radial-gradient(circle at 14% 8%, rgba(130, 72, 229, .35), transparent 31%),
        radial-gradient(circle at 89% 91%, rgba(13, 194, 219, .26), transparent 31%),
        linear-gradient(132deg, #070a1d, #101537 53%, #071b34);
    background-size: auto;
    animation: none;
}

.contact-card {
    max-width: 820px;
    padding: clamp(26px, 5vw, 48px);
    border: 1px solid rgba(110, 220, 255, .21);
    border-radius: var(--afh-radius-xl);
    background: rgba(8, 14, 35, .88);
    box-shadow: 0 30px 82px rgba(2, 5, 18, .42);
    backdrop-filter: blur(12px);
    animation: afhFadeUp .7s var(--afh-ease) both;
}

.contact-card h2 {
    margin-top: 0;
    color: #f3fbff;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.subtitle {
    color: #aebfda;
}

.input-group label,
.radio-group label,
.privacy-consent {
    color: #e6efff;
}

.input-group input,
.input-group select,
.input-group textarea {
    border: 1px solid rgba(137, 172, 222, .22);
    border-radius: 14px;
    background: rgba(3, 8, 24, .62);
    color: #f3f7ff;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #7f90ac;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border: 1px solid rgba(84, 220, 247, .72);
    box-shadow: 0 0 0 4px rgba(36, 190, 220, .12);
}

.input-group select option {
    background: #0c1530;
    color: #fff;
}

.input-help,
.support-email-note {
    color: #93a6c3;
}

.support-email-note a {
    color: #70e4f7;
}

.button-group {
    flex-wrap: wrap;
}

.send-btn,
.reset-btn {
    min-width: 150px;
    padding: 13px 28px;
}

.reset-btn {
    border-color: rgba(157, 176, 212, .2);
    background: rgba(154, 171, 207, .1);
    color: #eaf1ff;
}

.reset-btn:hover {
    transform: translateY(-2px);
    background: rgba(154, 171, 207, .17);
}

.toast {
    max-width: min(390px, calc(100vw - 36px));
    border: 1px solid rgba(112, 222, 255, .2);
    border-radius: 15px;
    background: rgba(7, 13, 31, .95);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .34);
}

@keyframes afhFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */

.footer-ultra {
    position: relative;
    margin-top: clamp(60px, 8vw, 100px);
    padding: 76px 24px 30px;
    border-top: 1px solid rgba(98, 220, 255, .2);
    background:
        radial-gradient(circle at 12% 0%, rgba(116, 70, 226, .28), transparent 30%),
        radial-gradient(circle at 89% 100%, rgba(9, 192, 218, .2), transparent 32%),
        #050817;
}

body[data-page="contact"] .footer-ultra,
body[data-page="maintenance"] .footer-ultra {
    margin-top: 0;
}

.footer-bg-animation {
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .1;
    background: linear-gradient(110deg, #6c43e8, #294db2, #08b9d9);
    animation: gradientMove 18s ease infinite;
}

.footer-wave {
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(95, 226, 255, .65), transparent);
}

.footer-container-ultra {
    width: min(100%, var(--afh-container));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr .75fr;
    gap: clamp(28px, 5vw, 68px);
}

.footer-box-ultra {
    min-width: 0;
}

.footer-box-ultra h2 {
    margin-top: 0;
    color: #f2f8ff;
    font-size: 1.7rem;
    letter-spacing: -.035em;
}

.footer-brand-title {
    display: flex;
    align-items: center;
    gap: 13px;
}

.footer-brand-title img {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border: 1px solid rgba(107, 229, 255, .35);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 24px rgba(46, 199, 240, .18);
}

.footer-box-ultra h3 {
    color: #79e6f8;
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.footer-box-ultra p,
.footer-box-ultra a,
.footer-bottom-ultra {
    color: #9fb0cb;
}

.footer-box-ultra a {
    width: fit-content;
    margin: 8px 0;
}

.footer-box-ultra a:hover {
    color: #78e6f8;
    transform: translateX(4px);
}

.ai-tag {
    padding: 7px 12px;
    color: #83eaf9;
}

.social-ultra a {
    border: 1px solid rgba(130, 168, 220, .16);
    background: rgba(255, 255, 255, .05);
}

.social-ultra a:hover {
    transform: translateY(-4px);
    border-color: rgba(91, 222, 247, .36);
    background: rgba(79, 111, 223, .18);
}

.footer-bottom-ultra {
    width: min(100%, var(--afh-container));
    margin-left: auto;
    margin-right: auto;
}

/* Maintenance */

.maintenance-main {
    min-height: 64vh;
}

.maintenance-card {
    position: relative;
    overflow: hidden;
    max-width: 700px;
    padding: clamp(34px, 7vw, 58px);
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius-xl);
    background: var(--afh-surface);
    box-shadow: var(--afh-shadow-md);
}

.maintenance-card h2 {
    color: var(--afh-ink);
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -.045em;
}

.maintenance-card p {
    color: var(--afh-muted);
}

/* Lightweight reveal system */

.afh-reveal-ready {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity var(--afh-slow) var(--afh-ease),
        transform var(--afh-slow) var(--afh-ease);
}

.afh-reveal-ready.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Future Global AI launch hooks — dormant until official files arrive. */

[data-afh-launch-root] {
    --afh-launch-progress: 0%;
    position: relative;
    isolation: isolate;
}

[data-afh-launch-root]::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 5;
    height: 3px;
    width: var(--afh-launch-progress);
    background: var(--afh-gradient);
    box-shadow: 0 0 18px rgba(78, 222, 255, .5);
    transition: width 420ms var(--afh-ease);
}

[data-afh-launch-phase="charging"] { --afh-launch-progress: 18%; }
[data-afh-launch-phase="initializing"] { --afh-launch-progress: 36%; }
[data-afh-launch-phase="ignition"] { --afh-launch-progress: 54%; }
[data-afh-launch-phase="ascent"] { --afh-launch-progress: 73%; }
[data-afh-launch-phase="hyperspace"] { --afh-launch-progress: 90%; }
[data-afh-launch-phase="complete"] { --afh-launch-progress: 100%; }

/* Dark mode refinements */

body.dark-mode .navbar {
    background: rgba(4, 7, 20, .94);
}

body.dark-mode .card,
body.dark-mode .gallery-item,
body.dark-mode .news-card,
body.dark-mode .tool-card,
body.dark-mode .tutorial-card,
body.dark-mode .feature-card,
body.dark-mode .stat-box,
body.dark-mode .featured-card,
body.dark-mode .timeline-item,
body.dark-mode .about-section,
body.dark-mode .page-container > section,
body.dark-mode details {
    background: var(--afh-surface);
    color: var(--afh-ink);
}

body.dark-mode .card-content h3,
body.dark-mode .gallery-item h3,
body.dark-mode .news-card h3,
body.dark-mode .tool-card h2,
body.dark-mode .tutorial-card h3,
body.dark-mode .feature-card h3,
body.dark-mode .gallery-section h2,
body.dark-mode .news-section h2,
body.dark-mode .tutorial-section h2,
body.dark-mode .stats h2,
body.dark-mode .about-section h2,
body.dark-mode .page-container > h1,
body.dark-mode .page-container > section h2,
body.dark-mode summary {
    color: var(--afh-ink);
}

body.dark-mode .search-container input,
body.dark-mode .cms-news-dialog,
body.dark-mode .cms-dialog-close {
    background: var(--afh-surface-strong);
    color: var(--afh-ink);
}

/* Responsive */

@media (min-width: 769px) {
    .menu-btn {
        display: none;
    }
}

@media (max-width: 1080px) {
    .navbar {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .navbar::-webkit-scrollbar {
        display: none;
    }

    .navbar a {
        flex: 0 0 auto;
    }

    .footer-container-ultra {
        grid-template-columns: 1.2fr 1fr;
    }

    .footer-box-ultra:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 20px;
    }

    .navbar {
        display: none;
    }

    .sidebar {
        width: 0;
    }

    .site-header {
        padding: 22px 66px 22px;
    }

    .logo-area {
        flex-direction: row;
        justify-content: center;
        text-align: left;
    }

    .site-logo {
        width: 58px;
        height: 58px;
        flex: 0 0 auto;
    }

    .site-header h1 {
        font-size: clamp(1.42rem, 6vw, 1.9rem);
    }

    .tagline {
        font-size: .76rem;
    }

    .hero {
        min-height: auto;
        padding: 58px 18px 66px;
        border-radius: 0 0 34px 34px;
    }

    .hero::before {
        margin-bottom: 16px;
        font-size: .58rem;
    }

    .hero h2 {
        font-size: clamp(2.3rem, 12vw, 4rem);
    }

    .hero img {
        width: 100%;
        max-height: 320px;
        margin: 28px auto;
        border-radius: 20px;
    }

    .global-ai-entry {
        grid-template-columns: 1fr;
    }

    .card-container,
    .news-container,
    .tutorial-container,
    .tool-container {
        flex-direction: row;
        align-items: stretch;
    }

    .card,
    .news-card,
    .tool-card,
    .tutorial-card {
        width: min(100%, 520px);
    }

    .gallery-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .featured-card {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .featured-image,
    .featured-img {
        min-height: 230px;
        max-height: 330px;
    }

    .stats-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-container-ultra {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .footer-box-ultra:last-child {
        grid-column: auto;
    }

    .contact-card {
        backdrop-filter: none;
    }

    .particles span:nth-child(n+14) {
        display: none;
    }
}

@media (max-width: 520px) {
    .site-header {
        min-height: 100px;
        padding: 18px 58px;
    }

    .logo-area {
        gap: 11px;
    }

    .site-logo {
        width: 48px;
        height: 48px;
    }

    .site-header h1 {
        font-size: 1.28rem;
    }

    .tagline {
        display: none;
    }

    .menu-btn,
    .theme-btn {
        top: 15px;
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .menu-btn { left: 10px; }
    .theme-btn { right: 10px; }

    .page-banner {
        border-radius: 24px;
    }

    .global-ai-entry {
        width: min(calc(100% - 24px), var(--afh-container));
        border-radius: 24px;
    }

    .global-ai-console {
        padding: 17px;
    }

    .stats-container {
        gap: 12px;
    }

    .stat-box {
        padding: 22px 12px;
    }

    .stat-box h1 {
        font-size: 2.2rem;
    }

    .button-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .send-btn,
    .reset-btn {
        width: 100%;
    }

    #favoriteList .tool-btn,
    #favoriteList .favorite-btn {
        width: 100%;
        margin: 8px 0 0;
    }

    .toast {
        right: 18px;
        bottom: 18px;
        left: 18px;
    }

    .footer-ultra {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (hover: none), (pointer: coarse) {
    .cursor-glow {
        display: none;
    }

    .card:hover,
    .gallery-item:hover,
    .news-card:hover,
    .tool-card:hover,
    .tutorial-card:hover,
    .feature-card:hover,
    .stat-box:hover,
    .featured-card:hover {
        transform: none;
    }

    .card:active,
    .gallery-item:active,
    .news-card:active,
    .tool-card:active,
    .tutorial-card:active,
    .feature-card:active,
    .stat-box:active,
    .featured-card:active {
        transform: scale(.988);
        border-color: var(--afh-border-bright);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .particles,
    .cursor-glow {
        display: none;
    }

    .afh-reveal-ready {
        opacity: 1;
        transform: none;
    }
}


/* =========================================================
   ULTIMATE POLISH PATCH — favicon-adjacent UI, News title,
   footer balance + Connect icon normalization
   ========================================================= */

/* News Hub: preserve the common banner, improve legibility. */
.news-hub-banner {
    isolation: isolate;
}

.news-hub-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.5vw, 16px);
    max-width: 100%;
    padding: .08em .16em;
    color: #ffffff !important;
    font-weight: 800;
    letter-spacing: -.035em !important;
    text-wrap: balance;
    text-shadow:
        0 2px 2px rgba(2, 6, 23, .78),
        0 0 22px rgba(92, 226, 255, .26),
        0 0 42px rgba(134, 91, 255, .22);
}

.news-hub-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: min(68%, 250px);
    height: 2px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(121, 230, 248, .95), rgba(164, 111, 255, .9), transparent);
    box-shadow: 0 0 18px rgba(121, 230, 248, .42);
}

.news-hub-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: .98em;
    height: .98em;
    font-size: .72em;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(121, 230, 248, .28));
}

/* Footer: stronger shared alignment without changing content. */
.footer-container-ultra {
    align-items: start;
}

.footer-box-ultra {
    position: relative;
}

.footer-box-ultra h2,
.footer-box-ultra h3 {
    margin-bottom: 14px;
}

.footer-box-ultra p {
    max-width: 42rem;
}

.footer-box-ultra:last-child {
    justify-self: end;
    width: min(100%, 230px);
}

.footer-box-ultra:last-child h3 {
    margin-bottom: 14px;
}

.social-ultra {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

.social-ultra a {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 13px;
    color: #eefaff;
    font-size: 18px !important;
    line-height: 1;
    transform: none;
}

.social-ultra a i {
    display: block;
    width: 1em;
    height: 1em;
    line-height: 1em;
    text-align: center;
    font-size: 1em;
}

.social-ultra a:hover {
    transform: translateY(-3px) !important;
}

.footer-bottom-ultra {
    line-height: 1.65;
}

@media (max-width: 900px) {
    .footer-box-ultra:last-child {
        justify-self: start;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .news-hub-title {
        gap: 9px;
        font-size: clamp(1.9rem, 10vw, 2.75rem) !important;
    }

    .news-hub-title::after {
        bottom: -8px;
        width: 72%;
    }

    .footer-container-ultra {
        text-align: left;
    }

    .footer-box-ultra:last-child {
        justify-self: stretch;
    }

    .social-ultra {
        gap: 9px;
    }

    .social-ultra a {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px;
        min-height: 40px;
        border-radius: 12px;
        font-size: 16px !important;
    }
}


/* =========================
   HERO / PAGE-BANNER CTA LINKS
   Keep Quick Tools and Open App visually consistent
   with the primary AI Tools CTA.
========================= */
.hero .hero-btn + .hero-btn,
.page-banner .hero-btn + .hero-btn {
    margin-left: 8px;
}

.page-banner .hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .hero .hero-btn,
    .page-banner .hero-btn {
        margin-left: 4px;
        margin-right: 4px;
    }
}
