/* Scholardo landing page — brand-aligned, light/dark, dependency-free.
   Color tokens mirror the app's BrandAccent + terminal theme palette:
     Light accent #502C9C / Dark accent #8A6BF3
     Light bg #F9F9F9 fg #161616 / Dark bg #1E1E1E fg #EDEDED            */

:root {
  --accent: #3f2d63;
  --accent-hover: #3f2280;
  --accent-soft: rgba(63, 45, 99, 0.1);
  --accent-contrast: #ffffff;

  --bg: #ffffff;
  --bg-alt: #f9f9f9;
  --surface: #ffffff;
  --surface-alt: #f4f4f6;
  --text: #0d0d0d;
  --text-secondary: #4a4a55;
  --text-muted: #8a8a94;
  --border: rgba(22, 22, 22, 0.1);
  --border-strong: rgba(22, 22, 22, 0.16);
  --shadow: 0 1px 2px rgba(22, 22, 22, 0.04), 0 12px 32px rgba(22, 22, 22, 0.06);
  --shadow-lg: 0 24px 60px rgba(40, 20, 90, 0.16);

  /* Right-angle design: containers, cards, and images are square.
     Only buttons stay pill-shaped (see .btn / .icon-btn). */
  --radius: 0;
  --radius-lg: 0;
  --maxw: 1120px;
  --font: "Cardo", "Noto Serif SC", "PingFang SC", "Hiragino Sans GB",
    Georgia, serif;
  --font-heading: "Exo 2", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "Source Code Pro", "SF Mono", "Fira Code", monospace;
}

[data-theme="dark"] {
  --accent: #8a6bf3;
  --accent-hover: #9d83f5;
  --accent-soft: rgba(138, 107, 243, 0.16);
  --accent-contrast: #15101f;

  --bg: #161616;
  --bg-alt: #1e1e1e;
  --surface: #1e1e1e;
  --surface-alt: #262626;
  --text: #ededed;
  --text-secondary: #a6a6b0;
  --text-muted: #7a7a84;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  min-width: clamp(120px, 20vw, 160px);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover {
  background: var(--accent-hover);
}
[data-theme="dark"] .btn-primary {
  color: #ffffff;
}
.btn-os-icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
}
.brand:hover {
  text-decoration: none;
  opacity: 0.85;
}
.brand img {
  height: 28px;
  width: auto;
  border-radius: 0;
  display: block;
}

/* light/dark logo switching */
[data-theme="light"] .logo-dark  { display: none; }
[data-theme="dark"]  .logo-light { display: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-family: "Source Code Pro", monospace;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-dl-btn {
  color: var(--accent);
  border-color: var(--accent);
  font-size: 1.1rem;
  position: relative;
  text-decoration: none;
}
.nav-dl-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.nav-dl-btn i {
  font-size: 1.15rem;
  line-height: 1;
}
.nav-dl-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--text);
  color: var(--bg);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 100;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

/* ---- Hero -------------------------------------------------------------- */

.hero {
  padding: 88px 0 56px;
  text-align: center;
  background: radial-gradient(
    ellipse 80% 60% at 50% -10%,
    var(--accent-soft),
    transparent 70%
  );
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 800;
  font-style: italic;
  max-width: 18ch;
  margin: 0 auto 22px;
}
[lang="zh-Hans"] .hero h1 {
  font-style: normal;
  max-width: none;
  white-space: nowrap;
}
.hero .subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 auto 32px;
}
.hero .subtitle em {
  font-style: italic;
  font-weight: 500;
  color: var(--text);
}
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-meta {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.hero-meta [data-version-label] {
  color: var(--text-secondary);
  font-weight: 600;
}

.hero-shot {
  margin: 56px 0 0;
  max-width: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.hero-shot picture {
  display: block;
}
.hero-shot img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Sections ---------------------------------------------------------- */

section {
  padding: 84px 0;
}
.section-head {
  max-width: 64ch;
  margin: 0 0 44px;
}
.section-head.center {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 600;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 1.08rem;
  margin: 16px 0 0;
}

.shift {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.shift .section-head {
  margin-bottom: 0;
}

/* ---- Feature grid ------------------------------------------------------ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.feature-card {
  grid-column: span 2;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.feature-card h3 {
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin: 0;
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.feature-icon i {
  font-size: 19px;
  line-height: 1;
}

/* ---- Comparison table -------------------------------------------------- */

.compare {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.95rem;
}
.compare-table th,
.compare-table td {
  padding: 15px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  font-weight: 700;
  color: var(--text);
  background: var(--surface-alt);
  position: sticky;
  top: 0;
}
.compare-table th.feature-col,
.compare-table td.feature-col {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  min-width: 230px;
}
.compare-table .col-scholardo {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.compare-table tbody tr:last-child td {
  border-bottom: none;
}
.compare-table tbody tr {
  transition: background 0.12s ease;
}
.compare-table tbody tr:hover td {
  background: var(--accent-soft);
}
.compare-table tbody tr:hover .col-scholardo {
  background: rgba(63, 45, 99, 0.22);
}
[data-theme="dark"] .compare-table tbody tr:hover .col-scholardo {
  background: rgba(138, 107, 243, 0.3);
}
.mark-yes,
.mark-no,
.mark-partial {
  text-align: center;
  font-size: 1.2rem;
  line-height: 1;
}
.mark-yes { color: var(--accent); }
.mark-no  { color: var(--border-strong); }
.mark-partial { color: var(--text-secondary); }
.compare-note {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 18px 0 0;
}

/* ---- Value rows -------------------------------------------------------- */

.value-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0;
}
.value-row + .value-row {
  border-top: 1px solid var(--border);
}
.value-row h3 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 14px;
}
.value-row p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0;
}
.value-visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    var(--surface-alt) 80%
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.value-visual svg {
  width: 88px;
  height: 88px;
  color: var(--accent);
  opacity: 0.85;
}
.value-row.reverse .value-text {
  order: 2;
}

/* ---- FAQ --------------------------------------------------------------- */

.faq { padding: 84px 0; border-top: 1px solid var(--border); }
.faq-list {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  border-top: 1px solid var(--border);
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--accent);
  flex: none;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  content: '×';
}
.faq-item p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0 0 20px;
  line-height: 1.7;
}

/* ---- Download ---------------------------------------------------------- */

.download {
  text-align: center;
  background: radial-gradient(
    ellipse 70% 80% at 50% 120%,
    var(--accent-soft),
    transparent 70%
  );
}
.download-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.download-card img.dl-icon {
  width: 76px;
  height: 76px;
  border-radius: 0;
  margin: 0 auto 22px;
}
.download-card h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
}

.update-banner {
  display: none;
  margin: 0 auto 24px;
}
.update-banner:not([hidden]) {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
.dl-meta {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.dl-version {
  font-weight: 700;
  color: var(--text-secondary);
}
.dl-links {
  margin-top: 10px;
}

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.footer-brand img {
  height: 36px;
  width: auto;
  border-radius: 0;
  display: block;
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.8;
}

/* ---- Pricing ----------------------------------------------------------- */

.pricing {
  padding: 80px 0;
  background: var(--bg-alt);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 32px 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pricing-card:hover {
  border-color: var(--accent);
}
.pricing-card--featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.pricing-card--featured:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent);
}
.pricing-badge {
  display: inline-block;
  margin-bottom: 20px;
  padding: 4px 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: flex-start;
}
.pricing-card-head h3 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text-muted);
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 32px;
}
.pricing-amount {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.pricing-amount--custom {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  color: var(--text-secondary);
}
.pricing-period {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.pricing-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pricing-features li {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
  line-height: 1.35;
}
.pricing-features li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}
.pricing-card .btn {
  width: 100%;
  justify-content: center;
  min-width: unset;
}
.pricing-note {
  text-align: center;
  margin-top: 32px;
  font-size: 0.86rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 860px) {
  .feature-card {
    grid-column: span 4;
  }
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
  .value-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .value-row.reverse .value-text {
    order: 0;
  }
  .value-visual {
    order: -1;
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  section {
    padding: 60px 0;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .feature-card {
    grid-column: span 1;
  }
  .hero {
    padding: 56px 0 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/* === polish v1: reveal-on-scroll + button micro-interactions === */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }
.btn { box-shadow: 0 1px 2px rgba(28, 27, 34, 0.06); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { box-shadow: 0 2px 8px rgba(63, 45, 99, 0.22); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(63, 45, 99, 0.32); }
[data-theme="dark"] .btn-primary { box-shadow: 0 2px 10px rgba(182, 156, 255, 0.20); }
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 8px 26px rgba(182, 156, 255, 0.30); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
