:root {
    overflow-wrap: anywhere;
}

body img {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

iframe[src*="youtube.com/embed/"],
iframe[src*="youtube-nocookie.com/embed/"] {
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}

p[style*="width:"], pre {
    max-width: 100%;
}

pre {
    white-space: pre-wrap;
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.top-header .menu-toggle {
    display: none;
}

.top-header .nav-disclosure {
    width: 100%;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.top-header .nav-menu .dropdown-menu,
.top-header .nav-menu .submenu {
    display: none;
}

.top-header .nav-menu [aria-expanded="true"] + ul {
    display: block;
}

.top-header .nav-menu .submenu a {
    display: block;
    padding: .5rem .65rem;
}

@media (min-width: 1101px) and (hover: hover) and (pointer: fine) {
    .top-header .dropdown-menu {
        width: min(21rem, 35vw);
        max-height: 70vh;
        overflow: auto;
    }

    .top-header .nav-menu .submenu {
        position: static;
        min-width: 0;
        margin-inline: .75rem;
        box-shadow: none;
    }
}

@media (max-width: 1100px), (hover: none), (pointer: coarse) {
    .top-header {
        position: static;
    }

    .top-header .header-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .65rem;
        padding: .75rem;
    }

    .top-header .logo-area {
        min-width: 0;
        gap: .5rem;
    }

    .top-header .logo-area img {
        height: 36px;
        max-width: 32%;
        object-fit: contain;
    }

    .top-header .logo-text h1 {
        font-size: 1.05rem;
    }

    .top-header .logo-text p {
        font-size: .75rem;
    }

    .top-header .menu-toggle {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: .5rem .7rem;
        border: 1px solid #cbd5e1;
        border-radius: .5rem;
        background: #fff;
        color: #1e3a8a;
        font: inherit;
        cursor: pointer;
    }

    .top-header .main-nav,
    .top-header .social-contacts {
        grid-column: 1 / -1;
    }

    .top-header .main-nav {
        display: block;
    }

    .top-header .menu-toggle[aria-expanded="false"] + .main-nav {
        display: none;
    }

    .top-header .nav-menu {
        display: block;
        padding: 0;
    }

    .top-header .nav-menu .dropdown-menu,
    .top-header .nav-menu .submenu {
        position: static;
        min-width: 0;
        margin-inline-start: .65rem;
        box-shadow: none;
        animation: none;
    }

    .top-header .nav-menu a,
    .top-header .nav-disclosure,
    .top-header .social-btn {
        min-height: 44px;
    }

    .top-header .social-btn {
        min-width: 44px;
    }
}

@media (max-width: 600px) {
    .hero-section, .section-block {
        padding-block: 2rem;
    }

    .hero-title {
        font-size: clamp(1.65rem, 6vw, 2.25rem);
    }

    .hero-actions {
        flex-wrap: wrap;
    }

    .products-grid, .solutions-grid, .features-grid, .use-cases-grid,
    .stats-container, .footer-container, .grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .main-container, .section-container, .footer-container {
        padding-inline: .875rem;
    }

}

/* Product page titles */
.product-heading {
    color: #112b48;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: clamp(1.75rem, 1.2rem + 2.35vw, 3.15rem);
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: .018em;
    text-wrap: balance;
}

.product-heading::before {
    content: "";
    display: block;
    width: 3rem;
    height: .2rem;
    margin-bottom: .9rem;
    border-radius: 99px;
    background: linear-gradient(90deg, #1671df, #07a99e);
}

.product-heading__details {
    display: block;
    margin-top: .65rem;
    color: #405977;
    font-size: clamp(.875rem, .8rem + .45vw, 1.15rem);
    font-weight: 500;
    line-height: 1.75;
    letter-spacing: normal;
    text-wrap: wrap;
}

.product-heading__model {
    display: inline-block;
    padding: .08em .45em;
    border: 1px solid #9acddd;
    border-radius: .35rem;
    background: #edf9fb;
    color: #075467;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-weight: 700;
    letter-spacing: .045em;
    white-space: nowrap;
}

.product-heading--light {
    color: #fff;
}

.product-heading--light::before {
    background: linear-gradient(90deg, #85caff, #69f1db);
}

@media (max-width: 760px) {
    .page-content:has(.product-heading) {
        margin: 1rem auto;
        padding: 1.25rem 1rem;
        font-size: 1rem;
        line-height: 1.9;
    }

    .page-content:has(.product-heading) :is(p, li, dd) {
        /* Legacy product descriptions set font sizes and line heights inline. */
        font-size: 1rem !important;
        line-height: 1.9 !important;
        letter-spacing: .02em;
    }

    .page-content:has(.product-heading) :is(p, li, dd) :is(span, strong, b, font) {
        font-size: inherit !important;
        line-height: inherit !important;
    }

    .page-content:has(.product-heading) p {
        margin-block-end: 1rem !important;
    }

    .page-content:has(.product-heading) :is(ul, ol) {
        padding-inline-start: 1.4rem;
        margin-block: .75rem 1.15rem;
    }

    .page-content:has(.product-heading) li + li {
        margin-block-start: .45rem;
    }

    .page-content:has(.product-heading) :is(h2, h3, h4) {
        margin-block: 1.35rem .55rem;
        line-height: 1.5;
    }

    .page-content:has(.product-heading) hr {
        margin-block: 1.35rem;
    }

    main:has(.product-heading--light) :is(p, li) {
        line-height: 1.85;
    }

    main:has(.product-heading--light) li + li {
        margin-block-start: .45rem;
    }
}

@media (min-width: 1101px) and (hover: hover) and (pointer: fine) {
    .top-header .header-container:has(.product-navigation) {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: .75rem;
    }

    .top-header .product-navigation {
        justify-content: center;
    }

    .top-header .product-navigation > .nav-menu {
        gap: .25rem;
    }

    .top-header .product-navigation > .nav-menu > li > .nav-link {
        padding-inline: .65rem;
        white-space: nowrap;
    }

    .top-header .product-navigation__entry > .nav-link {
        color: #b91c1c;
        background: #fff1f2;
    }

    .top-header .product-navigation__entry > .nav-link:is(:hover, [aria-expanded="true"]) {
        background: #ffe4e6;
    }

    .top-header .product-navigation__entry > .dropdown-menu {
        width: clamp(16.25rem, 23vw, 19rem);
        max-height: none;
        overflow: visible;
    }

    .top-header .product-navigation__entry .has-submenu {
        position: relative;
    }

    .top-header .product-navigation__entry .submenu {
        position: absolute;
        inset: 0 auto auto 100%;
        width: max-content;
        min-width: 19rem;
        max-width: 42vw;
        white-space: nowrap;
        max-height: 70vh;
        margin: 0;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
    }
}

@media (max-width: 1100px), (hover: none), (pointer: coarse) {
    .top-header .header-container:has(.product-navigation) {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .top-header .header-container:has(.product-navigation) .logo-area {
        grid-area: 1 / 1 / 2 / -1;
    }

    .top-header .menu-toggle:has(+ .product-navigation) {
        grid-area: 2 / 1;
        color: #b91c1c;
        border-color: #fecaca;
        background: #fff1f2;
        font-weight: 800;
        white-space: nowrap;
    }

    .top-header .product-navigation {
        grid-area: 3 / 1 / 4 / -1;
    }

    .top-header .product-navigation + .social-contacts {
        grid-area: 2 / 2;
        justify-content: flex-end;
        gap: clamp(.2rem, 1.3vw, .6rem);
    }

    .top-header .product-navigation + .social-contacts .social-btn {
        width: 44px;
        flex: 0 0 44px;
    }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 1100px),
       (prefers-reduced-motion: no-preference) and (hover: none),
       (prefers-reduced-motion: no-preference) and (pointer: coarse) {
    .top-header .menu-toggle:has(+ .product-navigation)[aria-expanded="false"] {
        animation: guide-menu-glow 1.6s ease-in-out 3;
    }
}

@keyframes guide-menu-glow {
    0%, 100% { box-shadow: 0 0 0 0 #ef444400; }
    50% { box-shadow: 0 0 .65rem .12rem #ef44445c; }
}

.top-header .logo-home {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
}

.top-header .logo-home img {
    display: block;
    max-width: 100%;
}
