/* ─────────────────────────────────────────────────────────
   Cassotis IME · 言泉输入法  —  Official Site Styles
   ───────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:            #f7f3e9;
  --bg-soft:       #faf7f0;
  --bg-alt:        #f2ede1;
  --surface:       rgba(255, 251, 242, 0.88);
  --surface-solid: #fffaf2;

  --ink:       #1c2926;
  --ink-soft:  #4a5c56;
  --ink-faint: #8a9b94;

  --line:      rgba(40, 60, 52, 0.10);
  --line-soft: rgba(40, 60, 52, 0.06);

  --brand:       #194f4b;
  --brand-mid:   #2f746f;
  --brand-light: #4a9c96;

  --accent:      #b56d3a;
  --accent-soft: rgba(181, 109, 58, 0.12);

  /* Hero dark */
  --hero-bg:    #0e2a26;
  --hero-mid:   #153530;
  --hero-glow:  rgba(47, 116, 111, 0.32);

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(18, 36, 30, 0.07), 0 4px 12px rgba(18, 36, 30, 0.05);
  --shadow-md: 0 6px 24px rgba(18, 36, 30, 0.10), 0 2px 6px rgba(18, 36, 30, 0.06);
  --shadow-lg: 0 16px 56px rgba(18, 36, 30, 0.14), 0 4px 12px rgba(18, 36, 30, 0.08);

  /* Radii */
  --r-sm:  10px;
  --r-md:  18px;
  --r-lg:  26px;
  --r-xl:  36px;
  --r-pill: 999px;

  /* Layout */
  --max-w: 1160px;

  /* Type */
  --font-body:  'Inter', 'PingFang SC', 'Microsoft YaHei UI', system-ui, sans-serif;
  --font-cn:    'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
  --font-title: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ── Page shell ─────────────────────────────────────────── */
.page-shell { position: relative; overflow: hidden; }

/* Ambient blobs */
.page-shell::before,
.page-shell::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(72px);
}
.page-shell::before {
  width: 520px; height: 520px;
  top: -180px; right: -140px;
  background: rgba(181, 109, 58, 0.15);
}
.page-shell::after {
  width: 440px; height: 440px;
  bottom: -160px; left: -100px;
  background: rgba(25, 79, 75, 0.12);
}

/* ── Site Header / Nav ──────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(247, 243, 233, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  width: 100%;
  padding: 0 clamp(16px, 4vw, 40px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1;
}

.brand-text span {
  font-family: var(--font-cn);
  font-size: 0.9rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-nav a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  transition: color 0.18s, background 0.18s;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px !important;
  border: 1px solid var(--line);
  border-radius: var(--r-pill) !important;
  background: rgba(255, 250, 241, 0.8);
  color: var(--ink) !important;
  font-weight: 500;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s !important;
}

.nav-cta:hover {
  background: var(--surface-solid) !important;
  border-color: rgba(25, 79, 75, 0.2) !important;
  box-shadow: 0 2px 8px rgba(25, 79, 75, 0.08) !important;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max-w));
  margin: 0 auto;
  padding: 72px 0 64px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-mid);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-cn);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.85;
  max-width: 40rem;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-size: 0.94rem;
  font-weight: 600;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.primary-button {
  background: linear-gradient(140deg, var(--brand-mid) 0%, var(--brand) 100%);
  color: #fef8f0;
  box-shadow: 0 6px 24px rgba(25, 79, 75, 0.28), 0 1px 3px rgba(25, 79, 75, 0.2);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(25, 79, 75, 0.34), 0 2px 6px rgba(25, 79, 75, 0.18);
}

.secondary-button {
  border: 1px solid rgba(25, 79, 75, 0.18);
  background: rgba(255, 250, 241, 0.72);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.secondary-button:hover {
  background: var(--surface-solid);
  border-color: rgba(25, 79, 75, 0.28);
  transform: translateY(-1px);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-points li {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 250, 241, 0.75);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
}

.orb-a {
  width: 180px; height: 180px;
  top: -12px; right: -8px;
  background: rgba(181, 109, 58, 0.15);
}

.orb-b {
  width: 150px; height: 150px;
  bottom: 20px; left: -12px;
  background: rgba(25, 79, 75, 0.14);
}


.snapshot-card {
  position: relative;
  z-index: 1;
  padding: 16px 16px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 252, 246, 0.92), rgba(255, 248, 238, 0.80));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.snapshot-frame {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(18, 36, 30, 0.12);
}

.snapshot-frame img {
  width: 100%;
  border-radius: 10px;
}

.snapshot-card figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0 2px;
  line-height: 1.5;
}

/* ── Signal Strip ───────────────────────────────────────── */
.signal-strip {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max-w));
  margin: 0 auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-radius: var(--r-md);
  background: var(--line);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.signal-strip div {
  display: grid;
  gap: 5px;
  padding: 18px 22px;
  background: rgba(250, 247, 240, 0.90);
  backdrop-filter: blur(8px);
}

.signal-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-mid);
}

.signal-strip strong {
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
}

/* ── Section Commons ────────────────────────────────────── */
.section {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max-w));
  margin: 0 auto;
  padding: 88px 0 0;
}

.section-heading {
  margin-bottom: 36px;
}

.section-heading .eyebrow {
  margin-bottom: 12px;
}

.section h2,
.callout-card h2,
.narrative-card h2 {
  font-family: var(--font-cn);
  font-weight: 500;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ── Feature Grid ───────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  padding: 26px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 252, 246, 0.9) 0%, rgba(255, 248, 238, 0.75) 100%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(25, 79, 75, 0.15);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(25, 79, 75, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--brand-mid);
  flex-shrink: 0;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-family: var(--font-cn);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--ink);
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

/* ── Narrative ──────────────────────────────────────────── */
.narrative-card {
  padding: 38px 36px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(181, 109, 58, 0.08) 0%, transparent 35%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(255, 248, 238, 0.82));
  box-shadow: var(--shadow-md);
}

.narrative-card .eyebrow {
  margin-bottom: 14px;
}

.narrative-card h2 {
  margin-bottom: 18px;
}

.narrative-card p {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.85;
  max-width: 56ch;
}

/* ── Origin ─────────────────────────────────────────────── */
.origin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.origin-card {
  position: relative;
  padding: 28px 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 252, 246, 0.92), rgba(255, 248, 238, 0.78));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.origin-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.45;
}

.origin-card-en::before { background: rgba(181, 109, 58, 0.22); }
.origin-card-cn::before { background: rgba(25, 79, 75, 0.18); }

.origin-card-label {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(25, 79, 75, 0.08);
  color: var(--brand-mid);
  margin-bottom: 14px;
}

.origin-card h3 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

.origin-card-cn h3 {
  font-family: var(--font-cn);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.origin-card p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 12px;
}

.origin-card p:last-child { margin-bottom: 0; }

.origin-note {
  color: var(--ink-faint) !important;
  font-size: 0.84rem !important;
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-top: 14px !important;
}

/* ── Status ─────────────────────────────────────────────── */
.status-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.status-card {
  padding: 24px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 252, 246, 0.9), rgba(255, 248, 238, 0.76));
  box-shadow: var(--shadow-sm);
}

.status-card h3 {
  font-family: var(--font-cn);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
}

.status-card ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.status-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.status-card li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-light);
  flex-shrink: 0;
  margin-top: 6px;
}

.status-note {
  font-size: 0.875rem;
  color: var(--ink-faint);
  line-height: 1.7;
}

.status-note a {
  color: var(--brand-mid);
  border-bottom: 1px solid rgba(47, 116, 111, 0.3);
  transition: border-color 0.18s;
}

.status-note a:hover { border-color: var(--brand-mid); }

/* ── Callout ─────────────────────────────────────────────── */
.callout-section { padding-bottom: 80px; }

.callout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 38px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(130deg, rgba(25, 79, 75, 0.07) 0%, transparent 40%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 247, 236, 0.86));
  box-shadow: var(--shadow-md);
}

.callout-text .eyebrow { margin-bottom: 10px; }
.callout-text h2 { margin-bottom: 14px; }

.callout-text p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.75;
  max-width: 46ch;
}

.callout-cta { white-space: nowrap; flex-shrink: 0; }

/* ── Download ────────────────────────────────────────────── */
.download-section { padding-bottom: 0; }

.download-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 38px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(25, 79, 75, 0.18);
  background:
    linear-gradient(130deg, rgba(25, 79, 75, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 247, 236, 0.88));
  box-shadow: var(--shadow-md);
}

.download-info .eyebrow { margin-bottom: 10px; }
.download-info h2 { margin-bottom: 12px; }

.download-info p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 42ch;
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
  padding-top: 4px;
}

.download-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 22px;
  min-height: 46px;
  border-radius: var(--r-pill);
  font-size: 0.94rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.18s;
}

.download-btn-pending {
  background: linear-gradient(140deg, var(--brand-mid) 0%, var(--brand) 100%);
  color: #fef8f0;
  box-shadow: 0 6px 24px rgba(25, 79, 75, 0.26), 0 1px 3px rgba(25, 79, 75, 0.18);
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

/* When ready, remove the pending class and pointer-events: none above */
.download-btn:not(.download-btn-pending):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(25, 79, 75, 0.32);
}

.download-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.9);
  margin-left: 2px;
}

.download-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
  line-height: 1.6;
  text-align: right;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--ink);
  padding: 36px clamp(16px, 4vw, 40px) 28px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  opacity: 0.85;
}

.footer-name {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-title);
  letter-spacing: 0.04em;
}

.footer-name span {
  font-family: var(--font-cn);
  font-size: 0.85rem;
}

.footer-meta {
  margin-top: 3px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  gap: 8px;
}

.footer-links a {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.18s, background 0.18s;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

.footer-rule {
  max-width: var(--max-w);
  margin: 24px auto 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.footer-copy {
  max-width: var(--max-w);
  margin: 16px auto 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.22);
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1020px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .hero-visual {
    max-width: 480px;
  }

  .signal-strip {
    grid-template-columns: 1fr;
  }

  .signal-strip div + div {
    border-top: 1px solid var(--line);
  }

  .origin-grid,
  .status-layout {
    grid-template-columns: 1fr;
  }

  .callout-card,
  .download-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .callout-cta {
    align-self: flex-start;
  }

  .download-actions {
    align-items: flex-start;
  }

  .download-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .site-nav a:not(.nav-cta) { display: none; }

  .hero { width: min(calc(100% - 24px), var(--max-w)); }
  .section { width: min(calc(100% - 24px), var(--max-w)); }
  .signal-strip { width: min(calc(100% - 24px), var(--max-w)); }

  .hero h1 { font-size: 2.6rem; }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .narrative-card,
  .callout-card {
    padding: 24px 20px;
  }

  .callout-card {
    padding: 24px 22px;
  }
}
