/* ============================================================
   Ritong — overseas destiny charting site
   Celestial / mystical theme · responsive
   ============================================================ */

:root {
  --bg: #0b0720;
  --bg-2: #120a2e;
  --surface: #170d34;
  --surface-2: #1d1140;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ece7fb;
  --muted: #b3a9d6;
  --gold: #e7c469;
  --gold-2: #d4a53a;
  --violet: #8b6dff;
  --radius: 18px;
  --maxw: 1160px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, #2a1556 0%, transparent 60%),
    radial-gradient(900px 600px at 0% 20%, #1a0e3a 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Starry background */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(231,196,105,.8), transparent),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 15% 65%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 90% 75%, rgba(139,109,255,.7), transparent);
  opacity: .55;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }
.container.narrow { max-width: 760px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 7, 32, 0.6);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { color: var(--gold); font-size: 20px; }
.brand-name { font-family: var(--font-serif); font-size: 24px; font-weight: 700; letter-spacing: .5px; }

.main-nav { display: flex; gap: 26px; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color .2s; }
.main-nav a:hover { color: var(--text); }

.header-tools { display: flex; align-items: center; gap: 14px; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; transition: border-color .2s;
}
.lang-btn:hover { border-color: var(--gold); }
.lang-menu {
  position: absolute; right: 0; top: 120%; margin: 0; padding: 6px; list-style: none;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); min-width: 170px; z-index: 60;
}
.lang-menu li button {
  width: 100%; text-align: left; background: none; border: 0; color: var(--text);
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.lang-menu li button:hover { background: rgba(255,255,255,.07); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%); color: #241704; box-shadow: 0 10px 26px rgba(212,165,58,.32); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-block { display: flex; width: 100%; }

/* Mobile nav toggle */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* Hero */
.hero { padding: 70px 0 60px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.eyebrow { color: var(--gold); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 14px; }
.hero-title { font-family: var(--font-serif); font-size: clamp(34px, 5vw, 56px); line-height: 1.1; margin: 0 0 18px; font-weight: 700; }
.hero-sub { color: var(--muted); font-size: 18px; max-width: 540px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 16px 26px; color: var(--muted); font-size: 14px; }

/* Hero animated chart */
.hero-art { display: flex; justify-content: center; }
.chart-orbit { position: relative; width: 340px; height: 340px; }
.chart-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-size: 40px; color: #241704;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold-2));
  box-shadow: 0 0 40px rgba(231,196,105,.6);
}
.orbit-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border: 1px dashed rgba(255,255,255,.18); border-radius: 50%; }
.r1 { width: 160px; height: 160px; animation: spin 26s linear infinite; }
.r2 { width: 240px; height: 240px; animation: spin 40s linear infinite reverse; }
.r3 { width: 320px; height: 320px; animation: spin 55s linear infinite; }
.node { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px; display: grid; place-items: center; font-size: 22px; color: var(--violet); filter: drop-shadow(0 0 8px rgba(139,109,255,.6)); }
.n1 { transform: rotate(0deg) translateY(-80px); }
.n2 { transform: rotate(60deg) translateY(-120px); color: var(--gold); }
.n3 { transform: rotate(120deg) translateY(-160px); }
.n4 { transform: rotate(180deg) translateY(-80px); color: #7fe3d0; }
.n5 { transform: rotate(240deg) translateY(-120px); color: #ff8fcf; }
.n6 { transform: rotate(300deg) translateY(-160px); color: #ffd27f; }
@keyframes spin { from { transform: translate(-50%,-50%) rotate(0); } to { transform: translate(-50%,-50%) rotate(360deg); } }

/* Sections */
.section { padding: 82px 0; }
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.section-head h2 { font-family: var(--font-serif); font-size: clamp(28px, 4vw, 42px); margin: 0 0 12px; font-weight: 700; }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }

/* Grids */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(231,196,105,.4); }
.card-icon { font-size: 34px; margin-bottom: 14px; }
.card h3 { font-family: var(--font-serif); font-size: 24px; margin: 0 0 10px; }
.card p { color: var(--muted); margin: 0; }

.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; transition: border-color .2s, transform .2s; }
.tile:hover { border-color: var(--gold); transform: translateY(-3px); }
.tile h4 { margin: 0 0 8px; font-size: 18px; color: var(--gold); }
.tile p { margin: 0; color: var(--muted); font-size: 15px; }

/* Steps */
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.steps li { text-align: center; position: relative; }
.step-num { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #241704; font-weight: 700; font-size: 22px; font-family: var(--font-serif); }
.steps h3 { margin: 0 0 8px; font-size: 20px; font-family: var(--font-serif); }
.steps p { margin: 0; color: var(--muted); }

/* Pricing */
.pricing { align-items: start; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; }
.plan-featured { border-color: var(--gold); box-shadow: 0 20px 60px rgba(231,196,105,.18); transform: translateY(-8px); }
.plan h3 { font-family: var(--font-serif); font-size: 24px; margin: 0 0 10px; }
.price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 20px; }
.price .amt { font-size: 40px; font-weight: 700; font-family: var(--font-serif); color: var(--gold); }
.price .per { color: var(--muted); font-size: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.plan li { padding: 9px 0; border-bottom: 1px dashed var(--line); color: var(--muted); font-size: 15px; }
.badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #241704; font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; letter-spacing: .5px; }
.pricing-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 26px; }

/* About / company */
.company-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; max-width: 760px; margin: 0 auto; }
.company-card h3 { font-family: var(--font-serif); margin: 0 0 16px; font-size: 22px; }
.company-card dl { margin: 0; display: grid; gap: 12px; }
.company-card dl > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.company-card dt { color: var(--gold); font-weight: 600; }
.company-card dd { margin: 0; color: var(--muted); }

/* Contact form */
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-family: inherit; font-size: 15px; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.consent input { margin-top: 3px; }
.form-status { margin: 14px 0 0; font-size: 14px; min-height: 20px; }
.form-status.ok { color: #7fe3a8; }
.form-status.err { color: #ff8f9c; }

.disclaimer { text-align: center; color: var(--muted); font-size: 13px; max-width: 760px; margin: 0 auto; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 46px 0 30px; background: rgba(0,0,0,.2); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 30px; align-items: start; }
.footer-brand .brand-name { font-size: 22px; }
.footer-brand p { color: var(--muted); margin: 8px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--gold); }
.footer-contact a { color: var(--gold); text-decoration: none; }
.footer-legal { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* Legal pages */
.legal-page { padding: 60px 0 80px; }
.legal-page .container { max-width: 840px; }
.legal-page h1 { font-family: var(--font-serif); font-size: clamp(30px, 5vw, 44px); margin: 10px 0 6px; }
.legal-updated { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.legal-body h2 { font-family: var(--font-serif); font-size: 24px; margin: 32px 0 10px; color: var(--gold); }
.legal-body p, .legal-body li { color: var(--muted); }
.legal-body ul { padding-left: 20px; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--gold); text-decoration: none; }
.back-link::before { content: "\2190  "; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-art { order: 1; }
  .hero-actions, .hero-badges { justify-content: center; }
  .grid-2, .grid-3, .steps { grid-template-columns: 1fr; }
  .plan-featured { transform: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .company-card dl > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 820px) {
  .main-nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface-2); border-bottom: 1px solid var(--line);
    padding: 10px 22px 18px; display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: flex; }
  .header-tools .btn { display: none; }
}
