/* ============================================
   XIHAI INTELLIGENT — Landing Page Styles
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-0: #05070d;
    --bg-1: #0a0f1e;
    --bg-2: #0f1730;
    --line: rgba(100, 180, 255, 0.12);
    --line-strong: rgba(120, 200, 255, 0.35);
    --text: #e6f1ff;
    --text-dim: #8ba3c7;
    --text-soft: #5e7394;
    --cyan: #00e5ff;
    --blue: #4b8bff;
    --purple: #a77bff;
    --pink: #ff5cc8;
    --grad: linear-gradient(135deg, #00e5ff 0%, #4b8bff 45%, #a77bff 100%);
    --grad-soft: linear-gradient(135deg, rgba(0,229,255,.14), rgba(167,123,255,.14));
    --mono: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
    --cn: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--cn);
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(0,229,255,.12), transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(167,123,255,.10), transparent 50%),
        radial-gradient(ellipse at 50% 85%, rgba(75,139,255,.10), transparent 55%),
        var(--bg-0);
    z-index: -3;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ---------- Canvas + overlays ---------- */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 0.55;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

.scanline {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,229,255,0.04) 50%, transparent 100%);
    background-size: 100% 8px;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% { background-position: 0 0; }
    100% { background-position: 0 100vh; }
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 18px 0;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(5, 7, 13, 0.55);
    border-bottom: 1px solid var(--line);
    transition: all .3s ease;
}

.site-header.scrolled {
    padding: 12px 0;
    background: rgba(5, 7, 13, 0.85);
    border-bottom-color: var(--line-strong);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-img { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(0,229,255,.6)); }

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-cn { font-size: 18px; font-weight: 700; letter-spacing: 2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-en { font-size: 10px; font-family: var(--mono); color: var(--text-soft); letter-spacing: 1.5px; margin-top: 2px; }

.main-nav { display: flex; gap: 36px; }

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    position: relative;
    padding: 6px 0;
    transition: color .25s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--grad);
    transition: width .3s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--cyan);
    padding: 6px 14px;
    border: 1px solid rgba(0,229,255,.3);
    border-radius: 100px;
    background: rgba(0,229,255,.06);
}

.dot-live {
    width: 7px; height: 7px; border-radius: 50%;
    background: #00ff9d;
    box-shadow: 0 0 8px #00ff9d, 0 0 16px rgba(0,255,157,.4);
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.85); }
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

.hero-svg {
    position: absolute;
    opacity: 0.35;
    filter: drop-shadow(0 0 20px rgba(0,229,255,.3));
}
.hero-svg-left { left: -80px; top: 20%; width: 420px; animation: float 12s ease-in-out infinite; }
.hero-svg-right { right: -100px; top: 10%; width: 520px; animation: spinSlow 80s linear infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(2deg); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-inner { position: relative; z-index: 2; }

.hero-tag { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }

.tag-chip {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    padding: 6px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--cyan);
    background: rgba(0,229,255,.05);
    position: relative;
}
.tag-chip-alt { color: var(--purple); border-color: rgba(167,123,255,.3); background: rgba(167,123,255,.05); }

.hero-title {
    font-size: clamp(42px, 7.5vw, 96px);
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.05;
    margin-bottom: 28px;
}

.hero-line { display: block; }

.hero-line.glitch {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    text-shadow: 0 0 40px rgba(0,229,255,.25);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    background: var(--bg-0);
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0.8;
}
.glitch::before {
    color: var(--cyan);
    animation: glitchTop 3.6s infinite steps(2, end);
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    transform: translate(-2px, -1px);
    mix-blend-mode: lighten;
}
.glitch::after {
    color: var(--pink);
    animation: glitchBot 4.2s infinite steps(2, end);
    clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
    transform: translate(2px, 1px);
    mix-blend-mode: lighten;
}

@keyframes glitchTop {
    0%, 92%, 100% { transform: translate(0,0); }
    93% { transform: translate(-3px, -2px); }
    95% { transform: translate(2px, 1px); }
    97% { transform: translate(-2px, 1px); }
}
@keyframes glitchBot {
    0%, 90%, 100% { transform: translate(0,0); }
    91% { transform: translate(3px, 2px); }
    94% { transform: translate(-2px, -1px); }
    96% { transform: translate(2px, -1px); }
}

.hero-en {
    font-family: var(--mono);
    font-size: clamp(12px, 1.4vw, 18px);
    font-weight: 400;
    letter-spacing: 8px;
    color: var(--text-soft);
    margin-top: 8px;
}

.hero-sub {
    font-size: 16px;
    color: var(--text-dim);
    max-width: 620px;
    margin-bottom: 40px;
    line-height: 1.9;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 72px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn svg { width: 16px; height: 16px; transition: transform .3s ease; }

.btn-primary {
    background: var(--grad);
    color: #05070d;
    box-shadow: 0 0 0 rgba(0,229,255,0), 0 8px 24px rgba(0,229,255,.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0,229,255,.5), 0 12px 30px rgba(167,123,255,.35);
}
.btn-primary:hover svg { transform: translateX(4px); }

.btn-ghost {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(255,255,255,0.02);
}
.btn-ghost:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0,229,255,.05);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    max-width: 640px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 24px 0;
}

.stat { padding: 0 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat:first-child { padding-left: 0; }

.stat-num {
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--text-soft);
    font-family: var(--mono);
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--text-soft);
}
.scroll-bar { width: 1px; height: 50px; background: linear-gradient(to bottom, var(--cyan), transparent); position: relative; overflow: hidden; }
.scroll-bar::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: var(--cyan);
    animation: scrollDown 2s ease-in-out infinite;
}
@keyframes scrollDown {
    0% { top: -20px; }
    100% { top: 60px; }
}

/* ---------- Section head ---------- */
.section-head { margin-bottom: 72px; position: relative; }

.section-index {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--cyan);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(34px, 5vw, 64px);
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 10px;
    line-height: 1.1;
}
.accent {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-en {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--text-soft);
}

/* ---------- About ---------- */
.about { padding: 140px 0; position: relative; }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-text .lead {
    font-size: 22px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 28px;
    line-height: 1.7;
    letter-spacing: 1px;
}

.about-text p { color: var(--text-dim); font-size: 15px; margin-bottom: 18px; line-height: 1.9; }

.about-visual {
    position: relative;
    aspect-ratio: 1 / 1;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neural-img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(0,229,255,.25));
    animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: .9; }
    50% { transform: scale(1.03); opacity: 1; }
}

.about-badge {
    position: absolute;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-ring {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(0,229,255,.5);
    border-radius: 50%;
    animation: spinSlow 30s linear infinite;
}
.badge-ring::before, .badge-ring::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
}
.badge-ring::before { top: -4px; left: 50%; transform: translateX(-50%); }
.badge-ring::after { bottom: -4px; left: 50%; transform: translateX(-50%); background: var(--purple); box-shadow: 0 0 10px var(--purple); }

.badge-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,229,255,.15) 0%, rgba(5,7,13,.8) 70%);
    border: 1px solid var(--line-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.badge-text {
    font-size: 28px;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.badge-sub {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-soft);
    margin-top: 4px;
}

/* ---------- Services ---------- */
.services {
    padding: 140px 0;
    background: linear-gradient(180deg, transparent, rgba(10,15,30,0.5), transparent);
    position: relative;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    padding: 40px 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(15,23,48,0.6), rgba(10,15,30,0.3));
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    transition: all .4s ease;
    cursor: default;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-soft);
    opacity: 0;
    transition: opacity .4s ease;
    z-index: 0;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 2px;
    background: var(--grad);
    transition: left .6s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    box-shadow: 0 20px 60px rgba(0,229,255,.08), 0 10px 30px rgba(167,123,255,.08);
}
.service-card:hover::before { opacity: 1; }
.service-card:hover::after { left: 0; }

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

.card-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0,229,255,.08);
    border: 1px solid rgba(0,229,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-icon img { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(0,229,255,.5)); }

.card-num {
    position: absolute;
    top: 32px;
    right: 36px;
    font-family: var(--mono);
    font-size: 56px;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1px rgba(120,200,255,.18);
    line-height: 1;
    z-index: 0;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.card-en {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--cyan);
    margin-bottom: 18px;
}

.card-desc {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.card-tags span {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text-dim);
    background: rgba(255,255,255,.02);
}

/* ---------- Tech strip ---------- */
.tech-strip {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 28px 0;
    overflow: hidden;
    background: rgba(10,15,30,0.3);
    position: relative;
}

.strip-track {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    animation: marquee 40s linear infinite;
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: 6px;
    color: var(--text-dim);
}
.strip-track span {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.strip-track .dot { color: var(--text-soft); -webkit-text-fill-color: var(--text-soft); }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Contact ---------- */
.contact { padding: 140px 0; position: relative; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-card {
    padding: 28px 32px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(15,23,48,0.5), rgba(10,15,30,0.2));
    backdrop-filter: blur(6px);
    position: relative;
    transition: all .35s ease;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--grad);
    opacity: 0;
    transition: opacity .3s ease;
}

.info-card:hover { border-color: var(--line-strong); transform: translateX(4px); }
.info-card:hover::before { opacity: 1; }

.info-main {
    grid-column: 1 / -1;
    padding: 40px 36px;
    background: linear-gradient(145deg, rgba(0,229,255,0.06), rgba(167,123,255,0.06));
    border-color: var(--line-strong);
}

.info-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--cyan);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-value {
    font-size: 17px;
    color: var(--text);
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.5;
}
.info-value.big {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.info-value.code { font-family: var(--mono); letter-spacing: 2px; }

.info-en-sub {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-soft);
    margin-top: 8px;
}

.info-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    opacity: 0.5;
    transition: opacity .3s ease;
}
.info-icon img { width: 100%; height: 100%; }
.info-card:hover .info-icon { opacity: 1; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.footer-glow {
    position: absolute;
    left: 50%;
    top: -1px;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
    opacity: 0.6;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.footer-logo img { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(0,229,255,.5)); }
.footer-logo span {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--text);
}

.footer-slogan {
    font-size: 13px;
    color: var(--text-soft);
    letter-spacing: 1px;
}

.footer-right { text-align: right; }
.footer-copy { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.footer-sub { font-family: var(--mono); font-size: 11px; color: var(--text-soft); letter-spacing: 1px; }

.footer-icp {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 2px;
}
.footer-icp a {
    color: var(--text-soft);
    text-decoration: none;
    transition: color .25s ease;
}
.footer-icp a:hover {
    color: var(--cyan);
}

/* ---------- Reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .9s ease, transform .9s ease;
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .nav-badge { display: none; }
    .about-grid { grid-template-columns: 1fr; gap: 60px; }
    .about-visual { max-width: 360px; }
    .service-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .info-main { grid-column: auto; }
    .hero-stats { grid-template-columns: 1fr; gap: 16px; }
    .stat { border-right: none; border-bottom: 1px solid var(--line); padding: 12px 0; }
    .stat:last-child { border-bottom: none; }
    .stat:first-child { padding-top: 0; }
    .hero-svg-left, .hero-svg-right { opacity: .15; width: 300px; }
    .hero-title { letter-spacing: 1px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-right { text-align: left; }
}

@media (max-width: 560px) {
    .container { padding: 0 20px; }
    .about, .services, .contact { padding: 90px 0; }
    .info-card { padding: 22px 24px; }
    .service-card { padding: 32px 24px; }
    .card-num { font-size: 44px; top: 24px; right: 24px; }
    .info-value.big { font-size: 22px; letter-spacing: 1px; }
    .btn { padding: 12px 22px; font-size: 13px; }
    .logo-cn { font-size: 16px; }
}
