:root {
    --paper: #fbfbfa;
    --ink: #141719;
    --muted: #62696b;
    --rule: #dfe2e1;
    --accent: #2254e6;
    --accent-soft: #e7edff;
    --max: 1320px;
}

@font-face {
    font-family: 'CoWeb Public Noto';
    src: url('/fonts/public-home-noto-sc.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }

body.public-home {
    margin: 0;
    min-width: 320px;
    overflow: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: 'CoWeb Public Noto', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.public-page {
    display: flex;
    flex-direction: column;
    width: min(calc(100% - 64px), var(--max));
    height: 100svh;
    min-height: 100svh;
    margin: 0 auto;
}

.public-nav {
    display: flex;
    flex: 0 0 76px;
    align-items: center;
    gap: 30px;
    border-bottom: 1px solid var(--rule);
}

.public-brand, .portal-link { color: inherit; text-decoration: none; }
.public-brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; color: #fff; background: var(--ink); font-size: 15px; font-weight: 500; }
.nav-line { position: relative; display: block; flex: 1; height: 1px; overflow: hidden; background: var(--rule); }
.nav-line i { position: absolute; top: 0; left: 0; width: 18%; height: 1px; background: var(--accent); animation: nav-scan 7s cubic-bezier(.22, 1, .36, 1) infinite; }

.public-main {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
    min-height: 0;
    padding: clamp(22px, 3.4vh, 38px) 0;
}

.public-intro {
    position: relative;
    z-index: 5;
    display: flex;
    min-width: 0;
    min-height: clamp(500px, 64vh, 620px);
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 5vh, 48px) 0 12px;
}
.public-intro h1 { margin: 0; font-size: clamp(58px, 6vw, 86px); font-weight: 500; letter-spacing: -.035em; line-height: .98; }
.public-intro h1 em { position: relative; color: var(--accent); font-style: normal; white-space: nowrap; }
.public-intro h1 em::after {
    position: absolute;
    top: 15%;
    right: -25px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--accent);
    content: '';
    transform: rotate(45deg);
    animation: node-blink 2.8s ease-in-out infinite;
}
.intro-rule {
    display: block;
    width: min(62%, 250px);
    margin-top: clamp(30px, 4.8vh, 48px);
    margin-bottom: auto;
    border-top: 1px solid var(--rule);
}

.portal-stage {
    position: relative;
    min-width: 0;
    min-height: clamp(500px, 64vh, 620px);
    isolation: isolate;
    perspective: 1200px;
}

.kinetic-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #fff;
    transform: perspective(1200px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
    transform-style: preserve-3d;
    transition: transform 620ms cubic-bezier(.16, 1, .3, 1), border-color 300ms ease;
}

.kinetic-field::before, .kinetic-field::after { position: absolute; content: ''; pointer-events: none; }
.kinetic-field::before { inset: 26px; border: 1px solid #eceeed; }
.kinetic-field::after { top: 26px; right: 26px; width: 12px; height: 12px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.field-axis { position: absolute; z-index: 1; display: block; background: var(--rule); }
.field-axis-horizontal { top: 50%; left: 9%; width: 82%; height: 1px; }
.field-axis-vertical { top: 9%; left: 50%; width: 1px; height: 82%; }
.field-orbit { position: absolute; top: 50%; left: 50%; display: block; border: 1px solid var(--accent); border-radius: 50%; }
.field-orbit-outer { width: min(66%, 410px); aspect-ratio: 1; transform: translate(-50%, -50%) rotateX(64deg) rotateZ(0); animation: orbit-outer 16s linear infinite; }
.field-orbit-inner { width: min(39%, 232px); aspect-ratio: 1; border-color: #cbd4f3; transform: translate(-50%, -50%) rotateY(65deg) rotateZ(28deg); animation: orbit-inner 11s linear infinite reverse; }
.field-core { position: absolute; top: 50%; left: 50%; display: grid; width: 92px; height: 92px; place-items: center; border-radius: 50%; background: var(--accent); box-shadow: 0 22px 44px rgba(34, 84, 230, .22); transform: translate(-50%, -50%) translate3d(var(--shift-x, 0), var(--shift-y, 0), 48px); transition: transform 650ms cubic-bezier(.16, 1, .3, 1), background-color 300ms ease; animation: core-breathe 4.8s ease-in-out infinite; }
.field-core::before, .field-core::after { position: absolute; content: ''; border: 1px solid #fff; border-radius: 50%; }
.field-core::before { inset: 23px; }
.field-core::after { inset: 34px; background: #fff; }
.field-core i { position: absolute; inset: -13px; border: 1px solid var(--accent); border-radius: 50%; opacity: .28; animation: core-wave 3.2s ease-out infinite; }

.field-node { position: absolute; z-index: 2; display: block; width: 12px; height: 12px; border: 2px solid var(--accent); background: #fff; transform: translate3d(var(--node-x, 0), var(--node-y, 0), 22px) rotate(45deg); transition: transform 680ms cubic-bezier(.16, 1, .3, 1); }
.field-node-a { top: 19%; left: 22%; }
.field-node-b { top: 27%; right: 18%; animation: node-blink 2.4s ease-in-out infinite; }
.field-node-c { right: 27%; bottom: 17%; }
.field-scan { position: absolute; z-index: 0; top: 0; left: 0; width: 1px; height: 100%; background: var(--accent); opacity: .18; animation: field-scan 8s cubic-bezier(.22, 1, .36, 1) infinite; }

.portal-links { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-link { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; min-height: 128px; padding: 18px 18px; border: 1px solid var(--ink); background: #fff; box-shadow: 0 18px 38px rgba(20, 23, 25, .1); transition: color 320ms ease, background-color 320ms ease, transform 480ms cubic-bezier(.16, 1, .3, 1), box-shadow 320ms ease; }
.portal-link-workspace { color: #fff; background: var(--accent); border-color: var(--accent); }
.portal-type { align-self: start; font-size: 9px; letter-spacing: .14em; opacity: .72; }
.portal-link strong { align-self: end; min-width: 0; font-size: clamp(21px, 1.85vw, 27px); font-weight: 500; letter-spacing: -.025em; }
.portal-arrow { grid-row: 1 / 3; grid-column: 2; align-self: end; margin-bottom: 4px; }
.portal-link:hover, .portal-link:focus-visible { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: 0 26px 54px rgba(20, 23, 25, .2); transform: translateY(-8px); }
.portal-link-team:hover, .portal-link-team:focus-visible { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); }
.portal-stage[data-active='team'] .field-core { background: var(--ink); }
.portal-stage[data-active='team'] .kinetic-field { border-color: #9dadde; }

.arrow-icon { position: relative; display: inline-block; width: 17px; height: 17px; }
.arrow-icon::before { position: absolute; top: 8px; left: 1px; width: 14px; height: 1px; content: ''; background: currentColor; transform: rotate(-45deg); transform-origin: right center; }
.arrow-icon::after { position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; content: ''; border-top: 1px solid currentColor; border-right: 1px solid currentColor; }

.public-footer { flex: 0 0 62px; display: flex; align-items: flex-start; justify-content: center; border-top: 1px solid var(--ink); padding-top: 15px; }
.filing-records { display: flex; width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 6px 28px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.filing-records strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.public-security-record { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.public-security-record img { width: 18px; height: 18px; object-fit: contain; flex: 0 0 18px; }
.public-security-record:hover strong, .public-security-record:focus-visible strong { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

@keyframes nav-scan { 0%, 100% { transform: translateX(-100%); } 50% { transform: translateX(555%); } }
@keyframes orbit-outer { to { transform: translate(-50%, -50%) rotateX(64deg) rotateZ(360deg); } }
@keyframes orbit-inner { to { transform: translate(-50%, -50%) rotateY(65deg) rotateZ(388deg); } }
@keyframes core-breathe { 0%, 100% { box-shadow: 0 22px 44px rgba(34, 84, 230, .18); } 50% { box-shadow: 0 30px 58px rgba(34, 84, 230, .3); } }
@keyframes core-wave { 0% { transform: scale(.82); opacity: .45; } 85%, 100% { transform: scale(1.45); opacity: 0; } }
@keyframes node-blink { 0%, 100% { background: #fff; } 50% { background: var(--accent); } }
@keyframes field-scan { 0%, 100% { left: 3%; opacity: .08; } 50% { left: 97%; opacity: .28; } }

@media (max-width: 1040px) and (min-width: 761px) {
    .public-page { width: min(calc(100% - 40px), var(--max)); }
    .public-main { grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr); gap: 24px; }
    .public-intro h1 { font-size: clamp(46px, 6.5vw, 64px); }
    .public-intro h1 em::after { right: -18px; width: 6px; height: 6px; }
    .portal-links { gap: 8px; }
    .portal-link { min-height: 108px; padding: 15px; }
    .portal-link strong { font-size: 21px; }
    .portal-type { font-size: 8px; }
}

@media (max-width: 760px) {
    .public-page { width: calc(100% - 32px); }
    .public-nav { flex-basis: 62px; gap: 18px; }
    .public-brand { font-size: 17px; }
    .brand-mark { width: 25px; height: 25px; font-size: 14px; }
    .public-main { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 0 12px; }
    .public-intro { min-height: 0; padding: 0; }
    .public-intro h1 { font-size: clamp(40px, 12vw, 52px); line-height: .98; }
    .public-intro h1 em::after { display: none; }
    .intro-rule { width: 34%; margin: 14px 0 12px; }
    .portal-stage { flex: 1 1 auto; min-height: 0; }
    .kinetic-field::before { inset: 14px; }
    .kinetic-field::after { top: 14px; right: 14px; }
    .field-axis-horizontal, .field-orbit, .field-core { top: 50%; }
    .field-orbit-outer { width: min(82%, 290px); }
    .field-orbit-inner { width: min(55%, 190px); }
    .field-core { width: 70px; height: 70px; }
    .field-core::before { inset: 18px; }
    .field-core::after { inset: 28px; }
    .field-node-a { top: 16%; left: 17%; }
    .field-node-b { top: 19%; right: 18%; }
    .field-node-c { right: 19%; bottom: 17%; }
    .portal-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .portal-link { min-height: 78px; padding: 10px 12px; box-shadow: 0 12px 24px rgba(20, 23, 25, .1); }
    .portal-type { font-size: 8px; }
    .portal-link strong { font-size: 19px; }
    .portal-link:hover, .portal-link:focus-visible { transform: translateY(-3px); }
    .public-footer { flex-basis: 59px; padding-top: 9px; }
    .filing-records { width: auto; justify-content: center; gap: 3px 14px; font-size: 11px; line-height: 1.4; }
    .filing-records strong { font-size: 12px; }
    .public-security-record img { width: 16px; height: 16px; flex-basis: 16px; }
}

@media (max-height: 720px) and (max-width: 760px) {
    .public-main { gap: 8px; padding: 10px 0; }
    .public-intro h1 { font-size: 36px; }
    .intro-rule { margin: 10px 0 8px; }
    .portal-link { min-height: 68px; padding: 8px 11px; }
    .portal-stage { min-height: 280px; }
}

@media (max-height: 640px) {
    body.public-home { overflow-y: auto; }
    .public-page { height: auto; }
}

@media (hover: none), (pointer: coarse) {
    .kinetic-field { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .kinetic-field, .field-core, .field-node { transform: none; }
    .field-core { translate: -50% -50%; }
}
