/* ============================================================================
   91RONG-X / 玖融财商 — UI V1.0 foundation
   Visual direction: Contemporary Financial Academy
   Editorial · Trustworthy · Structured · Warm · Intelligent · Professional
   Human · Calm · Premium but Accessible

   Light-first. Dark ink used sparingly for two editorial sections only.
   This file owns: tokens, reset, typography scale, layout grid, surfaces,
   utilities. It owns no component (see kit.css) and no surface composition
   (see public.css / auth.css / system.css).
   ========================================================================= */

:root {
  /* ---------------------------------------------------------------- colour */
  /* Warm ivory / paper */
  --paper:        #faf7f1;
  --paper-2:      #f4efe6;
  --paper-3:      #ece5d8;
  --paper-4:      #e3dbcb;

  /* Deep ink / navy charcoal */
  --ink:          #14201e;
  --ink-2:        #263633;
  --ink-3:        #55635f;
  --ink-4:        #5b6763;   /* AA-safe label / note grey on every paper surface */
  --ink-5:        #8b9793;   /* decorative only: separators, dots, placeholders */

  /* Muted financial green (brand) */
  --green:        #2e6b57;
  --green-deep:   #1d4739;
  --green-mid:    #47836c;
  --green-soft:   #e3ece5;
  --green-tint:   #f0f5f1;

  /* Soft sage */
  --sage:         #9db3a3;
  --sage-soft:    #dbe4dc;
  --sage-tint:    #eef3ef;

  /* Controlled cobalt accent */
  --cobalt:       #274b9f;
  --cobalt-deep:  #1b3672;
  --cobalt-soft:  #e5eaf7;
  --cobalt-tint:  #f1f4fb;

  /* Warm sand */
  --sand:         #d9c49c;
  --sand-soft:    #efe4ce;
  --sand-tint:    #f8f2e6;

  /* Support */
  --amber:        #8a5d15;   /* AA-safe on amber-soft and paper */
  --amber-soft:   #f6ecd9;
  --danger:       #a03a2b;
  --danger-soft:  #f8e7e3;

  /* Lines */
  --line:         #e2d9c9;
  --line-2:       #d3c8b3;
  --line-strong:  #b9ac94;
  --line-ink:     rgba(20, 32, 30, 0.10);
  --line-invert:  rgba(250, 247, 241, 0.18);

  /* Dark editorial surfaces */
  --dark:         #12211e;
  --dark-2:       #193029;
  --dark-line:    rgba(250, 247, 241, 0.14);
  --dark-text:    #f2eee6;
  --dark-muted:   rgba(242, 238, 230, 0.68);
  --dark-faint:   rgba(242, 238, 230, 0.55); /* M11: >=4.5:1 on --dark-2 (was 0.42, 3.41:1) */

  --white:        #ffffff;
  --paper-rgb:    250, 247, 241;

  /* Typography */
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "STSong", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-display: clamp(2.05rem, 1.35rem + 2.2vw, 3.15rem);
  --fs-h1:      clamp(1.85rem, 1.25rem + 1.7vw, 2.6rem);
  --fs-h2:      clamp(1.5rem, 1.1rem + 1.15vw, 2.05rem);
  --fs-h3:      clamp(1.15rem, 1.02rem + 0.4vw, 1.35rem);
  --fs-h4:      1.0625rem;
  --fs-lede:    clamp(1.0625rem, 1rem + 0.28vw, 1.1875rem);
  --fs-body:    1rem;
  --fs-sm:      0.9375rem;
  --fs-xs:      0.8125rem;
  --fs-2xs:     0.75rem;
  --fs-metric:  clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem);

  --lh-tight:   1.22;
  --lh-snug:    1.4;
  --lh-body:    1.78;
  --lh-loose:   2;

  --ls-eyebrow: 0.16em;
  --ls-title:   -0.005em;

  /* Space */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 72px; --s11: 96px;

  /* Shape — moderate radius, editorial restraint */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(20, 32, 30, 0.05);
  --shadow-sm: 0 2px 6px -2px rgba(20, 32, 30, 0.10), 0 1px 2px rgba(20, 32, 30, 0.05);
  --shadow-md: 0 12px 28px -18px rgba(20, 32, 30, 0.30), 0 2px 6px -3px rgba(20, 32, 30, 0.08);
  --shadow-lg: 0 30px 60px -34px rgba(20, 32, 30, 0.36), 0 4px 12px -6px rgba(20, 32, 30, 0.10);
  --shadow-ring: 0 0 0 1px var(--line);
  --focus: 0 0 0 3px rgba(39, 75, 159, 0.28);

  /* Layout */
  --container: 1200px;
  --container-wide: 1320px;
  --container-narrow: 860px;
  --gutter: 24px;
  --section-y: clamp(3.25rem, 2rem + 4vw, 5.5rem);
  --header-h: 68px;

  --z-header: 60;
  --z-sticky: 70;
  --z-overlay: 90;
  --z-toast: 100;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-deep); }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote, p, h1, h2, h3, h4, h5, h6, dl, dd, dt { margin: 0; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
[hidden] { display: none !important; }
/* M9 A1/A2: a [hidden] element stays hidden even when a width-scoped .only-* rule
   sets display !important (specificity 0,2,0 beats 0,1,0). */
[hidden].only-mobile, [hidden].only-tablet, [hidden].only-compact,
[hidden].only-desktop, [hidden].only-desktop-flex { display: none !important; }

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--sand-soft); color: var(--ink); }

/* ------------------------------------------------------------- typography */

h1, h2, h3, h4 { font-weight: 600; }

.display,
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--ls-title);
  color: var(--ink);
  text-wrap: balance;
}

.display { font-size: var(--fs-display); line-height: var(--lh-tight); }
.h1      { font-size: var(--fs-h1);      line-height: 1.28; }
.h2      { font-size: var(--fs-h2);      line-height: 1.34; }
.h3      { font-size: var(--fs-h3);      line-height: 1.42; }
.h4      { font-family: var(--font-sans); font-size: var(--fs-h4); line-height: 1.5; font-weight: 600; }

.lede {
  font-size: var(--fs-lede);
  line-height: 1.72;
  color: var(--ink-2);
  text-wrap: pretty;
}
.body    { font-size: var(--fs-body); color: var(--ink-2); }
.body-sm { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.72; }
.muted   { color: var(--ink-3); }
.faint   { color: var(--ink-4); }
.strong  { font-weight: 600; color: var(--ink); }
.num     { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Editorial eyebrow: numbered chapter label, one of the strongest
   signals that this is an academy and not a SaaS landing page. */
.eyebrow {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--green);
}
.eyebrow__index {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-4);
  letter-spacing: 0.08em;
}
.eyebrow--ink { color: var(--ink); }
.eyebrow--light { color: var(--sage-soft); }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}
.rule--ink { background: var(--ink); height: 2px; }

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

.shell { min-height: 100%; display: flex; flex-direction: column; }
.shell__main { flex: 1 1 auto; }
.shell__main:focus { outline: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }

.section--paper2 { background: var(--paper-2); }
.section--paper3 { background: var(--paper-3); }
.section--sand   { background: var(--sand-tint); }
.section--sage   { background: var(--sage-tint); }
.section--green-tint { background: var(--green-tint); }
.section--dark {
  background: var(--dark);
  color: var(--dark-text);
}
.section--dark .h1, .section--dark .h2, .section--dark .h3, .section--dark .display { color: var(--dark-text); }
.section--dark .lede { color: var(--dark-muted); }
.section--dark .body, .section--dark .body-sm { color: var(--dark-muted); }
.section--dark .rule { background: var(--dark-line); }
.section--dark .eyebrow { color: var(--sage); }

/* The one dark band on program detail is a thin editorial strip, not a page. */
.section--band { background: var(--dark-2); color: var(--dark-text); padding-block: clamp(1.75rem, 1.2rem + 2vw, 3rem); }

.grid { display: grid; gap: var(--s6); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid--gap-lg { gap: var(--s7); }
.grid--gap-sm { gap: var(--s4); }

.split { display: grid; gap: var(--s8); align-items: start; }
.split--hero { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: clamp(2rem, 1rem + 3vw, 4.5rem); align-items: center; }
.split--aside { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: clamp(2rem, 1rem + 3vw, 4rem); }
.split--aside-left { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(2rem, 1rem + 3vw, 4rem); }
.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; }
.stack--2 { gap: var(--s2); } .stack--3 { gap: var(--s3); } .stack--4 { gap: var(--s4); }
.stack--5 { gap: var(--s5); } .stack--6 { gap: var(--s6); } .stack--7 { gap: var(--s7); }
.stack--8 { gap: var(--s8); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--top { align-items: flex-start; }
.row--gap-sm { gap: var(--s2); }
.row--gap-lg { gap: var(--s6); }
.row--baseline { align-items: baseline; }

.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------------------------------------------------------------- surfaces */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel--paper { background: var(--paper); }
.panel--paper2 { background: var(--paper-2); }
.panel--ink { background: var(--ink); border-color: var(--ink); color: var(--dark-text); }
.panel--green { background: var(--green-tint); border-color: var(--green-soft); }
.panel--pad { padding: var(--s7); }
.panel--pad-sm { padding: var(--s5); }
.panel--pad-lg { padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.panel--shadow { box-shadow: var(--shadow-md); }
.panel--flat { border-radius: var(--r-md); }

.inset {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  padding: var(--s5);
}

.hairline-top { border-top: 1px solid var(--line); padding-top: var(--s5); }
.hairline-bottom { border-bottom: 1px solid var(--line); padding-bottom: var(--s5); }

/* Editorial numbered block: used instead of yet another card. */
.numlist { counter-reset: numlist; }
.numlist__item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--s5);
  padding-block: var(--s6);
  border-top: 1px solid var(--line);
}
.numlist__item:last-child { border-bottom: 1px solid var(--line); }
.numlist__index {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-4);
  letter-spacing: 0.04em;
  padding-top: 6px;
}

/* ------------------------------------------------------------------ utils */

.only-mobile, .only-tablet { display: none !important; }
.only-desktop { display: block; }
.only-desktop-flex { display: flex; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 999;
  background: var(--ink); color: var(--dark-text);
  padding: 10px 16px; border-radius: var(--r-sm);
  transition: top 0.16s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--dark-text); }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.max-60 { max-width: 60ch; }
.max-46 { max-width: 46ch; }
.max-70 { max-width: 70ch; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.divider-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-5); display: inline-block; }

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

@media (max-width: 1023px) {
  :root { --gutter: 22px; }
  .only-desktop, .only-desktop-flex { display: none !important; }
  .only-tablet { display: block !important; }
  .split--hero, .split--aside, .split--aside-left { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  :root {
    --gutter: 18px;
    --r-lg: 14px;
    --r-xl: 18px;
  }
  .only-mobile { display: block !important; }
  .only-tablet { display: none !important; }
  .grid--2, .grid--3, .grid--4, .grid--5 { grid-template-columns: minmax(0, 1fr); }
  .split--even { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: var(--s5); }
  .numlist__item { grid-template-columns: 34px minmax(0, 1fr); gap: var(--s4); }
  .panel--pad, .panel--pad-lg { padding: var(--s5); }
  .row { gap: var(--s2); }
}

@media (min-width: 600px) and (max-width: 1023px) {
  .only-mobile { display: none !important; }
  .only-tablet { display: block !important; }
}

/* M9 A2: the compact header menu (phone and tablet) is shown up to 1023px and
   hidden only on the desktop nav breakpoint. */
@media (min-width: 1024px) {
  .only-compact { display: none !important; }
}

@media print {
  .site-header, .site-footer, .sticky-cta, .toast-host, .overlay-host { display: none !important; }
}
