/* Rushi (如是) — landing styles
   A warm, paper-and-ink palette inspired by the in-app theme: cream paper,
   sandalwood, vermillion accent, slate ink. Mobile-first, no JS framework. */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --paper:     #F2E6CC;
  --paper-2:   #E8D8B7;
  --paper-3:   #D7C29B;
  --ink:       #2A1F12;
  --ink-2:     #4A3A26;
  --muted:     #6E5A40;
  --line:      rgba(74, 58, 38, 0.16);
  --wood:      #5A371B;
  --wood-deep: #2A1408;
  --wood-light:#8C5A36;
  --vermilion: #B84A2E;
  --vermilion-dark: #8E2C18;
  --jade:      #4F7A60;
  --gold:      #B98A3C;
  --surface:   rgba(255, 250, 240, 0.62);
  --surface-2: rgba(255, 250, 240, 0.92);
  --shadow-sm: 0 1px 3px rgba(74, 58, 38, 0.08);
  --shadow-md: 0 4px 18px rgba(74, 58, 38, 0.10);
  --shadow-lg: 0 18px 48px rgba(74, 58, 38, 0.14);
  --radius:    14px;
  --radius-lg: 22px;
  --max-w:     1120px;
  --serif: 'Noto Serif SC', 'Songti SC', 'Songti TC', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, #F8EDD2 0%, transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 55%, var(--paper-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--vermilion-dark); text-decoration: none; }
a:hover { color: var(--vermilion); text-decoration: underline; text-underline-offset: 2px; }

/* ------------ Nav ------------ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(242, 230, 204, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 14px 22px;
  display: flex; align-items: center; gap: 18px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.nav-brand img { width: 30px; height: 30px; border-radius: 7px; box-shadow: var(--shadow-sm); }
.nav-brand .name-cn { font-family: var(--serif); font-size: 18px; }
.nav-brand .name-en { font-size: 13px; color: var(--muted); margin-left: 4px; }
.nav-links { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--vermilion-dark); text-decoration: none; }
@media (max-width: 720px) {
  .nav-links a:not(.btn) { display: none; }
}

/* ------------ Layout ------------ */
.section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 80px 22px;
}
.section-narrow { max-width: 880px; }

.eyebrow {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--vermilion-dark); font-weight: 600;
  margin-bottom: 14px;
}

h1, h2, h3 {
  font-family: var(--serif); color: var(--ink); letter-spacing: -0.005em;
  font-weight: 600;
}
h1 { font-size: clamp(36px, 6vw, 58px); line-height: 1.18; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.22; margin-bottom: 14px; }
h3 { font-size: 20px; line-height: 1.35; }
.lede { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 640px; }

/* ------------ Hero ------------ */
.hero {
  text-align: center;
  padding: 80px 22px 40px;
  max-width: 880px; margin: 0 auto;
}
.hero-icon {
  width: 112px; height: 112px;
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}
.hero h1 {
  margin: 0 auto 18px;
  max-width: 780px;
}
.hero h1 .glyph {
  font-family: var(--serif);
  background: linear-gradient(135deg, var(--vermilion) 0%, var(--wood) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede { margin: 0 auto 14px; }
.hero p.subtitle { color: var(--muted); margin-top: 6px; font-family: var(--serif); font-size: 17px; }

.cta-row {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin: 32px 0 18px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  cursor: pointer; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--wood-deep); color: var(--paper); box-shadow: var(--shadow-lg); }
.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
.btn svg { flex-shrink: 0; }

.hero-meta {
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  margin-top: 8px;
}
.hero-meta span::before { content: "·"; margin-right: 18px; color: var(--line); }
.hero-meta span:first-child::before { content: ""; margin: 0; }

/* ------------ Language dropdown ------------ */
.lang-dropdown { position: relative; }
.lang-dropdown-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  font-family: var(--sans);
}
.lang-dropdown-trigger:hover { background: var(--surface-2); border-color: var(--ink); color: var(--ink); }
.lang-dropdown-trigger svg { opacity: 0.7; }
.lang-dropdown-trigger .caret { font-size: 9px; opacity: 0.65; margin-left: 2px; }
.lang-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 168px;
  background: rgba(255, 250, 240, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 200;
}
.lang-dropdown-menu.open { display: block; }
.lang-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: transparent;
  border: none; border-radius: 8px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.lang-dropdown-item:hover { background: rgba(74, 58, 38, 0.06); color: var(--ink); }
.lang-dropdown-item.active { color: var(--ink); font-weight: 600; background: rgba(184, 74, 46, 0.08); }
.lang-dropdown-item.active::before { content: "✓ "; color: var(--vermilion-dark); font-weight: 700; }

/* ------------ Hero poster row ------------ */
.hero-posters {
  max-width: 1200px;
  margin: 30px auto 0;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.hero-poster {
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 250, 240, 0.45);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-poster:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.hero-poster img {
  width: 100%; height: auto; display: block;
}
@media (max-width: 980px) {
  .hero-posters { grid-template-columns: repeat(3, 1fr); }
  .hero-posters > .hero-poster:nth-child(4),
  .hero-posters > .hero-poster:nth-child(5) { display: none; }
}
@media (max-width: 580px) {
  .hero-posters {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 65%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 16px;
    gap: 12px;
  }
  .hero-posters > .hero-poster { scroll-snap-align: center; }
  .hero-posters > .hero-poster:nth-child(4),
  .hero-posters > .hero-poster:nth-child(5) { display: block; }
}

/* ------------ Stats / facts ------------ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  max-width: var(--max-w); margin: 40px auto 0;
  padding: 0 22px;
}
.stat {
  text-align: center;
  padding: 22px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat .num { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--wood); display: block; }
.stat .label { font-size: 13px; color: var(--muted); margin-top: 6px; display: block; }

/* ------------ Features ------------ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 40px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.feature-glyph {
  font-family: var(--serif);
  font-size: 28px; color: var(--vermilion-dark);
  display: inline-block; margin-bottom: 10px;
  line-height: 1;
}
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--ink-2); font-size: 14.5px; }

/* ------------ Screenshots strip ------------ */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 36px;
}
.shot {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.shot img { width: 100%; height: auto; display: block; }
.shot-caption { padding: 12px 14px; font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* ------------ Languages strip ------------ */
.lang-strip {
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 36px 22px;
}
.lang-strip-label {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.lang-list {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 18px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-2);
  max-width: 760px; margin: 0 auto;
}
.lang-list span { white-space: nowrap; }
.lang-list span::after {
  content: "·"; margin-left: 18px; color: var(--line);
}
.lang-list span:last-child::after { content: ""; }

/* ------------ Sutras / open-source ------------ */
.sutras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.sutra-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.sutra-card .title-cn {
  font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink);
  margin-bottom: 4px;
}
.sutra-card .title-en { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.sutra-card .meta { font-size: 13px; color: var(--ink-2); }
.sutra-card .meta strong { color: var(--ink); }

/* ------------ CTA section ------------ */
.cta-section {
  text-align: center;
  background:
    linear-gradient(180deg, transparent 0%, rgba(184, 74, 46, 0.04) 100%);
  padding: 80px 22px 100px;
  border-top: 1px solid var(--line);
}

/* ------------ Footer ------------ */
footer {
  padding: 50px 22px 70px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.foot-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 30px;
  justify-content: space-between; align-items: flex-start;
}
.foot-brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 18px; color: var(--ink);
}
.foot-brand img { width: 40px; height: 40px; border-radius: 9px; }
.foot-links { display: flex; gap: 28px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 8px; min-width: 130px; }
.foot-col-title {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.foot-col a { color: var(--ink-2); font-size: 14px; }
.foot-col a:hover { color: var(--vermilion-dark); }
.foot-bottom {
  max-width: var(--max-w); margin: 36px auto 0;
  padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--muted);
}

/* ------------ Legal pages ------------ */
.legal-page {
  max-width: 760px; margin: 0 auto;
  padding: 60px 22px 80px;
  font-size: 16px; line-height: 1.78;
  color: var(--ink-2);
}
.legal-page h1 {
  font-size: 38px; color: var(--ink); margin-bottom: 8px;
}
.legal-page h2 {
  font-size: 22px; color: var(--ink); margin: 36px 0 10px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.legal-page h2:first-of-type { padding-top: 0; border-top: none; }
.legal-page p { margin-bottom: 14px; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin-bottom: 14px; }
.legal-page li { margin-bottom: 6px; }
.legal-page table {
  width: 100%; margin: 12px 0 18px;
  border-collapse: collapse; font-size: 14.5px;
}
.legal-page th, .legal-page td {
  text-align: left; vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.legal-page th { background: var(--surface); color: var(--ink); font-weight: 600; }
.legal-page code {
  background: rgba(74, 58, 38, 0.08);
  padding: 2px 6px; border-radius: 4px;
  font-size: 13.5px; font-family: ui-monospace, SF Mono, Menlo, monospace;
}
.legal-page .updated {
  color: var(--muted); font-size: 14px; margin-bottom: 28px;
}
.back-link {
  display: inline-block; margin-bottom: 32px;
  color: var(--muted); font-size: 14px;
}

/* ------------ Misc ------------ */
.divider {
  height: 1px; background: var(--line); margin: 70px auto;
  max-width: 280px;
}
.section h2 + .lede { margin-top: 8px; max-width: 700px; }
