/* ============================================================
   SPECTRUM / CODÉLUX — Website Design System
   Light therapy · Science-driven · Medical-grade
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg-900: #05070d;
  --bg-850: #080b14;
  --bg-800: #0b1020;
  --bg-700: #10162b;
  --bg-600: #161e38;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #eef2ff;
  --text-2: #aab4d0;
  --text-3: #727f9e;

  --violet: #8a5cff;
  --blue: #4d7cff;
  --cyan: #35d6e8;
  --amber: #ffb347;
  --red: #ff4d5e;
  --red-deep: #d61f3a;

  --accent: #5b8cff;
  --accent-glow: rgba(91, 140, 255, 0.35);

  /* Signature spectrum gradient */
  --spectrum: linear-gradient(90deg, #8a5cff 0%, #4d7cff 18%, #35d6e8 36%, #6ee7a8 52%, #ffb347 68%, #ff6a4d 84%, #d61f3a 100%);
  --spectrum-soft: linear-gradient(90deg, rgba(138,92,255,.25), rgba(77,124,255,.25), rgba(53,214,232,.25), rgba(110,231,168,.25), rgba(255,179,71,.25), rgba(255,106,77,.25), rgba(214,31,58,.25));

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --maxw: 1200px;
  --header-h: 76px;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg-900);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, textarea, select { font: inherit; }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.section { padding: 104px 0; position: relative; }
.section-sm { padding: 72px 0; }
.spectrum-line { height: 3px; border: 0; background: var(--spectrum); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3.2rem); }
h3 { font-size: 1.35rem; }
p { color: var(--text-2); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--cyan); display: inline-block; }
.section-head { max-width: 720px; margin-bottom: 54px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { margin-top: 18px; font-size: 1.05rem; }

.grad-text {
  background: var(--spectrum);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: .25s ease; white-space: nowrap;
}
.btn-primary { background: var(--spectrum); color: #060810; box-shadow: 0 8px 30px rgba(77,124,255,.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(77,124,255,.45); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--cyan); }
.btn-sm { padding: 10px 18px; font-size: .85rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 100;
  display: flex; align-items: center;
  background: rgba(5, 7, 13, 0.72); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .3s ease;
}
.nav { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--spectrum); position: relative; overflow: hidden;
  box-shadow: 0 0 22px var(--accent-glow);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 4px; border-radius: 6px;
  background: var(--bg-900); opacity: .9;
}
.brand-mark::before {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 12px; height: 12px; transform: translate(-50%,-50%) rotate(45deg);
  background: var(--spectrum); border-radius: 2px;
}
.brand-name { font-weight: 800; font-size: 1.22rem; letter-spacing: .04em; }
.brand-name span { color: var(--cyan); }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font-size: .9rem; font-weight: 500; color: var(--text-2); transition: color .2s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: var(--spectrum);
}
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang-toggle { font-size: .8rem; color: var(--text-3); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; }
.menu-btn { display: none; background: none; border: 0; color: var(--text); cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  padding-top: var(--header-h); overflow: hidden;
  background:
    radial-gradient(90% 70% at 80% 20%, rgba(77,124,255,.16), transparent 60%),
    radial-gradient(70% 60% at 15% 85%, rgba(214,31,58,.12), transparent 60%),
    var(--bg-900);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 60% 40%, #000, transparent 80%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { margin-bottom: 22px; }
.hero-sub { font-size: 1.12rem; max-width: 540px; margin-bottom: 34px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 26px; margin-top: 46px; flex-wrap: wrap; }
.hero-badges div { display: flex; flex-direction: column; }
.hero-badges strong { font-size: 1.5rem; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-badges small { color: var(--text-3); font-size: .76rem; letter-spacing: .05em; }

/* Hero visual — light device */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; min-height: 460px; }
.glow-orb {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214,31,58,.35), rgba(138,92,255,.12) 45%, transparent 70%);
  filter: blur(30px); animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
.hero-device { position: relative; z-index: 2; width: 100%; max-width: 460px; filter: drop-shadow(0 30px 60px rgba(214,31,58,.35)); }
.orbit-ring {
  position: absolute; border: 1px solid rgba(255,255,255,.10); border-radius: 50%;
  width: 520px; height: 260px; z-index: 1; transform: rotate(-18deg);
}
.orbit-ring b { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px var(--red); top: 50%; left: 50%; }

/* ---------- Trust strip ---------- */
.trust-strip {
  border-block: 1px solid var(--border); background: var(--bg-850);
  padding: 26px 0;
}
.trust-strip .container { display: flex; align-items: center; justify-content: center; gap: 44px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .9rem; font-weight: 600; }
.trust-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; position: relative; overflow: hidden; transition: .3s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(255,255,255,.28); box-shadow: var(--shadow); }
.card .icon {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  background: var(--spectrum-soft); border: 1px solid var(--border); margin-bottom: 22px; font-size: 1.4rem;
}
.card h3 { margin-bottom: 12px; }
.card p { font-size: .92rem; }

/* Product cards */
.product-card {
  background: var(--bg-800); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .3s ease; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.product-media {
  height: 250px; background: radial-gradient(70% 70% at 50% 40%, rgba(214,31,58,.14), transparent 65%), var(--bg-700);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.product-media svg { width: 78%; height: 84%; filter: drop-shadow(0 16px 26px rgba(0,0,0,.5)); }
.tag {
  position: absolute; top: 14px; left: 14px; font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px;
  background: rgba(5,7,13,.7); border: 1px solid var(--border); color: var(--cyan);
}
.product-info { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-info .model { color: var(--text-3); font-size: .78rem; letter-spacing: .12em; font-weight: 700; }
.product-info h3 { font-size: 1.15rem; }
.product-info .wavelen { font-size: .8rem; color: var(--red); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: .68rem; padding: 4px 9px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }

/* ---------- Spectrum visual ---------- */
.spectrum-bar { height: 26px; border-radius: 999px; background: var(--spectrum); box-shadow: 0 0 40px var(--spectrum-soft); }
.spectrum-scale { display: flex; justify-content: space-between; margin-top: 12px; font-size: .74rem; color: var(--text-3); }
.wavelength-card { display: flex; gap: 18px; align-items: flex-start; }
.wavelength-swatch { width: 6px; align-self: stretch; border-radius: 99px; flex: none; }

/* ---------- Comparison table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { background: var(--bg-700); color: var(--text); font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:hover { background: var(--surface); }
td:first-child { color: var(--text); font-weight: 600; }
.check { color: var(--cyan); font-weight: 700; }

/* ---------- Pricing tiers (OEM) ---------- */
.tier { background: var(--bg-800); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.tier.featured { border-color: var(--accent); background: linear-gradient(160deg, rgba(91,140,255,.12), var(--bg-800)); }
.tier .step { font-size: .78rem; color: var(--cyan); letter-spacing: .12em; font-weight: 700; }

/* ---------- Evidence / literature ---------- */
.evidence-item { border-left: 2px solid var(--border); padding: 4px 0 4px 24px; margin-bottom: 26px; }
.evidence-item .wl { font-size: .76rem; font-weight: 800; letter-spacing: .1em; }
.evidence-item h4 { font-size: 1rem; margin-bottom: 6px; }
.evidence-item p { font-size: .86rem; }
.evidence-item .pmid { font-size: .76rem; color: var(--accent); }

/* ---------- CTA band ---------- */
.cta-band { position: relative; text-align: center; padding: 92px 0; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(50% 120% at 50% 50%, rgba(138,92,255,.18), transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin-bottom: 18px; }
.cta-band p { max-width: 560px; margin: 0 auto 30px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-850); border-top: 1px solid var(--border); padding: 72px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 44px; margin-bottom: 52px; }
.footer-brand p { font-size: .9rem; margin-top: 18px; max-width: 300px; }
.footer-col h4 { font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px; color: var(--text); }
.footer-col a { display: block; color: var(--text-2); font-size: .9rem; margin-bottom: 11px; transition: color .2s; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 26px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }
.footer-cert { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.footer-cert span { font-size: .66rem; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 1; transform: none; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 360px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg-850); flex-direction: column; align-items: stretch; padding: 20px 24px; gap: 0; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .menu-btn { display: block; }
}
@media (max-width: 640px) {
  .container { width: min(100% - 32px, var(--maxw)); }
  .section { padding: 72px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-badges { gap: 18px; }
  .lang-toggle { display: none; }
}

/* ============================================================
   Bilingual (中文 / English) + real logo overrides
   ============================================================ */

/* Language visibility — controlled by class on <html> */
.lang-zh .i18n-en { display: none !important; }
.lang-en .i18n-zh { display: none !important; }
/* fallback: if no lang class, show English */
html:not(.lang-zh):not(.lang-en) .i18n-zh { display: none !important; }

/* Real CODÉLUX logo image — blue, on a light plate for dark backgrounds */
.brand .logo-img { height: 30px; width: auto; display: block; }
.brand .logo-plate {
  background: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
  display: inline-flex;
  align-items: center;
}
.site-header:not(.scrolled) .brand .logo-plate { background: rgba(255,255,255,.94); }

/* Language switch button */
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 3px; background: var(--surface); cursor: pointer;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--text-3);
  font-size: .72rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: .2s; letter-spacing: .03em;
}
.lang-switch button.active { background: var(--spectrum); color: #060810; }

/* Footer logo plate slightly smaller */
.footer-brand .logo-img { height: 28px; }
