/* ==========================================================================
   ONERISK — design tokens (Figma variables) + shared layout/components.
   Page-specific styles live in wwwroot/css/pages/*.css.
   Figma letter-spacing is in %: -1.1% of 14.5px = -0.1595px, etc.
   ========================================================================== */
:root {
    /* colour */
    --ground-navy: #0f172a;
    --text-primary: #f3f6fa;
    --text-secondary: #a9b5c7;
    --text-tertiary: #6d7c92;
    --text-on-gold: #0f172a;
    --accent-gold: #ffac00;
    --accent-gold-dim: rgba(255, 172, 0, 0.14);
    --brand-primary: #ffac00;
    --brand-secondary: #f86f00;
    --white: #ffffff;
    --neutral-500: #737373;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --glass-fill: rgba(255, 255, 255, 0.04);
    --glass-fill-2: rgba(255, 255, 255, 0.05);
    --glass-fill-3: rgba(255, 255, 255, 0.09);
    --glass-hair: rgba(255, 255, 255, 0.08);
    --bezel-inner: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14);

    /* radius */
    --radius-xs: 15px;
    --radius-sm: 20px;
    --radius-md: 26px;
    --radius-lg: 32px;
    --radius-4xl: 32px;
    --radius-pill: 999px;

    /* layout */
    --shell: 1280px;
    --gutter: 32px; /* tablet side margin; 16px on phones (see below) */
    --nav-h: 76px;

    /* Latin glyphs come from Plus Jakarta Sans; Chinese falls through to Noto Sans TC. */
    --font-sans: "Plus Jakarta Sans", "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
    margin: 0;
    background: var(--ground-navy);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; }
@media (max-width: 1312px) { .shell { padding-inline: var(--gutter); } }
@media (max-width: 640px) { :root { --gutter: 16px; } }

/* ---------- type scale (Figma text styles) ---------- */
.display-hero { font-weight: 800; font-size: 66px; line-height: 1; letter-spacing: -2.772px; }
.display-h1 { font-weight: 700; font-size: 58px; line-height: 1.02; letter-spacing: -2.32px; }
.display-title { font-weight: 700; font-size: 48px; line-height: 1.2; letter-spacing: -1.92px; }
.h2 { font-weight: 600; font-size: 34px; line-height: 1.2; letter-spacing: -1.088px; }
.tile-name { font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: -0.532px; }
.body-lede { font-weight: 400; font-size: 19.5px; line-height: 1.62; letter-spacing: -0.2145px; }
.body-base { font-weight: 400; font-size: 16px; line-height: 1.68; letter-spacing: -0.176px; }
.body-small { font-weight: 400; font-size: 14.5px; line-height: 1.6; letter-spacing: -0.1595px; }
.mono-label { font-family: var(--font-mono); font-weight: 400; font-size: 10.5px; line-height: 1.6; letter-spacing: 1.995px; text-transform: uppercase; }
.mono-micro { font-family: var(--font-mono); font-weight: 400; font-size: 9px; line-height: 1.6; letter-spacing: 1.44px; text-transform: uppercase; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-gold { color: var(--accent-gold); }

.u-link { text-decoration: underline; text-underline-position: from-font; }
.u-link:hover { color: var(--text-primary); }

@media (max-width: 1024px) {
    .display-hero { font-size: 52px; }
    .display-h1 { font-size: 46px; }
    .display-title { font-size: 40px; }
}
@media (max-width: 640px) {
    .display-hero { font-size: 40px; letter-spacing: -1.6px; }
    .display-h1 { font-size: 36px; letter-spacing: -1.4px; }
    .display-title { font-size: 32px; letter-spacing: -1.2px; }
    .h2 { font-size: 28px; }
    .body-lede { font-size: 17px; }
}

/* ---------- buttons (Figma "Button": Gold = primary, Glass = secondary) ---------- */
.btn-gold, .btn-glass {
    display: inline-flex; align-items: center; justify-content: center; gap: 14px;
    padding: 8px 8px 8px 26px;
    border-radius: var(--radius-pill);
    font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: -0.21px;
    white-space: nowrap; flex-shrink: 0;
    transition: transform .15s ease, filter .15s ease, background-color .15s ease;
}
.btn-gold { background: var(--accent-gold); color: var(--text-on-gold); }
.btn-gold:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-glass { background: var(--glass-fill-3); color: var(--text-primary); box-shadow: var(--bezel-inner); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.14); }
.btn-gold__icon, .btn-glass__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--radius-pill); overflow: hidden;
    background: rgba(15, 23, 42, 0.13);
}
.btn-glass__icon { background: rgba(255, 255, 255, 0.1); }
.btn-gold--sm { gap: 11px; padding: 4px 6px 4px 19px; font-size: 13.5px; letter-spacing: -0.189px; }
.btn-gold--sm .btn-gold__icon { width: 28px; height: 28px; }

/* ---------- navigation ---------- */
.site-nav { position: sticky; top: 0; z-index: 100; background: var(--ground-navy); }
.site-nav__bar {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    height: var(--nav-h); padding: 16px 40px;
}
.site-nav__logo img { width: 160px; height: 44px; object-fit: cover; }
.site-nav__right { display: flex; align-items: center; gap: 24px; }
.site-nav__links { display: flex; align-items: center; gap: 2px; }

.nav-pill {
    display: inline-flex; align-items: flex-end; gap: 4px;
    padding: 8px 14px; border-radius: var(--radius-pill);
    font-weight: 500; font-size: 14px; line-height: normal; letter-spacing: -0.168px;
    color: var(--white); white-space: nowrap;
    transition: background-color .15s ease;
}
.nav-pill:hover, .nav-pill[aria-expanded="true"] { background: var(--glass-fill-2); }
.nav-pill.is-active { background: var(--glass-fill-3); color: var(--text-primary); }
.nav-pill--toggle img { transition: transform .2s ease; }
.nav-pill--toggle[aria-expanded="true"] img { transform: rotate(180deg); }

.nav-dropdown { position: static; }
/* Anchored to the nav bar: Figma places the 1026px menu 179px from the right of a 1920 frame. */
.mega-menu {
    position: absolute; top: calc(100% + 8px);
    right: max(16px, min(179px, calc(100vw - 1026px - 16px)));
    width: min(1026px, calc(100vw - 32px)); transform: translateY(-6px);
    display: flex; gap: 16px; align-items: flex-start;
    padding: 24px 24px 20px;
    background: var(--ground-navy); border-radius: var(--radius-4xl);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.mega-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -36px; height: 36px; }
.nav-dropdown.is-open .mega-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.mega-menu__card {
    display: flex; flex-direction: column; gap: 16px;
    padding: 20px; border-radius: 20px; background: var(--glass-fill-2);
}
.mega-menu__card--trade { width: 310px; flex-shrink: 0; }
.mega-menu__card--business { flex: 1 0 0; min-width: 1px; }
.mega-menu__label { color: var(--text-secondary); }
.mega-menu__cols { display: flex; gap: 24px; }
.mega-menu__cols > .mega-menu__list { flex: 1 0 0; min-width: 1px; }
.mega-menu__list { display: flex; flex-direction: column; gap: 12px; }
.mega-menu__item {
    display: flex; align-items: center; gap: 12px;
    font-size: 14.5px; line-height: 1.6; letter-spacing: -0.1595px; color: var(--text-primary);
    border-radius: 10px; transition: color .15s ease;
}
.mega-menu__item:hover { color: var(--accent-gold); }
.mega-menu__icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 36px; height: 36px; border-radius: 8px; background: var(--white);
}

.nav-lang { position: relative; }
.lang-menu {
    position: absolute; top: calc(100% + 26px); right: -16px; min-width: 180px;
    display: flex; flex-direction: column; gap: 2px; padding: 8px;
    background: var(--ground-navy); border-radius: var(--radius-sm);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px var(--glass-hair);
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.lang-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -26px; height: 26px; }
.nav-lang.is-open .lang-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.lang-menu__item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    font-weight: 500; font-size: 14px; line-height: normal; color: var(--white);
    transition: background-color .15s ease;
}
.lang-menu__item:hover { background: var(--glass-fill-2); }
.lang-menu__item.is-active { background: var(--glass-fill-3); color: var(--text-primary); }
.nav-lang__toggle img { transition: transform .2s ease; }
.nav-lang__toggle[aria-expanded="true"] img { transform: rotate(180deg); }
.nav-lang__toggle {
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 600; font-size: 14px; line-height: 24px; color: var(--white);
}

.site-nav__burger { display: none; width: 40px; height: 40px; border-radius: 12px; background: var(--glass-fill-3); position: relative; }
.site-nav__burger span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--white); transition: transform .2s ease, opacity .2s ease; }
.site-nav__burger span:nth-child(1) { top: 13px; }
.site-nav__burger span:nth-child(2) { top: 19px; }
.site-nav__burger span:nth-child(3) { top: 25px; }
.site-nav.is-open .site-nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-nav.is-open .site-nav__burger span:nth-child(2) { opacity: 0; }
.site-nav.is-open .site-nav__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
    .site-nav__bar { padding: 16px var(--gutter); }
    .site-nav__logo img { width: 128px; height: 35px; }
    .site-nav__burger { display: block; }
    .site-nav__right {
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h));
        overflow-y: auto; overscroll-behavior: contain;
        flex-direction: column; align-items: stretch; gap: 16px;
        padding: 8px var(--gutter) 24px; background: var(--ground-navy);
        border-top: 1px solid var(--glass-hair);
        display: none;
    }
    .site-nav.is-open .site-nav__right { display: flex; }
    .site-nav__links { flex-direction: column; align-items: stretch; gap: 4px; }
    .nav-pill { justify-content: space-between; align-items: center; min-height: 48px; padding: 12px 14px; font-size: 16px; width: 100%; }
    .site-nav__links .btn-gold { align-self: stretch; justify-content: space-between; margin-top: 12px; min-height: 48px; padding-left: 20px; font-size: 15px; }
    .mega-menu__item { min-height: 44px; }
    .mega-menu {
        position: static; width: 100%; transform: none; box-shadow: none; right: auto;
        flex-direction: column; padding: 8px 0; display: none;
        opacity: 1; visibility: visible; pointer-events: auto;
    }
    .nav-dropdown.is-open .mega-menu { display: flex; transform: none; }
    .mega-menu__card--trade { width: 100%; }
    .mega-menu__card--business { width: 100%; }
    .mega-menu__cols { gap: 24px; }
    .mega-menu::before { display: none; }
    .nav-lang { padding: 0; }
    /* Mobile: the language list sits inline in the open burger panel. */
    .nav-lang__toggle { display: none; }
    .lang-menu {
        position: static; flex-direction: row; min-width: 0; padding: 4px; gap: 4px;
        background: var(--glass-fill-2); border-radius: var(--radius-pill); box-shadow: none;
        opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    }
    .lang-menu li { flex: 1; }
    .lang-menu__item { justify-content: center; min-height: 44px; border-radius: var(--radius-pill); }
    .lang-menu__item img { display: none; }
    body.nav-locked { overflow: hidden; }
    .lang-menu::before { display: none; }
}

/* ---------- CTA band (Figma component "CTA Band") ---------- */
.cta-band { padding: 100px 0; }
.cta-band__card {
    padding: 6px; border-radius: var(--radius-lg); overflow: hidden;
    background: var(--glass-fill); border: 1px solid var(--glass-hair);
}
.cta-band__core {
    display: flex; align-items: center; gap: 36px;
    padding: 60px 54px; border-radius: var(--radius-md);
    background: var(--glass-fill-2); box-shadow: var(--bezel-inner);
}
.cta-band__copy { flex: 1 0 0; min-width: 1px; display: flex; flex-direction: column; gap: 14px; }
.cta-band__title { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
    .cta-band { padding: 64px 0; }
    .cta-band__core { flex-direction: column; align-items: flex-start; padding: 36px 24px; }
    .cta-band__title { flex-direction: column; align-items: flex-start; gap: 12px; }
    .cta-band .btn-gold { align-self: stretch; justify-content: space-between; min-height: 50px; }
}

/* ---------- footer (Figma component "Footer") ---------- */
.site-footer { background: var(--ground-navy); border-top: 1px solid var(--glass-hair); padding: 100px 0 34px; }
.site-footer__shell { max-width: var(--shell); margin-inline: auto; padding-inline: 56px; display: flex; flex-direction: column; gap: 52px; }
.site-footer__grid { display: flex; gap: 38px; align-items: flex-start; }
.site-footer__brand { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.site-footer__brand img { width: 120px; height: 33px; object-fit: cover; }
.site-footer__cols { display: flex; gap: 24px; }
.site-footer__col { display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; }
.site-footer__col ul { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.6; letter-spacing: -0.1595px; color: var(--text-secondary); }
.site-footer__col a { transition: color .15s ease; }
.site-footer__col a:hover { color: var(--text-primary); }
.site-footer__contact { width: 240px; }
.site-footer__contact a { overflow-wrap: anywhere; }
.site-footer__bottom { border-top: 1px solid var(--glass-hair); padding-top: 22px; }
.site-footer__bottom p { font-size: 13px; line-height: normal; color: var(--text-tertiary); }
/* Below the 1280 shell, align the footer with page content (same side margin as .shell). */
@media (max-width: 1312px) { .site-footer__shell { padding-inline: var(--gutter); } }
/* Tablet: brand on its own row, then the four link columns in an even grid. */
@media (max-width: 1100px) {
    .site-footer { padding-top: 72px; }
    .site-footer__shell { padding-inline: var(--gutter); gap: 40px; }
    .site-footer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.45fr); gap: 40px 24px; }
    .site-footer__brand { grid-column: 1 / -1; width: auto; max-width: 360px; }
    .site-footer__cols { display: contents; }
    .site-footer__col, .site-footer__contact { width: auto !important; }
}
/* Phone: two columns, contact block full width. */
@media (max-width: 640px) {
    .site-footer { padding-top: 56px; }
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
    .site-footer__contact { grid-column: 1 / -1; }
}

/* ---------- Traditional Chinese ----------
   The Figma type scale uses negative tracking and tight display leading tuned for Latin text;
   CJK glyphs need normal tracking and a little more line-height. */
html:lang(zh) body * { letter-spacing: 0 !important; }
html:lang(zh) .mono-label, html:lang(zh) .mono-micro { letter-spacing: 0.08em !important; }
html:lang(zh) .display-hero, html:lang(zh) .display-h1, html:lang(zh) .display-title { line-height: 1.2; }
html:lang(zh) .h2, html:lang(zh) .tile-name { line-height: 1.3; }

/* Phone: business covers in one column inside the burger menu. */
@media (max-width: 640px) {
    .mega-menu__cols { flex-direction: column; gap: 12px; }
}
