/* HonRui v4 — Fintech / financial-data aesthetic
   Dark slate base · electric cyan accent · mono numerals · grid backgrounds
*/

:root {
  --bg:        #FFFFFF;
  --bg-soft:   #F7F3EF;      /* 米白 — warm off-white */
  --bg-grid:   #EFEAE3;      /* warm grid line on bg-soft */

  --slate-950: #111827;      /* 深藍黑 — darkest base */
  --slate-900: #1e2a44;      /* 深海軍藍 — primary brand dark */
  --slate-800: #26324d;
  --slate-700: #34435f;
  --slate-600: #475573;

  --ink:      #1e2a44;       /* primary text = 深海軍藍 */
  --ink-2:    #34435f;
  --ink-3:    #5d6b89;
  --ink-4:    #8e9ab5;
  --line:     #E0DAD2;       /* warm divider line */
  --line-2:   #EFE9E2;

  --cyan:     #b88591;       /* 玫瑰銅 — primary accent (var name kept; rename to --rose is a follow-up) */
  --cyan-glow:#c89aa3;       /* lighter rose glow */
  --green:    #00B873;       /* tape green — status, unchanged */
  --red:      #E5484D;       /* status red, unchanged */
  --amber:    #F2A100;       /* status amber, unchanged */

  --sans:  'Inter', -apple-system, system-ui, sans-serif;
  --display:'Inter', sans-serif; /* tight tracking for fintech */
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1280px;
  --gut: 32px;
}

img, svg, video { max-width: 100%; height: auto; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 var(--gut); }

/* TOPBAR (dark, terminal-style) */
.topbar {
  background: var(--slate-950); color: #94A3BE;
  font-size: 12px; font-family: var(--mono); letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.topbar .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--gut); max-width: 1440px; margin: 0 auto;
}
.topbar .left { display: flex; gap: 28px; align-items: center; }
.topbar .clock { display: flex; gap: 8px; align-items: center; }
.topbar .clock .city { color: #94A3BE; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar .clock .t { color: #fff; font-weight: 500; }
.topbar .clock .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 6px rgba(0,184,115,0.7); animation: pulse 2.5s ease-in-out infinite; }
.topbar .right { display: flex; gap: 18px; align-items: center; flex-shrink: 0; white-space: nowrap; }
.topbar .lang { display: inline-flex; gap: 0; align-items: center; flex-shrink: 0; white-space: nowrap; }
.topbar .lang button { background: none; border: none; cursor: pointer; padding: 0; font: inherit; color: #94A3BE; font-family: var(--mono); }
.topbar .lang button.on { color: var(--cyan-glow); }
.topbar .lang .sep { color: #4B5572; margin: 0 6px; }

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* HEADER */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.site-header .row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  padding: 18px var(--gut); max-width: 1440px; margin: 0 auto;
}
.site-header .row > .brand { justify-self: start; }
.site-header .row > nav.primary { justify-self: center; }
.site-header .row > .cta-btn.desktop-cta { justify-self: end; }
.site-header .row > .nav-toggle { justify-self: end; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand .mark img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.brand .name { font-family: var(--sans); font-size: 18px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.brand .name span { color: var(--cyan); font-weight: 500; }
.brand .sub {
  font-size: 18px; color: var(--ink-3); font-weight: 500;
  letter-spacing: -0.005em;
  border-left: 1px solid var(--line); padding-left: 14px; margin-left: 6px;
  font-family: var(--sans);
}
nav.primary { display: flex; gap: 28px; align-items: center; }
nav.primary a {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 8px 0; position: relative;
  transition: color 0.15s;
}
nav.primary a:hover { color: var(--cyan); }
nav.primary a.active { color: var(--ink); }
nav.primary a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -19px;
  height: 2px; background: var(--cyan); box-shadow: 0 0 8px rgba(184,133,145,0.4);
}

.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: var(--slate-900); color: #fff !important;
  font-size: 13px; font-weight: 500; border-radius: 6px;
  transition: all 0.15s;
  border: 1px solid var(--slate-700);
  cursor: pointer; font-family: inherit;
  position: relative; overflow: hidden;
}
.cta-btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(184,133,145,0.15) 50%, transparent 100%);
  transform: translateX(-100%); transition: transform 0.4s;
}
.cta-btn:hover { background: var(--slate-800); border-color: var(--cyan); }
.cta-btn:hover::before { transform: translateX(100%); }
.cta-btn .arrow { transition: transform 0.2s; }
.cta-btn:hover .arrow { transform: translateX(2px); color: var(--cyan-glow); }

.cta-btn.ghost {
  background: transparent; color: var(--ink) !important;
  border: 1px solid var(--line);
}
.cta-btn.ghost:hover { border-color: var(--cyan); background: var(--bg-soft); }
.cta-btn.ghost::before { display: none; }

/* TYPE */
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; background: var(--cyan);
  box-shadow: 0 0 8px rgba(184,133,145,0.6);
}
.eyebrow .num { color: var(--ink-3); }

.h-display {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(44px, 5.5vw, 76px);
  line-height: 1.04; letter-spacing: -0.035em; color: var(--ink);
}
.h-display em {
  font-style: normal;
  background: linear-gradient(180deg, var(--ink) 60%, var(--cyan) 140%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.h-section {
  font-family: var(--display); font-weight: 600;
  font-size: 42px; line-height: 1.12; letter-spacing: -0.025em;
  color: var(--ink); margin: 0;
}
.h-section em {
  font-style: normal; color: var(--cyan);
}
.lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); font-weight: 400; max-width: 56ch; }

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

/* FOOTER */
.site-footer {
  background: var(--bg-soft); color: var(--ink-2);
  padding: 64px 0 24px;
  position: relative; overflow: hidden;
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(184,133,145,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(184,133,145,0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
.site-footer .container-wide { position: relative; z-index: 1; }
.site-footer .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.site-footer .brand .name { color: var(--ink); }
.site-footer .brand .sub { color: var(--ink-3); border-color: var(--line); }
.site-footer h5 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan); font-weight: 500; margin: 0 0 16px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 6px 0; font-size: 13.5px; color: var(--ink-2); }
.site-footer li a { color: var(--ink-2); }
.site-footer li a:hover { color: var(--cyan); }
.site-footer .desc { font-size: 13.5px; line-height: 1.65; color: var(--ink-3); max-width: 32ch; margin-top: 16px; }
.site-footer .bot { display: flex; justify-content: space-between; padding-top: 24px; font-size: 11.5px; color: var(--ink-4); font-family: var(--mono); }
.site-footer .bot .legal { display: flex; gap: 24px; }
.site-footer .bot a { color: var(--ink-3); }
.site-footer .bot a:hover { color: var(--cyan); }

/* =====================================================================
   RESPONSIVE — global rules (chrome + page sections)
   Breakpoints: 1100 / 900 / 700 / 520
   ===================================================================== */

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 6px; width: 40px; height: 40px;
  cursor: pointer; padding: 0; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1100px) {
  :root { --gut: 24px; }
  .topbar .left { gap: 18px; flex-wrap: wrap; }
  .topbar .clock .city { font-size: 10px; }
  .h-section { font-size: 36px; }
  .h-display { font-size: clamp(38px, 6vw, 64px) !important; }
}

@media (max-width: 900px) {
  :root { --gut: 20px; }
  body { font-size: 15px; }

  /* TOPBAR — drop two clocks, compact spacing */
  .topbar { font-size: 11px; }
  .topbar .row { padding: 6px var(--gut); gap: 12px; }
  .topbar .left { gap: 14px; }
  .topbar .clock:nth-child(n+3) { display: none; }
  .topbar .right .audience { display: none; }

  /* MASTHEAD */
  .site-header .row { padding: 14px var(--gut); grid-template-columns: 1fr auto; }
  .site-header .row > .nav-toggle { grid-column: 2; }
  .brand .sub { display: none; }
  nav.primary {
    position: fixed; top: 0; right: -100%; width: min(320px, 80vw); height: 100vh;
    background: var(--bg); border-left: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 80px 28px 28px; z-index: 100; transition: right .25s ease;
    box-shadow: -12px 0 32px -16px rgba(30,42,68,0.2);
  }
  nav.primary.open { right: 0; }
  nav.primary a { width: 100%; padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--line-2); }
  nav.primary a.active::after { display: none; }
  nav.primary a.active { color: var(--cyan); }
  .site-header .desktop-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-cta { display: inline-flex !important; }
}
@media (min-width: 901px) {
  .mobile-cta { display: none !important; }
}

@media (max-width: 900px) {
  /* TYPE */
  .h-section { font-size: 30px; }
  .h-display { font-size: clamp(34px, 8vw, 52px) !important; line-height: 1.08; }
  .lede { font-size: 16px; }

  /* FOOTER */
  .site-footer { padding: 48px 0 20px; }
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 32px; }
  .site-footer .grid > :first-child { grid-column: 1 / -1; }
  .site-footer .bot { flex-direction: column; gap: 12px; }
  .site-footer .bot .legal { flex-wrap: wrap; gap: 14px; }

  /* Universal grid fallbacks (page-scoped sections) */
  .hero .grid,
  .svc .grid,
  .how .head,
  .latest .grid,
  .cta .grid,
  .trust .grid,
  .svc-block .head,
  .svc-block .grid,
  .princ .head,
  .comp .grid,
  .team .head,
  .sub .grid, .subscribe .grid,
  .featured,
  .featured-wrap .head,
  .feed .head,
  .filter .row,
  .ch .head,
  .offices .head,
  .faq .head,
  .cov .head {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .hero { padding: 56px 0 64px !important; }
  .hero .panel, .hero .menu { width: 100%; }

  /* Reduce dense multi-col grids */
  .princ .grid,
  .comp .rhs,
  .team .g,
  .ch .grid,
  .offices .grid,
  .faq .list,
  .feed .g,
  .svc-block .features,
  .svc-block .deliv-list,
  .partners .grid,
  .trust .logos,
  .stat-grid,
  .stats,
  .hero .stats,
  .services .grid,
  .latest .cards,
  .how .steps,
  .tiers,
  .stat-strip,
  .insights .grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Filters / Tabs become scrollable */
  .filter .tabs { flex-wrap: wrap; gap: 6px; }
  .filter .meta { margin-left: 0; }

  /* Tables / Coverage matrix */
  .cov .matrix {
    grid-template-columns: 140px repeat(4, minmax(80px, 1fr)) !important;
    overflow-x: auto; display: grid;
  }
  .cov-wrap, .cov .container { overflow-x: auto; }

  /* Timeline rail → 2 cols */
  .time .rail { grid-template-columns: 1fr 1fr !important; gap: 28px 24px !important; }
  .time .rail::before { display: none; }
  .time .pt h4 { height: auto !important; }

  /* CTA / dark sections padding */
  .cta, .how, .engage, .sub, .subscribe, .faq { padding: 72px 0 !important; }
  .services, .featured-wrap, .feed, .offices, .ch, .princ, .time, .team, .trust, .comp { padding: 72px 0 !important; }
  .stat-strip { padding: 36px 0 !important; }

  /* Form */
  .form-card .row { grid-template-columns: 1fr !important; gap: 8px !important; padding: 12px 0 !important; }
  .form-card .row .lbl { padding-top: 0 !important; }
  .form-card .body { padding: 24px 22px !important; }
  .form-card .footer { flex-direction: column; gap: 14px; align-items: flex-start; padding: 18px 22px !important; }
  .form-card .seg { grid-template-columns: 1fr !important; }
  .form-card .chk { grid-template-columns: 1fr !important; }

  /* Hero panel rows tighter */
  .hero .panel .row { grid-template-columns: 70px 1fr 80px 64px !important; padding: 9px 14px !important; gap: 8px !important; font-size: 11.5px !important; }

  /* Cards padding */
  .card, .feat, .office, .tier, .team .p, .princ .item, .featured .l, .featured .r {
    padding: 24px !important;
  }
}

@media (max-width: 700px) {
  .topbar .clock:nth-child(n+2) { display: none; }
  .h-section { font-size: 26px; }
  .h-display { font-size: clamp(30px, 9vw, 44px) !important; }

  /* Single column for everything 2-col */
  .princ .grid,
  .comp .rhs,
  .team .g,
  .ch .grid,
  .offices .grid,
  .faq .list,
  .feed .g,
  .svc-block .features,
  .svc-block .deliv-list,
  .partners .grid,
  .trust .logos,
  .stats,
  .hero .stats,
  .services .grid,
  .latest .cards,
  .how .steps,
  .tiers,
  .insights .grid,
  .time .rail {
    grid-template-columns: 1fr !important;
  }

  .filter { position: static !important; padding: 16px 0 !important; }

  /* Coverage matrix → stacked card style */
  .cov .matrix {
    grid-template-columns: 1fr !important;
    border-radius: 8px;
  }
  .cov .matrix .h:not(:first-child) { display: none; }
  .cov .matrix .h:first-child { display: none; }
  .cov .matrix .row-label {
    grid-column: 1 !important; padding: 14px 16px !important;
    border-right: none !important; background: rgba(255,255,255,0.05) !important;
  }
  .cov .matrix .cell {
    border-right: none !important;
    padding: 12px 16px !important;
    flex-direction: row !important; justify-content: space-between;
  }
  .cov .matrix .cell::before {
    content: attr(data-region);
    color: #4B5572; font-size: 10.5px; letter-spacing: 0.1em;
  }
  .cov .legend { flex-direction: column; gap: 10px; }

  /* Featured report */
  .featured .l { padding: 28px !important; }
  .featured h3 { font-size: 26px !important; }
  .featured .meta-row { flex-wrap: wrap; gap: 16px !important; }

  /* Timeline */
  .time .pt { padding: 0 !important; }

  /* Offices */
  .office .ribbon .city { font-size: 24px !important; }

  /* Hero panel — drop ticker name col */
  .hero .panel .row { grid-template-columns: 60px 1fr 64px !important; }
  .hero .panel .row .name { display: none; }

  /* Services hero menu items */
  .hero .menu a { padding: 12px 10px !important; }

  /* Footer single col */
  .site-footer .grid { grid-template-columns: 1fr !important; }
  .site-footer .grid > :first-child { grid-column: 1 !important; }
}

@media (max-width: 520px) {
  :root { --gut: 16px; }
  .topbar .lang { font-size: 10.5px; }
  .topbar .clock { display: none !important; }
  .topbar .clock:first-child { display: flex !important; }
  .h-section { font-size: 24px; }
  .h-display { font-size: clamp(28px, 10vw, 38px) !important; }
  .lede { font-size: 15px; }

  .cta-btn { padding: 9px 14px; font-size: 12.5px; }
  .brand .name { font-size: 16px; }
  .brand .mark { width: 28px; height: 28px; }

  /* Featured report */
  .featured h3 { font-size: 22px !important; }
  .featured .l, .featured .r { padding: 22px !important; }

  /* Card grids: single column, tighter padding */
  .card, .feat, .office, .tier, .team .p, .princ .item {
    padding: 20px !important;
  }

  /* Form labels above inputs already; tighten */
  .form-card .head { padding: 14px 18px !important; }
  .form-card .footer .submit { width: 100%; justify-content: center; }
}
