/* ===========================================================
   Jiangan Tech — Field Ledger design system
   Warm paper · ink · cobalt · editorial serif + mono annotations
   =========================================================== */

:root {
    --paper: #f3efe4;
    --paper-2: #eae4d5;
    --paper-3: #ddd4c2;
    --ink: #14191b;
    --ink-2: #2c3335;
    --muted: #5e655f;
    --line: #c9c1af;
    --line-soft: rgba(20, 25, 27, 0.13);
    --cobalt: #2036c8;
    --cobalt-deep: #15257f;
    --cream: #f8f4e9;
    --brick: #a8352a;

    --serif: "Instrument Serif", "Noto Serif SC", Georgia, "Songti SC", serif;
    --sans: "Manrope", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

    --wrap: 1400px;
    --gutter: clamp(20px, 4.4vw, 64px);
    --nav-h: 76px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset ---------- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font-family: inherit;
    color: inherit;
}

::selection {
    background: var(--cobalt);
    color: var(--cream);
}

:focus-visible {
    outline: 2px solid var(--cobalt);
    outline-offset: 3px;
}

/* ---------- type helpers ---------- */

.serif {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.mono {
    font-family: var(--mono);
}

.label {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.lead {
    font-size: clamp(1.02rem, 1.25vw, 1.16rem);
    line-height: 1.72;
    color: var(--ink-2);
    max-width: 58ch;
}

.arrow {
    font-family: var(--mono);
    font-size: 0.9em;
    line-height: 1;
}

/* ---------- layout ---------- */

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.wrap--narrow {
    max-width: 1120px;
}

.sec {
    padding-block: clamp(60px, 8.5vw, 116px);
    border-top: 1px solid var(--line);
}

.sec--ink {
    background: var(--ink);
    color: var(--cream);
    border-color: rgba(248, 244, 233, 0.22);
}

.sec--cobalt {
    background: var(--cobalt);
    color: var(--cream);
    border-color: rgba(248, 244, 233, 0.28);
}

.rule-top {
    border-top: 1px solid var(--ink);
}

/* section heading: outlined index / title / marginal note */

.sec-head {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) minmax(160px, 250px);
    gap: clamp(18px, 3vw, 40px);
    align-items: end;
    padding-top: 16px;
    border-top: 1px solid var(--ink);
    margin-bottom: clamp(32px, 5vw, 60px);
}

.sec-head__idx {
    font-family: var(--serif);
    font-size: clamp(2.6rem, 5.2vw, 4.4rem);
    line-height: 0.78;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1px var(--line);
}

.sec-head h2 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.2vw, 3.7rem);
    font-weight: 400;
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.sec-head__note {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    line-height: 1.7;
    color: var(--muted);
    text-align: right;
    text-transform: uppercase;
}

.sec--ink .sec-head {
    border-color: var(--cream);
}

.sec--ink .sec-head__idx {
    -webkit-text-stroke-color: rgba(248, 244, 233, 0.38);
}

.sec--ink .sec-head__note {
    color: rgba(248, 244, 233, 0.6);
}

/* ---------- kicker + stamp ---------- */

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--muted);
}

.kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--cobalt);
}

.sec--ink .kicker {
    color: rgba(248, 244, 233, 0.66);
}

.sec--ink .kicker::before {
    background: var(--paper-3);
}

.stamp {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--brick);
    color: var(--brick);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transform: rotate(-4deg);
}

/* ---------- buttons + links ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 52px;
    padding: 0 22px;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.25s var(--ease), color 0.25s var(--ease),
        border-color 0.25s var(--ease);
}

.btn .arrow {
    transition: transform 0.25s var(--ease);
}

.btn:hover {
    background: var(--ink);
    color: var(--cream);
}

.btn:hover .arrow {
    transform: translateX(4px);
}

.btn--fill {
    background: var(--ink);
    color: var(--cream);
}

.btn--fill:hover {
    background: var(--cobalt);
    border-color: var(--cobalt);
}

.btn--light {
    border-color: rgba(248, 244, 233, 0.65);
    color: var(--cream);
}

.btn--light:hover {
    background: var(--cream);
    border-color: var(--cream);
    color: var(--ink);
}

.btn--ink {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--cream);
}

.btn--ink:hover {
    background: var(--cream);
    color: var(--ink);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--ink);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.text-link:hover {
    color: var(--cobalt);
    border-color: var(--cobalt);
}

.text-link .arrow {
    transition: transform 0.2s var(--ease);
}

.text-link:hover .arrow {
    transform: translate(2px, -2px);
}

.sec--ink .text-link,
.sec--cobalt .text-link {
    border-color: rgba(248, 244, 233, 0.6);
    color: var(--cream);
}

.sec--ink .text-link:hover,
.sec--cobalt .text-link:hover {
    border-color: var(--cream);
}

/* ---------- header ---------- */

.site-head {
    position: sticky;
    top: 0;
    z-index: 90;
}

.utility {
    background: var(--ink);
    color: rgba(248, 244, 233, 0.72);
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.utility .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 28px;
}

.utility__loc {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.utility__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cobalt);
    box-shadow: 0 0 0 3px rgba(32, 54, 200, 0.25);
}

.site-nav {
    position: relative;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
}

.site-nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 40px);
    min-height: var(--nav-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand__cn {
    font-family: var(--serif);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand__en {
    font-family: var(--mono);
    font-size: 0.5rem;
    letter-spacing: 0.24em;
    color: var(--muted);
    margin-top: 3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.9vw, 30px);
}

.nav-links a {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 4px 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-2);
    transition: color 0.2s var(--ease);
}

.nav-links a sup {
    font-family: var(--mono);
    font-size: 0.48rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--muted);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: var(--cobalt);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.6vw, 22px);
}

.language-switch {
    position: relative;
}

.language-switch .dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
    border-bottom: 1px solid transparent;
}

.language-switch .dropdown-trigger:hover {
    border-color: var(--ink);
}

.language-switch .dropdown-trigger .fa-chevron-down {
    font-size: 0.5rem;
    color: var(--muted);
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 5;
    min-width: 138px;
    display: none;
    background: var(--paper);
    border: 1px solid var(--ink);
    box-shadow: 6px 6px 0 rgba(20, 25, 27, 0.12);
}

.language-switch.show .dropdown-content,
.language-switch:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--line-soft);
}

.dropdown-content a:last-child {
    border-bottom: 0;
}

.dropdown-content a:hover,
.dropdown-content a.active {
    background: var(--paper-2);
    color: var(--cobalt);
}

.dropdown-content .lang-code {
    color: var(--muted);
    font-size: 0.55rem;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    min-height: 42px;
    padding: 0 16px;
    background: var(--ink);
    border: 1px solid var(--ink);
    color: var(--cream);
    font-size: 0.74rem;
    font-weight: 600;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.nav-cta .arrow {
    font-size: 0.8rem;
}

.nav-cta:hover {
    background: var(--cobalt);
    border-color: var(--cobalt);
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--ink);
    margin: 4px 0;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* ---------- page head (inner pages) ---------- */

.page-head {
    padding-block: clamp(44px, 6.5vw, 92px) clamp(36px, 5vw, 64px);
    border-bottom: 1px solid var(--ink);
}

.page-head__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: clamp(28px, 4vw, 52px);
}

.page-head__top .dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--cobalt);
    margin-right: 8px;
}

.page-title {
    font-family: var(--serif);
    font-size: clamp(3rem, 7vw, 6.4rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.page-title em {
    font-style: normal;
    color: var(--cobalt);
}

.page-dek {
    max-width: 52ch;
    margin-top: clamp(20px, 3vw, 32px);
    font-size: clamp(0.98rem, 1.15vw, 1.1rem);
    line-height: 1.75;
    color: var(--ink-2);
}

/* ---------- footer ---------- */

.site-foot {
    background: var(--ink);
    color: var(--cream);
    padding-top: clamp(56px, 7vw, 96px);
    overflow: hidden;
}

.foot-top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 1.15fr;
    gap: clamp(32px, 6vw, 100px);
}

.foot-brand .brand {
    margin-bottom: 20px;
}

.foot-brand .brand__cn {
    color: var(--cream);
}

.foot-brand .brand__en {
    color: rgba(248, 244, 233, 0.5);
}

.foot-desc {
    max-width: 38ch;
    font-size: 0.9rem;
    line-height: 1.75;
    color: rgba(248, 244, 233, 0.68);
}

.foot-coords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 28px;
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    color: rgba(248, 244, 233, 0.45);
}

.foot-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 48px);
    border-top: 1px solid rgba(248, 244, 233, 0.24);
    padding-top: 20px;
}

.foot-group__title {
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(248, 244, 233, 0.45);
    margin-bottom: 18px;
}

.foot-group li {
    margin-bottom: 10px;
}

.foot-group a {
    font-size: 0.86rem;
    color: rgba(248, 244, 233, 0.82);
    border-bottom: 1px solid transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.foot-group a:hover {
    color: var(--cream);
    border-color: rgba(248, 244, 233, 0.5);
}

.foot-contact li {
    font-size: 0.8rem;
    color: rgba(248, 244, 233, 0.75);
    font-family: var(--mono);
    letter-spacing: 0.02em;
}

.foot-contact strong {
    display: block;
    font-family: var(--sans);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: rgba(248, 244, 233, 0.4);
    margin-bottom: 2px;
}

.foot-mega {
    margin-top: clamp(48px, 7vw, 90px);
    font-family: var(--serif);
    font-size: clamp(4rem, 13vw, 13rem);
    line-height: 0.8;
    letter-spacing: -0.04em;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1px rgba(248, 244, 233, 0.22);
    user-select: none;
}

.foot-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-block: 18px;
    border-top: 1px solid rgba(248, 244, 233, 0.2);
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    color: rgba(248, 244, 233, 0.5);
}

.foot-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
}

.foot-legal a:hover {
    color: var(--cream);
}

.foot-social {
    display: flex;
    gap: 18px;
}

.foot-social a {
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(248, 244, 233, 0.65);
}

.foot-social a:hover {
    color: var(--cream);
}

/* ---------- shared bits ---------- */

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.note {
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    line-height: 1.7;
    color: var(--muted);
}

.rise {
    animation: rise 0.8s var(--ease) both;
}

.rise-2 {
    animation-delay: 0.1s;
}

.rise-3 {
    animation-delay: 0.2s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    .nav-links {
        gap: 14px;
    }

    .nav-links a sup {
        display: none;
    }

    .sec-head {
        grid-template-columns: 90px 1fr 180px;
    }
}

@media (max-width: 900px) {
    .utility {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 24px;
        background: var(--paper);
        border-bottom: 1px solid var(--ink);
        box-shadow: 0 18px 30px rgba(20, 25, 27, 0.08);
    }

    .nav-links.active a {
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
        font-size: 0.95rem;
    }

    .nav-links.active a::after {
        display: none;
    }

    .foot-top {
        grid-template-columns: 1fr;
    }

    .sec-head {
        grid-template-columns: 1fr;
        gap: 14px;
        align-items: start;
    }

    .sec-head__idx {
        font-size: 2.4rem;
    }

    .sec-head__note {
        text-align: left;
    }
}

@media (max-width: 620px) {
    .nav-cta {
        display: none;
    }

    .brand__en {
        display: none;
    }

    .foot-groups {
        grid-template-columns: 1fr 1fr;
    }

    .page-head__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .foot-mega {
        font-size: clamp(3rem, 19vw, 5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
