/* ============================================================
   BASEDATATECH — Design System
   Palette: deep navy + gold, premium corporate
   ============================================================ */

:root {
  --navy-900: #0a1730;
  --navy-800: #0e1f3d;
  --navy-700: #16294f;
  --navy-600: #1e3563;
  --gold-500: #c9a24b;
  --gold-400: #d4b96a;
  --gold-300: #e3cd8f;
  --cream: #f7f5f0;
  --white: #ffffff;
  --ink: #1c2434;
  --muted: #5b6478;
  --line: #e6e1d5;

  --font-serif: "Noto Serif TC", serif;
  --font-sans: "Noto Sans TC", sans-serif;

  --container: 1140px;
  --radius: 10px;
  --shadow: 0 18px 45px -18px rgba(10, 23, 48, 0.25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

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

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.scrolled {
  background: rgba(10, 23, 48, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(201, 162, 75, 0.25), 0 8px 30px -12px rgba(0, 0, 0, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  color: var(--white);
}

.brand::first-letter { color: var(--gold-400); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  transition: color 0.25s;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--gold-500);
  transition: width 0.3s var(--ease);
}

.nav-link:hover { color: var(--white); }
.nav-link:hover::after { width: 100%; }

.nav-cta {
  padding: 8px 20px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  color: var(--gold-400);
}

.nav-cta::after { display: none; }
.nav-cta:hover {
  background: var(--gold-500);
  color: var(--navy-900);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 140px 0 100px;
  color: var(--white);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 162, 75, 0.22), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(900px 500px at 50% 40%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 56px;
}

/* ---------- Hero data-network graphic ---------- */

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.data-network {
  width: 100%;
  max-width: 460px;
  height: auto;
  color: var(--gold-400);
}

/* Intro: lines draw in, nodes pop in. After ~3.5s the 3D engine in
   main.js takes over and drives position, radius and opacity inline. */
.net-lines path {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.35;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: line-draw 2.2s var(--ease) forwards;
}

.net-lines path:nth-child(odd)  { animation-delay: 0.15s; }
.net-lines path:nth-child(3n)   { animation-delay: 0.35s; }
.net-lines path:nth-child(4n)   { animation-delay: 0.55s; }
.net-lines path:nth-child(5n)   { animation-delay: 0.75s; }

@keyframes line-draw {
  to { stroke-dashoffset: 0; }
}

.net-nodes circle {
  fill: var(--gold-400);
  animation: node-in 0.9s var(--ease) backwards;
}

.net-nodes circle:nth-child(2n) { animation-delay: 0.25s; }
.net-nodes circle:nth-child(3n) { animation-delay: 0.5s; }
.net-nodes circle:nth-child(5n) { animation-delay: 0.7s; }

.net-nodes circle.hub {
  filter: drop-shadow(0 0 8px rgba(212, 185, 106, 0.9));
}

@keyframes node-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Data pulses travelling along edges (positioned by main.js) */
.net-pulses circle {
  fill: var(--gold-300);
  filter: drop-shadow(0 0 5px rgba(227, 205, 143, 0.95));
  opacity: 0.9;
}

/* Edge fade while shapes morph (main.js toggles .morphing) */
.net-lines { transition: opacity 0.6s ease; }
.net-lines.morphing { opacity: 0.45; }

/* Occasional sparkle on a random node */
.sparkle {
  fill: #fff7e0;
  filter: drop-shadow(0 0 6px rgba(227, 205, 143, 0.9));
  transform-box: fill-box;
  transform-origin: center;
  animation: sparkle-pop 1.2s var(--ease) forwards;
}

@keyframes sparkle-pop {
  0%   { transform: scale(0) rotate(0deg); opacity: 0; }
  35%  { transform: scale(1.15) rotate(45deg); opacity: 1; }
  100% { transform: scale(0.2) rotate(90deg); opacity: 0; }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--gold-400);
  padding: 6px 0;
  border-bottom: 1px solid rgba(201, 162, 75, 0.5);
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.22;
  letter-spacing: 0.02em;
  margin-bottom: 26px;
}

.hero-sub {
  max-width: 620px;
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 44px;
}

.hero-actions { display: flex; gap: 18px; flex-wrap: wrap; }

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

.btn {
  display: inline-block;
  padding: 14px 34px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, color 0.25s;
}

.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--navy-900);
  box-shadow: 0 10px 28px -10px rgba(201, 162, 75, 0.55);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -10px rgba(201, 162, 75, 0.65);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: var(--white);
}

.btn-outline:hover {
  border-color: var(--gold-400);
  color: var(--gold-400);
  transform: translateY(-2px);
}

.btn-lg { padding: 17px 46px; font-size: 1.05rem; }

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

.section { padding: 110px 0; }

.section-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold-500);
  margin-bottom: 14px;
}

.section-eyebrow::before {
  content: "";
  display: inline-block;
  width: 34px; height: 2px;
  background: var(--gold-500);
  vertical-align: middle;
  margin-right: 12px;
  transform: translateY(-2px);
}

.section-eyebrow.light { color: var(--gold-400); }

.section-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.3;
  color: var(--navy-800);
  margin-bottom: 26px;
}

.section-title.light { color: var(--white); }

.section-navy {
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(201, 162, 75, 0.14), transparent 55%),
    linear-gradient(165deg, var(--navy-800), var(--navy-900));
  color: var(--white);
}

/* ---------- Service cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 44px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold-500);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: 0 8px 24px -16px rgba(10, 23, 48, 0.18);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.card-icon {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--navy-700), var(--navy-900));
  color: var(--gold-400);
  margin-bottom: 24px;
}

.card-icon svg { width: 26px; height: 26px; }

.card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 12px;
}

.card-text { color: var(--muted); font-size: 0.98rem; }

/* ---------- Product ---------- */

.product-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}

.en-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold-400);
  margin-top: 10px;
}

.product-text {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 300;
  margin-bottom: 30px;
  max-width: 480px;
}

.feature-list { list-style: none; margin-bottom: 40px; }

.feature-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.9);
}

.feature-check {
  flex: none;
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(201, 162, 75, 0.16);
  color: var(--gold-400);
  font-size: 0.8rem;
}

.product-visual { display: flex; justify-content: center; }

.mock-window {
  width: 100%;
  max-width: 440px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: perspective(1200px) rotateY(-8deg) rotateX(2deg);
}

.mock-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  background: var(--navy-800);
}

.mock-bar span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.mock-bar span:first-child { background: var(--gold-500); }

.mock-body { padding: 26px; }

.mock-line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #ece7da, #f5f2ea);
  margin-bottom: 14px;
}

.w45 { width: 45%; } .w60 { width: 60%; } .w75 { width: 75%; } .w90 { width: 90%; }

.mock-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.mock-card {
  height: 58px;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--navy-700), var(--navy-900));
  position: relative;
}

.mock-card::after {
  content: "";
  position: absolute;
  left: 10px; bottom: 10px;
  width: 55%; height: 6px;
  border-radius: 3px;
  background: var(--gold-500);
}

/* ---------- About ---------- */

.about-lead {
  max-width: 680px;
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 50px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.value-item {
  padding-top: 24px;
  border-top: 2px solid var(--line);
  position: relative;
}

.value-item::before {
  content: "";
  position: absolute;
  top: -2px; left: 0;
  width: 46px; height: 2px;
  background: var(--gold-500);
}

.value-item h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--navy-800);
  margin-bottom: 10px;
}

.value-item p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Contact ---------- */

.section-cta {
  background: var(--white);
  text-align: center;
  border-top: 1px solid var(--line);
}

.section-cta .section-eyebrow::before { display: none; }

.contact-text {
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--muted);
}

.contact-details {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 44px;
  font-size: 1.02rem;
  color: var(--navy-800);
  font-weight: 500;
}

a.contact-item {
  border-bottom: 1px solid var(--gold-500);
  transition: color 0.25s;
}

a.contact-item:hover { color: var(--gold-500); }

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

.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.65);
  padding: 44px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--white);
}

.footer-nav { display: flex; gap: 26px; font-size: 0.9rem; }

.footer-nav a { transition: color 0.25s; }
.footer-nav a:hover { color: var(--gold-400); }

.footer-copy { font-size: 0.85rem; }

/* ---------- Reveal animation ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
  .net-lines path,
  .net-nodes circle { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .net-pulses, .net-sparkles { display: none; }
}

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

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .data-network { max-width: min(360px, 78vw); margin: 0 auto; }
  .hero { padding-top: 120px; }
  .product-inner { grid-template-columns: 1fr; gap: 48px; }
  .product-visual { order: -1; }
  .mock-window { transform: none; }
  .card-grid, .value-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 23, 48, 0.97);
    backdrop-filter: blur(10px);
    padding: 10px 24px 24px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }

  .main-nav.open { opacity: 1; visibility: visible; transform: none; }

  .nav-link { padding: 14px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .nav-link::after { display: none; }

  .nav-cta {
    margin-top: 14px;
    text-align: center;
    border-bottom: 1px solid var(--gold-500);
  }

  .nav-toggle { display: flex; }
  .section { padding: 80px 0; }
  .contact-details { flex-direction: column; gap: 14px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
