/* ============================================================
   PM 覺醒 — AI 產品戰略師養成攻略
   Design tokens — 深藍黑戰情室 + 青紫霓虹
   ============================================================ */

:root {
  /* Backgrounds */
  --bg-main: #080B16;
  --bg-section: #0D1224;
  --bg-card: #121A32;
  --bg-card-2: #0F1730;

  /* Accents */
  --accent-cyan: #18D8FF;
  --accent-purple: #8B5CF6;
  --accent-blue: #3B82F6;

  /* Secondary accents */
  --accent-gold: #FACC15;
  --accent-green: #22C55E;
  --accent-red: #FB7185;

  /* Text */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dark: #0F172A;

  /* Borders & shadows */
  --border-soft: rgba(148, 163, 184, 0.18);
  --border-glow: rgba(24, 216, 255, 0.45);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(24, 216, 255, 0.25);

  /* Type */
  --font-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-en: "Inter", "Noto Sans TC", sans-serif;
  --font-tech: "Space Grotesk", "Inter", sans-serif;

  /* Layout */
  --maxw: 1200px;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-zh);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient war-room backdrop: grid + nebula glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 30%, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(40% 38% at 82% 8%, rgba(139, 92, 246, 0.20), transparent 70%),
    radial-gradient(46% 42% at 12% 4%, rgba(24, 216, 255, 0.16), transparent 70%),
    radial-gradient(60% 50% at 50% 102%, rgba(59, 130, 246, 0.12), transparent 70%);
}

#root { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---------- Shared layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { position: relative; padding: 104px 0; }
.section--alt { background: var(--bg-section); }
.section--alt::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(24, 216, 255, 0.05), transparent 70%);
}

/* ---------- Eyebrow / section heads ---------- */
.eyebrow {
  font-family: var(--font-tech);
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
}

.sec-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.sec-head.left { margin-left: 0; text-align: left; }
.sec-title {
  font-family: var(--font-zh);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-wrap: balance;
}
.sec-sub {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 26px;
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #5fc8ff 60%, var(--accent-blue));
  color: #04111c;
  box-shadow: 0 0 0 1px rgba(24,216,255,.4), 0 12px 30px rgba(24,216,255,.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(24,216,255,.6), 0 16px 44px rgba(24,216,255,.42);
}
.btn-ghost {
  background: rgba(148,163,184,0.06);
  border-color: var(--border-soft);
  color: var(--text-primary);
}
.btn-ghost:hover {
  border-color: var(--border-glow);
  background: rgba(24,216,255,0.06);
  transform: translateY(-2px);
}
.btn-lg { padding: 17px 34px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Pills / tags ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-tech);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  background: rgba(148,163,184,0.05);
  white-space: nowrap;
}
.pill-cyan { color: var(--accent-cyan); border-color: rgba(24,216,255,.4); background: rgba(24,216,255,.08); }
.pill-purple { color: #c4b5fd; border-color: rgba(139,92,246,.45); background: rgba(139,92,246,.1); }
.pill-gold { color: var(--accent-gold); border-color: rgba(250,204,21,.4); background: rgba(250,204,21,.08); }

/* ---------- Card base ---------- */
.glass {
  background: linear-gradient(180deg, rgba(18,26,50,0.92), rgba(8,11,22,0.92));
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

/* Corner-bracket tactical frame helper */
.bracket { position: relative; }
.bracket::before, .bracket::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 1.5px solid var(--accent-cyan);
  opacity: .55;
}
.bracket::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.bracket::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.16,.84,.44,1), transform .7s cubic-bezier(.16,.84,.44,1);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }
/* Failsafe: when the compositor is throttled and the entrance transition
   stalls, force the resolved visible state with no transition. */
body.reveal-settled .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Placeholder (imagery) ---------- */
.ph {
  position: relative;
  background-color: var(--bg-card-2);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(148,163,184,0.07) 0 1px,
    transparent 1px 11px
  );
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ph-label {
  font-family: var(--font-tech);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(8,11,22,0.7);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* keyframes for ambient float */
@keyframes floaty {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-14px) }
}
@keyframes pulseGlow {
  0%, 100% { opacity: .5 }
  50% { opacity: 1 }
}
@keyframes scanline {
  0% { transform: translateY(-100%) }
  100% { transform: translateY(900%) }
}
