/* Study Chinese — sitewide design system (Jade Academy).
   Warm ivory paper + deep jade + gold + restrained cinnabar. Shared by every page.
   Component patterns live in ui.css; this file owns tokens, base, nav, footer, forms. */

:root {
  /* surfaces */
  --paper: #FAF8EF;
  --paper-2: #F3F1E5;
  --mint: #EAF6EC;
  --mint-2: #DFF1E4;
  --card: #FFFFFF;

  /* jade scale */
  --jade: #15A24A;
  --jade-bright: #18B257;
  --jade-deep: #0C7A37;
  --jade-700: #0A6A33;
  --jade-soft: #DCF4E2;
  --jade-soft-2: #E9F8EC;

  /* dark forest (footer / dark sections) */
  --forest: #06251A;
  --forest-2: #0A3122;
  --forest-card: #103A29;

  /* warm accents */
  --gold: #F4B740;
  --gold-deep: #A96F06;
  --gold-soft: #FBEFCB;
  --cinnabar: #B8442C;          /* muted Chinese red — seals + rare accents only */
  --cinnabar-soft: #F7E3DC;

  /* ink */
  --ink: #182420;
  --ink2: #4A5A50;
  --muted: #6E7E73;
  --on-dark: #EDF8F0;
  --on-dark2: #A9CFB7;

  --border: #E3E0D0;
  --border-mint: #D5EADB;
  --ring: #0C7A37;

  --jade-grad: linear-gradient(135deg, #18B257 0%, #0E9F6E 100%);
  --gold-grad: linear-gradient(135deg, #FFCB52, #F0A50E);

  --shadow-sm: 0 4px 14px -6px rgba(20, 45, 30, .12);
  --shadow: 0 12px 32px -10px rgba(11, 60, 35, .14);
  --shadow-lg: 0 30px 64px -28px rgba(9, 52, 30, .30);
  --shadow-xl: 0 54px 120px -44px rgba(6, 40, 24, .42);
  --shadow-jade: 0 18px 38px -14px rgba(15, 140, 64, .45);
  --shadow-gold: 0 14px 30px -12px rgba(213, 150, 16, .45);
  --hi: inset 0 1.5px 0 rgba(255, 255, 255, .65);

  --r-sm: 12px; --r-md: 20px; --r-lg: 28px; --r-xl: 40px; --r-pill: 999px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --maxw: 1180px;
  --pad: clamp(70px, 10vw, 132px);

  --f-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --f-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --f-hanzi: 'Noto Serif SC', 'Songti SC', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body); color: var(--ink); background: var(--paper);
  line-height: 1.62; font-size: 16.5px; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.06; letter-spacing: -.024em; font-weight: 700; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
/* height:auto keeps the attr-derived aspect ratio when CSS overrides width —
   without it, a width-styled img keeps its height="" attribute and stretches. */
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--jade-soft); color: var(--jade-700); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.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; }

.ic { width: 1.3em; height: 1.3em; display: inline-block; vertical-align: -.2em; flex: none; }
.ic-lg { width: 28px; height: 28px; }
.ic-sm { width: 16px; height: 16px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 600;
  font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--jade-deep); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--jade); }
.eyebrow.on-dark { color: #8FE6B0; }
.eyebrow.on-dark::before { background: #8FE6B0; }

/* red seal stamp — the one cultural accent, used sparingly */
.seal {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  background: var(--cinnabar); color: #FCEFE8; border-radius: 10px;
  font-family: var(--f-hanzi); font-weight: 700; font-size: 1.45rem; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(252, 239, 232, .38), 0 8px 18px -8px rgba(140, 46, 26, .55);
  transform: rotate(-3deg);
}
.seal-sm { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 8px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--f-display); font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border-radius: var(--r-pill); border: 0; cursor: pointer; white-space: nowrap;
  transition: transform .16s var(--ease-out), box-shadow .3s var(--ease-out), background .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--jade); color: #fff; box-shadow: var(--shadow-jade), var(--hi); }
.btn-gold { background: var(--gold-grad); color: #3D2A03; box-shadow: var(--shadow-gold), var(--hi); }
.btn-light { background: #fff; color: var(--jade-deep); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--jade-deep); border: 1.5px solid var(--border-mint); }
.btn-ghost-dark { background: rgba(255, 255, 255, .06); color: var(--on-dark); border: 1.5px solid rgba(236, 248, 239, .26); }
.btn-lg { padding: 17px 32px; font-size: 1.08rem; }
.btn-sm { padding: 10px 18px; font-size: .92rem; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 26px 50px -16px rgba(15, 140, 64, .6), var(--hi); }
  .btn-gold:hover { transform: translateY(-2px); box-shadow: 0 24px 46px -14px rgba(213, 150, 16, .6), var(--hi); }
  .btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .btn-ghost:hover { border-color: var(--jade); transform: translateY(-2px); }
  .btn-ghost-dark:hover { border-color: #8FE6B0; color: #fff; background: rgba(255, 255, 255, .1); transform: translateY(-2px); }
}

.badge {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-display); font-weight: 600; font-size: .78rem;
  color: var(--jade-deep); background: var(--jade-soft); padding: 6px 14px; border-radius: var(--r-pill);
}
.badge-gold { color: var(--gold-deep); background: var(--gold-soft); }
.badge-red { color: var(--cinnabar); background: var(--cinnabar-soft); }

.link-arrow { font-weight: 700; color: var(--jade-deep); display: inline-flex; align-items: center; gap: 7px; }
.link-arrow .ic { transition: transform .2s var(--ease-out); }
.link-arrow:hover .ic { transform: translateX(4px); }

/* ============ REVEALS ============ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); }
.js .reveal.from-left { transform: translateX(-40px); }
.js .reveal.pop { transform: scale(.94); }
.js .reveal.in { opacity: 1; transform: none; }

/* ============ ANNOUNCEMENT BAR ============ */
.annc { background: var(--forest); color: var(--on-dark); font-size: .88rem; }
.annc-in { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; padding-block: 7px; flex-wrap: wrap; text-align: center; }
.annc b { color: #8FE6B0; font-weight: 700; }
.annc a { color: var(--gold); font-weight: 700; white-space: nowrap; border-bottom: 1px solid rgba(244, 183, 64, .4); }
.annc a:hover { border-color: var(--gold); }

/* ============ NAV ============ */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(250, 248, 239, .86); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); transition: box-shadow .3s var(--ease-out); }
.nav.scrolled { box-shadow: 0 1px 0 var(--border), 0 10px 30px -18px rgba(11, 60, 35, .18); }
.nav-in { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 1.14rem; flex: none; white-space: nowrap; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; box-shadow: 0 5px 14px -5px rgba(9, 52, 30, .45), 0 0 0 1px rgba(11, 60, 35, .06); transition: transform .2s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.05); }

.nav-links { display: none; align-items: center; gap: 4px; margin-left: 14px; font-weight: 600; color: var(--ink2); font-size: .93rem; }
.nav-links > a, .nav-drop > button {
  display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; border-radius: var(--r-pill);
  background: transparent; border: 0; cursor: pointer; font: inherit; color: inherit; transition: background .2s, color .2s;
}
.nav-links > a:hover, .nav-drop > button:hover, .nav-links > a.is-active { background: var(--mint); color: var(--jade-700); }
.nav-drop { position: relative; }
.nav-drop .caret { width: 14px; height: 14px; transition: transform .2s var(--ease-out); }
.nav-drop.open .caret { transform: rotate(180deg); }
.drop-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 250px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px;
  display: none; z-index: 60;
}
.nav-drop.open .drop-menu { display: block; animation: drop-in .22s var(--ease-out); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }
.drop-menu a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; font-weight: 600; color: var(--ink); transition: background .15s; }
.drop-menu a:hover { background: var(--mint); }
.drop-menu a .drop-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--jade-soft); color: var(--jade-deep); flex: none; }
.drop-menu a .drop-ic .ic { width: 18px; height: 18px; }
.drop-menu a small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; line-height: 1.3; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-signin { font-weight: 700; color: var(--ink2); font-size: .93rem; padding: 9px 13px; border-radius: var(--r-pill); transition: background .2s, color .2s; }
.nav-signin:hover { background: var(--mint); color: var(--jade-700); }
.nav-cta { padding: 11px 20px; font-size: .93rem; }

/* mobile toggle + sheet */
.nav-burger { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); cursor: pointer; color: var(--ink); }
.nav-burger .ic { width: 22px; height: 22px; }
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; background: var(--paper); display: none; flex-direction: column;
  padding: 18px clamp(20px, 5vw, 40px) 30px; overflow-y: auto;
}
.mobile-menu.open { display: flex; animation: sheet-in .3s var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } }
.mm-head { display: flex; align-items: center; justify-content: space-between; height: 56px; margin-bottom: 10px; }
.mm-group { border-bottom: 1px solid var(--border); padding-block: 14px; }
.mm-group h4 { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.mm-group a { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; font-family: var(--f-display); font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.mm-group a .ic { color: var(--muted); width: 18px; height: 18px; }
.mm-cta { margin-top: auto; padding-top: 22px; display: flex; flex-direction: column; gap: 10px; }

@media (min-width: 1060px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}
@media (max-width: 1059px) { .nav-signin { display: none; } }
@media (max-width: 560px)  { .nav-cta { display: none; } }

/* ============ FORMS ============ */
.field-label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 7px; color: var(--ink); }
.field-label small { font-weight: 500; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font-family: var(--f-body); font-size: 1rem; font-weight: 500; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px; padding: 13px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236E7E73' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-msg { font-size: .95rem; font-weight: 700; margin-top: 12px; min-height: 1.2em; }
.form-msg.ok { color: var(--jade-deep); animation: msg-pop .35s var(--ease-out); }
.form-msg.err { color: var(--cinnabar); }
@keyframes msg-pop { from { opacity: 0; transform: scale(.92) translateY(4px); } }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--ink2); }
.consent input { margin-top: 4px; accent-color: var(--jade); width: 17px; height: 17px; flex: none; }

/* inline email waitlist row (announcement/footer use) */
.waitlist-row { display: flex; gap: 10px; background: var(--card); padding: 8px; border-radius: var(--r-pill); box-shadow: var(--shadow); border: 1px solid var(--border); }
.waitlist-row .input { border: 0; background: transparent; box-shadow: none !important; padding: 8px 14px; }
.waitlist-row:focus-within { border-color: var(--jade); box-shadow: var(--shadow), 0 0 0 3px var(--jade-soft); }

/* ============ FOOTER ============ */
.foot { background: var(--forest); color: var(--on-dark2); padding: clamp(48px, 7vw, 84px) 0 34px; position: relative; overflow: clip; }
.foot::before { content: "学"; position: absolute; right: -3%; bottom: -18%; font-family: var(--f-hanzi); font-weight: 700; font-size: clamp(16rem, 30vw, 28rem); color: #fff; opacity: .028; line-height: 1; pointer-events: none; }
.foot-grid { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 34px; }
.brand-light { color: var(--on-dark); }
.foot-tag { font-family: var(--f-display); font-weight: 600; color: var(--on-dark); margin-top: 16px; font-size: 1.05rem; max-width: 26ch; }
.foot-made { font-size: .88rem; margin-top: 8px; }
.foot-social { display: flex; gap: 10px; margin-top: 18px; }
.foot-social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-pill); background: var(--forest-card); border: 1px solid rgba(143, 230, 176, .18); color: var(--on-dark); transition: transform .2s var(--ease-out), border-color .2s; }
.foot-social a:hover { transform: translateY(-3px); border-color: var(--jade-bright); }
.foot-social .ic { width: 19px; height: 19px; }
.foot h4 { color: var(--on-dark); font-size: .8rem; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 14px; }
.foot-col a { display: block; padding-block: 5px; font-weight: 600; font-size: .93rem; color: var(--on-dark2); transition: color .2s; }
.foot-col a:hover { color: #fff; }
.foot-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(143, 230, 176, .12); font-size: .87rem; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: relative; }
.foot-bottom a { color: var(--on-dark2); } .foot-bottom a:hover { color: #fff; }
@media (max-width: 980px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ============ SECTION PRIMITIVES ============ */
.section { padding: var(--pad) 0; position: relative; }
.section-mint { background: linear-gradient(180deg, var(--mint) 0%, var(--paper) 100%); }
.section-mint-solid { background: var(--mint); border-block: 1px solid var(--border-mint); }
.section-dark { background: radial-gradient(120% 90% at 78% 0%, var(--forest-2), var(--forest) 72%); color: var(--on-dark); }
.sec-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); font-weight: 800; margin-bottom: 16px; }
.sec-head p { color: var(--ink2); font-size: clamp(1.02rem, 1.5vw, 1.16rem); }
.section-dark .sec-head p { color: var(--on-dark2); }
.sec-head .hl { color: var(--jade-deep); }
.section-dark .hl { color: #8FE6B0; }

/* ink landscape divider (decorative) */
.ink-hills { display: block; width: 100%; height: clamp(46px, 7vw, 96px); color: var(--mint-2); }
.ink-hills.on-paper { color: var(--paper-2); }
