/* WesmartAI — shared site stylesheet
   One stylesheet for every page. Page files should not carry their own <style> blocks. */

:root {
  --bg: #0b1120;
  --bg-alt: #0a0f1c;
  --bg-deep: #070b14;
  --surface: rgba(30, 41, 59, 0.45);
  --surface-strong: rgba(30, 41, 59, 0.75);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(96, 165, 250, 0.35);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --heading: #ffffff;
  --blue: #60a5fa;
  --blue-strong: #2563eb;
  --green: #34d399;
  --amber: #fbbf24;
  --grad-text: linear-gradient(to right, #60a5fa, #34d399);
  --grad-accent: linear-gradient(135deg, #2563eb, #10b981);
  --grad-teal: linear-gradient(135deg, #0f766e, #14b8a6);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --container: 1200px;
  --gutter: 24px;
  --font: 'Inter', 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: var(--header-h);
}
img, video { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #93c5fd; }
::selection { background: rgba(59, 130, 246, 0.3); }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 960px; }
.section { padding: 96px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); position: relative; }
.section--alt { background: var(--bg-alt); }
.section--deep { background: var(--bg-deep); }
.section-head { text-align: center; max-width: 860px; margin: 0 auto 56px; }
.section-head--left { text-align: left; margin-left: 0; }
.grid-2 { display: grid; gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.layout-sidebar { display: grid; gap: 48px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { color: var(--heading); margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 900; margin-bottom: 16px; }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: #cbd5e1; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.gradient-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue); background: rgba(30, 58, 138, 0.3); border: 1px solid rgba(59, 130, 246, 0.35);
  margin-bottom: 16px;
}
.badge--green { color: var(--green); background: rgba(6, 78, 59, 0.35); border-color: rgba(16, 185, 129, 0.35); }
.badge--amber { color: var(--amber); background: rgba(120, 53, 15, 0.3); border-color: rgba(245, 158, 11, 0.35); }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); background: rgba(15, 23, 42, 0.6);
}
.tag--green { color: var(--green); border-color: rgba(16, 185, 129, 0.35); }
.tag--blue { color: var(--blue); border-color: rgba(59, 130, 246, 0.35); }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-row--center { justify-content: center; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  border: 1px solid transparent; transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn--primary { background: var(--blue-strong); color: #fff; border-color: rgba(96, 165, 250, 0.5); box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.6); }
.btn--primary:hover { background: #3b82f6; color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-strong); color: #fff; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: var(--border-strong); }
.card p:last-child { margin-bottom: 0; }
.card--flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card__body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.card__media { height: 200px; overflow: hidden; background: #0f172a; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--pattern {
  display: flex; align-items: center; justify-content: center; color: var(--blue);
  background:
    radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.35), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(16, 185, 129, 0.3), transparent 55%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.07) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.07) 0 1px, transparent 1px 28px),
    #0b1324;
}
.card__media--pattern svg { width: 64px; height: 64px; }
.card__footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.85rem; font-weight: 700; color: var(--blue); }
.icon-box {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--blue); background: rgba(30, 58, 138, 0.3); border: 1px solid rgba(59, 130, 246, 0.35); margin-bottom: 20px;
}
.icon-box svg { width: 26px; height: 26px; }
.icon-box--green { color: var(--green); background: rgba(6, 78, 59, 0.35); border-color: rgba(16, 185, 129, 0.35); }
.def-list { list-style: none; padding: 0; margin: 0 0 16px; font-size: 0.92rem; }
.def-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.def-list li:last-child { border-bottom: 0; }
.def-list strong { color: var(--heading); font-weight: 600; margin-right: 6px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 26px; margin-bottom: 8px; color: #cbd5e1; }
.check-list li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 10px; height: 10px; border-radius: 50%; background: var(--grad-accent); }

/* ---------- Stats ---------- */
.stat { text-align: center; }
.stat__value { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.15; margin-bottom: 10px; }
.stat__label { font-size: 0.85rem; font-weight: 700; color: var(--heading); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }

/* ---------- Patents ---------- */
.patent-card { display: flex; flex-direction: column; }
.patent-card__no { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.95rem; color: var(--green); font-weight: 700; margin-bottom: 6px; }
.patent-card__status { margin-top: auto; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.flow-strip {
  margin-top: 40px; padding: 22px 26px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: rgba(15, 23, 42, 0.7);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; text-align: center;
}
.flow-strip__node { font-weight: 700; color: var(--heading); }
.flow-strip__core { padding: 6px 16px; border-radius: 10px; background: var(--grad-accent); color: #fff; font-weight: 900; letter-spacing: 0.05em; }
.flow-strip__arrow { color: var(--blue); font-weight: 700; }
.flow-strip__note { flex-basis: 100%; color: var(--muted); font-size: 0.9rem; margin: 0; }
.flow-strip__core--teal { background: var(--grad-teal); }
.product-line + .product-line { margin-top: 64px; padding-top: 56px; border-top: 1px solid var(--border); }
.product-line__head { margin-bottom: 28px; }
.product-line__title { font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 800; margin-bottom: 8px; }
.product-line__desc { color: var(--muted); margin: 0; max-width: 760px; }
.product-line .flow-strip { margin-top: 28px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; padding: 96px 0 104px;
  background:
    radial-gradient(ellipse 60% 55% at 85% 10%, rgba(37, 99, 235, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 45% at 10% 90%, rgba(16, 185, 129, 0.16), transparent 70%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.045) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.045) 0 1px, transparent 1px 64px),
    var(--bg);
}
.hero__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.hero__badges .badge { margin-bottom: 0; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 30px; }
.hero__media video { width: 100%; border-radius: var(--radius); border: 1px solid rgba(71, 85, 105, 0.6); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); background: #1e293b; }

/* ---------- Page header (inner pages) ---------- */
.page-hero { padding: 72px 0 48px; text-align: center; background: radial-gradient(ellipse 60% 70% at 50% 0%, rgba(37, 99, 235, 0.2), transparent 70%), var(--bg); }
.page-hero .lead { max-width: 760px; margin: 12px auto 0; }
.page-hero__sub { color: var(--muted); font-size: 1.1rem; margin-top: 10px; }

/* ---------- Profile (CEO page) ---------- */
.portrait { position: relative; max-width: 1040px; margin: 0 auto; border-radius: 24px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.8); }
.portrait img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.portrait__caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 32px 28px; background: linear-gradient(to top, rgba(2, 6, 23, 0.88), transparent); }
.portrait__caption .small { text-transform: uppercase; letter-spacing: 0.12em; color: #cbd5e1; }
.portrait__caption strong { display: block; color: #fff; font-size: clamp(1.1rem, 2.4vw, 1.6rem); }
.prose h2 { font-size: 1.6rem; display: flex; align-items: center; gap: 12px; margin: 48px 0 18px; }
.prose h2:first-child { margin-top: 0; }
.prose h2::before { content: ""; width: 4px; height: 1.2em; border-radius: 4px; background: var(--grad-accent); flex-shrink: 0; }
.prose p { color: #cbd5e1; }
.prose strong { color: var(--heading); }
.callout { border-left: 4px solid var(--blue-strong); background: rgba(30, 41, 59, 0.55); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 24px 0; color: #e2e8f0; }
.callout--quote { font-size: 1.1rem; font-weight: 600; color: #fff; border-left-color: var(--green); }
.phase { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px 22px; margin-bottom: 16px; background: rgba(15, 23, 42, 0.5); }
.phase h3 { font-size: 1.05rem; color: var(--blue); }
.phase p:last-child { margin-bottom: 0; }
.sidebar { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 24px); }
.sidebar h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 0.45em; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-deep); border: 2px solid var(--blue); }
.timeline li.is-patent::before { border-color: var(--green); background: rgba(16, 185, 129, 0.35); }
.timeline time { display: block; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.8rem; color: var(--faint); }
.timeline span { color: var(--text); font-size: 0.92rem; line-height: 1.5; }

/* ---------- Report ---------- */
.report-section { padding: 32px 0; border-bottom: 1px solid var(--border); }
.report-section:last-of-type { border-bottom: 0; }
.report-section h2 { font-size: 1.5rem; }
.diagram { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.92rem; line-height: 1.9; padding: 22px 24px; border-radius: var(--radius-sm); background: #050914; border: 1px solid var(--border); color: #cbd5e1; overflow-x: auto; white-space: pre; }
.statement { font-size: 0.95rem; color: var(--muted); border-left: 3px solid var(--green); padding: 4px 0 4px 16px; margin-top: 24px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
table.data th, table.data td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: rgba(30, 41, 59, 0.8); color: var(--heading); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.is-highlight td { background: rgba(30, 58, 138, 0.22); }
table.data td.value { font-weight: 700; color: var(--green); }
.footnote { font-size: 0.85rem; color: var(--faint); margin-top: 14px; }
.big-figure { text-align: center; padding: 32px; }
.big-figure__value { font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 900; line-height: 1.1; }

/* ---------- Video section (GaaS) ---------- */
.video-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.8); background: #000; }
.example-list { list-style: none; padding: 0; margin: 12px 0 18px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.88rem; }
.example-list li { padding: 8px 12px; border-radius: 8px; background: rgba(15, 23, 42, 0.7); border: 1px solid var(--border); margin-bottom: 8px; color: #cbd5e1; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50; background: rgba(11, 17, 32, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand__mark { width: 34px; height: 34px; border-radius: 8px; background: var(--grad-accent); display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.7); }
.brand__name { display: block; font-weight: 800; font-size: 1.1rem; line-height: 1.1; }
.brand__sub { display: block; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.08em; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: #cbd5e1; font-size: 0.92rem; font-weight: 500; }
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current="page"] { color: var(--blue); }
.lang-switch { padding: 5px 14px; border-radius: 999px; border: 1px solid #475569; font-size: 0.8rem !important; font-weight: 700 !important; color: #e2e8f0 !important; }
.lang-switch:hover { background: #1e293b; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; color: #fff; width: 42px; height: 42px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-deep); border-top: 1px solid #1e293b; color: var(--muted); padding: 64px 0 32px; font-size: 0.9rem; }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.site-footer li svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 4px; color: var(--faint); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--blue); }
.site-footer__grid { display: grid; gap: 40px; grid-template-columns: 1.3fr 1.3fr 1fr; margin-bottom: 40px; }
.site-footer__bottom { border-top: 1px solid #1e293b; padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.8rem; }

/* ---------- Reveal on scroll (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
}
@media (max-width: 900px) {
  .grid-3, .grid-2, .split { grid-template-columns: minmax(0, 1fr); }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px;
    background: #0b1120; border-bottom: 1px solid var(--border); box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
  .site-nav a.lang-switch { margin-top: 14px; align-self: flex-start; padding: 8px 18px; border: 1px solid #475569; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 64px; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .hero { padding: 56px 0 64px; }
  .page-hero { padding: 48px 0 32px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .product-line + .product-line { margin-top: 44px; padding-top: 40px; }
  .card, .card__body { padding: 22px; }
  .btn-row .btn { width: 100%; }
  .brand__sub { display: none; }
  .portrait__caption { padding: 32px 18px 16px; }
  .portrait img { aspect-ratio: 4 / 3; }
}

/* ---------- Utilities ---------- */
.section--flush { border-top: 0; padding-top: 64px; }
.text-strong { color: var(--heading); font-weight: 700; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
