:root {
    --bg: #0b0c0f;
    --bg-alt: #11131a;
    --panel: #161922;
    --line: rgba(197, 212, 220, 0.14);
    --text: #e8e6e1;
    --muted: #9a958c;
    --ice: #c5d4dc;
    --ice-strong: #dce7ec;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --max: 1180px;
    --narrow: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: radial-gradient(1200px 700px at 80% -10%, rgba(197, 212, 220, 0.08), transparent 50%), var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans", "Noto Sans TC", "Noto Sans SC", sans-serif;
    font-size: 18px;
    line-height: 1.65;
    min-height: 100vh;
}
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--muted); }
a { color: var(--ice); text-decoration: none; }
a:hover { color: var(--ice-strong); }
.shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(var(--narrow), calc(100% - 40px)); }
.sr-only, .hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ice);
    color: var(--bg);
    padding: 8px 12px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 80; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(16px);
    background: rgba(11, 12, 15, 0.78);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 24px;
}
.wordmark { display: flex; align-items: center; line-height: 0; }
.brand-logo { display: block; height: 42px; width: auto; }
.brand-logo-footer { height: 48px; margin-bottom: 12px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-list a { color: var(--muted); font-size: 12px; letter-spacing: 0.03em; white-space: nowrap; }
.nav-list a.is-active, .nav-list a:hover { color: var(--text); }
.nav-tools { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; gap: 8px; font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.lang-switch a { color: var(--muted); }
.lang-switch a.is-active { color: var(--ice-strong); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; }
.nav-toggle-bar { display: block; width: 18px; height: 1px; background: var(--text); margin: 5px 0; }

.btn[hidden] { display: none !important; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font: inherit;
    font-size: 14px;
    letter-spacing: 0.02em;
    cursor: pointer;
}
.btn-primary { background: var(--ice); color: #11141a; border-color: transparent; }
.btn-primary:hover { background: var(--ice-strong); color: #11141a; }
.btn-ghost { background: transparent; color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero {
    position: relative;
    isolation: isolate;
    padding: 72px 0 40px;
}
.hero::before {
    content: "";
    position: absolute;
    inset: -40px 0 auto auto;
    width: min(58vw, 760px);
    height: 520px;
    background: url("/public/images/visual-core.jpg") center / cover no-repeat;
    opacity: 0.22;
    -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 28%, transparent 74%);
    mask-image: radial-gradient(ellipse at 70% 30%, #000 28%, transparent 74%);
    pointer-events: none;
    z-index: -1;
}
.hero-grid, .contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}
.kicker {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ice);
    margin-bottom: 14px;
}
.lede { font-size: 1.15rem; color: var(--text); max-width: 40rem; }
.page-hero { padding: 72px 0 80px; }
.crumb { font-size: 13px; margin-bottom: 18px; }
.badge {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--ice);
    margin-bottom: 20px;
}

.block { padding: 88px 0; }
.block-alt { background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); }
.closer { border-top: 1px solid var(--line); }

.chip-list, .arch-pills, .env-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
}
.chip-list li, .arch-pills li, .env-pills li {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 36px 0;
}
.card-grid.five { grid-template-columns: repeat(5, 1fr); }
.card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    color: inherit;
    box-shadow: var(--shadow);
    min-height: 100%;
}
.card h2, .card h3 { font-size: 1.15rem; color: var(--text); }
.card:hover { border-color: rgba(197, 212, 220, 0.35); }

.cycle, .levels, .funnel {
    list-style: none;
    padding: 0;
    margin: 36px 0;
    display: grid;
    gap: 14px;
}
.cycle { grid-template-columns: repeat(5, 1fr); }
.levels { grid-template-columns: repeat(3, 1fr); }
.cycle li, .levels li, .funnel li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.cycle span, .levels span, .funnel li {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    color: var(--ice);
}
.delivery, .emphasis {
    color: var(--text);
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}
.fine { font-size: 14px; }
.text-link { display: inline-block; margin-top: 16px; }

.link-rows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 28px;
}
.link-rows a {
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    color: var(--text);
}

.name-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 32px 0;
}
.name-list li {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.name-list strong { color: var(--text); }
.name-list span, .name-list em { font-size: 13px; color: var(--muted); font-style: normal; }
.name-list.tall { grid-template-columns: 1fr; }

.brain-core { margin: 0; }
.brain-core svg { width: 100%; height: auto; overflow: visible; }
.core-hex {
    fill: none;
    stroke: var(--ice);
    stroke-width: 0.6;
}
.core-dot, .node-dot { fill: var(--ice-strong); }
.core-link {
    stroke: rgba(197, 212, 220, 0.35);
    stroke-width: 0.35;
    stroke-dasharray: 2 3;
    animation: flow 8s linear infinite;
}
.node-label {
    fill: var(--muted);
    font-size: 3.2px;
    font-family: "IBM Plex Sans", "Noto Sans TC", "Noto Sans SC", sans-serif;
}
@keyframes flow { to { stroke-dashoffset: -40; } }

.arch { margin: 40px 0; display: grid; gap: 12px; }
.arch-layer, .arch-brain {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    background: var(--panel);
}
.arch-brain { background: linear-gradient(180deg, rgba(197,212,220,0.08), var(--panel)); }
.arch-kicker {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ice);
    margin: 0 0 10px;
}
.arch-stages { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.arch-stages li { display: grid; gap: 2px; }
.arch-stages span { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ice); }
.arch-stages strong { color: var(--text); font-weight: 500; }
.arch-arrow {
    width: 1px;
    height: 18px;
    margin: 0 auto;
    background: var(--ice);
    opacity: 0.4;
}

.contact-form, .ask-lead, .ask-form { display: grid; gap: 12px; }
.contact-form label, .ask-lead label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea {
    width: 100%;
    background: #0e1016;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
}
input:focus, textarea:focus { outline: 1px solid var(--ice); }
.form-status { color: var(--ice); }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 56px 0 28px;
    background: var(--bg-alt);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 32px; }
.footer-brand { color: var(--text); letter-spacing: 0.14em; font-size: 13px; font-weight: 700; }
.footer-strap, .footer-prop { color: var(--muted); }
.footer-label { color: var(--text); margin-bottom: 8px; }
.site-address {
    font-style: normal;
    color: var(--muted);
    line-height: 1.45;
    margin: 0 0 1em;
}
.visual-break {
    margin: 32px 0 8px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #08090c;
}
.visual-break img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.page-hero .visual-break { margin: 28px 0 36px; }
.visual-inset { margin: 20px 0 0; }
.footer-nav { display: grid; gap: 8px; }
.footer-copy {
    margin-top: 36px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-legal a { color: var(--muted); }
.cookie-bar {
    position: fixed;
    left: 20px;
    bottom: 22px;
    z-index: 45;
    width: min(420px, calc(100% - 96px));
    background: #141822;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.cookie-bar p { margin: 0 0 12px; font-size: 14px; }
.cookie-bar-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cookie-bar-actions a { font-size: 14px; }

.float-actions {
    position: fixed;
    right: 20px;
    bottom: 22px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.float-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #141822;
    color: var(--ice-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    padding: 0;
}
.float-btn svg { width: 22px; height: 22px; display: block; }
.float-btn.ask-open {
    background: var(--ice);
    color: #11141a;
    border-color: transparent;
}
.float-btn:hover { color: var(--text); border-color: rgba(197, 212, 220, 0.4); }
.float-btn.ask-open:hover { color: #11141a; background: var(--ice-strong); }
.float-btn[hidden] { display: none !important; }
.ask-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 8, 0.62);
    z-index: 60;
    display: none;
    justify-content: flex-end;
}
.ask-overlay.is-open {
    display: flex;
}
.ask-lead[hidden],
.ask-form[hidden] {
    display: none;
}
.ask-panel {
    position: relative;
    width: min(460px, 100%);
    height: 100%;
    background: #10131a;
    border-left: 1px solid var(--line);
    padding: 28px;
    overflow: auto;
}
.ask-panel-wide { width: min(560px, 100%); padding-top: 48px; }
.ask-panel-wide .brain-enquire {
    border: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
}
.ask-panel-wide .brain-enquire::after { display: none; }
.ask-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ask-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: 0;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
}
.ask-note { font-size: 13px; }
.ask-thread { display: grid; gap: 12px; margin: 20px 0; }
.ask-bubble { padding: 12px 14px; border-radius: 14px; font-size: 15px; }
.ask-bubble.user { background: #1a2030; color: var(--text); }
.ask-bubble.brain { background: var(--panel); border: 1px solid var(--line); color: var(--muted); }

.page-hero .contact-grid { align-items: start; }
.brain-enquire {
    position: relative;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
    background:
        radial-gradient(420px 220px at 100% 0%, rgba(197, 212, 220, 0.08), transparent 55%),
        linear-gradient(180deg, #141822, #10131a);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 22px 22px 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.brain-enquire::after {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(197, 212, 220, 0.45), transparent);
    animation: enquire-scan 4.8s linear infinite;
}
.brain-enquire-orbit { align-self: start; }
.brain-enquire-core { width: 92px; height: 92px; }
.enquire-halo { animation: enquire-breathe 3.6s ease-in-out infinite; transform-origin: 50px 50px; }
.enquire-pulse { animation: enquire-pulse 1.8s ease-in-out infinite; }
.brain-enquire-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.brain-enquire-head h2 { margin: 0; font-size: 1.25rem; }
.brain-enquire-status {
    margin: 0;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ice);
}
.brain-enquire-status::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--ice-strong);
    box-shadow: 0 0 10px var(--ice);
    animation: enquire-pulse 1.8s ease-in-out infinite;
}
.brain-enquire-thread {
    display: grid;
    gap: 10px;
    min-height: 168px;
    max-height: 340px;
    overflow: auto;
    padding-right: 4px;
    margin-bottom: 14px;
}
.brain-pop { animation: brain-pop 0.42s ease both; }
.typing-bubble { display: inline-flex; gap: 5px; align-items: center; min-height: 20px; }
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ice);
    animation: typing 1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
.brain-enquire.is-guided .brain-field { display: none; }
.brain-enquire.is-guided .brain-field.is-active { display: grid; gap: 6px; animation: brain-pop 0.35s ease; }
.brain-composer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.brain-enquire.is-complete .brain-enquire-form { display: none; }
.captcha-field { display: grid; gap: 8px; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-image {
    display: block;
    width: 228px;
    height: 72px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #0e1016;
}
@keyframes enquire-breathe {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
@keyframes enquire-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.35); opacity: 1; }
}
@keyframes enquire-scan {
    0% { transform: translateY(0); opacity: 0; }
    15% { opacity: 0.8; }
    100% { transform: translateY(520px); opacity: 0; }
}
@keyframes brain-pop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@keyframes typing {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 820px) {
    .hero-grid, .contact-grid, .footer-grid, .card-grid, .card-grid.five, .cycle, .levels, .name-list, .link-rows {
        grid-template-columns: 1fr;
    }
    .nav-toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 76px;
        background: #0d0f14;
        border-bottom: 1px solid var(--line);
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav.is-open { display: flex; }
    .nav-list { flex-direction: column; }
    .brain-enquire { grid-template-columns: 1fr; }
    .brain-enquire-core { width: 72px; height: 72px; }
    .cookie-bar { left: 16px; right: 16px; bottom: 88px; width: auto; }
}
