/*
  xqgauas.cn overrides and additions on top of TemplateMo 619 Axis Industrial.
  Design tokens stay in templatemo-axis-industrial.css.
*/
:root {
    --header-h: 56px;
    --fs-hero: clamp(2.8rem, 13vw, 7.2rem);
    --cn: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: "JetBrains Mono", var(--cn), monospace, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.font-display,
.header__logo,
.footer__logo,
.footer__brand-name,
.stack__card-step,
.bento-card__title,
.hero__title,
.section__title {
    font-family: "Space Grotesk", var(--cn), sans-serif;
}

/* Chinese headings should not rely on Latin uppercase tracking */
.hero__title,
.section__title,
.stack__card-title,
.bento-card__title,
.page-head__title,
.work-hero__title {
    text-transform: none;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.header {
    background: #000000;
    color: #ffffff;
    height: var(--header-h);
    border-bottom: 2px solid var(--safety);
}

.header__logo {
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: #ffffff;
    text-transform: none;
}

.header__logo-text { color: #ffffff; }

.header__logo-mark {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

.header__product {
    font-size: 0.68rem;
    opacity: 0.75;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 0.08em;
    max-width: 12rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header__nav a {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.88);
    min-height: var(--header-h);
    padding: 0 1rem;
}

.header__nav a:hover,
.header__nav a:focus-visible {
    background: var(--safety);
    color: #ffffff;
    outline: none;
}

.header__nav a.active,
.header__nav a.is-active,
.header__nav a[aria-current="page"] {
    background: var(--safety);
    color: #ffffff;
}

.header__clock {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.68rem;
    opacity: 1;
    min-width: 8.5em;
}

.header__burger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.header__burger span { background: #ffffff; }

/* Inner pages sit below the fixed header */
.page-head {
    padding: calc(var(--header-h) + 3.5rem) clamp(1rem, 4vw, 4rem) 3rem;
    border-bottom: var(--border);
    background: var(--surface);
    position: relative;
}

.page-head__kicker {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--safety);
    margin-bottom: 0.8rem;
}

.page-head__title {
    font-size: var(--fs-h1);
    margin-bottom: 1rem;
}

.page-head__lead {
    max-width: 40rem;
    font-size: var(--fs-data);
    line-height: 1.85;
    opacity: 0.72;
}

/* Tabs */
.tabset-wrap { margin-top: 1.5rem; }

.tabset {
    display: flex;
    flex-wrap: wrap;
    border: var(--border);
    background: #000000;
    box-shadow: var(--shadow);
}

.tabset [role="tab"] {
    flex: 1 1 8rem;
    min-height: 48px;
    background: #000000;
    color: rgba(255, 255, 255, 0.9);
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    font-family: "JetBrains Mono", var(--cn), monospace, sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 0.75rem 1.1rem;
}

.tabset [role="tab"]:last-child { border-right: 0; }

.tabset [role="tab"]:hover,
.tabset [role="tab"]:focus-visible {
    background: #1a1a1a;
    outline: 2px solid var(--safety);
    outline-offset: -2px;
}

.tabset [role="tab"][aria-selected="true"],
.tabset [role="tab"].active {
    background: var(--safety);
    color: #ffffff;
}

.tab-panels {
    border: var(--border);
    border-top: 0;
    background: var(--base);
    padding: clamp(1.2rem, 3vw, 2rem);
    box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-panel h3 {
    font-size: var(--fs-h3);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 0.8rem;
}

.tab-panel p,
.tab-panel li {
    font-size: var(--fs-data);
    line-height: 1.85;
    opacity: 0.82;
}

.tab-panel ul {
    list-style: disc;
    padding-left: 1.2rem;
    margin-top: 0.6rem;
}

.tab-panel li { margin: 0.35rem 0; }

/* Cards / service direction */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.dir-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border: var(--border);
    box-shadow: var(--shadow);
    background: var(--base);
    padding: clamp(1.2rem, 3vw, 2rem);
    color: inherit;
    min-height: 100%;
}

.dir-card:hover,
.dir-card:focus-visible {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--ink);
    outline: none;
}

.dir-card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink);
}

.dir-card__no {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    color: var(--safety);
}

.dir-card__title {
    font-size: var(--fs-h3);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}

.dir-card__text {
    font-size: var(--fs-data);
    line-height: 1.8;
    opacity: 0.72;
    flex: 1;
}

.dir-card__go {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--safety);
}

/* Content typography */
.prose { max-width: 44rem; }
.prose h2, .prose h3 {
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
    margin: 1.6rem 0 0.7rem;
}
.prose p { font-size: var(--fs-data); line-height: 1.9; margin: 0.7rem 0; opacity: 0.82; }
.prose ul { list-style: disc; padding-left: 1.2rem; }
.prose li { font-size: var(--fs-data); line-height: 1.8; margin: 0.35rem 0; opacity: 0.82; }

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
}

.btn:focus-visible {
    outline: 3px solid var(--safety);
    outline-offset: 3px;
}

/* Footer contrast */
.footer { background: #000000; color: #ffffff; }
.footer__brand-name { text-transform: none; letter-spacing: 0; line-height: 1.15; color: #ffffff; }
.footer__brand-desc { opacity: 0.8; }
.footer__col-title { color: #ffffff; opacity: 1; text-transform: none; letter-spacing: 0.08em; }
.footer__col a, .footer__copy, .footer__legal {
    color: rgba(255, 255, 255, 0.88);
    opacity: 1;
    text-transform: none;
    letter-spacing: 0.02em;
}
.footer__col a:hover, .footer__copy a:hover { color: var(--safety); }
.footer__legal { margin-top: 1.2rem; font-size: 0.78rem; line-height: 1.8; }
.footer__legal a { text-decoration: underline; }
.footer__legal .legal-name { display: block; margin-bottom: 0.2rem; }
.footer__wordmark {
    font-family: "Space Grotesk", var(--cn), sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer__bottom {
    align-items: flex-start;
    gap: 1rem;
}

/* Toast */
.site-toast {
    position: fixed;
    left: 50%;
    bottom: 1.6rem;
    transform: translateX(-50%) translateY(120%);
    background: #000000;
    color: #ffffff;
    border: 4px solid var(--safety);
    box-shadow: var(--shadow-safety);
    padding: 0.75rem 1.2rem;
    z-index: 2000;
    min-width: 10rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.site-toast.is-on {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Work detail */
.work-hero__meta { font-size: 0.75rem; color: var(--safety); letter-spacing: 0.12em; margin-bottom: 0.6rem; }

/* Contact list */
.contact-list { display: grid; gap: 1rem; margin-top: 1.2rem; }
.contact-item {
    border: var(--border);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.3rem;
    background: var(--base);
}
.contact-item__label { font-size: 0.72rem; letter-spacing: 0.12em; color: var(--safety); margin-bottom: 0.35rem; }
.contact-item a { word-break: break-all; text-decoration: underline; }

/* Note / disclaimer */
.note {
    font-size: 0.82rem;
    line-height: 1.7;
    opacity: 0.7;
    border-left: 4px solid var(--safety);
    padding-left: 0.8rem;
    margin-top: 1.2rem;
}

/* Bento as links */
a.bento-card { color: inherit; }
a.bento-card .bento-card__title { text-transform: none; letter-spacing: 0; line-height: 1.25; }

/* Stack cards follow new header height */
.stack__card { top: calc(var(--header-h) + 16px); }
.stack__card:nth-child(2) { top: calc(var(--header-h) + 46px); }
.stack__card:nth-child(3) { top: calc(var(--header-h) + 76px); }
.stack__card:nth-child(4) { top: calc(var(--header-h) + 106px); }
.stack__card-title { text-transform: none; letter-spacing: 0; line-height: 1.2; }

.hero__desc { opacity: 0.78; max-width: 36rem; }

@media (max-width: 1100px) {
    .header__product { display: none; }
}

@media (max-width: 900px) {
    .header__nav { display: none; }
    .header__burger { display: flex; }
    .header__nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        height: auto;
        background: #000000;
        border-bottom: 2px solid var(--safety);
        overflow-y: auto;
        max-height: calc(100svh - var(--header-h));
        z-index: 1001;
    }
    .header__nav.open a {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        min-height: 48px;
        padding: 0.9rem 1.2rem;
        color: rgba(255,255,255,0.92);
        font-size: 1rem;
    }
    .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header__clock { display: none; }
    :root { --fs-hero: clamp(2.4rem, 14vw, 3.6rem); }
}

@media (max-width: 375px) {
    :root { --fs-hero: 2.2rem; }
    .header { padding: 0 0.7rem; }
    .tabset [role="tab"] { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
}

@media (prefers-reduced-motion: reduce) {
    .hero__title { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}
